diff options
author | kiko%async.com.br <> | 2004-07-21 09:58:44 +0200 |
---|---|---|
committer | kiko%async.com.br <> | 2004-07-21 09:58:44 +0200 |
commit | cb2d1a0a94cf690f2f29044010324b3d22505991 (patch) | |
tree | 5f4e29aad8a258bb90a5bb140a3d9a506714ecb2 /template/en/default/search/search-advanced.html.tmpl | |
parent | 7bdd1cbe564883cd12abee3657e671e97e85a8e5 (diff) | |
download | bugzilla-cb2d1a0a94cf690f2f29044010324b3d22505991.tar.gz bugzilla-cb2d1a0a94cf690f2f29044010324b3d22505991.tar.xz |
Fix for bug 123030: Move query.cgi javascript to separate file. Create
productform.js that contains functions to handle the various select
boxes in the advanced search page, and update the callsites to use
it. r,a=myk.
Diffstat (limited to 'template/en/default/search/search-advanced.html.tmpl')
-rw-r--r-- | template/en/default/search/search-advanced.html.tmpl | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl index bbed6c2d6..89938adbe 100644 --- a/template/en/default/search/search-advanced.html.tmpl +++ b/template/en/default/search/search-advanced.html.tmpl @@ -30,10 +30,48 @@ [% USE Bugzilla %] [% cgi = Bugzilla.cgi %] + +[% js_data = BLOCK %] +function doOnSelectProduct() { + var f = document.forms['queryform']; + milestone = (typeof(f.target_milestone) == "undefined" ? + null : f.target_milestone); + selectProduct(f.product, f.component, f.version, milestone); +} + +var first_load = true; [%# is this the first time we load the page? %] +var last_sel = new Array(); [%# caches last selection %] + +var cpts = new Array(); +var vers = new Array(); +[% IF Param('usetargetmilestone') %] +var tms = new Array(); +[% END %] + +[%# 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 %]] = [ + [%- FOREACH item = p.components %]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; + vers[[% n %]] = [ + [%- FOREACH item = p.versions -%]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; + [% IF Param('usetargetmilestone') %] + tms[[% n %]] = [ + [%- FOREACH item = p.milestones %]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; + [% END %] + [% n = n+1 %] +[% END %] + +[% END %] + [% PROCESS global/header.html.tmpl title = "Search for $terms.bugs" h1 = "" - onload = "selectProduct(document.forms['queryform']);initHelp();" + onload = "doOnSelectProduct(); initHelp();" + javascript = js_data + javascript_urls = [ "js/productform.js" ] style = "td.selected_tab { border-width: 2px 2px 0px; border-style: solid; |