line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Plugin::Filter::Minify::JavaScript; |
2
|
|
|
|
|
|
|
$Template::Plugin::Filter::Minify::JavaScript::VERSION = '0.94'; |
3
|
|
|
|
|
|
|
# ABSTRACT: JavaScript::Minifier filter for Template Toolkit |
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
69362
|
use 5.006; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
81
|
|
6
|
2
|
|
|
2
|
|
11
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
74
|
|
7
|
2
|
|
|
2
|
|
20
|
use base 'Template::Plugin::Filter'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
2019
|
|
8
|
2
|
|
|
2
|
|
22899
|
use JavaScript::Minifier; |
|
2
|
|
|
|
|
8101
|
|
|
2
|
|
|
|
|
383
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub init { |
11
|
1
|
|
|
1
|
0
|
68
|
my $self = shift; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
|
|
8
|
$self->install_filter('minify_js'); |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
54
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub filter { |
19
|
1
|
|
|
1
|
0
|
92
|
my ($self, $text) = @_; |
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
3
|
$text = JavaScript::Minifier::minify(input => $text); |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
2573
|
return $text; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |