diff options
author | Matěj Cepl <mcepl@redhat.com> | 2011-01-28 02:04:52 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2011-01-28 02:04:52 +0100 |
commit | 83a7d703cbabd6e514a6d8a948b39325b59e9f58 (patch) | |
tree | e1bf21f956c5f0e151bb254dec8771e22c3261df /data/rhbzpage.js | |
parent | 6424471ab36679138c1708ddaf97c40e6bf24155 (diff) | |
download | bugzilla-triage-83a7d703cbabd6e514a6d8a948b39325b59e9f58.tar.gz |
bzpage.js mostly done
Also:
* created libbugzilla.js for putting aside most RPCed functions
* utils.js and color.js moved to data
* tons and tons of restructing to make things work via RPC
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 |