[jifty-devel] small doc patch for web.pm

bart bunting bart at bunting.net.au
Fri Jun 23 21:58:11 EDT 2006

This is a small documentation patch for J::Web.pm describing where to
put your application's javascript and how to add additional javascript

Can someone check it for accuracy in case I've missed something.


Index: jifty/trunk/lib/Jifty/Web.pm
--- jifty/trunk/lib/Jifty/Web.pm	(revision 1359)
+++ jifty/trunk/lib/Jifty/Web.pm	(working copy)
@@ -983,6 +983,24 @@
 Returns a C<< <script> >> tag for the compressed Javascript.
+Your application specific javascript goes in
+F<share/web/static/js/app.js>.  This will be automagically included if
+it exists.
+However if you want to include other javascript libraries you need to
+add them to the javascript_libs array of your application.  Do this in
+the C<start> sub of your main application class.  For example if your application is Foo then in L<lib/Foo.pm>
+ sub start {
+   Jifty->web->javascript_libs([
+ 			       @{ Jifty->web->javascript_libs },
+ 			       "yourJavascriptLib.js",
+ 			      ]);
+ }
+Jifty will look for javascript libraries under share/web/static/js/ by
 sub include_javascript {

More information about the jifty-devel mailing list