...using jQuery with $ (Which is used by MooTools) variable is not
directly possible...
Why is it so?
I mean, when jQuery is loaded after MooTools, it should reassing the
window.$ to jQuery, no?
I'd then adjust MooTools code to use
`
document.id('wrapper')` instead of `$('wrapper')` and
`document.getElements('.wrappers')` instead of `$$('wrappers')`
IMO introducing modular script loader might be too complex for CMS
(although I'd really like to have such option in JDocument)
On May 14, 5:44 am, Ashan <
ashan...@gmail.com> wrote:
> Hi everyone,
>
> During past two weeks, I was looking at the implementation possibilities to
> reduce MooTools usage in Jooma!. One of the observations was that it
> requires to keep jQuery and MooTools side by side (Reduce the conflicts
> with extensions, templates & etc.) but using jQuery with $ (Which is used
> by MooTools) variable is not directly possible. I came up with the
> following approaches to do the implementation (Since using jQuery instead
> of $ for selector is not nice).
>
> 1) Scope the MooTools dependent sections with anonymous functions and
> assigning $ for jQuery within that scope and implement it using jQuery
> (Removing the MooTools dependencies).
>
> *(function($){*
> * // Removed Mootools dependent code with jQuery*
> *})(jQuery);*
>
> 2) Instead of the above approach, change the way that the application loads
> using jQuery and other libraries by using a modular script loader like
> Require.js. (This is already used by Anibal for installation section).
>
> *define(["jquery"], function($) {*
> * //jQuery dependent code*
> *});*
> *
> *