$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|<script type="text/javascript" src="${file}"></script>|;
+ }
+
+ return $code;
}
1;
created with said C<label>. No attribute named C<label> is created in
that case.
+=item C<javascript_tag $file1, $file2, $file3...>
+
+Creates a HTML 'E<lt>script type="text/javascript" src="..."E<gt>'
+tag for each file name parameter passed. Each file name will be
+postfixed with '.js' if it isn't already and prefixed with 'js/' if it
+doesn't contain a slash.
+
=back
=head2 CONVERSION FUNCTIONS