From b817da8d82bd4182053274ef7ac0a29f7c59d3f8 Mon Sep 17 00:00:00 2001 From: albert Date: Wed, 14 Sep 2011 17:55:32 -0400 Subject: [PATCH] changes to comment expansion link in comment listing --- app/assets/javascripts/comments.js | 21 ------------------- app/assets/stylesheets/application.css.scss | 2 +- .../comments/partials/index/_header.html.erb | 7 +------ 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/app/assets/javascripts/comments.js b/app/assets/javascripts/comments.js index 2de43bab1..46bee6445 100644 --- a/app/assets/javascripts/comments.js +++ b/app/assets/javascripts/comments.js @@ -5,7 +5,6 @@ $("div.dtext-preview").hide(); this.initialize_response_link(); this.initialize_preview_button(); - this.hide_threshold_comments(); this.initialize_reply_links(); } @@ -61,33 +60,13 @@ Danbooru.Comment.highlight_threshold_comments = function(post_id) { var threshold = parseInt(Danbooru.meta("user-comment-threshold")); var articles = $("article.comment[data-post-id=" + post_id + "]"); - console.log("articles=%o", articles); articles.each(function(i, v) { var $comment = $(v); - console.log("testing %o", $comment); if (parseInt($comment.data("score")) < threshold) { $comment.addClass("below-threshold"); } }) } - - Danbooru.Comment.hide_threshold_comments = function(post_id) { - var threshold = parseInt(Danbooru.meta("user-comment-threshold")); - var articles = null; - - if (post_id) { - articles = $("article.comment[data-post-id=" + post_id + "]"); - } else { - articles = $("article.comment"); - } - - articles.each(function(i, v) { - var $comment = $(v); - if (parseInt($comment.data("score")) < threshold) { - $comment.hide(); - } - }); - } })(); $(document).ready(function() { diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index a05bfceca..8af25e857 100644 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -602,7 +602,7 @@ div.comments-for-post { } article.comment.below-threshold { - opacity: 0.2; + opacity: 0.3; } article.comment.below-threshold:hover { diff --git a/app/views/comments/partials/index/_header.html.erb b/app/views/comments/partials/index/_header.html.erb index 33fe40457..7416c845e 100644 --- a/app/views/comments/partials/index/_header.html.erb +++ b/app/views/comments/partials/index/_header.html.erb @@ -31,14 +31,9 @@ <% end %>
- <% if post.comments.count > 6 %> - - <%= link_to "#{pluralize(post.comments.count - 6, 'more comment')}", comments_path(:post_id => post.id), :remote => true %> - - <% end %> <% if post.comments.hidden(CurrentUser.user).count > 0 %> - <%= link_to "#{pluralize(post.comments.hidden(CurrentUser.user).count, 'comment')} below threshold", comments_path(:post_id => post.id, :include_below_threshold => true), :remote => true %> + <%= link_to "Show all comments", comments_path(:post_id => post.id, :include_below_threshold => true), :remote => true %> <% end %>