diff options
Diffstat (limited to 'data/lib/collectingMetadata.js')
-rw-r--r-- | data/lib/collectingMetadata.js | 11 |
1 files changed, 8 insertions, 3 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; } // ----------------------------------------------------------- |