Replace mootools with jquery (or dojo) on the front end.

User avatar
micheas
Joomla! Explorer
Joomla! Explorer
Posts: 323
Joined: Sat Sep 03, 2005 10:54 am
Location: San Francisco, CA
Contact:

Replace mootools with jquery (or dojo) on the front end.

Postby micheas » Thu Jul 16, 2009 3:00 am

Suggestion: replace Mootools as the Joomla javascript library. for the front end only.

As far as I know this involves rewriting one file. (correction about 500 lines that I have found so far)

Problems to solve:
Mootools like prototype encourage the use overrides that "pollute" the global name space. This means that if one is developing a component one does not know what state other modules on the page may have left the global name space.

Many extension developers have resorted to using jQuery in compatibility mode. This results in Joomla appearing slow as you have multiple javascript libraries loading.

Additional benifits:
There seems to be a larger community around jquery and more plentiful documentation for beginners.
Projects like civicrm could use the same for their front end for both drupal and joomla. giving them incentive to move from dojo to jquery making joomla websites using civicrm faster to load by up to 75% over the current situation.
people could use code.google.com for jquery to get some benefit from googles edge servers to decrease the traffic of one's website and improve performance.

Potential problems
Some templates are based on mootools and would either need rewrote or modified by including mootools in /template/templatename/js/mootools.js and making some small modifications to the header of the templates index.php file.

some extensions may rely on mootools, which should then be rewritten to use jquery but they could as a stop gap load mootools.js as a stop gap. However, using mootools in a component is fairly dangerous as you may find your component colliding with certain templates so it appears in my fairly brief non random unscientific survey of components that majority of component writers go to with jquery.

One major downside is that mootools has physics in its effects and losing them would be sad. but I don't see those effects utilized that much.

problems
some templates rely on mootools and would therefore be broken. however, the fix is a one line

scope of work
rewrite media/system/js/caption.js
rewrite beez/javascript/md_stylechanger.js
rewrite ja_purity/js/* (the biggest project)

the overall scope of work looks to be about 500 lines of code.

There appears to be no conflict with tinymce.

I am sure I have missed a few issues, but it seems like a reasonable request if it came with code.

Comments?

User avatar
amar_strange
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 183
Joined: Fri Jan 19, 2007 8:06 am
Contact:

Re: Replace mootools with jquery (or dojo) on the front end.

Postby amar_strange » Thu Jul 16, 2009 4:49 am

check out this too

[url]viewtopic.php?f=231&t=283215[/url]
Last edited by amar_strange on Thu Jul 16, 2009 5:33 am, edited 1 time in total.

User avatar
micheas
Joomla! Explorer
Joomla! Explorer
Posts: 323
Joined: Sat Sep 03, 2005 10:54 am
Location: San Francisco, CA
Contact:

Re: Replace mootools with jquery (or dojo) on the front end.

Postby micheas » Thu Jul 16, 2009 5:32 am

While that discussion shows that it is possible to use both javascript libraries at the same time.(I have done it.) and it also shows that changing the standard library would be maintainable.

It does nothing to address the problem of more and more joomla extensions are using jquery, and the fact that the awesome things you can do with mootools are a really bad idea when you have random unknown (but trusted) javascript being executed on the page.

I think that moving to jQuery or dojo would be a really good move. (I would be concerned about the lack of beginners documentation for dojo. but that is fixable)

Loading mootools and jquery is a huge waste of bandwidth and makes joomla seem slow.

The best solution in my mind is rewrite the mootools code with jquery.

I may find the time to do this in the next couple weeks, but I would like to know how much pushback there will be to the replacement files.

User avatar
amar_strange
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 183
Joined: Fri Jan 19, 2007 8:06 am
Contact:

Re: Replace mootools with jquery (or dojo) on the front end.

Postby amar_strange » Thu Jul 30, 2009 11:51 am

I will wait to see the results...

User avatar
cybervigilante
Joomla! Explorer
Joomla! Explorer
Posts: 493
Joined: Mon Apr 23, 2007 11:59 pm
Location: Apache Junction, AZ
Contact:

Re: Replace mootools with jquery (or dojo) on the front end.

Postby cybervigilante » Fri Jan 08, 2010 5:10 am

While waiting for a less ancient MooTools in 1.6 I started learning Dojo and now I don't want to go back to MooTools. It sure would be nice if they unhooked MooTools from the back end so you could easily use the framework of your choice without double-loading two of them. I prefer MooTools to be an option. I don't care if the back end has fancy menus; it's more like my garage - it's there the get the job done. The fancy is for the front end.
Arguing with trolls is like watering bricks and expecting flowers.

User avatar
micheas
Joomla! Explorer
Joomla! Explorer
Posts: 323
Joined: Sat Sep 03, 2005 10:54 am
Location: San Francisco, CA
Contact:

Re: Replace mootools with jquery (or dojo) on the front end.

Postby micheas » Fri Jan 08, 2010 5:29 am

Actually, the latest version of mootools includes code to not pollute the global name space, if you want.

That has killed a lot of my enthusiasm for jQuery over mootools. (the other problem with mootools is the the relative lack of beginner howto's, compared to jQuery, but mootools physics more than makes up for it, IMHO.)


Return to “Feature Requests - White Papers - Archived”

Who is online

Users browsing this forum: No registered users and 4 guests