X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FTemplate%2FPlugin%2FJavaScript.pm;h=16989e9a2d84f9e3396d72c1f86862c5663be2b5;hb=c18a652e2cd4409fce9c8383a9fbcc0e31e6a83f;hp=48158307f8f085eb57758f53bda318c3206c6feb;hpb=20d730acdbb52b5b75af783aa010609e25b73024;p=kivitendo-erp.git diff --git a/SL/Template/Plugin/JavaScript.pm b/SL/Template/Plugin/JavaScript.pm index 48158307f..16989e9a2 100644 --- a/SL/Template/Plugin/JavaScript.pm +++ b/SL/Template/Plugin/JavaScript.pm @@ -1,23 +1,16 @@ package SL::Template::Plugin::JavaScript; -use base qw( Template::Plugin::Filter ); +use base qw( Template::Plugin ); +use Template::Plugin; use strict; -my $cached_instance; - sub new { - my $class = shift; - - return $cached_instance ||= $class->SUPER::new(@_); -} - -sub init { - my $self = shift; - - $self->install_filter($self->{ _ARGS }->[0] || 'js'); + my ($class, $context, @args) = @_; - return $self; + return bless { + CONTEXT => $context, + }, $class; } # @@ -45,11 +38,6 @@ sub escape { return $text; } -sub filter { - my ($self, $text) = @_; - return $self->escape($text); -} - sub replace_with { return _replace_helper('replaceWith', @_); } @@ -104,11 +92,6 @@ value is not wrapped in quotes. Example: -You can also use the filter syntax instead: - - - =item C Returns code replacing the DOM elements matched by C<$selector> with