From b3c7cd4633a734c17d6035aee8e32a1491106f14 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Fri, 21 May 2010 16:50:08 +0200 Subject: Various small cleanups. --- bugzillaBugTriage.js | 44 +++++++++++++++++++------------------------- 1 file changed, 19 insertions(+), 25 deletions(-) (limited to 'bugzillaBugTriage.js') diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index cda0968..ba2aaa7 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -1451,7 +1451,6 @@ RHBugzillaPage = function(doc) { this.setBranding(); this.checkComments(); - this.buildButtons(topRow, bottomRow); // offline-capable submit this.doc.forms.namedItem("changeform").addEventListener('submit', @@ -1459,6 +1458,17 @@ RHBugzillaPage = function(doc) { that.submitCallback.call(that, evt); }, false); + // TODO Get compiz bugs as well + if ((config.gJSONData.configData.PCIIDsURL + && (config.PCI_ID_Array.length > 0)) + && this.maintCCAddr === "xgl-maint@redhat.com") { + // Add find chip magic button + let whiteboard_string = this.doc.getElementById("status_whiteboard").value; + if (!/card_/.test(whiteboard_string)) { + this.fillInChipMagic(); + } + } + if (logSubmits) { this.setUpLoggingButtons(); } @@ -1888,7 +1898,7 @@ RHBugzillaPage.prototype.setBranding = function() { // Make background-color of the body of bug salmon pink // for security bugs. if (this.hasKeyword("Security")) { - this.doc.getElementById("bugzilla-body").style.background = SalmonPink + this.doc.getElementById("bugzilla-body").style.background = this.SalmonPink .toString() + ' none'; } @@ -2253,7 +2263,7 @@ RHBugzillaPage.prototype.getWholeURL = function(selectValue, bugID) { * + responseHeaders * + responseText */ -RHBugzillaPage.prototype.callBack = function(data, textStatus) { +RHBugzillaPage.prototype.fixingMIMECallBack = function(data, textStatus) { if (--this.reqCounter <= 0) { setTimeout(this.doc.location.reload, 1000); } @@ -2311,7 +2321,7 @@ RHBugzillaPage.prototype.fixAttachById = function(id, type, email) { if (req.readyState == 4) { if (req.status == 200) { console.log("Fixing attachment MIME type success!"); - that.callBack(); + that.fixingMIMECallBack(); } else { console.error("Fixing MIME type attachment failed!"); } @@ -2480,27 +2490,11 @@ RHBugzillaPage.prototype.parseBacktrace = function(ret) { return outStr; }; -/** - * Main executable functioning actually building all buttons on the page -- - * separated into function, so that it could be called from onload method of the - * XMLHttpRequest. - * - * @param jsonList Array created from JSON - * @return none - */ -RHBugzillaPage.prototype.buildButtons = function(above, below) { - // FIXME REMAINS OF THIS FUNCTION SHOULD BE MOVED SOMEWHERE - // TODO Get compiz bugs as well - if ((chipIDsGroupings.length > 0) - && this.maintCCAddr === "xgl-maint@redhat.com") { - // Add find chip magic button - let whiteboard_string = this.doc.getElementById("status_whiteboard").value; - if (!/card_/.test(whiteboard_string)) { - this.fillInChipMagic(); - } - } -}; - +// FIXME we should store whole URL, not just ID (to cooperate with other bugzillas) +// General rule: there is nothing special about bugzilla.redhat.com, so for example +// constantData.bugzillalabelNames should be made non-RH-centric +// and getBugzillaName should work everywhere same (even on bugzilla.mozilla.org, +// if that makes sense?) RHBugzillaPage.prototype.addLogRecord = function() { let rec = {}; rec.date = new Date(); -- cgit