line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catalyst::Helper::Dojo;
|
2
|
1
|
|
|
1
|
|
32890
|
use strict;
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
40
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use Carp qw/ croak /;
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
76
|
|
5
|
1
|
|
|
1
|
|
5
|
use File::Spec;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
36
|
|
6
|
1
|
|
|
1
|
|
801
|
use HTML::Dojo;
|
|
1
|
|
|
|
|
1824
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.02000';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 NAME
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
Catalyst::Helper::Dojo - Helper to generate Dojo JavaScript / AJAX library
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
script/myapp_create.pl Dojo edition
|
17
|
|
|
|
|
|
|
# where "edition" is the edition name you want to install
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
See L for a list of available editions.
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Helper to generate Dojo JavaScript / AJAX library.
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head2 METHODS
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=over 4
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=item mk_stuff
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Create javascript files for Dojo in your application's C
|
32
|
|
|
|
|
|
|
directory.
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
=back
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub mk_stuff {
|
39
|
0
|
|
|
0
|
1
|
|
my ( $self, $helper, $edition ) = @_;
|
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
my %args;
|
42
|
0
|
0
|
|
|
|
|
$args{edition} = $edition if defined $edition;
|
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
my $dojo = HTML::Dojo->new( %args );
|
45
|
|
|
|
|
|
|
|
46
|
0
|
|
|
|
|
|
my $dirs = $dojo->list({
|
47
|
|
|
|
|
|
|
directories => 1,
|
48
|
|
|
|
|
|
|
files => 0,
|
49
|
|
|
|
|
|
|
});
|
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
|
|
|
my $dojo_dir = File::Spec->catdir(
|
52
|
|
|
|
|
|
|
$helper->{base}, 'root', 'static', 'dojo' );
|
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
for (@$dirs) {
|
55
|
0
|
|
|
|
|
|
my $dir = File::Spec->catdir( $dojo_dir, $_ );
|
56
|
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
$helper->mk_dir( $dir );
|
58
|
|
|
|
|
|
|
}
|
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
|
|
|
my $files = $dojo->list;
|
61
|
|
|
|
|
|
|
|
62
|
0
|
|
|
|
|
|
for (@$files) {
|
63
|
0
|
|
|
|
|
|
my $file = File::Spec->catfile( $dojo_dir, $_ );
|
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
$helper->mk_file( $file, $dojo->file($_) );
|
66
|
|
|
|
|
|
|
}
|
67
|
0
|
|
|
|
|
|
return;
|
68
|
|
|
|
|
|
|
}
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head1 SUPPORT
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
IRC:
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Join #catalyst on irc.perl.org.
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
Mailing Lists:
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
http://lists.rawmode.org/mailman/listinfo/catalyst
|
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
For Dojo-specific support, see L.
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=head1 SEE ALSO
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
L, L
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L
|
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Carl Franks, C
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 LICENSE
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This library is free software . You can redistribute it and/or modify
|
95
|
|
|
|
|
|
|
it under the same terms as perl itself.
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
1;
|