jqeury.min.js conflict jqeury.min.js conflict
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

jqeury.min.js conflict

Started by allvip, November 26, 2013, 01:41:20 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

allvip

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?




allvip

#1
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:

// 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

ΑndrĂ©

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.

allvip

#3
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)








allvip

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

allvip

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

allvip

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

allvip

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?

phill104

Quote from: allvip on February 01, 2014, 01: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?
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.
It is a mistake to think you can solve any major problems just with potatoes.

allvip

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.


allvip

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

phill104

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
It is a mistake to think you can solve any major problems just with potatoes.

allvip

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.

phill104

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
It is a mistake to think you can solve any major problems just with potatoes.

gmc

Quote from: allvip on February 01, 2014, 01:12:54 PM
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....
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

allvip

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.

phill104

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

allvip

#17
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.

allvip

#18
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

allvip

#19
Quote from: Phill Luckhurst on February 01, 2014, 11:56:22 PM
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