/[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 1133 - (show annotations)
Tue Jun 30 15:10:55 2009 UTC (14 years, 10 months ago) by dpavlin
File size: 682 byte(s)
make classes immutable and remove moose droppings to make Perl::Critic::Moose happy
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 no Moose::Role;
35
36 1;

  ViewVC Help
Powered by ViewVC 1.1.26