From 38c0e794b2a46545ed2b31d5ddfd27cd533c1d3d Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 23 Sep 2010 14:23:25 +0200 Subject: innerHTML is a good servant ... scrap it, it is bad servant even. --- lib/rhbzpage.js | 12 ++++-------- package.json | 2 +- update.rdf | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/lib/rhbzpage.js b/lib/rhbzpage.js index c3d86ba..9bbc81f 100644 --- a/lib/rhbzpage.js +++ b/lib/rhbzpage.js @@ -311,13 +311,9 @@ RHBugzillaPage.prototype.pasteBacktraceInComments = function() { // 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 - console.log("btAttachments = " + btAttachments.toSource()); btAttachments.forEach(function(x) { var attURL = "https://bugzilla.redhat.com/attachment.cgi?id=" + x[1]; - console.log("attURL = " + attURL); - console.log("this.btSnippet = " + this.btSnippet); - console.log("btparsed = " + this.idContainsWord("status_whiteboard", 'btparsed')); if ((!this.btSnippet) && (!this.idContainsWord("status_whiteboard", 'btparsed'))) { var that = this; @@ -388,8 +384,10 @@ RHBugzillaPage.prototype.addNewAttachmentRow = function addNewAttachmentRow(orig var newTRElem = origAtt[4].cloneNode(true); // fix number of the attachment - newTRElem.innerHTML = newTRElem.innerHTML.replace(origAtt[1], newAttId); - console.log("newTRElem = " + newTRElem.innerHTML); + Array.forEach(newTRElem.getElementsByTagName("a"), function (aEl) { + aEl.setAttribute("href", + aEl.getAttribute("href").replace(origAtt[1], newAttId)); + }); var aElements = newTRElem.getElementsByTagName("a"); aElements[0].setAttribute("name","parsed-backtrace.txt"); @@ -402,7 +400,6 @@ RHBugzillaPage.prototype.addNewAttachmentRow = function addNewAttachmentRow(orig var vcardSpan = newTRElem.getElementsByClassName("vcard")[0]; if (vcardSpan !== undefined) { - console.log("vcardSpan = " + vcardSpan); var vcardSpanClassList = vcardSpan.classList; if (/@redhat\.com/.test(this.login) && !vcardSpanClassList.contains("redhat_user")) { vcardSpanClassList.add("redhat_user"); @@ -415,7 +412,6 @@ RHBugzillaPage.prototype.addNewAttachmentRow = function addNewAttachmentRow(orig } var elem = newTRElem.querySelector("td:last-of-type"); - console.log("elem.innerHTML = " + elem.innerHTML); this.createDeadLink("showBacktrace", "show BT", elem, this.showAttachment, newAttId, false); diff --git a/package.json b/package.json index 3dfffe1..74a8473 100644 --- a/package.json +++ b/package.json @@ -7,5 +7,5 @@ "description": "Additional buttons and other function helping in the triage on bugzilla", "author": "Matej Cepl (http://matej.ceplovi.cz)", "license": "MIT/X11 (http://opensource.org/licenses/mit-license.php)", - "version": "0.23" + "version": "0.24" } diff --git a/update.rdf b/update.rdf index 7afdf2b..425440a 100644 --- a/update.rdf +++ b/update.rdf @@ -156,6 +156,24 @@ https://fedorahosted.org/released/bugzilla-triage-scripts/bugzilla-triage-0.23.xpi + + https://fedorahosted.org/bugzilla-triage-scripts/wiki/ChangeLog + + + + + + + 0.24 + + + + {ec8030f7-c20a-464f-9b0e-13a3a9e97384} + 3.6 + 4.* + + https://fedorahosted.org/released/bugzilla-triage-scripts/bugzilla-triage-0.24.xpi + https://fedorahosted.org/bugzilla-triage-scripts/wiki/ChangeLog -- cgit