long text truncation

This commit is contained in:
danielgrippi 2012-01-04 16:38:40 -08:00 committed by Dennis Collinson
parent ff82283b3c
commit ae5fb67f71
7 changed files with 24 additions and 11 deletions

View file

@ -18,7 +18,7 @@
</a> </a>
</span> </span>
<p> <p class="collapsible">
<%= text %> <%= text %>
</p> </p>

View file

@ -37,7 +37,7 @@
<% } %> <% } %>
<% } %> <% } %>
<p> <p class="collapsible">
<%= root.text %> <%= root.text %>
</p> </p>

View file

@ -12,7 +12,7 @@
<% } %> <% } %>
<% } %> <% } %>
<p> <p class="collapsible">
<%= text %> <%= text %>
</p> </p>

View file

@ -1,8 +1,12 @@
<div class="right controls"> <div class="right controls">
<% if(author.id != current_user.id) { %> <% if(author.id != current_user.id) { %>
<img src="/images/icons/ignoreuser.png" alt="Ignoreuser" class="block_user control_icon" title= "<%= Diaspora.I18n.t('ignore') %>" /> <a href="#" rel=nofollow>
<img src="/images/icons/ignoreuser.png" alt="Ignoreuser" class="block_user control_icon" title= "<%= Diaspora.I18n.t('ignore') %>" />
</a>
<% } else { %> <% } else { %>
<img src="/images/deletelabel.png" class="delete control_icon remove_post" title="<%= Diaspora.I18n.t('delete') %>" /> <a href="#" rel=nofollow>
<img src="/images/deletelabel.png" class="delete control_icon remove_post" title="<%= Diaspora.I18n.t('delete') %>" />
</a>
<% } %> <% } %>
</div> </div>

View file

@ -14,9 +14,5 @@ app.views.Comment = app.views.StreamObject.extend({
$(this.el).attr("id", this.model.get("guid")); $(this.el).attr("id", this.model.get("guid"));
return this; return this;
},
postRenderTemplate : function(){
this.$("time").timeago();
} }
}); });

View file

@ -47,8 +47,7 @@ app.views.Post = app.views.StreamObject.extend({
postRenderTemplate : function() { postRenderTemplate : function() {
this.renderPostContent() this.renderPostContent()
.initializeTooltips() .initializeTooltips()
.$(".details time") .$("time").timeago();
.timeago();
return this; return this;
}, },

View file

@ -5,6 +5,20 @@ app.views.StreamObject = app.views.Base.extend({
this.model.bind('change', this.render, this); this.model.bind('change', this.render, this);
}, },
postRenderTemplate : function(){
// time
this.$("time").timeago();
// collapse long posts
this.$(".collapsible").expander({
slicePoint: 400,
widow: 12,
expandText: Diaspora.I18n.t("show_more"),
userCollapse: false
});
},
destroyModel: function(evt){ destroyModel: function(evt){
if(evt){ evt.preventDefault(); } if(evt){ evt.preventDefault(); }
if(!confirm(Diaspora.I18n.t("confirm_dialog"))) { return } if(!confirm(Diaspora.I18n.t("confirm_dialog"))) { return }