Commit cb2d1a0a authored by kiko%async.com.br's avatar kiko%async.com.br

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.
parent 7bdd1cbe
...@@ -30,10 +30,48 @@ ...@@ -30,10 +30,48 @@
[% USE Bugzilla %] [% USE Bugzilla %]
[% cgi = Bugzilla.cgi %] [% 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 [% PROCESS global/header.html.tmpl
title = "Search for $terms.bugs" title = "Search for $terms.bugs"
h1 = "" h1 = ""
onload = "selectProduct(document.forms['queryform']);initHelp();" onload = "doOnSelectProduct(); initHelp();"
javascript = js_data
javascript_urls = [ "js/productform.js" ]
style = "td.selected_tab { style = "td.selected_tab {
border-width: 2px 2px 0px; border-width: 2px 2px 0px;
border-style: solid; border-style: solid;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment