From 76d95acc16354964068bcf0c5bdb0d3264e83fc1 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 17 May 2010 17:03:04 +0200 Subject: Move pasteBacktraceInComments to RHBugzillaPage --- bugzillaBugTriage.js | 112 +++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) (limited to 'bugzillaBugTriage.js') diff --git a/bugzillaBugTriage.js b/bugzillaBugTriage.js index ded744d..f19a40e 100644 --- a/bugzillaBugTriage.js +++ b/bugzillaBugTriage.js @@ -1295,62 +1295,6 @@ BZPage.prototype.getCCList = function() { return outCCList; }; -/** - * - */ -BZPage.prototype.pasteBacktraceInComments = function() { - // FIXME This paragraph looks suspicous ... what is it? - // Does it belong to this function? - let notedLabel = this.doc.querySelector("label[for='newcc']"); - while (notedLabel.firstChild) { - let node = notedLabel.removeChild(notedLabel.firstChild); - notedLabel.parentNode.insertBefore(node, notedLabel); - } - notedLabel.parentNode.removeChild(notedLabel); - - let abrtQueryURL = "https://bugzilla.redhat.com/buglist.cgi?" - + "cmdtype=dorem&remaction=run&namedcmd=all%20NEW%20abrt%20crashes&sharer_id=74116"; - - let mainTitle = this.doc - .getElementsByClassName("bz_alias_short_desc_container")[0]; - let abrtButton = this.doc.createElement("a"); - abrtButton.setAttribute("accesskey", "a"); - abrtButton.setAttribute("href", abrtQueryURL); - abrtButton.textContent = "Abrt bugs"; - mainTitle.appendChild(abrtButton); - - if (this.idContainsWord("cf_devel_whiteboard", 'btparsed')) { - this.addStuffToTextBox('status_whiteboard', 'btparsed'); - } - - if (!(this.isTriaged() || this.idContainsWord("status_whiteboard", - 'btparsed'))) { - let btAttachments = this.attachments - .filter(function(att, idx, arr) { - return (/backtrace/.test(att[0])); - }); - // TODO we need to go through all backtrace attachments, but - // just the first one will do for now, we would need to do async - // parsing - btAttachments.forEach(function(x) { - attURL = "https://bugzilla.redhat.com/attachment.cgi?id=" - + x[1]; - console.log("attURL = " + attURL); - console.log("btSnippet = " + this.btSnippet); - if (!this.btSnippet) { - let btRaw = hlpr.loadText(attURL, function(ret) { - this.btSnippet = this.parseBacktrace(ret); - if (this.btSnippet) { - this.addStuffToTextBox("comment", this.btSnippet); - this.addStuffToTextBox("status_whiteboard", - "btparsed"); - } - }, this); - } - }, this); - } -}; - // ==================================================================================== // MozillaBugzilla object @@ -1717,6 +1661,62 @@ RHBugzillaPage.prototype.ProfessionalProducts = [ "Red Hat Enterprise MRG" ]; +/** + * + */ +RHBugzillaPage.prototype.pasteBacktraceInComments = function() { + // FIXME This paragraph looks suspicous ... what is it? + // Does it belong to this function? + let notedLabel = this.doc.querySelector("label[for='newcc']"); + while (notedLabel.firstChild) { + let node = notedLabel.removeChild(notedLabel.firstChild); + notedLabel.parentNode.insertBefore(node, notedLabel); + } + notedLabel.parentNode.removeChild(notedLabel); + + let abrtQueryURL = "https://bugzilla.redhat.com/buglist.cgi?" + + "cmdtype=dorem&remaction=run&namedcmd=all%20NEW%20abrt%20crashes&sharer_id=74116"; + + let mainTitle = this.doc + .getElementsByClassName("bz_alias_short_desc_container")[0]; + let abrtButton = this.doc.createElement("a"); + abrtButton.setAttribute("accesskey", "a"); + abrtButton.setAttribute("href", abrtQueryURL); + abrtButton.textContent = "Abrt bugs"; + mainTitle.appendChild(abrtButton); + + if (this.idContainsWord("cf_devel_whiteboard", 'btparsed')) { + this.addStuffToTextBox('status_whiteboard', 'btparsed'); + } + + if (!(this.isTriaged() || this.idContainsWord("status_whiteboard", + 'btparsed'))) { + let btAttachments = this.attachments + .filter(function(att, idx, arr) { + return (/backtrace/.test(att[0])); + }); + // TODO we need to go through all backtrace attachments, but + // just the first one will do for now, we would need to do async + // parsing + btAttachments.forEach(function(x) { + attURL = "https://bugzilla.redhat.com/attachment.cgi?id=" + + x[1]; + console.log("attURL = " + attURL); + console.log("btSnippet = " + this.btSnippet); + if (!this.btSnippet) { + let btRaw = hlpr.loadText(attURL, function(ret) { + this.btSnippet = this.parseBacktrace(ret); + if (this.btSnippet) { + this.addStuffToTextBox("comment", this.btSnippet); + this.addStuffToTextBox("status_whiteboard", + "btparsed"); + } + }, this); + } + }, this); + } +}; + /** * */ -- cgit