add comment highlighting to post/show page
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user