aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/global
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-09-18 00:28:09 +0800
committerByron Jones <glob@mozilla.com>2014-09-18 00:28:09 +0800
commit1bead98c517f658b17d42f2f79d8ce80317a7040 (patch)
tree16b569221a7d8b5124f92290f6be11122e6f2c14 /template/en/default/global
parent2288b4680c04ec00bff02179de926fdfbd896c79 (diff)
downloadbugs-1bead98c517f658b17d42f2f79d8ce80317a7040.tar
bugs-1bead98c517f658b17d42f2f79d8ce80317a7040.tar.gz
bugs-1bead98c517f658b17d42f2f79d8ce80317a7040.tar.bz2
bugs-1bead98c517f658b17d42f2f79d8ce80317a7040.tar.xz
bugs-1bead98c517f658b17d42f2f79d8ce80317a7040.zip
Bug 1064395: concatenate and slightly minify javascript files
r=dkl,a=glob
Diffstat (limited to 'template/en/default/global')
-rw-r--r--template/en/default/global/header.html.tmpl31
1 files changed, 24 insertions, 7 deletions
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index 4f6e187d8..63c5dd43d 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -90,8 +90,16 @@
[% SET yui = yui_resolve_deps(yui, yui_deps) %]
[% SET css_sets = css_files(style_urls, yui, yui_css) %]
- <link href="[% css_sets.unified_standard_skin FILTER html %]"
- rel="stylesheet" type="text/css">
+ [% IF constants.CONCATENATE_ASSETS %]
+ [% PROCESS format_css_link asset_url = css_sets.unified_standard_skin %]
+ [% ELSE %]
+ [% FOREACH asset_url = css_sets.standard %]
+ [% PROCESS format_css_link %]
+ [% END %]
+ [% FOREACH asset_url = css_sets.skin %]
+ [% PROCESS format_css_link %]
+ [% END %]
+ [% END %]
[% IF style %]
<style type="text/css">
@@ -100,8 +108,13 @@
[% END %]
[% IF css_sets.unified_custom %]
- <link href="[% css_sets.unified_custom FILTER html %]"
- rel="stylesheet" type="text/css">
+ [% IF constants.CONCATENATE_ASSETS %]
+ [% PROCESS format_css_link asset_url = css_sets.unified_custom %]
+ [% ELSE %]
+ [% FOREACH asset_rul = css_sets.custom %]
+ [% PROCESS format_css_link %]
+ [% END %]
+ [% END %]
[% END %]
[%# YUI Scripts %]
@@ -110,7 +123,7 @@
[% END %]
[% starting_js_urls.push('js/global.js') %]
- [% FOREACH javascript_url = starting_js_urls %]
+ [% FOREACH asset_url = concatenate_js(starting_js_urls) %]
[% PROCESS format_js_link %]
[% END %]
@@ -180,7 +193,7 @@
// -->
</script>
- [% FOREACH javascript_url = javascript_urls %]
+ [% FOREACH asset_url = concatenate_js(javascript_urls) %]
[% PROCESS format_js_link %]
[% END %]
@@ -251,6 +264,10 @@
<div id="message">[% message %]</div>
[% END %]
+[% BLOCK format_css_link %]
+ <link href="[% asset_url FILTER html %]" rel="stylesheet" type="text/css">
+[% END %]
+
[% BLOCK format_js_link %]
- <script type="text/javascript" src="[% javascript_url FILTER mtime FILTER html %]"></script>
+ <script type="text/javascript" src="[% asset_url FILTER mtime FILTER html %]"></script>
[% END %]