Advanced search  

News:

cpg1.5.36 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.34 or older update to this latest version as soon as possible.
[more]

Pages: [1] 2 3 4   Go Down

Author Topic: jqeury.min.js conflict  (Read 16150 times)

0 Members and 1 Guest are viewing this topic.

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
jqeury.min.js conflict
« on: November 26, 2013, 02:41:20 PM »

I need to have <script src="themes/curve/js/jquery.min.js" type="text/javascript"></script> in my template.html
 but

create new album is not working because of it.

what should I do?



« Last Edit: February 04, 2014, 05:32:14 PM by allvip »
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #1 on: November 26, 2013, 08:59:24 PM »

ok.found it.
 I added this code at the end of function theme_display_thumbnails because I need it for the thumbnails but it works even at the end of function pageheader:

Code: [Select]
// This line of code will include js file
js_include('themes/curve/js/jquery.min.js');

However there is a catch in using this function. This function should be called before the pageheader() function is called. The actual inclusion of javascript files is done in pageheader() function and that is the reason all js inclusion should be done before that.

read all abot it in coppermine docs:

http://documentation.coppermine-gallery.net/en/dev_javascript.htm
« Last Edit: February 02, 2014, 06:05:05 AM by allvip »
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15171
Re: jqeury.min.js conflict
« Reply #2 on: November 27, 2013, 04:21:47 PM »

I already noticed that a newer jQuery version breaks some parts of Coppermine. I hadn't time yet for a closer look why this happens and what else don't work anymore.
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #3 on: December 08, 2013, 03:21:37 PM »

newer jQuery version breaks some parts of Coppermine if is in theme.php.

with js_include('themes/your_theme_name/js/jquery.min.js'); in theme.php albmgr.php is working but admin tools is not working.it needs a older version like jquery-1.3.2.js (copy jquery-1.3.2.js from the js folder of your coppermine gallery)







« Last Edit: February 02, 2014, 06:06:34 AM by allvip »
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #4 on: February 01, 2014, 01:17:24 PM »

all my solutions goes to same result:

a new version of jquery breaks some parts of Coppermine even if it is in theme.php or template.html
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #5 on: February 01, 2014, 01:38:38 PM »

sort my pictures- picmgr.php,new album - albmgr.php, admin tools - util.php,rating stars and fimstrip arrows on displayimage.php

It's impossible to use jquery plugins with copermine if they need jquery-1.11.0.min.js not jquery-1.3.2.js
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #6 on: February 01, 2014, 02:12:54 PM »

Can I make coppermine use the curve theme for all the admin pages?
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #7 on: February 01, 2014, 02:30:01 PM »

Can coppermine be changed to use the new jquery version for admin pages and displayimage.php?
Why it works only with old versions of jqeury anyway?
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4281
    • Windsurf.me
Re: jqeury.min.js conflict
« Reply #8 on: February 01, 2014, 05:04:32 PM »

Can coppermine be changed to use the new jquery version for admin pages and displayimage.php?
Why it works only with old versions of jqeury anyway?
When the code was written jQ3.2 was the current version. As time has gone on jQuery has been updated but we have not changed the code to be compatible with newer versions yet. The changes are quite substantial as a lot has changed with jQuery. Hopefully we can find someone with the time and talent to begin the updates.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #9 on: February 01, 2014, 05:44:44 PM »

I added jquery-1.11.0.min.js in the gallery js folder
replaced js_include('js/jquery-1.3.2.js'); with js_include('js/jquery-1.11.0.min.js'); in include/init.inc.php

everyting is working but not admin tools.Admin tools is the only thing that needs someone with the time and talent to begin the updates.

Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #10 on: February 01, 2014, 06:04:34 PM »

Anyway the biggest problem I think is that coppermine won't allow jquery in template.html.
I added in the curve theme under {JAVASCRIPT} <script type="text/javascript" src="themes/curve/js/jquery-1.11.0.min.js"></script>

and again nothing is working.

with <script type="text/javascript" src="themes/curve/js/jquery-1.3.2.js"></script> in template.html only albmgr.php is working (with jquery-1.11.0.min.js or with jquery-1.3.2.js in init.inc.php.)

I think it does not matter what version of jquery is using coppermine.

The problem is a jquery conflict or something if jquery is used in template.html
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4281
    • Windsurf.me
Re: jqeury.min.js conflict
« Reply #11 on: February 01, 2014, 06:33:13 PM »

YES YOU CAN LOAD SCRIPTS IN TEMPLATE.HTML

Sorry, but there is not need for the bold text, I can read without it....

Without seeing your full code it is impossible to say exactly what is going wrong. Loading multiple versions of a library is always going to cause problems if you do not do it properly. Having said that please try the following plugin as it might help you.

http://forum.coppermine-gallery.net/index.php/topic,74696.0.html
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #12 on: February 01, 2014, 07:08:58 PM »

Thanks for the plugin.Is proabibly what I need.

Is no code to see.
I just added the <script type="text/javascript" src="js/jquery-1.3.2.js"></script>  in template.html under {JAVASCRIPT} to the original curve theme.I did no other edits to the theme.

it looks like is not possible to load jquery-1.3.2.js from init.inc.php and from template.html.it creats a conflict.
really hope that plugin does what I want.
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4281
    • Windsurf.me
Re: jqeury.min.js conflict
« Reply #13 on: February 01, 2014, 07:21:46 PM »

The plugin should help. Here is some information on loading multiple versions of a library - https://forum.jquery.com/topic/multiple-versions-of-jquery-on-the-same-page
Logged
It is a mistake to think you can solve any major problems just with potatoes.

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 601
    • GMC Design Photo Gallery
Re: jqeury.min.js conflict
« Reply #14 on: February 02, 2014, 12:18:03 AM »

Can I make coppermine use the curve theme for all the admin pages?
You can always override your theme by adding ?theme=curve to the page being displayed... (or &theme=curve if a parm is already specified...)
Any navigation will use the specified theme (don't need to respecify on each page) until you say ?theme=xxxxxx (whatever your theme name is...) Only affects your session - other gallery users will remain on the normal theme.

I've used this method when I've run into issues where a theme isn't displaying something properly - or a quick way to see if an issue is in the theme (change to curve to see if it fixes it...)
My current theme of fiblack3dblue does a poor job displaying albmgr - it works - just not readable... so I switch myself to curve to make my changes, then switch back... until I have time to go look at it... or pick another theme....
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #15 on: February 02, 2014, 12:46:55 AM »

I know about ?theme=curve and {THEME_SELECT_LIST} but my users need to use albmgr.php

To dispaly a message:please switch theme and then switch back when your finished is ugly.
Logged

Phill Luckhurst

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4281
    • Windsurf.me
Re: jqeury.min.js conflict
« Reply #16 on: February 02, 2014, 12:56:22 AM »

Why will your own custom JS not work with the already loaded library?
Logged
It is a mistake to think you can solve any major problems just with potatoes.

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #17 on: February 02, 2014, 01:00:32 AM »

I used js_include('js/jquery-1.11.0.min.js'); under require('include/init.inc.php'); on index.php,thumbnails.php and displayimage.php because I have a jquery plugin on all those pages that needs jquery-1.11.0.min.js

the script for the jquery plugin is in template.html

I see no conflict this way.

Is a good solution because the theme is for my gallery,but if I want to make a theme for others I will have to say:please add this to...for the theme to work.
« Last Edit: February 02, 2014, 01:20:37 AM by allvip »
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: jqeury.min.js conflict
« Reply #18 on: February 02, 2014, 01:13:22 AM »

jquery no conflict is not ease to use.
I used this:
http://jquerynoconflict.discoverproductivity.co.uk/noconflict.html

http://api.jquery.com/jquery.noconflict/

and your link but nothing.

maybe because I need  to change even the $ from the js file of my plugin not just on the small code from template.html or because the jquery files are one in init.inc.php and one in template.html

I want to finish my theme fast so I do not have time to understand jquery.noconflict
« Last Edit: February 02, 2014, 01:22:27 AM by allvip »
Logged

allvip

  • Global Moderator
  • Coppermine addict
  • *****
  • Country: 00
  • Offline Offline
  • Posts: 1284
Re: Re: jqeury.min.js conflict
« Reply #19 on: February 02, 2014, 03:48:20 AM »

Why will your own custom JS not work with the already loaded library?

Is working now.I had an error in theme.php

the jquery plugin from displayimage.js is working with jquery 1.3.2 from  init.inc.php (no need to include it in template.html or theme.php)

on thumbnails.php I use another jquery plugin that works with the jquery from init.inc.php (no nedd to include the jquery in template.html or thumbnails.php) but only if it is 1.10 not 1.3.2.

but 1.10 can not replace 1.3.2 in init.inc.php.breaks the admin tools.

I have to include it on thumbnails.php

CONCLUSION:

Admin tools is the only thing that needs someone with the time and talent to begin the updates so will use 1.10
« Last Edit: February 02, 2014, 04:02:43 AM by allvip »
Logged
Pages: [1] 2 3 4   Go Up
 

Page created in 0.081 seconds with 19 queries.