MS DH fixed like sizes, everywhere
This commit is contained in:
parent
864233eb63
commit
bc465848c9
4 changed files with 79 additions and 4 deletions
|
|
@ -62,9 +62,6 @@
|
|||
= button_to t('.delete_photo'), @photo, :confirm => t('are_you_sure'), :method => :delete
|
||||
|
||||
.span-16.prepend-4.append-4.last
|
||||
%h5
|
||||
= t('_comments')
|
||||
|
||||
#photo_stream.stream.show
|
||||
// TODO(likes)
|
||||
/- if (defined?(current_user) && !current_user.liked?(@parent))
|
||||
|
|
|
|||
43
public/javascripts/widgets/post.js
Normal file
43
public/javascripts/widgets/post.js
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/* Copyright (c) 2011, Diaspora Inc. This file is
|
||||
* licensed under the Affero General Public License version 3 or later. See
|
||||
* the COPYRIGHT file.
|
||||
*/
|
||||
|
||||
(function() {
|
||||
var Post = function() {
|
||||
this.likesSelector = ".like_it, .dislike_it";
|
||||
this.expandLikesSelector = "a.expand_likes, a.expand_dislikes";
|
||||
this.start = function() {
|
||||
//timeago
|
||||
//set up ikes
|
||||
//comments
|
||||
//audio video links
|
||||
//embedder
|
||||
//
|
||||
|
||||
|
||||
this.setUpLikes();
|
||||
};
|
||||
|
||||
this.setUpLikes = function() {
|
||||
$(this.expandLikesSelector).live("click", function(evt) {
|
||||
evt.preventDefault();
|
||||
$(this).siblings(".likes_list")
|
||||
.fadeToggle("fast");
|
||||
});
|
||||
|
||||
var likeIt = $(this.likesSelector);
|
||||
|
||||
likeIt.live("ajax:loading", function() {
|
||||
$(this).parent().fadeOut("fast");
|
||||
});
|
||||
|
||||
likeIt.live("ajax:failure", function() {
|
||||
Diaspora.widgets.alert.alert(Diaspora.widgets.i18n.t("failed_to_like"));
|
||||
$(this).parent().fadeIn("fast");
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
Diaspora.widgets.add("post", Post);
|
||||
})();
|
||||
|
|
@ -2346,7 +2346,7 @@ ul.show_comments,
|
|||
.likes_container
|
||||
> *
|
||||
:font
|
||||
:size smaller
|
||||
:size 8px
|
||||
:weight bold
|
||||
|
||||
img
|
||||
|
|
|
|||
35
spec/javascripts/widgets/post-spec.js
Normal file
35
spec/javascripts/widgets/post-spec.js
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
/* Copyright (c) 2011, Diaspora Inc. This file is
|
||||
* licensed under the Affero General Public License version 3 or later. See
|
||||
* the COPYRIGHT file.
|
||||
*/
|
||||
|
||||
describe("Diaspora", function() {
|
||||
describe("widgets", function() {
|
||||
describe("post", function() {
|
||||
describe("start", function() {
|
||||
it("should set up like on initialize", function() {
|
||||
spyOn(Diaspora.widgets.post, "setUpLikes");
|
||||
Diaspora.widgets.post.start();
|
||||
expect(Diaspora.widgets.post.setUpLikes).toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
describe("setUpLikes", function() {
|
||||
it("adds a listener for the click event on a.expand_likes", function() {
|
||||
spyOn(window, "$").andCallThrough();
|
||||
Diaspora.widgets.post.start();
|
||||
expect($).toHaveBeenCalledWith(Diaspora.widgets.post.expandLikesSelector);
|
||||
$.reset();
|
||||
});
|
||||
|
||||
it("adds a listener for ajax:success and ajax:failure", function() {
|
||||
spyOn(window, "$").andCallThrough();
|
||||
Diaspora.widgets.post.start();
|
||||
expect($).toHaveBeenCalledWith(Diaspora.widgets.post.likesSelector);
|
||||
$.reset();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in a new issue