public
Description: Use Google's copies of major Javascript libraries instead of the local copies.
Homepage:
Clone URL: git://github.com/chriswarren/include_google_js.git
chriswarren (author)
Tue Jun 16 23:07:36 -0700 2009
commit  9fceda1a58d4154356fe13a8cbac8516804701ed
tree    9e63b108697d4f073056a4baf33e6115a143b664
parent  73b7a9f6e07ed5b4dee61f3f25645297bf09b664
name age message
file .gitignore Sun Jan 25 21:19:39 -0800 2009 fixed a bug with @@include_google_js that cause... [Terry Heath]
file MIT-LICENSE Tue Jun 03 13:16:57 -0700 2008 Commiting all files [chriswarren]
file README Loading commit data...
file Rakefile
file init.rb Tue Jun 03 13:16:57 -0700 2008 Commiting all files [chriswarren]
file install.rb Tue Jun 03 14:33:17 -0700 2008 Dropped the environment.rb flag, using puts :in... [chriswarren]
directory lib/ Tue Jun 16 23:07:36 -0700 2009 * Little more code cleanup [chriswarren]
directory tasks/ Tue Jun 09 23:56:39 -0700 2009 * Added jQuery UI * Little more refactoring, dr... [chriswarren]
directory test/
file uninstall.rb Tue Jun 03 13:16:57 -0700 2008 Commiting all files [chriswarren]
IncludeGoogleJs
===============

Allows you to easily use Google's hosted javascript libraries instead of your own copies, lightening the load for your 
server and for your visitors.

IncludeGoogleJs will override javascript_include_tag to use Google's hosted Javascript libraries instead of the local 
copies, as explained at 
http://ajaxian.com/archives/announcing-ajax-libraries-api-speed-up-your-ajax-apps-with-googles-infrastructure
and announced at
http://googleajaxsearchapi.blogspot.com/2008/05/speed-up-access-to-your-favorite.html

Acts like the regular javascript_include_tag, but adds :include_google_js and :version options.
Gets the requested files and swaps out any that Google hosts.
Checks for a working connection to ajax.googleapis.com before switching over.

Versions are based on the version running locally, or can be overridden by passing :versions => {:scriptaculous => 
"1.5", :jquery => "1.3.2"}.

Should work with Rails > 2.0.

Thanks to Brian Hogan and Jose Fernandez for their help.

Installation
=======

From git:
ruby script/plugin install git://github.com/chriswarren/include_google_js.git


Examples
=======

Pass 

:include_google_js => true

as an option to javascript_include_tag to use Google's copy instead of the local copy.

---
Pass 

:versions => {:scriptaculous => "1.8", :prototype => "1.6"}

as an option to javascript_include_tag to specify the version of a library to retrieve.

Copyright (c) 2008-2009 Christopher Warren, released under the MIT license