Revision 62ba378c
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
SL/Template/Plugin/L.pm | ||
---|---|---|
203 | 203 |
$self->javascript( |
204 | 204 |
"Calendar.setup({ inputField: '$name_e', ifFormat: '$::myconfig{jsc_dateformat}', align: '$params{cal_align}', button: 'trigger$seq' });" |
205 | 205 |
) : ''); |
206 |
|
|
207 |
sub javascript_tag { |
|
208 |
my $self = shift; |
|
209 |
my $code = ''; |
|
210 |
|
|
211 |
foreach my $file (@_) { |
|
212 |
$file .= '.js' unless $file =~ m/\.js$/; |
|
213 |
$file = "js/${file}" unless $file =~ m|/|; |
|
214 |
|
|
215 |
$code .= qq|<script type="text/javascript" src="${file}"></script>|; |
|
216 |
} |
|
217 |
|
|
218 |
return $code; |
|
206 | 219 |
} |
207 | 220 |
|
208 | 221 |
1; |
... | ... | |
310 | 323 |
created with said C<label>. No attribute named C<label> is created in |
311 | 324 |
that case. |
312 | 325 |
|
326 |
=item C<javascript_tag $file1, $file2, $file3...> |
|
327 |
|
|
328 |
Creates a HTML 'E<lt>script type="text/javascript" src="..."E<gt>' |
|
329 |
tag for each file name parameter passed. Each file name will be |
|
330 |
postfixed with '.js' if it isn't already and prefixed with 'js/' if it |
|
331 |
doesn't contain a slash. |
|
332 |
|
|
313 | 333 |
=back |
314 | 334 |
|
315 | 335 |
=head2 CONVERSION FUNCTIONS |
Auch abrufbar als: Unified diff
Layout-Helfer für JavaScript-Src-Tags
Conflicts: