From: Kasun Gajasinghe <kasunbg@gmail.com> Date: Fri, 30 Sep 2011 18:51:56 +0000 (+0000) Subject: remove some JS warninings X-Git-Tag: release/1.79.1~6^2~672 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=989c7530e508bf2c25ac550480e3178cd239b866;p=docbook-dsssl remove some JS warninings --- diff --git a/xsl/webhelp/template/content/search/nwSearchFnt.js b/xsl/webhelp/template/content/search/nwSearchFnt.js index 0b49b5a06..addd48045 100644 --- a/xsl/webhelp/template/content/search/nwSearchFnt.js +++ b/xsl/webhelp/template/content/search/nwSearchFnt.js @@ -732,20 +732,20 @@ function SortResults(mots) { fileAndWordListValuesOnly = fileAndWordListValuesOnly.sort(compare_nbMots); var listToOutput = new Array(); - for (var j in fileAndWordListValuesOnly) { + for (var fawlvoIdx in fileAndWordListValuesOnly) { for (t in temptab) { - if (temptab[t].motsliste == fileAndWordListValuesOnly[j]) { - if (listToOutput[j] == undefined) { - listToOutput[j] = new Array(temptab[t]); + if (temptab[t].motsliste == fileAndWordListValuesOnly[fawlvoIdx]) { + if (listToOutput[fawlvoIdx] == undefined) { + listToOutput[fawlvoIdx] = new Array(temptab[t]); } else { - listToOutput[j].push(temptab[t]); + listToOutput[fawlvoIdx].push(temptab[t]); } } } } // Sort results by scoring, descending on the same group - for (var i in listToOutput) { - listToOutput[i].sort(function(a, b){ + for (var ltoIdx in listToOutput) { + listToOutput[ltoIdx].sort(function(a, b){ return b.scoring - a.scoring; }); }