diff options
Diffstat (limited to 'template')
10 files changed, 66 insertions, 29 deletions
diff --git a/template/en/default/admin/components/create.html.tmpl b/template/en/default/admin/components/create.html.tmpl index 96c80226c..c3b691d83 100644 --- a/template/en/default/admin/components/create.html.tmpl +++ b/template/en/default/admin/components/create.html.tmpl @@ -26,8 +26,8 @@ [% title = BLOCK %]Add component to the [% product.name FILTER html %] product[% END %] [% PROCESS global/header.html.tmpl - style_urls = [ 'skins/standard/yui/autocomplete.css'] - javascript_urls = [ "js/yui/bz_autocomplete_bundle.js", "js/field.js"] + yui = [ 'autocomplete' ] + javascript_urls = [ "js/field.js" ] title = title %] diff --git a/template/en/default/admin/components/edit.html.tmpl b/template/en/default/admin/components/edit.html.tmpl index 30b7303e7..be14be054 100644 --- a/template/en/default/admin/components/edit.html.tmpl +++ b/template/en/default/admin/components/edit.html.tmpl @@ -33,8 +33,8 @@ [% END %] [% PROCESS global/header.html.tmpl title = title - style_urls = [ 'skins/standard/yui/autocomplete.css'] - javascript_urls = [ "js/yui/bz_autocomplete_bundle.js", "js/field.js"] + yui = [ 'autocomplete' ] + javascript_urls = [ "js/field.js" ] %] <form method="post" action="editcomponents.cgi"> diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 39f14e8de..a59fe9112 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -30,11 +30,9 @@ [% PROCESS global/header.html.tmpl title = title - style_urls = [ 'skins/standard/yui/autocomplete.css', - 'skins/standard/attachment.css', - 'skins/standard/yui/calendar.css' ] - javascript_urls = [ "js/yui/bz_autocomplete_bundle.js", - "js/attachment.js", "js/util.js", "js/yui/calendar.js", + yui = [ 'autocomplete', 'calendar' ] + style_urls = [ 'skins/standard/attachment.css' ] + javascript_urls = [ "js/attachment.js", "js/util.js", "js/field.js", "js/TUI.js" ] onload = 'set_assign_to();' %] diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl index c260f6902..a17c3201a 100644 --- a/template/en/default/bug/show-header.html.tmpl +++ b/template/en/default/bug/show-header.html.tmpl @@ -34,11 +34,9 @@ [% title = "$terms.Bug $bug.bug_id – $filtered_desc" %] [% header = "$terms.Bug $bug.bug_id" %] [% header_addl_info = "Last modified: $filtered_timestamp" %] -[% javascript_urls = [ "js/yui/bz_autocomplete_bundle.js", - "js/util.js", "js/field.js", "js/yui/calendar.js" ] %] -[% style_urls = [ "skins/standard/yui/autocomplete.css", - "skins/standard/yui/calendar.css", - "skins/standard/show_bug.css" ] %] +[% yui = ['autocomplete', 'calendar'] %] +[% javascript_urls = [ "js/util.js", "js/field.js" ] %] +[% style_urls = [ "skins/standard/show_bug.css" ] %] [% doc_section = "bug_page.html" %] [% bodyclasses = ['bz_bug', "bz_status_$bug.bug_status", diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index 8e94e86f4..3d7fc2e68 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -46,8 +46,23 @@ header_addl_info = "" onload = "" style_urls = [] + yui = [] %] +[% SET yui_css = { + autocomplete => 1, + calendar => 1, +} %] + +[%# Note: This is simple dependency resolution--you can't have dependencies + # that depend on each other. You have to specify all of a module's deps, + # if that module is going to be specified in "yui". + #%] +[% SET yui_deps = { + autocomplete => ['json', 'connection', 'datasource'], +} %] + + [%# We should be able to set the default value of the header variable # to the value of the title variable using the DEFAULT directive, # but that doesn't work if a caller sets header to the empty string @@ -70,6 +85,7 @@ [% PROCESS 'global/setting-descs.none.tmpl' %] [%# Set up the skin CSS cascade: + # 0. YUI CSS # 1. Standard Bugzilla stylesheet set (persistent) # 2. Standard Bugzilla stylesheet set (selectable) # 3. All third-party "skin" stylesheet sets (selectable) @@ -83,6 +99,14 @@ [% END %] [% style_urls.unshift('skins/standard/global.css') %] + + [% FOREACH yui_name = yui %] + [% IF yui_css.$yui_name %] + <link rel="stylesheet" type="text/css" + href="js/yui/assets/skins/sam/[%- yui_name FILTER html %].css"> + [% END %] + [% END %] + [%# CSS cascade, part 1: Standard Bugzilla stylesheet set (persistent). # Always present. #%] @@ -190,9 +214,24 @@ type="text/css"> <![endif]--> - <script src="js/yui/yahoo-dom-event.js" type="text/javascript"></script> - <script src="js/yui/cookie.js" type="text/javascript"></script> + [%# YUI Scripts %] + <script src="js/yui/yahoo-dom-event/yahoo-dom-event.js" + type="text/javascript"></script> + <script src="js/yui/cookie/cookie-min.js" type="text/javascript"></script> + [%# 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 %] + <script type="text/javascript" + src="js/yui/[% yui_name FILTER html %]/ + [%- yui_name FILTER html %]-min.js"></script> + [% END %] + <script src="js/global.js" type="text/javascript"></script> + <script type="text/javascript"> <!-- YAHOO.namespace('bugzilla'); diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index 4743d260d..cbeb72cf8 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -46,10 +46,9 @@ title = title style = style atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom" - javascript_urls = [ "js/yui/bz_autocomplete_bundle.js", "js/util.js", - "js/field.js", "js/yui/calendar.js" ] - style_urls = [ "skins/standard/yui/autocomplete.css", - "skins/standard/buglist.css", "skins/standard/yui/calendar.css" ] + yui = [ 'autocomplete', 'calendar' ] + javascript_urls = [ "js/util.js", "js/field.js" ] + style_urls = [ "skins/standard/buglist.css" ] doc_section = "query.html#list" %] diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl index 4203d90a6..1e0cc9251 100644 --- a/template/en/default/search/search-advanced.html.tmpl +++ b/template/en/default/search/search-advanced.html.tmpl @@ -38,10 +38,10 @@ var queryform = "queryform" title = "Search for $terms.bugs" onload = "doOnSelectProduct(0); enableHelp();" javascript = js_data - javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/util.js", + yui = [ 'calendar' ] + javascript_urls = [ "js/productform.js", "js/util.js", "js/help.js" , "js/TUI.js", "js/field.js"] - style_urls = [ "skins/standard/help.css" , "skins/standard/search_form.css", - "skins/standard/yui/calendar.css" ] + style_urls = [ "skins/standard/help.css" , "skins/standard/search_form.css" ] doc_section = "query.html" style = "dl.bug_changes dt { margin-top: 15px; diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl index 82e656149..460a518a7 100644 --- a/template/en/default/search/search-create-series.html.tmpl +++ b/template/en/default/search/search-create-series.html.tmpl @@ -33,9 +33,10 @@ [% PROCESS global/header.html.tmpl title = "Create New Data Set" onload = "doOnSelectProduct(0);" + yui = [ 'calendar' ] javascript = js_data - javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/TUI.js", "js/field.js" ] - style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/search_form.css" ] + javascript_urls = [ "js/productform.js", "js/TUI.js", "js/field.js" ] + style_urls = [ "skins/standard/search_form.css" ] doc_section = "reporting.html#charts-new-series" %] diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl index 48d9561d6..34dccb6fd 100644 --- a/template/en/default/search/search-report-graph.html.tmpl +++ b/template/en/default/search/search-report-graph.html.tmpl @@ -32,9 +32,10 @@ var queryform = "reportform" [% PROCESS global/header.html.tmpl title = "Generate Graphical Report" onload = "doOnSelectProduct(0); chartTypeChanged()" + yui = [ 'calendar' ] javascript = js_data - javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/TUI.js", "js/field.js" ] - style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/search_form.css" ] + javascript_urls = [ "js/productform.js", "js/TUI.js", "js/field.js" ] + style_urls = [ "skins/standard/search_form.css" ] doc_section = "reporting.html#reports" %] diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl index 374630712..8947d193b 100644 --- a/template/en/default/search/search-report-table.html.tmpl +++ b/template/en/default/search/search-report-table.html.tmpl @@ -32,9 +32,10 @@ var queryform = "reportform" [% PROCESS global/header.html.tmpl title = "Generate Tabular Report" onload = "doOnSelectProduct(0)" + yui = [ 'calendar' ] javascript = js_data - javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/TUI.js", "js/field.js" ] - style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/search_form.css" ] + javascript_urls = [ "js/productform.js", "js/TUI.js", "js/field.js" ] + style_urls = [ "skins/standard/search_form.css" ] doc_section = "reporting.html#reports" %] |