Google Ajax Library


For a Joomla user, Joomla import mootools.js automatically. Mootools.js is more than 70KB, If we host the mootools.js in Google, then how much bandwidth it will save?
For example, it will replace
"/media/system/js/mootools.js"
with
"http://ajax.googleapis.com/ajax/libs/mootools/1.11/mootools-yui-compressed.js"
or
"http://ajax.googleapis.com/ajax/libs/mootools/1.21/mootools-yui-compressed.js"
It depends the version you have set. The mootools version must host on Google's Ajax libraries.
The Joomla Plugin Google Ajax Library will automatically replace your local ajax libraries with Google's AJAX libraries.
Support Ajax libraries:
1. Mootools
2. Prototype
3. JQuery
4. YUI
5. SWFObject
Benefits of the using Joomla Plugin: GoogleAjaxLib
* Save bandwidth.
* Speed up your site's response.
* Service more online users.
V1.1 Use system plugin to give a big short replace.
V1.2 AddSWFObject
V1.3 Add a version for Joomla1.6.x
V1.4 Add a version for Joomla1.7.x
V1.5
1. Add an option to use Google AJAX Libraries for Joomla Administrator
2.Update the version of the libraries.
3.Remove JUI
Thanks for making our life easy.
Regards
Syed
There's a minor issue for me where I can't find a compatible mootools version that doesn't pooch the administrator area.
Editors don't load and any javascript enabled items fail entirely - including menus. I currently need to have it off while I'm editing in the backend.
There's an option to toggle the sidebar on or off when adding new items in K2.
That toggle function doesn't work if you use Mootools from Google. I tried with Mootools 1.1.1 and 1.1.2.
That said I don't believe that's a bug specific to this addon. Just be aware if you use this and K2 you might not be able to toggle said sidebar.
I love the idea , so if someone knows the trick, please let me know. Would be really nice to use the Google version.
Also nice to see it works with joomla javascript compressors also for extra speed.
The event onAfterDisplayContent is never called for my component, so it still use included Joomla mootools (ver 1.11), maybe it's on Joomla (I'll try find which event suitable for the plugin)
You can change this by doing the following in GoogleAjaxLib.php on line 47:
old:
$headerstuff['scripts']['http://ajax.googleapis.com/ajax/libs/mootools/'.$mootoolsVersion.'/mootools-yui-compressed.js']="text/javascript";
new:
$headerstuff['scripts'] = array('http://ajax.googleapis.com/ajax/libs/mootools/'.$mootoolsVersion.'/mootools-yui-compressed.js' => "text/javascript") + $headerstuff['scripts'];
Regards
delgardo
Thanks, delgardo
I have fixed the bug.
Just tested this plugin, I like it. Very nice idea.
I might add: your plugin would be better if we can add multiple versions of Jquery or prototypes and mootools. For instance VM uses an older verision of prototypes and other hot extensions use latest jQuery, like Core Design Tools.
Thanks, and congrats.
Danny

