diff options
author | Yorhel <git@yorhel.nl> | 2009-10-02 10:35:14 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-10-02 10:35:14 +0200 |
commit | c7f7fdbff9901940914ddcb77299fd7c6ec0fdc3 (patch) | |
tree | 8e76d889262d0fe587febe3cf442588c22a02752 /lib | |
parent | cd414f4cf51744ecb9b468ce6f38be72c2054d4a (diff) |
JS: Moved <script> tags to bottom of the page and removed DOMLoad()
Time to clean up the javascript code a bit, this is a start...
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNDB/Util/LayoutHTML.pm | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/VNDB/Util/LayoutHTML.pm b/lib/VNDB/Util/LayoutHTML.pm index 85971ba9..99b615b5 100644 --- a/lib/VNDB/Util/LayoutHTML.pm +++ b/lib/VNDB/Util/LayoutHTML.pm @@ -14,6 +14,7 @@ sub htmlHeader { # %options->{ title, js, noindex, search } my($self, %o) = @_; my $skin = $self->reqParam('skin') || $self->authInfo->{skin} || $self->{skin_default}; $skin = $self->{skin_default} if !$self->{skins}{$skin} || !-d "$VNDB::ROOT/static/s/$skin"; + $self->{js} = $o{js}; # save for use in htmlFooter # heading html; @@ -22,12 +23,6 @@ sub htmlHeader { # %options->{ title, js, noindex, search } Link rel => 'shortcut icon', href => '/favicon.ico', type => 'image/x-icon'; Link rel => 'stylesheet', href => $self->{url_static}.'/s/'.$skin.'/style.css?'.$self->{version}, type => 'text/css', media => 'all'; Link rel => 'search', type => 'application/opensearchdescription+xml', title => 'VNDB VN Search', href => $self->{url}.'/opensearch.xml'; - if($o{js}) { - script type => 'text/javascript', src => $self->{url_static}.'/f/forms.js?'.$self->{version}; end; - } - script type => 'text/javascript', src => $self->{url_static}.'/f/script.js?'.$self->{version}; - # most browsers don't like a self-closing <script> tag... - end; if($self->authInfo->{customcss}) { (my $css = $self->authInfo->{customcss}) =~ s/\n/ /g; style type => 'text/css', $css; @@ -163,6 +158,8 @@ sub htmlFooter { a href => $self->{source_url}, mt '_footer_source'; end; end; # /div maincontent + script type => 'text/javascript', src => $self->{url_static}.'/f/script.js?'.$self->{version}, ''; + script type => 'text/javascript', src => $self->{url_static}.'/f/forms.js?'.$self->{version}, '' if $self->{js}; end; # /body end; # /html |