From 832061efc023f2a570c589af36ddd2bbb64334be Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 3 Feb 2010 21:29:09 +0100 Subject: Remove unnessary methods from BzPage ... either by removing them outright or moving them to be embedded functions. --- bugzillaBugTriage.js | 69 +++++++++++++++++++++++----------------------------- 1 file changed, 31 insertions(+), 38 deletions(-) (limited to 'bugzillaBugTriage.js') diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index a62c630..7f93ca8 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -480,12 +480,6 @@ Color.prototype.lightColor = function() { //==================================================================================== // BzPage's methods -BzPage.prototype.getLogTime = function() { - // FIXME to be implemented - var today = new Date(); - return today.toDateString(); -} - /** * Check for the presence of a keyword * @@ -862,34 +856,6 @@ BzPage.prototype.setBranding = function () { } }; -/** - */ -BzPage.prototype.groupIDs = function (manStr,cardStrID) { - var outStr = filterByRegexp(chipIDsGroupings,manStr+","+cardStrID); - if (outStr.length === 0) { - outStr = "UNGROUPED_" + manStr+"/"+cardStrID; - } - return outStr; -}; - -/** - * Given PCI IDs for manufacturer and card ID return chipset string - * - * @param manufacturerNo string with manufacturer PCI ID - * @param cardNo string with card PCI ID - * - * @return array with chip string and optinoal variants - */ -BzPage.prototype.checkChipStringFromID = function (manufacturerNo,cardNo) { - var soughtID = (manufacturerNo+","+cardNo).toUpperCase(); - var outList = PCI_ID_Array[soughtID]; - if (outList) { - return outList; - } else { - return ""; - } -}; - /** * Given line to be parsed, find out which chipset it is and fill in the whiteboard * @@ -898,6 +864,32 @@ BzPage.prototype.checkChipStringFromID = function (manufacturerNo,cardNo) { * @return None */ BzPage.prototype.fillInWhiteBoard = function (iLine, driverStr) { + function groupIDs (manStr,cardStrID) { + var outStr = filterByRegexp(chipIDsGroupings,manStr+","+cardStrID); + if (outStr.length === 0) { + outStr = "UNGROUPED_" + manStr+"/"+cardStrID; + } + return outStr; + }; + + /** + * Given PCI IDs for manufacturer and card ID return chipset string + * + * @param manufacturerNo string with manufacturer PCI ID + * @param cardNo string with card PCI ID + * + * @return array with chip string and optinoal variants + */ + function checkChipStringFromID (manufacturerNo,cardNo) { + var soughtID = (manufacturerNo+","+cardNo).toUpperCase(); + var outList = PCI_ID_Array[soughtID]; + if (outList) { + return outList; + } else { + return ""; + } + }; + var outStr = ""; var cardIDStr = ""; var cardIDArr = []; @@ -905,14 +897,14 @@ BzPage.prototype.fillInWhiteBoard = function (iLine, driverStr) { chipSwitchboard: if (driverStr === "RADEON") { var cardID = iLine.replace(ATIgetIDRE,"$1"); - cardIDArr = this.checkChipStringFromID("1002",cardID); + cardIDArr = checkChipStringFromID("1002",cardID); if (cardIDArr.length > 0) { cardIDStr = cardIDArr[0]; if (cardIDArr[1]) { optionStr = cardIDArr[1]; - outStr = this.groupIDs(driverStr,cardIDStr)+"/" + optionStr; + outStr = groupIDs(driverStr,cardIDStr)+"/" + optionStr; } else { - outStr = this.groupIDs(driverStr,cardIDStr); + outStr = groupIDs(driverStr,cardIDStr); optionStr = ""; } } else { @@ -933,7 +925,7 @@ BzPage.prototype.fillInWhiteBoard = function (iLine, driverStr) { iLine = iLine.replace(new RegExp(cardIDArr[0],"i")).trim(); // nVidia developers opted-out from grouping if (driverStr === "INTEL") { - outStr = this.groupIDs(cardIDArr[1],iLine); + outStr = groupIDs(cardIDArr[1],iLine); } else { outStr = iLine; } @@ -1907,6 +1899,7 @@ function BzPage(doc) { false); // logging all submits for timesheet + console.log("logSubmits = " + logSubmits); if (logSubmits) { this.dok.forms.namedItem("changeform").addEventListener("submit", function () {that.addLogRecord();} -- cgit