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"
def comment_toggle(count, commenting_disabled=false)
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
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
str << " (#{count})"
str
end
def new_comment_form(post_id, current_user)

View file

@ -44,3 +44,6 @@ en:
show_more: "show more"
failed_to_like: "Failed to like!"
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(),
showUl = $(this).closest('li'),
commentBlock = $this.closest(".stream_element").find("ul.comments", ".content"),
commentBlockMore = $this.closest(".stream_element").find(".older_comments", ".content"),
show = (text.indexOf("show") != -1);
commentBlockMore = $this.closest(".stream_element").find(".older_comments", ".content")
if( commentBlockMore.hasClass("inactive") ) {
commentBlockMore.fadeIn(150, function() {
commentBlockMore.removeClass("inactive");
commentBlockMore.removeClass("hidden");
});
$this.html(Diaspora.widgets.i18n.t('comments.hide'));
} else {
if(commentBlock.hasClass("hidden")) {
commentBlock.removeClass('hidden');
showUl.css('margin-bottom','-1em');
$this.html(Diaspora.widgets.i18n.t('comments.hide'));
}else{
commentBlock.addClass('hidden');
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) {