jQuery.noConflict

Permalink
I recon it's a bit to ask, but I've been using other libraries in some of my work and jQuery has this wonderful noConflict feature which will allow the side-by-side use of other popular libraries (I'd been using mootools).

Anyway, I've gone through and modified all the tokens to get it to work but I imagine at some point I'm going to need to look at updating the code to a more recent release; which will of course require I do it again (and again and again..).

I'd be happy to make the changes myself but I'm afraid the quality of my work might leave something to be desired (I'm a self-teaching novice programmer; my field is operation/systems).

The upside is aside from the initial work the noConflict feature requires very little change and I'd imagine the benefits might make it something worth at least considering.

Thanks for the great work and the great project!

 
Remo replied on at Permalink Reply
Remo
I would love to see those changes in the core!

I'm a huge jQuery fan but I had a project with mootools where I had a lot of problems because of this conflict too..
AlbertPotato replied on at Permalink Reply
AlbertPotato
Currently trying to get the sliding-door Wordpress theme working in c5 and mootools is killing the c5 edit bar.
frz replied on at Permalink Reply
frz
anyone care to submit a patch on this? I think my standard answer would be "disable moo in edit mode" but obviously that's pretty thin.
AlbertPotato replied on at Permalink Reply
AlbertPotato
Disabling mootools while in edit mode would probably work good enough for my project. How would I do that?
ScottC replied on at Permalink Reply
ScottC
didn't test this

<?php
if (!$c->isEditMode()){  // c is not in edit mode
?>
//your mootools include goes here.
<?php }?>
AlbertPotato replied on at Permalink Reply
AlbertPotato
This worked great for if I'm in edit mode, but what about if I'm logged in at all? I'd like to see the c5 top bar even out of edit mode.

I tried:
if (!$u->isLoggedIn())

but I get:

Fatal error: Call to a member function isLoggedIn() on a non-object in /Applications/MAMP/htdocs/themes/slidingdoor/default.php on line 8
Remo replied on at Permalink Reply
Remo
as it says..

1. try add global $u;
2. if this doens't work, create a new user object $u = new User();
AlbertPotato replied on at Permalink Reply
AlbertPotato
Got it to work by using this:

if (!$_SESSION['uID'] > 0) {
...
}


Appreciate the help!
Remo replied on at Permalink Reply
Remo
I think someone posted a patch for this a while ago. I'm quite sure it doesn't work wiht 5.3.3 out of the box but it might be a good start.

About disabling - you simply don't include mootools.
frz replied on at Permalink Reply
frz
he's probably looking for the if inEditMode syntax.
AlbertPotato replied on at Permalink Reply
AlbertPotato
Yes, that's what I was looking for. Thanks all!!
diorist replied on at Permalink Reply
diorist
I know this is an old thread, but I just ran into a conflict with C5 and noconflict() on the current C5 release. Thought I'd throw out the workaround that finally got both my script and the C5 edit bar to work at the same time...

By changing the
$(document).ready(function() {
in my template's functions.js file to
jQuery(function( $ ){
I was able to eliminate using noconflict() altogether.

In case it helps...