From 4acb2424e62cbd64bc92a5dec2cbe1e2b7096157 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Mon, 21 Jun 2010 19:10:21 -0700 Subject: Bug 22353: Automatic duplicate bug detection on enter_bug.cgi r=glob, a=mkanat --- template/en/default/global/header.html.tmpl | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'template/en/default/global/header.html.tmpl') diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 3d7fc2e68..75fa71825 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -52,6 +52,7 @@ [% SET yui_css = { autocomplete => 1, calendar => 1, + datatable => 1, } %] [%# Note: This is simple dependency resolution--you can't have dependencies @@ -60,6 +61,7 @@ #%] [% SET yui_deps = { autocomplete => ['json', 'connection', 'datasource'], + datatable => ['json', 'connection', 'datasource', 'element'], } %] @@ -99,7 +101,20 @@ [% END %] [% style_urls.unshift('skins/standard/global.css') %] + [%# YUI dependency resolution %] + [%# We have to do this in a separate array, because modifying the + # existing array by unshift'ing dependencies confuses FOREACH. + #%] + [% SET yui_resolved = [] %] + [% FOREACH yui_name = yui %] + [% FOREACH yui_dep = yui_deps.${yui_name}.reverse %] + [% yui_resolved.push(yui_dep) IF NOT yui_resolved.contains(yui_dep) %] + [% END %] + [% yui_resolved.push(yui_name) IF NOT yui_resolved.contains(yui_name) %] + [% END %] + [% SET yui = yui_resolved %] + [%# YUI CSS %] [% FOREACH yui_name = yui %] [% IF yui_css.$yui_name %] - [%# Resolve YUI dependencies. Note that CSS was already done above. %] - [% FOREACH yui_name = yui %] - [% IF yui_deps.$yui_name %] - [% yui = yui_deps.${yui_name}.merge(yui) %] - [% END %] - [% END %] [% FOREACH yui_name = yui %]