ben_del
Forum Replies Created
-
Forum: Plugins
In reply to: [SVG Support] Callback Option … ?In my case, I’m animating certain elements of the SVG code using JavaScript. But since the SVG code is loaded after the page load has finished, my animation script is failing, as there is no code present to animate (yet) when it fires.
So, it would be useful if I could specify a callback function(s) that would be fired at the ‘complete’ event of the get request for the SVG code.
I could see two ways to do it:
1) A ‘global’ function to call, which would receive each given SVG as an argument. This could be an option of the plugin. Just a simple text field that would store a function name, which would then be called, passing each returned SVG as it’s main argument each time it’s called. This would be useful if, say, I knew that ALL my animations were going to need to fire an “animateSVG” function.
2) SVG-specific function names. This could perhaps be assigned PER SVG. Somehow at the point of insertion/selection of the SVG image in the WP editor, a function name could be supplied by the user. This would then be stored as a data-callback-XXX attribute on the rendered SVG root node. Then the SVG Support script would search the DOM at the onComplete for elements that had a data-callback- prefix and fire their corresponding functions, again, passing the SVG element as an argument to the specified function.
Those are just how I saw it happening. I’m sure there are many ways you could do it.
Thanks for the reply and for considering the feature addition.
best,
Ben
Alin,
Thank you! Much appreciated.
Have a good one,
Ben
Ah! I haven’t! Makes perfect sense now that I think about it. I sent you an email about getting access to the update download links. Thanks!
This did not fix it for me. Still getting lots of undefined index warnings for meta_type.
Here are the ones I’ve caught:
Warning: Missing argument 4 for alm_get_meta_query(), called in /nas/wp/www/cluster-41579/celdf/wp-content/plugins/ajax-load-more-preloaded/ajax-load-more-preloaded.php on line 160 and defined in /nas/wp/www/cluster-41579/celdf/wp-content/plugins/ajax-load-more/core/functions.php on line 226 Notice: Undefined variable: meta_type in /nas/wp/www/cluster-41579/celdf/wp-content/plugins/ajax-load-more/core/functions.php on line 230I don’t have the exact warning, but there is another one on line 625 of ajax-load-more.php.
Right, but that assumes only one way of getting those parameters into the
$.fn.almFilterfunction call. I am allowing my user to select various filters from a<select>menu and am then calling the almFilter function from within my javascript, passing those arguments dynamically. So I am not using data attributes in my HTML at all. I assumed that the key names would just match the shortcode key names. Seems to me like since you are making the$.fn.almFilteravailable as a public method, that you should not limit it to ONLY being useful if one chooses to use the data-attribute method. Or at least explain that in the docs more clearly. At this point, your example assumes that is the only way someone would use it.cheers
Alright. Finally found a workaround. I needed to set
preloaded=falseandpause=falseto get it working so that when I use$.fn.almFilterto update the query params, it loads automatically.I actually ended up just passing those two as
falseto thedataargument of$.fn.almFilter. Works fine.So — a feature request!…
It would be great if I could setpreloaded=trueANDpause=trueon the initial ALM shortcode AND be able to use$.fn.almFilter()to instantly show updated results WITHOUT having to pass those two params every time. 🙂Thanks.
Doing some more digging… and found that when I have
preloaded="true"the AJAX request is NOT getting sent when I use$.fn.almFilter(). If I set it to false, it works.Seems like this sort of defeats the purpose. If I’m filtering — in my case, using a
<select>element to choose a new parameter — I’d like to have the results show up instantly. Instead, as it is now, the user would have to make a selection and THEN hit the “Load More” button to see the results.Any thoughts on how to workaround this?
thanks.
Thanks for the info. I had to do some more digging and found that another plugin was forcing jQuery to be loaded in an order that was causing ALM to not have it available yet on page load. Sorted it out!
Great plugin by the way. Works really well. Was happy to pay for the bundle. 🙂
I did some more tinkering and found that I was causing the problem by updating to the latest jQuery. Here is the code that was causing the ALM script to not load (seems strange that this would cause that). ??
if( !is_admin()){ wp_deregister_script('jquery'); wp_register_script('jquery2', get_template_directory_uri() . '/js/vendor/jquery.js', array(), '2.1.4', true); wp_enqueue_script('jquery2'); }Is there a way to continue to use ALM and still use the code above?
Thanks.
Forum: Fixing WordPress
In reply to: Very Slow Admin After Update to 3.8.1Well, I thought it was resolved, but today it is back. Crushing slowness on both admin and front-end site.
I have disabled ALL plugins and reverted to one of the default themes.
I have checked that my PHP memory allocation is high (currently at 256mb).
Any other suggestions or help would be much appreciated.
Forum: Fixing WordPress
In reply to: Very Slow Admin After Update to 3.8.1I was not able to determine the exact cause of the problem — I checked error logs, but they led to nothing conclusive. I *did* finally choose the “Reinstall Now” option from the Updates page. http://yourdomain.com/wp-admin/update-core.php
This worked for me. I hope it works for some of you as well.
—Ben