JQuery Update [message #165049] |
Wed, 20 April 2011 14:19 |
|
Dayo
Messages: 101 Registered: April 2011
Karma: 0
|
Senior Member |
|
|
Two diff files attached for consideration.
Basically, Joomla uses Mootools and FUDforum, JQuery both of which are in conflict with each other (they both use the same "$" shortcut). I have taken care of this in the script but it will be better to load non-conflicting files.
1. js.diff simply adds "$jquery = jQuery.noConflict();" to the end of jquery.js and changes all the "$" calls in lib.js to "$jquery"
2. js-2.diff does the same as js.diff for lib.js and for jquery.js, is just a copy of JQuery 1.5.1 with the "noConflict" function at the end.
JQuery 1.5.1 works fine with the current templates I looked at (not all though) so might be a good idea to move up to this version for the next release.
-
Attachment: js.diff
(Size: 9.75KB, Downloaded 1226 times)
-
Attachment: js-2.diff
(Size: 167.60KB, Downloaded 1254 times)
[Updated on: Wed, 20 April 2011 14:21] Report message to a moderator
|
|
|
|
|
|
|
Re: JQuery Update [message #165060 is a reply to message #165058] |
Wed, 20 April 2011 16:06 |
|
Dayo
Messages: 101 Registered: April 2011
Karma: 0
|
Senior Member |
|
|
Took a look at some candidates (tree.tmpl for instance) to gauge how much effort to try to consolidate and can see that has to be put into the "too hard basket".
Workaround it is!
[Updated on: Wed, 20 April 2011 16:07] Report message to a moderator
|
|
|
|
Re: JQuery Update [message #165062 is a reply to message #165061] |
Wed, 20 April 2011 18:12 |
|
Dayo
Messages: 101 Registered: April 2011
Karma: 0
|
Senior Member |
|
|
Thanks for trying. A step closer indeed.
To finish up what you started in tree.tmpl, is it possible to do something like ...
<script type="text/javascript">
/* <![CDATA[ */
tree_cur_msg( {VAR: mid} );
/* ]]> */
</script>
and add this to lib.js ...
function tree_cur_msg(cur_msg)
{
$jquery('#b' + cur_msg).removeClass().addClass('RowStyleC');
}
... which would eradicate the issue for that file if possible
I have written the regex to resolve the conflict before the forum html is rendered so this is not a show stopper.
I just raised the issue since if the conflict was not there, I'll have been able to drop a few lines of regex code and optimise load speed.
[Updated on: Wed, 20 April 2011 18:15] Report message to a moderator
|
|
|
|
|
|
|