Kris-B / nanoGALLERY4GS

nanoGALLERY plugin for GetSimple CMS
14 stars 5 forks source link

Redundant JQuery insert #6

Open xtroll opened 10 years ago

xtroll commented 10 years ago

The GS- get_header() function always inserts another jquery include in my page header on pages which are using the nanoGALLERY. The include strangely comes from admin/inc/plugin_functions.php, I dont know how to get rid of this call. I already include JQuery in my template. So I have 2 versions simultan-included... I hope my description is understandable... What can I do?

The additionally inserted source from admin/inc/plugin_functions.php looks like this:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?v=1.7.1"></script><script>window.jQuery || document.write('<!-- CDN FALLING BACK --><script src="http://myurl/admin/template/js/jquery.min.js?v=1.7.1"><\/script>');</script>

Its inserted far above the other nanoGALLERY includes. And its only happening when using nanoGALLERY.

Thanks for help!

Kris-B commented 10 years ago

The plugin implements queue_script('jquery', GSFRONT) which will load jQuery only once regardless of how many plugins have set it to load.

More info on this GetSimple page: http://get-simple.info/wiki/plugins:creation#register_queue_your_script

I don't know if it can apply to template.

xtroll commented 10 years ago

Ah okay, discovered it in nanogallery3.php and commented it out (because I include a more recent JQuery lib directly in my template). Would be nice, to put an option for not including JQuery in the nanoGALLERY admin settings. Thanks and greetings!

marlontpita commented 10 years ago

xtroll, I have the same issue, can you please point out which one to be commented on nanogallery3.php, thanks

xtroll commented 10 years ago

In plugins/nanogallery3.php the line after "add_action('index-pretemplate...." //queue_script('jquery', GSFRONT);

marlontpita commented 10 years ago

I commented the.

activate filter

add_filter('content','nanoGallery'); add_action('index-pretemplate','nanoGallery_check'); //queue_script('jquery', GSFRONT);

but still I got this redundancy. http://marlonpita.com/index.php?id=gallery

Any Idea? I really appreciate your help.

Thanks

xtroll commented 10 years ago

Your site includes the 1.7.1 library even on pages without nanogallery. So you might have another plugin, wich implements the "queue_script('jquery', GSFRONT)" - Some plugins come with options to deactivate the jquery include from the backend, on others you have to check the sources in the same way like we did here in nanogallery. Good luck and greetings to Manila ;-)

marlontpita commented 10 years ago

Thanks, xtroll, I just did a manual encoding just to fix it. thanks again