/[Frey]/trunk/lib/Frey/jQuery.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/lib/Frey/jQuery.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 908 - (show annotations)
Fri Jan 2 13:22:13 2009 UTC (15 years, 3 months ago) by dpavlin
File size: 665 byte(s)
 r1003@eeepy:  dpavlin | 2009-01-01 19:04:54 +0100
 use jquery from google ajax api hosting if not available locally

1 package Frey::jQuery;
2 use Moose::Role;
3
4 has jquery_path => (
5 is => 'rw',
6 default => 'static/js/jquery/jquery-1.2.6.js',
7 );
8
9 =head2 depends
10
11 Load C<jquery> and our log extension from local filesystem
12 or from google hosted jquery
13
14 =cut
15
16 sub depends {
17 my ($self) = @_;
18 warn "# depends";
19 if ( -e $self->jquery_path ) {
20 $self->add_js( $self->jquery_path );
21 } else {
22 $self->add_js( 'http://www.google.com/jsapi' );
23 $self->add_js(q|
24 google.load("jquery", "1");
25 google.setOnLoadCallback(function(){
26 console.log('jquery loaded');
27 });
28 |);
29 }
30 $self->add_js ( 'static/Frey/jQuery/log.js' );
31 $self->add_css( 'static/Frey/jQuery/log.css' );
32 }
33
34 1;

  ViewVC Help
Powered by ViewVC 1.1.26