Commit 0cd4b869 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 258647: productmenu.js and productform.js should be consolidated - Patch by…

Bug 258647: productmenu.js and productform.js should be consolidated - Patch by Teemu Mannermaa <wicked+bz@etlicon.fi> r=myk a=LpSolit
parent fcdf86c3
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
table#form th { text-align: right; vertical-align: baseline; white-space: nowrap; } table#form th { text-align: right; vertical-align: baseline; white-space: nowrap; }
table#form td { text-align: left; vertical-align: baseline; } table#form td { text-align: left; vertical-align: baseline; }
" "
onload="selectProduct(document.forms[0], 'product', 'component', '__Any__');" onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, '__Any__');"
javascript_urls=["productmenu.js"] javascript_urls=["js/productform.js"]
%] %]
<form method="post" action="editflagtypes.cgi"> <form method="post" action="editflagtypes.cgi">
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
<tr> <tr>
<td style="vertical-align: top;"> <td style="vertical-align: top;">
<b>Product/Component:</b><br> <b>Product/Component:</b><br>
<select name="product" onchange="selectProduct(this.form, 'product', 'component', '__Any__');"> <select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');">
<option value="">__Any__</option> <option value="">__Any__</option>
[% FOREACH prod = products %] [% FOREACH prod = products %]
<option value="[% prod.name FILTER html %]" <option value="[% prod.name FILTER html %]"
......
...@@ -31,8 +31,8 @@ ...@@ -31,8 +31,8 @@
.inactive { color: #787878; } .inactive { color: #787878; }
.multiplicable { display: block; } .multiplicable { display: block; }
" "
onload="selectProduct(document.forms[0], 'product', 'component', '__All__');" onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, '__All__');"
javascript_urls=["productmenu.js"] javascript_urls=["js/productform.js"]
%] %]
<p> <p>
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<tr> <tr>
<th><label for="product">Product:</label></th> <th><label for="product">Product:</label></th>
<td> <td>
<select name="product" onchange="selectProduct(this.form, 'product', 'component', '__Any__');"> <select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');">
<option value="">__Any__</option> <option value="">__Any__</option>
[% FOREACH prod = products %] [% FOREACH prod = products %]
<option value="[% prod.name FILTER html %]" <option value="[% prod.name FILTER html %]"
......
...@@ -22,12 +22,14 @@ ...@@ -22,12 +22,14 @@
[%# The javascript block gets used in header.html.tmpl. %] [%# The javascript block gets used in header.html.tmpl. %]
[% javascript = BLOCK %] [% javascript = BLOCK %]
var usetms = 0; // do we have target milestone? var useclassification = false; // No classification level in use
var first_load = 1; // is this the first time we load the page? var first_load = true; // Is this the first time we load the page?
var last_sel = []; // caches last selection var last_sel = []; // Caches last selection
var cpts = new Array(); var cpts = new Array();
[% n = 1 %]
[% FOREACH prod = products %] [% FOREACH prod = products %]
cpts['[% prod.name FILTER js %]'] = [ cpts['[% n %]'] = [
[%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; [%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ];
[% n = n+1 %]
[% END %] [% END %]
[% END %] [% END %]
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
table.requests th { text-align: left; } table.requests th { text-align: left; }
table#filtering th { text-align: right; } table#filtering th { text-align: right; }
" "
onload="selectProduct(document.forms[0], 'product', 'component', 'Any');" onload="var f = document.forms[0]; selectProduct(f.product, f.component, null, null, 'Any');"
javascript_urls=["productmenu.js"] javascript_urls=["js/productform.js"]
%] %]
<p> <p>
...@@ -53,7 +53,7 @@ to some group are shown by default. ...@@ -53,7 +53,7 @@ to some group are shown by default.
title="Requester's email address"></td> title="Requester's email address"></td>
<th>Product:</th> <th>Product:</th>
<td> <td>
<select name="product" onchange="selectProduct(this.form, 'product', 'component', 'Any');"> <select name="product" onchange="selectProduct(this, this.form.component, null, null, 'Any');">
<option value="">Any</option> <option value="">Any</option>
[% FOREACH prod = products %] [% FOREACH prod = products %]
<option value="[% prod.name FILTER html %]" <option value="[% prod.name FILTER html %]"
......
...@@ -93,12 +93,12 @@ function doOnSelectProduct(selectmode) { ...@@ -93,12 +93,12 @@ function doOnSelectProduct(selectmode) {
if (useclassification && f.classification.selectedIndex > -1) { if (useclassification && f.classification.selectedIndex > -1) {
selectClassification(f.classification, f.product, f.component, f.version, milestone); selectClassification(f.classification, f.product, f.component, f.version, milestone);
} else { } else {
selectProduct(f.product, f.component, f.version, milestone); selectProduct(f.product, f.component, f.version, milestone, null);
} }
} else if (selectmode == 1) { } else if (selectmode == 1) {
selectClassification(f.classification, f.product, f.component, f.version, milestone); selectClassification(f.classification, f.product, f.component, f.version, milestone);
} else { } else {
selectProduct(f.product, f.component, f.version, milestone); selectProduct(f.product, f.component, f.version, milestone, null);
} }
} }
......
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