From 44b48df3901d829e1423749136d142964ccb4a3e Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Fri, 4 Jul 2003 04:31:13 +0000 Subject: Bug 13540 - allow key terms, like "Bugzilla" and "bug", to be altered without changing all the templates. Patch by jwilmoth@starbucks.com; r=gerv, a=justdave. --- template/en/default/search/form.html.tmpl | 114 +++++++++++++++--------------- 1 file changed, 58 insertions(+), 56 deletions(-) (limited to 'template/en/default/search/form.html.tmpl') diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index 3ebe01f05..6862ac6f6 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -20,7 +20,9 @@ # Christian Reis [javascript rewrite] # Gervase Markham #%] - + +[% PROCESS global/variables.none.tmpl %] + [%# Note: use Template comments and not JS ones here, to avoid bloating what we actually send to the browser %] @@ -35,17 +37,17 @@ var vers = new Array(); var tms = new Array(); [% END %] -[%# Create three arrays of components, versions and target milestones, indexed +[%# Create three arrays of components, versions and target milestones, indexed # numerically according to the product they refer to. #%] [% n = 0 %] [% FOREACH p = product %] - cpts[[% n %]] = [ + cpts[[% n %]] = [ [%- FOREACH item = p.components %]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; - vers[[% n %]] = [ + vers[[% n %]] = [ [%- FOREACH item = p.versions -%]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; [% IF Param('usetargetmilestone') %] - tms[[% n %]] = [ + tms[[% n %]] = [ [%- FOREACH item = p.milestones %]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; [% END %] [% n = n+1 %] @@ -57,7 +59,7 @@ var tms = new Array(); # correspond to the elements selected in source. # - array should be a array of arrays, indexed by number. the # array should contain the elements that correspond to that - # product. + # product. # - sel is a list of selected items, either whole or a diff # depending on merging. # - target should be the target select object. @@ -78,7 +80,7 @@ var tms = new Array(); %] function updateSelect(array, sel, target, merging) { - + var i, item; [%# If we have no versions/components/milestones %] @@ -119,7 +121,7 @@ function updateSelect(array, sel, target, merging) { return true; } -[%# Returns elements in a that are not in b. +[%# Returns elements in a that are not in b. # NOT A REAL DIFF: does not check the reverse. # - a,b: arrays of values to be compare. %] function fake_diff_array(a, b) { @@ -203,7 +205,7 @@ function merge_arrays(a, b, b_is_select) { [%# Returns an array of indexes or values from a select form control. # - control: select control from which to find selections - # - findall: boolean, store all options when true or just the selected + # - findall: boolean, store all options when true or just the selected # indexes # - want_values: boolean; we store values when true and indexes when # false %] @@ -263,7 +265,7 @@ function selectProduct(f) { first_load = false; return; } - + [%# turn first_load off. this is tricky, since it seems to be redundant with the above clause. It's not: if when we first load the page there is _one_ element selected, it won't fall into that @@ -273,7 +275,7 @@ function selectProduct(f) { without merge/sorting. %] first_load = false; - [%# - sel keeps the array of products we are selected. + [%# - sel keeps the array of products we are selected. - merging says if it is a full list or just a list of products that were added to the current selection. %] var merging = false; @@ -285,10 +287,10 @@ function selectProduct(f) { if (!findall) { [%# save sel for the next invocation of selectProduct() %] var tmp = sel; - + [%# this is an optimization: if we have just added products to an - existing selection, no need to clear the form controls and add - everybody again; just merge the new ones with the existing + existing selection, no need to clear the form controls and add + everybody again; just merge the new ones with the existing options. %] if ((last_sel.length > 0) && (last_sel.length < sel.length)) { sel = fake_diff_array(sel, last_sel); @@ -317,7 +319,7 @@ function selectProduct(f) { // --> -[% query_variants = [ +[% query_variants = [ { value => "allwordssubstr", description => "contains all of the words/strings" }, { value => "anywordssubstr", description => "contains any of the words/strings" }, { value => "substring", description => "contains the string" }, @@ -342,7 +344,7 @@ function selectProduct(f) { [% FOREACH qv = query_variants %] - [% END %] + [% END %] @@ -352,7 +354,7 @@ function selectProduct(f) { - + [%# *** Product Component Version Target *** %] @@ -394,7 +396,7 @@ function selectProduct(f) { reserved word - we use 'component_' instead. %]