"Issues" w/ included jQuery/noConflict mode

Discussion corner for Developers of Serendipity.
Post Reply
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

"Issues" w/ included jQuery/noConflict mode

Post by yellowled »

"Issues" is a tad too strong, but here's something I noticed:

My development blog runs on s9y 1.6-alpha, which already includes jQuery in noConflict mode. My current blog runs on s9y 1.5.5, which means I include jQuery manually w/out noConflict. This results in my javascript stuff behaving very weird in my dev blog. Once 1.6 is released, this will also break backwards compatibility on older templates including jQuery manually.

Maybe we should add some kind of config/theme option to not include jQuery (in the frontend) and/or not to run in in noConflict mode? (Only if it's not too much of a hassle, of course.)

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: "Issues" w/ included jQuery/noConflict mode

Post by garvinhicking »

Hi!

What exactly breaks? If you use jQuery in your template files, you shouldn't get any problems...

Which current s9y templates that are in spartacus bundle jquery? Basically, as soon as they have their "jquery.js" file, s9y does not use its budnled jquery. Also when the tempaltes config.inc.php has the line

$serendipity['capabilities']['jquery'] = false

this will also not be emitted. I guess you just didn't see this yet. :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: "Issues" w/ included jQuery/noConflict mode

Post by yellowled »

garvinhicking wrote:What exactly breaks?
Running noConflict, $() doesn't work any longer, you need to use jQuery() instead. (Yes, I could work around that by using jQuery in noConflict mode in my pre-1.6 templates, but I'm just not used to doing that. :wink:)
garvinhicking wrote:Which current s9y templates that are in spartacus bundle jquery?
Erm, none, I guess? :)
garvinhicking wrote:$serendipity['capabilities']['jquery'] = false
Ah, perfect. :) (That's only suppressing it in the frontend, right?)

Here's another thing to consider: We should really try to keep the bundled jQuery up to date. Right now, the 1.6-alpha uses 1.4.4 -- the current stable jQuery is 1.6.1. Also, we most definitely want to bundle the minified version as is saves about 200K. I'd be happy to take care of this as I follow jQuery development anyway -- it should suffice to replace the bundled jquery.js in svn with the latest minified jquery lib (renaming it to jquery.js, of course), right?

YL
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: "Issues" w/ included jQuery/noConflict mode

Post by garvinhicking »

Hi!

Yes, please maintain the jquery.js file from us.

About frontend/backend for the capabilities variable, I'm not sure. But you'll find out :)

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: "Issues" w/ included jQuery/noConflict mode

Post by yellowled »

garvinhicking wrote:About frontend/backend for the capabilities variable, I'm not sure.
Seems to suppress it in the backend as well. IMHO it shouldn't. Then again, once 1.6. is shipped, I'm not going to use it any longer anyway, and it's very likely no one else ever will, so nevermind. :)

jQuery updated to 1.6.1.

YL
Post Reply