Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
bd32e09bf3
8 changed files with 80 additions and 68 deletions
|
|
@ -2,7 +2,7 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
%li.comment{:id => post.id}
|
%li.comment
|
||||||
= person_image_link(post.person)
|
= person_image_link(post.person)
|
||||||
.content
|
.content
|
||||||
.from
|
.from
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@
|
||||||
-# licensed under the Affero General Public License version 3 or later. See
|
-# licensed under the Affero General Public License version 3 or later. See
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
|
|
||||||
%div.comments
|
%ul.comments{:id => post.id}
|
||||||
%ul.comment_set{:id => post.id}
|
|
||||||
- for comment in post.comments
|
- for comment in post.comments
|
||||||
= render 'comments/comment', :post => comment
|
= render 'comments/comment', :post => comment
|
||||||
%li.comment.show
|
%li.comment.show
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,14 @@
|
||||||
|
|
||||||
function processComment(post_id, html){
|
function processComment(post_id, html){
|
||||||
post = $("*[data-guid='"+post_id+"']'");
|
post = $("*[data-guid='"+post_id+"']'");
|
||||||
$(' .comment_set li:last', post ).before(
|
$('.comments li:last', post ).before(
|
||||||
$(html).fadeIn("fast", function(){})
|
$(html).fadeIn("fast", function(){})
|
||||||
);
|
);
|
||||||
toggler = $('.show_post_comments', post)
|
toggler = $('.show_post_comments', post)
|
||||||
|
|
||||||
if(toggler.length > 0){
|
if(toggler.length > 0){
|
||||||
toggler.html(
|
toggler.html(
|
||||||
toggler.html().replace(/\d+/,$('.comment_set', post)[0].childElementCount -1));
|
toggler.html().replace(/\d+/,$('.comments', post)[0].childElementCount -1));
|
||||||
|
|
||||||
if( !$(".comments", post).is(':visible') ){
|
if( !$(".comments", post).is(':visible') ){
|
||||||
toggler.click();
|
toggler.click();
|
||||||
|
|
@ -63,9 +63,9 @@
|
||||||
function processPost(className, html, aspectIds){
|
function processPost(className, html, aspectIds){
|
||||||
if(onPageForAspects(aspectIds)){
|
if(onPageForAspects(aspectIds)){
|
||||||
var addPostToStream = function (html){
|
var addPostToStream = function (html){
|
||||||
$("#stream").prepend(
|
$("#stream:not('.show')").prepend(
|
||||||
$(html).fadeIn("fast", function(){
|
$(html).fadeIn("fast", function(){
|
||||||
$("#stream label:first").inFieldLabels();
|
$("#stream").find("label").first().inFieldLabels();
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
%li
|
%li
|
||||||
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => "add a new aspect"
|
= link_to '+', '#add_aspect_pane', :class => "add_aspect_button", :title => "add a new aspect"
|
||||||
|
|
||||||
%ul{ :style => "position:absolute;right:0;bottom:0.01em;"}
|
%ul.right{:style=>"bottom:0;"}
|
||||||
%li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)}
|
%li{ :style => "margin-right:0;", :class => ("selected" if @aspect == :manage)}
|
||||||
= link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects')
|
= link_to ( (@request_count == 0)? t('.manage') : "#{t('.manage')} (#{@request_count})"), {:controller => :aspects, :action => :manage}, :class => "edit_aspect_button", :class => new_request(@request_count), :title => t('.manage_your_aspects')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,13 +6,10 @@
|
||||||
= render 'shared/author_info', :post => @status_message
|
= render 'shared/author_info', :post => @status_message
|
||||||
|
|
||||||
.span-14.append-1.last
|
.span-14.append-1.last
|
||||||
#stream
|
|
||||||
%h1.show_text
|
%h1.show_text
|
||||||
= make_links(@status_message.message)
|
= make_links(@status_message.message)
|
||||||
|
|
||||||
= "Posted #{how_long_ago(@status_message)} to"
|
= how_long_ago(@status_message)
|
||||||
- for aspect in current_user.aspects_with_post( @status_message.id )
|
|
||||||
= link_to aspect.name, aspect
|
|
||||||
|
|
||||||
- if current_user.owns? @status_message
|
- if current_user.owns? @status_message
|
||||||
%p
|
%p
|
||||||
|
|
|
||||||
|
|
@ -5,39 +5,64 @@
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('.comment_set').each(function(index) {
|
|
||||||
var $this = $(this);
|
// expand all comments on page load
|
||||||
if($this.children().length > 1) {
|
$("#stream:not('.show')").find('.comments').each(function(index) {
|
||||||
var show_comments_toggle = $this.parent().prev().children(".show_post_comments");
|
var comments = $(this);
|
||||||
show_comments_toggle.click();
|
if(comments.children("li").length > 1) {
|
||||||
|
var show_comments_toggle = comments.closest("li").find(".show_post_comments");
|
||||||
|
expandComments(show_comments_toggle);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});//end document ready
|
|
||||||
|
|
||||||
$(".show_post_comments").live('click', function(event) {
|
// comment toggle action
|
||||||
event.preventDefault();
|
$("#stream:not('.show')").delegate("a.show_post_comments", "click", function(evt) {
|
||||||
|
evt.preventDefault();
|
||||||
|
expandComments($(this));
|
||||||
|
});
|
||||||
|
|
||||||
var $this = $(this);
|
// comment submit action
|
||||||
|
$("#stream").delegate("a.comment_submit", "click", function(evt){
|
||||||
|
$(this).closest("form").children(".comment_box").attr("rows", 1);
|
||||||
|
});
|
||||||
|
|
||||||
if( $this.hasClass( "visible")) {
|
$("#stream").delegate("textarea.comment_box", "focus", function(evt){
|
||||||
$this.html($(this).html().replace("hide", "show"));
|
var commentBox = $(this);
|
||||||
$this.closest("li").children(".content").children(".comments").slideUp(150);
|
commentBox.attr("rows", 2)
|
||||||
} else {
|
.closest("form").find(".comment_submit").fadeIn(200);
|
||||||
$this.html($(this).html().replace("show", "hide"));
|
});
|
||||||
$this.closest("li").children(".content").children(".comments").slideDown(150);
|
|
||||||
|
$("#stream").delegate("textarea.comment_box", "blur", function(evt){
|
||||||
|
var commentBox = $(this);
|
||||||
|
if( !commentBox.val() ) {
|
||||||
|
commentBox.attr("rows", 1)
|
||||||
|
.closest("form").find(".comment_submit").hide();
|
||||||
}
|
}
|
||||||
$(this).toggleClass( "visible" );
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// reshare button action
|
||||||
$(".comment_submit").live('click', function(evt){
|
$("#stream").delegate(".reshare_button", "click", function(evt){
|
||||||
$(this).closest("form").children("p .comment_box").attr("rows", 1);
|
evt.preventDefault();
|
||||||
});
|
|
||||||
|
|
||||||
$(".reshare_button").live("click", function(e){
|
|
||||||
e.preventDefault();
|
|
||||||
var button = $(this);
|
var button = $(this);
|
||||||
button.parent(".reshare_pane").children(".reshare_box").show();
|
button.closest(".reshare_pane").children(".reshare_box").show();
|
||||||
button.addClass("active");
|
button.addClass("active");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});//end document ready
|
||||||
|
|
||||||
|
|
||||||
|
function expandComments(toggler){
|
||||||
|
var text = toggler.html();
|
||||||
|
commentBlock = toggler.closest("li").find("ul.comments", ".content");
|
||||||
|
|
||||||
|
if( toggler.hasClass("visible")) {
|
||||||
|
toggler.removeClass("visible")
|
||||||
|
.html(text.replace("hide", "show"));
|
||||||
|
commentBlock.slideUp(150);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
toggler.addClass("visible")
|
||||||
|
.html(text.replace("show", "hide"));
|
||||||
|
commentBlock.slideDown(150);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,13 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$("#publisher textarea, .comment_box").keydown( function(e) {
|
$("#publisher").find("textarea").keydown( function(e) {
|
||||||
|
if (e.keyCode == 13) {
|
||||||
|
$(this).closest("form").submit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#stream").delegate("textarea.comment_box", "keydown", function(e){
|
||||||
if (e.keyCode == 13) {
|
if (e.keyCode == 13) {
|
||||||
$(this).closest("form").submit();
|
$(this).closest("form").submit();
|
||||||
}
|
}
|
||||||
|
|
@ -126,17 +132,3 @@ $(".make_profile_photo").live("click", function(){
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$(".comment_box").live("focus",function(evt){
|
|
||||||
var $this = $(this);
|
|
||||||
$this.attr("rows", 2);
|
|
||||||
$this.parents("p").parents("form").children("p").children(".comment_submit").fadeIn(200);
|
|
||||||
});
|
|
||||||
|
|
||||||
$(".comment_box").live('blur', function(evt){
|
|
||||||
var $this = $(this);
|
|
||||||
if( $this.val() == '' ) {
|
|
||||||
$this.parents("p").parents("form").children("p").children(".comment_submit").fadeOut(0);
|
|
||||||
$this.attr("rows", 1);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -433,9 +433,8 @@ form
|
||||||
:right 1em
|
:right 1em
|
||||||
|
|
||||||
#stream.show
|
#stream.show
|
||||||
div.comments
|
ul.comments
|
||||||
:display block
|
:display block
|
||||||
ul.comment_set
|
|
||||||
:margin
|
:margin
|
||||||
:top 0
|
:top 0
|
||||||
> li
|
> li
|
||||||
|
|
@ -447,7 +446,7 @@ form
|
||||||
:border none
|
:border none
|
||||||
|
|
||||||
|
|
||||||
#stream div.comments
|
#stream ul.comments
|
||||||
:display none
|
:display none
|
||||||
|
|
||||||
.avatar
|
.avatar
|
||||||
|
|
@ -462,7 +461,7 @@ input.comment_submit
|
||||||
:right -10px
|
:right -10px
|
||||||
|
|
||||||
|
|
||||||
ul.comment_set
|
ul.comments
|
||||||
:margin 0
|
:margin 0
|
||||||
:top 1em
|
:top 1em
|
||||||
:padding 0
|
:padding 0
|
||||||
|
|
@ -794,7 +793,7 @@ h1.big_text
|
||||||
:top 1px solid #999
|
:top 1px solid #999
|
||||||
:bottom 2px solid #eee
|
:bottom 2px solid #eee
|
||||||
|
|
||||||
.show_post_comments ul.comment_set
|
.show_post_comments ul.comments
|
||||||
:width 100%
|
:width 100%
|
||||||
|
|
||||||
.sub_header
|
.sub_header
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue