| 1 | package Template::Plugin::Filter::Minify::JavaScript::XS; | ||
| 2 | 2 | $Template::Plugin::Filter::Minify::JavaScript::XS::VERSION = '0.94'; | |
| 3 | # ABSTRACT: JavaScript::Minifier::XS filter for Template Toolkit | ||
| 4 | |||
| 5 | 2 | ▶ | use 5.006; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 2 | ▶ | use base 'Template::Plugin::Filter'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 2 | ▶ | use JavaScript::Minifier::XS; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 1 | ▶ | sub init { |
|
Subroutine
init: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 11 | 1 | my $self = shift; | |
| 12 | |||
| 13 | 1 | $self->install_filter('minify_js'); | |
| 14 | |||
| 15 | 1 | return $self; | |
| 16 | } | ||
| 17 | |||
| 18 | 1 | ▶ | sub filter { |
|
Subroutine
filter: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 19 | 1 | my ($self, $text) = @_; | |
| 20 | |||
| 21 | 1 | $text = JavaScript::Minifier::XS::minify($text); | |
| 22 | |||
| 23 | 1 | return $text; | |
| 24 | } | ||
| 25 | |||
| 26 | 2 | 1; | |
| 27 | |||
| 28 | __END__ | ||