Page 1 of 1

"Issues" w/ included jQuery/noConflict mode

Posted: Mon May 16, 2011 7:05 pm
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

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

Posted: Mon May 16, 2011 8:28 pm
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

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

Posted: Tue May 17, 2011 12:27 am
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

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

Posted: Tue May 17, 2011 10:55 am
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

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

Posted: Tue May 17, 2011 12:24 pm
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