Jump to content

adrian

PW-Moderators
  • Posts

    11,097
  • Joined

  • Last visited

  • Days Won

    365

Everything posted by adrian

  1. It should be pretty simple to figure out - if you're using jquery, then the only reason I think it wouldn't work is if you're not bootstrapping PW in the called php file. Anyway, good luck getting it sorted out.
  2. Not really an answer to your question, but perhaps this module does what you need already: It doesn't currently support repeater fields, but might be worth using this as a base and extending it to support repeaters. There are lots of other posts that describe how to populate repeaters. https://www.google.com/search?q=site%3Aprocesswire.com%2Ftalk%2F repeaters api
  3. It can be handled by the new stuff I set up recently. Have a read here: It allows you to set Tracy settings in config.php or config-dev.php (so it's local only). I think this is probably the best solution. Let me know how you find it and if you have any suggestions for improvements. PS - there is some further discussion about the instigation of this feature starting around here: https://processwire.com/talk/topic/5693-new-module-type-wiremail/?do=findComment&comment=172371
  4. I am testing this on localhost. Actually, I think the issue is probably the contents of the php file (in my example /data/testajax.php) that is being called via ajax. I forgot to provide that to you. It needs to bootstrap PW so that Tracy is also loaded, eg: <?php include '../index.php'; Hopefully if you do that, it should work as expected.
  5. Can you try this simple example in your template file: <script src="//code.jquery.com/jquery-2.1.1.min.js"></script> <script> $( document ).ready(function() { $("#ajaxButton").click(function(e) { e.preventDefault(); $.ajax({ type: "POST", url: "/data/testajax.php?test=1", data: { id: $(this).val() }, success: function(result) { console.log('ok'); }, error: function(result) { console.log('error'); } }); }); }); </script> <input id="ajaxButton" type="submit" name="testAjax" value="Test Ajax" /> This is how it looks for me:
  6. Are you using a JS framework? You need to make sure the X-Requested-With header is sent so that PHP (and therefore Tracy) can recognize it as an AJAX call. jQuery does this by default, but other frameworks may not, eg Angular. In pure/vanilla JS, you can do: xmlhttp.setRequestHeader("X-Requested-With", "XMLHttpRequest"); In Angular you can do: $http.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
  7. The AJAX bar displays automatically when there has been an AJAX request - you can see this behavior when viewing the Page Tree in the PW admin, or triggering sub items from any of the admin menus, or any AJAX calls you make on the frontend. You should also see "Redirect" bars when there has been a redirect call. Do you not see any of these?
  8. Sure - just check out the RequestInfo panel on the AJAX bar and open up the Input POST section. Does that get you what you want?
  9. Hey @Robin S - any reason why the find siblings method doesn't use "include=all" ? I am assuming it was just an oversight, but it would be nice to have please. Thanks!
  10. Interesting that in this case InnoDB faster and yet there have been other issues where it's much slower: https://github.com/processwire/processwire-issues/issues/692 I am sure there's a good reason for it, but it does make the decision on which to use more difficult. Maybe MyISAM for most tables and InnoDB for the sessions table if you are using SessionHandlerDB?
  11. Hi @simonsays - firstly, that is just a warning coming from PHP 7.2. I need to adapt that code to handle the way the 7.2 now works with `count()`. I am curious though, because the warning you are getting says line 204, but the count is on line 202 in the current version. Are you running 1.0.9 or an older version? Despite the line number difference, I can't replicate the error. Typically outputformatting is off in a module, which means even a single image field will return an array, but in this module I do turn it on when creating the new filename so that dates/times are formatted as expected. Perhaps this is what is causing the issue. Could you please send me your settings for CustomUploadNames and also the settings for the image field in question so I can try to replicate? Thanks.
  12. We also have: $files->render() these days.
  13. Hi @kixe, I hadn't seen this before. I just had a quick look around and from what I can tell, it's a simpler version of @kongondo's RuntimeMarkup in that it doesn't allow you to use PHP to generate the markup. Would you mind describing the differences for us please?
  14. I just committed a new version with several tweaks and fixes for the old, unloved Template Resources panel. It now better detects variables, constants, and functions that are only used once and therefore redundant code. The panel icon is now also colored to warn you that there are redundant things that you could remove.
  15. Another nice option might be to extend spectrum to do this. I just did this via browser dev tools, but I expect it could be done with JS quite easily if we has the option to inject JS when using the Inputfield with Spectrum Color Picker (JavaScript) option. I really like being able to see the hex code without having to open the picker. What do you think?
  16. Thanks @kixe One more request for you please. I am using this setup: $('#{id}').on('keyup', function() { $(this).css({'background-color' : $(this).val()}); $(this).css({'color' : ($(this).val().replace('#','0x')) > (0xffffff/2) ? '#333' : '#fff'}); }); so that the input background changed dynamically as the hex code changes, but I also want the background to be colored onload so I changed case 4 to this: case 4: $this->attr('style', "color: $textColor; background: $bgColor;"); if ($this->alpha) $this->attr('value', $color32); else $this->attr('value', $color24); break; I guess I could probably modify the JS code to do the onload as well, but I was wondering if you thought such a setup would be a worthwhile core option?
  17. Have you tried using AdminOnSteroids or AdminCustomFiles to add the CSS without needing to module the core module file?
  18. Glad you've found it so useful. Sorry for the bug in that version. I have just committed a fix. Please let me know if you have any other problems.
  19. adrian

    Hanna Code

    Yeah, a little bit of regex magic should take care of that for you.
  20. adrian

    Hanna Code

    My example shows how you can do that with Hanna - you need to do something like define the value of a text variable within the hanna. They are self closing tags. There is no separate hanna close tag.
  21. adrian

    Hanna Code

    [[av_textblock size='' font_color='' color='' text='Some Text']] Although I think giving site editors the ability to change font size or color beyond selecting from <hx> tags is a bad idea for keeping a nice looking site.
  22. Just got a couple of likes from @Knubbi on my posts above which prompted me to note that there is a Search and Replace action for my Admin Actions module: http://modules.processwire.com/modules/process-admin-actions/
  23. Awesome thanks so much - this is really speeding my workflow up today.
  24. Thanks Steve, it should be fixed in the latest version just committed.
  25. It's clearly a BatchChildEditor module issue: https://github.com/adrianbj/BatchChildEditor/blob/339624b0a14a9f403ae73b37a08f3e0f5f8d6136/BatchChildEditor.module#L907 It's part of the Lister mode option so if you don't need that, just disabled it and everything will be fine. It's a limitation with PHP 5.3 and $this in enclosures.
×
×
  • Create New...