Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 62ba378c

Von Moritz Bunkus vor fast 14 Jahren hinzugefügt

  • ID 62ba378c53a7ead8c5e99ef965d79d7368216b88
  • Vorgänger 11e4b8f3
  • Nachfolger 368f9611

Layout-Helfer für JavaScript-Src-Tags

Conflicts:

SL/Template/Plugin/L.pm

Unterschiede anzeigen:

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