diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bzpage.js | 6 | ||||
-rw-r--r-- | lib/main.js | 12 | ||||
-rw-r--r-- | lib/rhbzpage.js | 35 |
3 files changed, 26 insertions, 27 deletions
diff --git a/lib/bzpage.js b/lib/bzpage.js index b8c38b8..94689ce 100644 --- a/lib/bzpage.js +++ b/lib/bzpage.js @@ -150,9 +150,9 @@ BZPage.prototype.getRealBugNo = function () { // https://bugzilla.redhat.com/show_bug.cgi?ctype=xml&id=serialWacom Request({ url: this.win.location.href+"&ctype=xml", - onComplete: function() { - if (this.response.status === 200) { - var xmlRepr = this.response.xml; + onComplete: function(response) { + if (response.status === 200) { + var xmlRepr = response.xml; var bugID = parseInt(xmlRepr.getElementsByTagName("bug_id")[0].textContent, 10); if (isNaN(bugID)) { throw new Error("Cannot get bug no. even from XML representation!"); diff --git a/lib/main.js b/lib/main.js index ea01925..8e8aeaa 100644 --- a/lib/main.js +++ b/lib/main.js @@ -65,9 +65,9 @@ function initialize(callback) { Request({ url: urlStr, - onComplete: function () { - if (this.response.status == 200) { - config.gJSONData = this.response.json; + onComplete: function (response) { + if (response.status == 200) { + config.gJSONData = response.json; // Get additional tables if ("downloadJSON" in config.gJSONData.configData) { @@ -78,9 +78,9 @@ function initialize(callback) { var url = arr[1]; Request({ url: url, - onComplete: function() { - if (this.response.status == 200) { - config.gJSONData.constantData[title] = this.response.json; + onComplete: function(response) { + if (response.status == 200) { + config.gJSONData.constantData[title] = response.json; } } }).get(); diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js index 2ab161f..0d9aad0 100644 --- a/lib/rhbzpage.js +++ b/lib/rhbzpage.js @@ -256,10 +256,9 @@ RHBugzillaPage.prototype.addAttachment = function addAttachment(data, callback, Request({ url: this.constantData.XMLRPCData[this.hostname].url, - onComplete: function() { - if (this.response.status == 200) { - console.log("this.response = " + this.response); - var resp = util.parseXMLfromString(this.response.text); + onComplete: function(response) { + if (response.status == 200) { + var resp = util.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); @@ -324,9 +323,9 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() { var that = this; Request({ url: attURL, - onComplete: function() { - if (this.response.status == 200) { - that.btSnippet = that.parseBacktrace(this.response.text); + onComplete: function(response) { + if (response.status == 200) { + that.btSnippet = that.parseBacktrace(response.text); if (that.btSnippet) { that.addCheckShowLink.call(that,x,that.btSnippet); } @@ -354,15 +353,15 @@ RHBugzillaPage.prototype.showAttachment = function showAttachment(id) { var that = this; Request({ url: "https://" + that.hostname + "/attachment.cgi?id=" + id, - onComplete: function () { - if (this.response.status == 200) { + onComplete: function (response) { + if (response.status == 200) { var infoWin = that.win.open("", "Check att. " + id, "width=640,height=640,status=no,location=no,"+ "titlebar=no,scrollbars=yes,resizable=yes"+ "alwaysRaised=yes"); var doc = infoWin.document; doc.body.innerHTML = "<pre id='textPre'>"+ - this.response.text + "</pre>"; + response.text + "</pre>"; } } }).get(); @@ -740,9 +739,9 @@ RHBugzillaPage.prototype.fillInChipMagic = function fillInChipMagic() { // parse Xorg.0.log Request({ url: attURL, - onComplete: function () { - if (this.response.status == 200) { - var interestingLineArr = this.response.text.split("\n"). + onComplete: function (response) { + if (response.status == 200) { + var interestingLineArr = response.text.split("\n"). filter(function (v,i,a) { return that.RE.Chipset.test(v); }); @@ -777,9 +776,9 @@ RHBugzillaPage.prototype.analyzeXorgLog = function analyzeXorgLog(attachID) { var that = this; Request({ url: attURL, - onComplete: function() { - if (this.response.status == 200) { - var results = this.response.text.split("\n"). + onComplete: function(response) { + if (response.status == 200) { + var results = response.text.split("\n"). filter(function(line) { return (that.RE.soughtLines.test(line)); }); @@ -886,8 +885,8 @@ RHBugzillaPage.prototype.fixAttachById = function fixAttachById(id, type, email) // test on https://bugzilla.redhat.com/show_bug.cgi?id=485145 Request({ url: this.constantData.XMLRPCData[this.hostname].url, - onComplete: function() { - if (this.response.status == 200) { + onComplete: function(response) { + if (response.status == 200) { that.XMLRPCcallback.call(that); } }, |