From 62ba378c53a7ead8c5e99ef965d79d7368216b88 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Dec 2010 13:43:40 +0100 Subject: [PATCH] =?utf8?q?Layout-Helfer=20f=C3=BCr=20JavaScript-Src-Tags?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Conflicts: SL/Template/Plugin/L.pm --- SL/Template/Plugin/L.pm | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/SL/Template/Plugin/L.pm b/SL/Template/Plugin/L.pm index 710f1c923..d9fd3c1f5 100644 --- a/SL/Template/Plugin/L.pm +++ b/SL/Template/Plugin/L.pm @@ -203,6 +203,19 @@ sub date_tag { $self->javascript( "Calendar.setup({ inputField: '$name_e', ifFormat: '$::myconfig{jsc_dateformat}', align: '$params{cal_align}', button: 'trigger$seq' });" ) : ''); + +sub javascript_tag { + my $self = shift; + my $code = ''; + + foreach my $file (@_) { + $file .= '.js' unless $file =~ m/\.js$/; + $file = "js/${file}" unless $file =~ m|/|; + + $code .= qq||; + } + + return $code; } 1; @@ -310,6 +323,13 @@ If C<%attributes> contains a key C