diff options
author | jake%acutex.net <> | 2001-09-14 05:04:40 +0200 |
---|---|---|
committer | jake%acutex.net <> | 2001-09-14 05:04:40 +0200 |
commit | 95d6555deb7e4bd104874dfed1a84fd67982de93 (patch) | |
tree | 5cfe021e24a39a87c223a8e39d0fb4cd9043dd09 /query.cgi | |
parent | bc065eccb192f288bb01364590eb3dcb040dc86a (diff) | |
download | bugzilla-95d6555deb7e4bd104874dfed1a84fd67982de93.tar.gz bugzilla-95d6555deb7e4bd104874dfed1a84fd67982de93.tar.xz |
Fix for bug 58436 - javascript strict warnings in query.cgi
Patch by Christian Reis <kiko@async.com.br>
r= caillon@returnzero.com, jake@acutex.net
Diffstat (limited to 'query.cgi')
-rwxr-xr-x | query.cgi | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -396,7 +396,7 @@ $jscript .= << 'ENDSCRIPT'; function updateSelect( array, sel, target, sel_is_diff, single ) { - var i; + var i, comp; // if single, even if it's a diff (happens when you have nothing // selected and select one item alone), skip this. @@ -444,9 +444,9 @@ function fake_diff_array( a, b ) { var newsel = new Array(); // do a boring array diff to see who's new - for ( ia in a ) { + for ( var ia in a ) { var found = 0; - for ( ib in b ) { + for ( var ib in b ) { if ( a[ia] == b[ib] ) { found = 1; } @@ -469,6 +469,7 @@ function merge_arrays( a, b, b_is_select ) { var pos_a = 0; var pos_b = 0; var ret = new Array(); + var bitem, aitem; // iterate through both arrays and add the larger item to the return // list. remove dupes, too. Use toLowerCase to provide @@ -539,10 +540,10 @@ function merge_arrays( a, b, b_is_select ) { function selectProduct( f ) { - // this is to avoid events that occur before the form itself is - // ready. mozilla doesn't seem to trigger this, though. + // this is to avoid handling events that occur before the form + // itself is ready, which happens in buggy browsers. - if ( !f ) { + if ( ( !f ) || ( ! f.product ) ) { return; } @@ -572,15 +573,15 @@ function selectProduct( f ) { var is_diff = 0; var single; - // is nothing selected, pick all + // if nothing selected, pick all if ( f.product.selectedIndex == -1 ) { - for ( i=0 ; i<f.product.length ; i++ ) { + for ( var i = 0 ; i < f.product.length ; i++ ) { sel[sel.length] = f.product.options[i].value; } single = 0; } else { - for ( i=0 ; i<f.product.length ; i++ ) { + for ( i = 0 ; i < f.product.length ; i++ ) { if ( f.product.options[i].selected ) { sel[sel.length] = f.product.options[i].value; } @@ -630,7 +631,7 @@ ENDSCRIPT PutHeader("Bugzilla Query Page", "Query", "This page lets you search the database for recorded bugs.", - q{onLoad="selectProduct(document.forms[0]);"}, $jscript); + q{onLoad="selectProduct(document.forms['queryform']);"}, $jscript); push @::legal_resolution, "---"; # Oy, what a hack. @@ -639,7 +640,7 @@ my @logfields = ("[Bug creation]", @::log_columns); print"<P>Give me a <A HREF=\"queryhelp.cgi\">clue</A> about how to use this form.<P>"; print qq{ -<FORM METHOD=GET ACTION="buglist.cgi"> +<FORM METHOD=GET ACTION="buglist.cgi" NAME="queryform"> <table> <tr> |