From 06c5c60704fb181cf870c04cb79b2d6275600f06 Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Mon, 6 Jun 2011 15:28:49 +0200 Subject: Make sending bugs upstream working (collecting comments was broken). --- data/lib/collectingMetadata.js | 11 ++++++++--- lib/main.js | 1 - 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/data/lib/collectingMetadata.js b/data/lib/collectingMetadata.js index f1fa488..a38f0fc 100644 --- a/data/lib/collectingMetadata.js +++ b/data/lib/collectingMetadata.js @@ -12,6 +12,9 @@ function Comment(comment) { this.timeSpan = timeSpan; } +Comment.prototype.getText = function getText() { + return this.element.getElementsByTagName("pre")[0].textContent.trim(); +} function CommentList(doc) { var commentElems = document.getElementById("comments"). @@ -42,9 +45,11 @@ CommentList.prototype.colorComments = function colorComments() { } CommentList.prototype.getAllCommentsText = function getAllCommentsText() { - return this.comments.reduce(function (outStr, com) { - outStr += com.getElementsByTagName("pre")[0].textContent + "\n"; - }).trim(); + var outStr = ""; + for (var idx in this.comments) { + outStr += this.comments[idx].getText() + "\n"; + } + return outStr; } // ----------------------------------------------------------- diff --git a/lib/main.js b/lib/main.js index 909de44..a48f515 100644 --- a/lib/main.js +++ b/lib/main.js @@ -214,4 +214,3 @@ contextMenu.Item({ require("clipboard").set(comment); } }); -tabs.open("https://bugzilla.redhat.com/show_bug.cgi?id=692250"); -- cgit