add comment highlighting to post/show page

This commit is contained in:
albert
2013-02-21 14:37:36 -05:00
parent c20cb34dea
commit 03d8d8c471

View File

@@ -7,6 +7,10 @@
this.initialize_reply_links();
this.initialize_expand_links();
}
if ($("#c-posts").length && $("#a-show").length) {
Danbooru.Comment.highlight_threshold_comments(Danbooru.meta("post-id"));
}
}
Danbooru.Comment.quote_message = function(data) {
@@ -63,6 +67,17 @@
}
})
}
Danbooru.Comment.hide_threshold_comments = function(post_id) {
var threshold = parseInt(Danbooru.meta("user-comment-threshold"));
var articles = $("article.comment[data-post-id=" + post_id + "]");
articles.each(function(i, v) {
var $comment = $(v);
if (parseInt($comment.data("score")) < threshold) {
$comment.hide();
}
})
}
})();
$(document).ready(function() {