devlabnet / SlideShow

SlideShow Plugin for CKEditor
16 stars 18 forks source link

SlideShow Not Working with jQuery already on head #20

Open jams13 opened 8 years ago

jams13 commented 8 years ago

hope anyone can help me with this.

i already have jquery on my head and if a let slideshow load the extra jquery(on 3rdparty) the slideshow works with two issues: 1 if i open the image it goes back to top. 2 error "jquery.ad-gallery.min.js:1 Uncaught TypeError: t(...)[0].width is not a function(anonymous function) @ jquery.ad-gallery.min.js:1n.event.dispatch @ jquery-2.1.4.min.js:3r.handle @ jquery-2.1.4.min.js:3". (this error occur with jquery2.1.4 and 1.11.1 ).

And the rest of my function on the page doesn't work (modals, nicescroll, menu, etc ).

if i don't let slideshow loads the jquery(on 3rdparty), my page works fine except for slideshow doesn't work and i get the same error as before "jquery.ad-gallery.min.js:1 Uncaught TypeError: t(...)[0].width is not a function(anonymous function) @ jquery.ad-gallery.min.js:1n.event.dispatch @ jquery-2.1.4.min.js:3r.handle @ jquery-2.1.4.min.js:3"

i only manage to stop the jquery(on 3rdparty) from loading by changing the name or deliting it, i try commenting the append of jquery in slideshow.js but the jquery is still being loadded.

How can i solve this it looks like calling and extra jquery causes errors on page except for slideshow. and if i prevent from loading it dosent work even if i alredy have a jqeury lib loaded.

What can i do?

cricri042 commented 8 years ago

Hi Jams, Can you try the new version I just updated ?

--Christian

jams13 commented 8 years ago

Hi Christian.

The width error was fixed. but i still have the other two problems.

1.When open image(fancybox) on click page goes back to top.

2.The rest of my function on page doesn't work.(loading the jquery on 3rdparty cancel my other jquery functions) Is there a way to make slideshow work without loading and extra jquery lib. because i am alredy using a jquery on my head.

cricri042 commented 8 years ago

Hi Jams, What happen if you just put in your ckeditor installation directory "ckeditor\plugins\slideshow\3rdParty" a fake file named "jquery.min.js" who contain nothing ?? (In other term, just empty the jquery.min.js file), so that nothing will be loaded, ..., Maybe this will work !

--Christian

jams13 commented 8 years ago

Hi Christian.

issue 1 i fixed by changing one line in jquery.fancybox.css line 168 hidden to visible

issue 2 still persists:

if i make a jquery.min.js file(empty): the slideshow dialog works, but the output page slideshow doesn't work, but the jquery function on page(nicescroll, menu, etc) works fine.

if i leave the jquery.min.js the slideshow dialog works, And the output page slideshow works, but the jquery function on page(nicescroll, menu, etc) doesn't works fine.

cricri042 commented 8 years ago

Hi Jams, Which version of jQuery do you have in your head, I'll try to reproduce the problem locally.

jams13 commented 8 years ago

Hi Christian.

i have jquery-2.1.4.min.js.

cricri042 commented 8 years ago

Hi Jams, I tried on my side with the new version I just updated ans it seems to be ok with jquery-2.1.4.min.js Anyway, I just updated a new version, and I added a config flag, so can you try it (the version here on GitHub). What you need to add is the following line in the ckeditor config.js file :

config.slideshowDoNotLoadJquery = true;

so, this file will looks like : CKEDITOR.editorConfig = function( config ) { // The configuration options below are needed when running CKEditor from source files. config.skin = 'moono'; // Define changes to default configuration here. For example: config.language = 'fr'; config.slideshowDoNotLoadJquery = true; ... }

This flag will inform the slideshow plugin to not load the local jquery file (if set to true, no jquery file will be loaded assuming that your page already load one, what's happen in your case).

Let me know if it's better.

--Christian

jams13 commented 8 years ago

Hi Christian.

the config flag works. jquery is not being loaded and the page jquery function works fine BUT slideshow dosen't work. it happens the same when i delete or make empty the jQueryfile.

i have been viewing the code from your flag,deleting the file or empty jQuery and i get the same code in html

here are some scrennshot 1 is working but not page(my other function are called like there were not declare), and 2 is when i either flag, delete or empty jQuery. no sure if be deleting the jquery i am missing a call function for slideshow, ad-gallery or fancybox so they appear.

captura de pantalla 1 captura de pantalla 2