make autoexpand work
This commit is contained in:
parent
42fcf3e394
commit
d2d205ee08
5 changed files with 73 additions and 35 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
= form_tag( post_comments_path(post_id), :id => "new_comment_on_#{post_id}", :class => 'new_comment', :autocomplete => "off") do
|
= form_tag( post_comments_path(post_id), :id => "new_comment_on_#{post_id}", :class => 'new_comment', :autocomplete => "off") do
|
||||||
= hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}"
|
= hidden_field_tag :post_id, post_id, :id => "post_id_on_#{post_id}"
|
||||||
= text_area_tag :text, nil, :rows => 2, :class => "comment_box",:id => "comment_text_on_#{post_id}", :placeholder => t('.comment'), :autofocus => true
|
= text_area_tag :text, nil, :class => "comment_box",:id => "comment_text_on_#{post_id}", :placeholder => t('.comment'), :autofocus => true
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= link_to "Cancel", post_path(post_id), :class => "cancel_new_comment btn"
|
= link_to "Cancel", post_path(post_id), :class => "cancel_new_comment btn"
|
||||||
|
|
|
||||||
|
|
@ -2,34 +2,43 @@
|
||||||
-# 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.
|
||||||
|
|
||||||
- if post
|
.reshare
|
||||||
.photo_area
|
- if post
|
||||||
- if post.is_a?(StatusMessage)
|
.photo_area
|
||||||
-if post.photos.size > 0
|
- if post.is_a?(StatusMessage)
|
||||||
.photo_attachments
|
-if post.photos.size > 0
|
||||||
- if post.photos.size > 1
|
.photo_attachments
|
||||||
.additional_photo_count
|
- if post.photos.size > 1
|
||||||
= "+ #{post.photos.size-1}"
|
.additional_photo_count
|
||||||
= image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo"
|
= "+ #{post.photos.size-1}"
|
||||||
- elsif post.activity_streams?
|
= image_tag post.photos.first.url(:thumb_large), :class => "stream-photo big-stream-photo"
|
||||||
= image_tag post.image_url
|
- elsif post.activity_streams?
|
||||||
|
= image_tag post.image_url
|
||||||
|
|
||||||
.content
|
.content
|
||||||
.from
|
.from
|
||||||
= person_image_link(post.author, :size => :thumb_small)
|
= person_image_link(post.author, :size => :thumb_small)
|
||||||
= person_link(post.author)
|
= person_link(post.author)
|
||||||
.info
|
.info
|
||||||
%span.time{:integer => post.created_at.to_i}
|
%span.time{:integer => post.created_at.to_i}
|
||||||
= t('ago', :time => time_ago_in_words(post.created_at))
|
= t('ago', :time => time_ago_in_words(post.created_at))
|
||||||
%span.via
|
%span.via
|
||||||
- if post.activity_streams?
|
- if post.activity_streams?
|
||||||
= t('.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
|
= t('shared.stream_element.via', :link => link_to("#{post.provider_display_name}", post.actor_url)).html_safe
|
||||||
|
–
|
||||||
|
%span.scope_scope
|
||||||
|
- if post.public?
|
||||||
|
= t('public')
|
||||||
|
- else
|
||||||
|
= t('limited')
|
||||||
|
|
||||||
- if post.activity_streams?
|
- if post.activity_streams?
|
||||||
= link_to image_tag(post.image_url, 'data-small-photo' => post.image_url, 'data-full-photo' => post.image_url, :class => 'stream-photo'), post.object_url, :class => "stream-photo-link"
|
= link_to image_tag(post.image_url, 'data-small-photo' => post.image_url, 'data-full-photo' => post.image_url, :class => 'stream-photo'), post.object_url, :class => "stream-photo-link"
|
||||||
- else
|
- else
|
||||||
= render 'status_messages/status_message', :post => post, :photos => post.photos
|
= render 'status_messages/status_message', :post => post, :photos => post.photos
|
||||||
- else
|
- else
|
||||||
= t('.deleted')
|
= t('.deleted')
|
||||||
|
|
||||||
%hr
|
.reshare_via
|
||||||
|
%span
|
||||||
|
= t('.reshared_via')
|
||||||
|
|
|
||||||
|
|
@ -661,6 +661,7 @@ en:
|
||||||
other: "%{count} new requests!"
|
other: "%{count} new requests!"
|
||||||
reshares:
|
reshares:
|
||||||
reshare:
|
reshare:
|
||||||
|
reshared_via: "reshared via"
|
||||||
reshare_original: "Reshare original"
|
reshare_original: "Reshare original"
|
||||||
reshare:
|
reshare:
|
||||||
zero: "Reshare"
|
zero: "Reshare"
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,9 @@ $(document).ready(function(){
|
||||||
beforeSend: function(){
|
beforeSend: function(){
|
||||||
link.addClass('loading');
|
link.addClass('loading');
|
||||||
},
|
},
|
||||||
|
context: link,
|
||||||
success: function(data){
|
success: function(data){
|
||||||
var textarea = parent.find('textarea').first();
|
var textarea = function(target) { return target.closest(".stream_element").find('textarea.comment_box').first()[0] };
|
||||||
lineHeight = 14;
|
|
||||||
|
|
||||||
link.removeClass('loading')
|
link.removeClass('loading')
|
||||||
|
|
||||||
if(!link.hasClass("add_comment_bottom_link")){
|
if(!link.hasClass("add_comment_bottom_link")){
|
||||||
|
|
@ -135,7 +134,10 @@ $(document).ready(function(){
|
||||||
|
|
||||||
container.hide();
|
container.hide();
|
||||||
parent.append(data);
|
parent.append(data);
|
||||||
new MBP.autogrow(textarea);
|
|
||||||
|
console.log($(this).closest(".stream_element").find('textarea'));
|
||||||
|
|
||||||
|
MBP.autogrow(textarea($(this)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -164,7 +166,7 @@ $(document).ready(function(){
|
||||||
var bottomBar = form.closest('.bottom_bar').first(),
|
var bottomBar = form.closest('.bottom_bar').first(),
|
||||||
container = bottomBar.find('.add_comment_bottom_link_container'),
|
container = bottomBar.find('.add_comment_bottom_link_container'),
|
||||||
commentActionLink = bottomBar.find("a.comment_action").first();
|
commentActionLink = bottomBar.find("a.comment_action").first();
|
||||||
reactionLink = bottomBar.find("a.show_comments").first(),
|
reactionLink = bottomBar.find(".show_comments").first(),
|
||||||
commentCount = bottomBar.find(".comment_count");
|
commentCount = bottomBar.find(".comment_count");
|
||||||
|
|
||||||
if(container.length > 0) {
|
if(container.length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,9 @@ body {
|
||||||
weight: bold !important; }; }
|
weight: bold !important; }; }
|
||||||
margin-bottom: 2px;
|
margin-bottom: 2px;
|
||||||
height: 45px; }
|
height: 45px; }
|
||||||
> .content {
|
|
||||||
|
> .content,
|
||||||
|
.reshare > .content {
|
||||||
padding: 10px {
|
padding: 10px {
|
||||||
bottom: 0; }; }
|
bottom: 0; }; }
|
||||||
padding: 10px 0;
|
padding: 10px 0;
|
||||||
|
|
@ -107,6 +109,7 @@ body {
|
||||||
@include border-radius(3px);
|
@include border-radius(3px);
|
||||||
@include box-shadow(0, 1px, 5px, rgba(0, 0, 0, 1));
|
@include box-shadow(0, 1px, 5px, rgba(0, 0, 0, 1));
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
padding-bottom: 10px;
|
||||||
background: {
|
background: {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
@ -553,3 +556,26 @@ header {
|
||||||
.new_status_message {
|
.new_status_message {
|
||||||
min-height: 300px;
|
min-height: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.reshare {
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
padding: {
|
||||||
|
bottom: 10px;
|
||||||
|
}
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
.reshare_via {
|
||||||
|
width: 100%;
|
||||||
|
position: absolute;
|
||||||
|
bottom: -7px;
|
||||||
|
text-align: center;
|
||||||
|
span {
|
||||||
|
padding: 2px 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #999;
|
||||||
|
background: {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue