you know the facepalm smiley? Here it is: m(

This commit is contained in:
MrZYX 2011-05-19 20:10:35 +02:00
parent e592e1b06e
commit 331aa1ff60
3 changed files with 11 additions and 6 deletions

View file

@ -6,10 +6,12 @@ module CommentsHelper
GSUB_THIS = "FIUSDHVIUSHDVIUBAIUHAPOIUXJM" GSUB_THIS = "FIUSDHVIUSHDVIUBAIUHAPOIUXJM"
def comment_toggle(count, commenting_disabled=false) def comment_toggle(count, commenting_disabled=false)
if count <= 3 if count <= 3
link_to "#{t('stream_helper.hide_comments')} (#{count})", '#', :class => "show_post_comments" str = link_to "#{t('stream_helper.hide_comments')}", '#', :class => "show_post_comments"
else else
link_to "#{t('stream_helper.show_comments')} (#{count})", '#', :class => "show_post_comments" str = link_to "#{t('stream_helper.show_comments')}", '#', :class => "show_post_comments"
end end
str << " (#{count})"
str
end end
def new_comment_form(post_id, current_user) def new_comment_form(post_id, current_user)

View file

@ -44,3 +44,6 @@ en:
show_more: "show more" show_more: "show more"
failed_to_like: "Failed to like!" failed_to_like: "Failed to like!"
failed_to_post_message: "Failed to post message!" failed_to_post_message: "Failed to post message!"
comments:
show: "show all comments"
hide: "hide comments"

View file

@ -132,25 +132,25 @@ var Stream = {
text = $this.html(), text = $this.html(),
showUl = $(this).closest('li'), showUl = $(this).closest('li'),
commentBlock = $this.closest(".stream_element").find("ul.comments", ".content"), commentBlock = $this.closest(".stream_element").find("ul.comments", ".content"),
commentBlockMore = $this.closest(".stream_element").find(".older_comments", ".content"), commentBlockMore = $this.closest(".stream_element").find(".older_comments", ".content")
show = (text.indexOf("show") != -1);
if( commentBlockMore.hasClass("inactive") ) { if( commentBlockMore.hasClass("inactive") ) {
commentBlockMore.fadeIn(150, function() { commentBlockMore.fadeIn(150, function() {
commentBlockMore.removeClass("inactive"); commentBlockMore.removeClass("inactive");
commentBlockMore.removeClass("hidden"); commentBlockMore.removeClass("hidden");
}); });
$this.html(Diaspora.widgets.i18n.t('comments.hide'));
} else { } else {
if(commentBlock.hasClass("hidden")) { if(commentBlock.hasClass("hidden")) {
commentBlock.removeClass('hidden'); commentBlock.removeClass('hidden');
showUl.css('margin-bottom','-1em'); showUl.css('margin-bottom','-1em');
$this.html(Diaspora.widgets.i18n.t('comments.hide'));
}else{ }else{
commentBlock.addClass('hidden'); commentBlock.addClass('hidden');
showUl.css('margin-bottom','1em'); showUl.css('margin-bottom','1em');
$this.html(Diaspora.widgets.i18n.t('comments.show'));
} }
} }
$this.html(text.replace((show) ? "show" : "hide", (show) ? "hide" : "show"));
}, },
focusNewComment: function(toggle, evt) { focusNewComment: function(toggle, evt) {