/[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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 907 by dpavlin, Sun Dec 14 23:26:54 2008 UTC revision 908 by dpavlin, Fri Jan 2 13:22:13 2009 UTC
# Line 1  Line 1 
1  package Frey::jQuery;  package Frey::jQuery;
2  use Moose::Role;  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 {  sub depends {
17          my ($self) = @_;          my ($self) = @_;
18          warn "# depends";          warn "# depends";
19          $self->add_js ( 'static/js/jquery/jquery-1.2.6.js' );          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' );          $self->add_js ( 'static/Frey/jQuery/log.js' );
31          $self->add_css( 'static/Frey/jQuery/log.css' );          $self->add_css( 'static/Frey/jQuery/log.css' );
32  }  }

Legend:
Removed from v.907  
changed lines
  Added in v.908

  ViewVC Help
Powered by ViewVC 1.1.26