Using jQuery instead of Mootools is not an option :-)
We adopted MooTools in our team as core JS library, we are happy and we have a 
lot of confidence on it.
And a lot of knowledge about plugins, self-made extensions, bugs, workaround...

M.

-----Original Message-----
From: user-list-ow...@magnolia-cms.com 
[mailto:user-list-ow...@magnolia-cms.com] On Behalf Of Peter Flood
Sent: mercoledì, 17. febbraio 2010 18:23
To: Magnolia User-List
Subject: Re: [magnolia-user] Magnolia & Mootools


Not sure what you're trying to do but you could use jQuery instead of 
mootools, it also uses $ as a function but there's an easy way to put it 
back, eg for jQuery replace $() with jQuery(). It's something like 
jQuery.no_conflict() as I recall.



Matteo Pelucco wrote:
>
> Hi all,
> I'm using Mootools as JS framework. Mootools is not scoped, so it 
> defines $ as a function. But it should not be a problem, because 
> Magnolia defines its own $ function with these lines:
> *****************************
> if (typeof $ != 'function') {
>     function $(element)
>     {
>         return document.getElementById(element);
>     }
> }
> *****************************
>
> I'am a bit confused: this piece of code
>
> *****************************
> ...(head with mootools js declaration)
> <body ${bodyID} ${bodyClass}>
>     
>     <script type="text/javascript">
>     alert($);
>     alert(typeof $);
>     </script>
>     
>     [#-- add Magnolia css and js: --]
>     [...@cms.links /]
>     
>     <script type="text/javascript">
>     alert($);
>     alert(typeof $);
>     </script>
> ...
> *****************************
>
> produced the following alert in IE7 // Chrome // Safari
>
> 1) <mootols $ function>
> 2) function
> 3) <magnolia $ function>
> 4) function
>
> but in Firefox
>
> 1) <mootols $ function>
> 2) function
> 3) <mootools $ function>
> 4) function
>
> Why this?
> The only way to let Magnolia & Mootols (but I think it is also with 
> other $-based-not-scoped js libs) is to replace
>
> *****************************
> [#-- add Magnolia css and js: --]
> [...@cms.links /]
> *****************************
>
> with
>
> *****************************
> [#-- add Magnolia css and js: --]
> [...@cms.links /]
>
> [#-- Mootools 1.2.4 HACK, because Magnolia redefines $ function --]
> <script type="text/javascript">
> $ = function (a, b) {
>     return document.id(a, b, this.document);
> }
> </script>
> *****************************
>
>
> PS: why not use something like "mgnl" as $ replacement?
>
> Matteo
>
>
> ----------------------------------------------------------------
> For list details see
> http://www.magnolia-cms.com/home/community/mailing-lists.html
> To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
> ----------------------------------------------------------------
>
>


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <user-list-unsubscr...@magnolia-cms.com>
----------------------------------------------------------------

Reply via email to