| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Alien::scriptaculous; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
############################################################################### |
|
4
|
|
|
|
|
|
|
# Required inclusions. |
|
5
|
|
|
|
|
|
|
############################################################################### |
|
6
|
2
|
|
|
2
|
|
73485
|
use strict; |
|
|
2
|
|
|
|
|
6
|
|
|
|
2
|
|
|
|
|
81
|
|
|
7
|
2
|
|
|
2
|
|
13
|
use warnings; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
59
|
|
|
8
|
2
|
|
|
2
|
|
12
|
use Carp; |
|
|
2
|
|
|
|
|
8
|
|
|
|
2
|
|
|
|
|
197
|
|
|
9
|
2
|
|
|
2
|
|
12
|
use File::Spec; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
51
|
|
|
10
|
2
|
|
|
2
|
|
2891
|
use File::Copy qw(copy); |
|
|
2
|
|
|
|
|
12209
|
|
|
|
2
|
|
|
|
|
164
|
|
|
11
|
2
|
|
|
2
|
|
16
|
use File::Path qw(mkpath); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
120
|
|
|
12
|
2
|
|
|
2
|
|
12
|
use File::Basename qw(dirname); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
417
|
|
|
13
|
2
|
|
|
2
|
|
1939
|
use Alien::Prototype; |
|
|
2
|
|
|
|
|
1545
|
|
|
|
2
|
|
|
|
|
904
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
############################################################################### |
|
16
|
|
|
|
|
|
|
# Version number |
|
17
|
|
|
|
|
|
|
############################################################################### |
|
18
|
|
|
|
|
|
|
our $SCRIPTACULOUS_VERSION = '1.8.0'; |
|
19
|
|
|
|
|
|
|
our $VERSION = '1.8.0.2'; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
############################################################################### |
|
22
|
|
|
|
|
|
|
# Subroutine: version() |
|
23
|
|
|
|
|
|
|
############################################################################### |
|
24
|
|
|
|
|
|
|
# Returns the script.aculo.us version number. |
|
25
|
|
|
|
|
|
|
# |
|
26
|
|
|
|
|
|
|
# Not to be confused with the 'Alien::scriptaculous' version number (which is |
|
27
|
|
|
|
|
|
|
# the version number of the Perl wrapper). |
|
28
|
|
|
|
|
|
|
############################################################################### |
|
29
|
|
|
|
|
|
|
sub version { |
|
30
|
0
|
|
|
0
|
1
|
0
|
return $SCRIPTACULOUS_VERSION; |
|
31
|
|
|
|
|
|
|
} |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
############################################################################### |
|
34
|
|
|
|
|
|
|
# Subroutine: path() |
|
35
|
|
|
|
|
|
|
############################################################################### |
|
36
|
|
|
|
|
|
|
# Returns the path to the available copy of script.aculo.us. |
|
37
|
|
|
|
|
|
|
############################################################################### |
|
38
|
|
|
|
|
|
|
sub path { |
|
39
|
3
|
|
|
3
|
1
|
13
|
my $base = $INC{'Alien/scriptaculous.pm'}; |
|
40
|
3
|
|
|
|
|
18
|
$base =~ s{\.pm$}{}; |
|
41
|
3
|
|
|
|
|
10
|
return $base; |
|
42
|
|
|
|
|
|
|
} |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
############################################################################### |
|
45
|
|
|
|
|
|
|
# Subroutine: to_blib() |
|
46
|
|
|
|
|
|
|
############################################################################### |
|
47
|
|
|
|
|
|
|
# Returns a hash containing paths to the source files to be copied, and their |
|
48
|
|
|
|
|
|
|
# relative destinations. |
|
49
|
|
|
|
|
|
|
############################################################################### |
|
50
|
|
|
|
|
|
|
sub to_blib { |
|
51
|
3
|
|
|
3
|
1
|
8
|
my $class = shift; |
|
52
|
3
|
|
|
|
|
9
|
my $path = $class->path(); |
|
53
|
3
|
|
|
|
|
9
|
my @files = map { "$_.js" } |
|
|
21
|
|
|
|
|
48
|
|
|
54
|
|
|
|
|
|
|
qw( builder controls dragdrop effects scriptaculous slider |
|
55
|
|
|
|
|
|
|
sound |
|
56
|
|
|
|
|
|
|
); |
|
57
|
3
|
|
|
|
|
8
|
my %blib = map { (File::Spec->catfile($path,'src',$_) => $_) } @files; |
|
|
21
|
|
|
|
|
232
|
|
|
58
|
3
|
|
|
|
|
26
|
return %blib; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
############################################################################### |
|
62
|
|
|
|
|
|
|
# Subroutine: files() |
|
63
|
|
|
|
|
|
|
############################################################################### |
|
64
|
|
|
|
|
|
|
# Returns the list of files that are installed by Alien::scriptaculous. |
|
65
|
|
|
|
|
|
|
############################################################################### |
|
66
|
|
|
|
|
|
|
sub files { |
|
67
|
1
|
|
|
1
|
1
|
13
|
my $class = shift; |
|
68
|
1
|
|
|
|
|
4
|
my %blib = $class->to_blib(); |
|
69
|
1
|
|
|
|
|
13
|
return sort values %blib; |
|
70
|
|
|
|
|
|
|
} |
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
############################################################################### |
|
73
|
|
|
|
|
|
|
# Subroutine: install($destdir) |
|
74
|
|
|
|
|
|
|
# Parameters: $destdir - Destination directory |
|
75
|
|
|
|
|
|
|
############################################################################### |
|
76
|
|
|
|
|
|
|
# Installs the script.aculo.us Javascript libraries into the given '$destdir'. |
|
77
|
|
|
|
|
|
|
# Throws a fatal exception on errors. |
|
78
|
|
|
|
|
|
|
############################################################################### |
|
79
|
|
|
|
|
|
|
sub install { |
|
80
|
2
|
|
|
2
|
1
|
4388
|
my ($class, $destdir) = @_; |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
# install Prototype |
|
83
|
2
|
|
|
|
|
17
|
Alien::Prototype->install( $destdir ); |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
# install our files |
|
86
|
2
|
|
|
|
|
2416
|
my %blib = $class->to_blib(); |
|
87
|
2
|
|
|
|
|
14
|
while (my ($srcfile, $dest) = each %blib) { |
|
88
|
|
|
|
|
|
|
# get full path to destination file |
|
89
|
14
|
|
|
|
|
5224
|
my $destfile = File::Spec->catfile( $destdir, $dest ); |
|
90
|
|
|
|
|
|
|
# create any required install directories |
|
91
|
14
|
|
|
|
|
434
|
my $instdir = dirname( $destfile ); |
|
92
|
14
|
50
|
|
|
|
264
|
if (!-d $instdir) { |
|
93
|
0
|
0
|
|
|
|
0
|
mkpath( $instdir ) || croak "can't create '$instdir'; $!"; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
|
|
|
|
|
|
# install the file |
|
96
|
14
|
50
|
|
|
|
45
|
copy( $srcfile, $destfile ) || croak "can't copy '$srcfile' to '$instdir'; $!"; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
|
|
|
|
|
|
} |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
1; |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 NAME |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
Alien::scriptaculous - installing and finding script.aculo.us |
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
use Alien::scriptaculous; |
|
109
|
|
|
|
|
|
|
... |
|
110
|
|
|
|
|
|
|
$version = Alien::scriptaculous->version(); |
|
111
|
|
|
|
|
|
|
$path = Alien::scriptaculous->path(); |
|
112
|
|
|
|
|
|
|
... |
|
113
|
|
|
|
|
|
|
Alien::scriptaculous->install( $my_destination_directory ); |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Please see L for the manifesto of the Alien namespace. |
|
118
|
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 METHODS |
|
120
|
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=over |
|
122
|
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item version() |
|
124
|
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Returns the script.aculo.us version number. |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
Not to be confused with the C version number (which |
|
128
|
|
|
|
|
|
|
is the version number of the Perl wrapper). |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item path() |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
Returns the path to the available copy of script.aculo.us. |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item to_blib() |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
Returns a hash containing paths to the source files to be copied, and their |
|
137
|
|
|
|
|
|
|
relative destinations. |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=item files() |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Returns the list of files that are installed by Alien::scriptaculous. |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=item install($destdir) |
|
144
|
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Installs the script.aculo.us Javascript libraries into the given |
|
146
|
|
|
|
|
|
|
C<$destdir>. Throws a fatal exception on errors. |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=back |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=head1 AUTHOR |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
Graham TerMarsch (cpan@howlingfrog.com) |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 LICENSE |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
Copyright (C) 2006, Graham TerMarsch. All rights reserved. |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
http://script.aculo.us/, |
|
163
|
|
|
|
|
|
|
L, |
|
164
|
|
|
|
|
|
|
L. |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
=cut |