Use Google's copies of major Javascript libraries instead of the local copies.
Ruby
Switch branches/tags
Nothing to show
Pull request Compare This branch is 22 commits ahead of jasherai:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
tasks
test
.gitignore
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

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