This plugin integrates the Prototype, Scriptaculous and Rico Javascript libraries into Grails. In Grails versions prior to 1.4 these libraries were included by default in Grails. As of Grails 1.4 jQuery is the default Javascript library in the Grails distribution with this plugin providing an alternative for those who would rather use Prototype or want to upgrade an existing Grails application that uses Prototype based script.
In order to use Prototype rather than jQuery in a Grails app you just need to:
grails uninstall-plugin jquery
grails install-plugin prototype
The plugin provides three Javascript libraries, prototype, scriptaculous and rico. The scriptaculous and rico libraries depend on prototype so if you are including either of those it is not necessary to include prototype separately.
For example:
<g:javascript plugin="prototype" library="scriptaculous"/>
Will be converted to:
<script type="text/javascript" src="/myapp/plugins/prototype-1.0-SNAPSHOT/js/prototype/prototype.js"></script>
<script type="text/javascript" src="/myapp/plugins/prototype-1.0-SNAPSHOT/js/prototype/scriptaculous.js"></script>
If you are using the Resources plugin you can include Prototype libraries that way. e.g.:
<r:require module="scriptaculous"/>
In order to have Grails' built-in AJAX tags such as g:formRemote
and g:remoteLink
to generate Prototype code you need to add the following declaration to your GSP:
<g:setProvider library="prototype"/>