[Rt-commit] rt branch, 4.2/frontend-peformance-tweaks, created. rt-4.2.3-61-g27fcdec

Wallace Reis wreis at bestpractical.com
Wed Mar 26 11:33:07 EDT 2014


The branch, 4.2/frontend-peformance-tweaks has been created
        at  27fcdec6bc1ca8b2c698e8b71e377c570874e39e (commit)

- Log -----------------------------------------------------------------
commit 3e8abba0ad1e509636a1b75a82da12b048b83904
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Fri Feb 7 04:42:21 2014 -0800

    Optimize some images
    
    Saved around 2KB.

diff --git a/share/static/images/bpslogo.png b/share/static/images/bpslogo.png
index 8a87374..23fa731 100644
Binary files a/share/static/images/bpslogo.png and b/share/static/images/bpslogo.png differ
diff --git a/share/static/images/eyedropper.png b/share/static/images/eyedropper.png
index 7b0431a..fc0d388 100644
Binary files a/share/static/images/eyedropper.png and b/share/static/images/eyedropper.png differ

commit 27fcdec6bc1ca8b2c698e8b71e377c570874e39e
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Fri Mar 14 15:43:18 2014 -0300

    Optimize the ordering of resources
    
    Correctly ordering stylesheets and scripts enables better parallelization
    of downloads and speeds up browser rendering time.
    
    https://developers.google.com/speed/docs/best-practices/rtt#PutStylesBeforeScripts

diff --git a/share/html/Elements/Footer b/share/html/Elements/Footer
index ccf4ff5..22f5ed9 100644
--- a/share/html/Elements/Footer
+++ b/share/html/Elements/Footer
@@ -66,9 +66,22 @@
 <%$d->Dump() %>
 </pre>
 % }
-  </body>
+
+<& /Elements/Framekiller &>
+
+% if ($m->comp_exists($stylesheet_plugin) ) {
+<& $stylesheet_plugin &>
+% }
+
+</body>
 </html>
 <%ARGS>
 $Debug => 0
 $Menu => 1
 </%ARGS>
+<%init>
+my $style = $session{'CurrentUser'}
+          ? $session{'CurrentUser'}->Stylesheet
+          : RT->Config->Get('WebDefaultStylesheet');
+my $stylesheet_plugin = "/NoAuth/css/".$style."/AfterMenus";
+</%init>
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index b0b0717..0c9e556 100644
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -56,17 +56,17 @@
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     <!-- The X-UA-Compatible <meta> tag above must be very early in <head> -->
 
-    <& /Elements/Framekiller &>
-
 % if ($Refresh && $Refresh =~ /^(\d+)/ && $1 > 0) {
 %   my $URL = $m->notes->{RefreshURL}; $URL = $URL ? ";URL=$URL" : "";
     <meta http-equiv="refresh" content="<% "$1$URL" %>" />
 % }
 
-<link rel="shortcut icon" href="<%RT->Config->Get('WebImagesURL')%>favicon.png" type="image/png" />
+<& JavascriptConfig &>
+
 % for my $cssfile ( @css_files ) {
 <link rel="stylesheet" href="<%RT->Config->Get('WebPath')%><% $cssfile %>" type="text/css" media="all" />
 % }
+<link rel="shortcut icon" href="<%RT->Config->Get('WebImagesURL')%>favicon.png" type="image/png" />
 
 % for (keys %{$LinkRel || {}}) {
     <link rel="<% $_ %>" href="<% RT->Config->Get('WebPath') . $LinkRel->{$_} %>" />
@@ -76,8 +76,6 @@
     <link rel="alternate" href="<%$RSSAutoDiscovery%>" type="application/rss+xml" title="RSS RT Search" />
 % }
 
-<& HeaderJavascript, focus => $Focus, onload => $onload, RichText => $RichText &>
-
 % my $stylesheet_plugin = "/NoAuth/css/".$style."/InHeader";
 % if ($m->comp_exists($stylesheet_plugin) ) {
 <& $stylesheet_plugin &>
@@ -94,6 +92,8 @@
 % # Leave %ARGS for backward compatibility
 % $m->callback( %ARGS, CallbackName => 'Head', ARGSRef => \%ARGS );
 
+<& HeaderJavascript, focus => $Focus, onload => $onload, RichText => $RichText &>
+
 </head>
   <body class="<% lc $style %><% RT->Config->Get("UseSideBySideLayout", $session{'CurrentUser'}) ? ' sidebyside' : '' %>" <% $id && qq[id="comp-$id"] |n %>>
 
diff --git a/share/html/Elements/HeaderJavascript b/share/html/Elements/HeaderJavascript
index 4b1abdb..f0f56b3 100644
--- a/share/html/Elements/HeaderJavascript
+++ b/share/html/Elements/HeaderJavascript
@@ -49,7 +49,6 @@
 $focus => undef
 $onload => undef
 </%args>
-<& JavascriptConfig &>
 
 % for my $jsfile ( @js_files ) {
 <script type="text/javascript" src="<%RT->Config->Get('WebPath')%><% $jsfile %>"></script>
diff --git a/share/html/Elements/PageLayout b/share/html/Elements/PageLayout
index 00c3259..debd4e6 100644
--- a/share/html/Elements/PageLayout
+++ b/share/html/Elements/PageLayout
@@ -51,10 +51,6 @@
 % }
 <div id="topactions"><& /Elements/WidgetBar, menu => PageWidgets() &></div>
 
-% if ($m->comp_exists($stylesheet_plugin) ) {
-<& $stylesheet_plugin &>
-% }
-
 <div id="body">
 % $m->callback( %ARGS, CallbackName => 'BeforeBody' );
 % $m->flush_buffer(); # we've got the page laid out, let's flush the buffer;
@@ -62,9 +58,3 @@
 $title => $m->callers(-1)->path
 $show_menu => 1
 </%ARGS>
-<%init>
-my $style = $session{'CurrentUser'}
-          ? $session{'CurrentUser'}->Stylesheet
-          : RT->Config->Get('WebDefaultStylesheet');
-my $stylesheet_plugin = "/NoAuth/css/".$style."/AfterMenus";
-</%init>
diff --git a/share/html/m/_elements/footer b/share/html/m/_elements/footer
index 10f3fba..b7efd97 100644
--- a/share/html/m/_elements/footer
+++ b/share/html/m/_elements/footer
@@ -51,5 +51,6 @@
 <&|/l_unsafe,     '', '', '2014', '<a href="http://www.bestpractical.com?rt='.$RT::VERSION.'">Best Practical Solutions, LLC</a>', &>[_1] RT [_2] Copyright 1996-[_3] [_4].</&>
 </div>
 </div>
+<& /Elements/Framekiller &>
 </body>
 </html>
diff --git a/share/html/m/_elements/header b/share/html/m/_elements/header
index 4674991..a970e0d 100644
--- a/share/html/m/_elements/header
+++ b/share/html/m/_elements/header
@@ -55,7 +55,6 @@ $r->headers_out->{'Cache-control'} = 'no-cache';
 </%init>
 <html>
 <head>
-<& /Elements/Framekiller &>
 <link rel="stylesheet" type="text/css" href="<%RT->Config->Get('WebPath')%>/static/css/mobile.css"/>
 <title><%$title%></title>
 % my ($jquery) = grep { /^jquery-\d+\./ } RT::Interface::Web->JSFiles;

-----------------------------------------------------------------------


More information about the rt-commit mailing list