diff options
Diffstat (limited to 'data/rhbzpage.js')
-rw-r--r-- | data/rhbzpage.js | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/data/rhbzpage.js b/data/rhbzpage.js index 1d0907a..ba55ed6 100644 --- a/data/rhbzpage.js +++ b/data/rhbzpage.js @@ -104,6 +104,19 @@ nonTestedFunction addAttachment(data, callback, param) { var msg = new xrpc.XMLRPCMessage("bugzilla.addAttachment"); var that = this; + // Get bug no + var bugNo = getBugNo(window.location.toString()); + + // deal with aliases + // FIXME there is no password in content scripts anymore! + if (isNaN(parseInt(bugNo, 10)) && this.password) { + getRealBugNo(function(bugN) { + // Zbytek funkce addAttachment + }); + } + + + msg.addParameter(this.bugNo); msg.addParameter({ description: titleParsedAttachment, @@ -119,7 +132,7 @@ nonTestedFunction addAttachment(data, callback, param) { url: this.constantData.XMLRPCData[this.hostname].url, onComplete: function(response) { if (response.status == 200) { - var resp = util.parseXMLfromString(response.text); + var resp = parseXMLfromString(response.text); var newAttachID = parseInt(resp.params.param.value.array.data.value.int, 10); console.log("attachID = " + newAttachID); callback.call(that, param, newAttachID, data.length); @@ -310,6 +323,7 @@ nonTestedFunction addCheckShowLink(oldAtt, snippet) { nonTestedFunction markBadAttachments(atts) { var that = this; var badMIMEArray = [ "application/octet-stream", "text/x-log", "undefined" ]; + // FIXME there is no password anymore, we have to fix it somehow else if (!this.password) { return ; // User didn't provide password, so whole MIME fixing business // should be switched off. @@ -414,7 +428,7 @@ nonTestedFunction setBranding() { } // we should make visible whether maintCCAddr is in CCList - if (util.isInList(this.maintCCAddr, this.CCList)) { + if (util.isInList(this.maintCCAddr, getCCList())) { var ccEditBoxElem = this.doc.getElementById("cc_edit_area_showhide"); ccEditBoxElem.style.color = "navy"; ccEditBoxElem.style.fontWeight = "bolder"; @@ -619,9 +633,10 @@ nonTestedFunction fillInChipMagic() { // Persuade createNewButton to have mercy and to actually add // non-default button that.constantData.chipMagicTrigger = true; - that.packages["rh-xorg"].chipMagic.chipMagic = interestingLine+"\t"+interestingArray[1] - .toUpperCase(); - that.createNewButton("status_whiteboard", true, "rh-xorg", "chipMagic"); + // FIXME packages don't exist anymore + // that.packages["rh-xorg"].chipMagic.chipMagic = interestingLine+"\t"+interestingArray[1] + // .toUpperCase(); + createNewButton("status_whiteboard", true, "rh-xorg", "chipMagic"); } } } @@ -706,6 +721,7 @@ nonTestedFunction XMLRPCcallback() { } } +// FIXME this whole goes to libbzpage.js /** * The worker function -- call XMLRPC to fix MIME type of the particular * attachment |