diff options
Diffstat (limited to 'data/lib/collectingMetadata.js')
-rw-r--r-- | data/lib/collectingMetadata.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/data/lib/collectingMetadata.js b/data/lib/collectingMetadata.js index 06b43ac..f1fa488 100644 --- a/data/lib/collectingMetadata.js +++ b/data/lib/collectingMetadata.js @@ -14,10 +14,10 @@ function Comment(comment) { function CommentList(doc) { - var comments = document.getElementById("comments"). + var commentElems = document.getElementById("comments"). getElementsByClassName("bz_comment"); - comments = []; - Array.forEach(comments, function(item) { + var comments = {}; + Array.forEach(commentElems, function(item) { var com = new Comment(item); if (com.element) { comments[ISODateString(com.date)] = com; @@ -32,12 +32,13 @@ function CommentList(doc) { */ CommentList.prototype.colorComments = function colorComments() { var reporter = getReporter(); - var reporterComments = this.comments.filter(function (com) { - return com.author === reporter; - }); - reporterComments.forEach(function (com) { - com.element.style.backgroundColor = ReporterColor.toString(); - }); + var com = null; + for (var idx in this.comments) { + com = this.comments[idx]; + if (com.author === reporter) { + com.element.style.backgroundColor = ReporterColor.toString(); + } + } } CommentList.prototype.getAllCommentsText = function getAllCommentsText() { @@ -45,7 +46,6 @@ CommentList.prototype.getAllCommentsText = function getAllCommentsText() { outStr += com.getElementsByTagName("pre")[0].textContent + "\n"; }).trim(); } - // ----------------------------------------------------------- /** |