Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authordanielgrippi <danielgrippi@gmail.com>2011-07-09 02:29:58 +0400
committerRaphael Sofaer <raphael@joindiaspora.com>2011-07-12 02:02:46 +0400
commit797a6f5ca9cf18a5bff22cefe04eeb191d6a990e (patch)
tree5a0110b52fa5a2f967a649bd8bc62fc2aabbbf35 /public
parent2e15b6a61e44f0bdd98f7b25473164eb3f38ebae (diff)
like comments js response wip
Diffstat (limited to 'public')
-rw-r--r--public/javascripts/content-updater.js11
-rw-r--r--public/javascripts/view.js2
-rw-r--r--public/javascripts/web-socket-receiver.js11
-rw-r--r--public/stylesheets/sass/application.sass12
4 files changed, 14 insertions, 22 deletions
diff --git a/public/javascripts/content-updater.js b/public/javascripts/content-updater.js
index 0f1e115c7..c9b074cc8 100644
--- a/public/javascripts/content-updater.js
+++ b/public/javascripts/content-updater.js
@@ -4,14 +4,11 @@
*/
var ContentUpdater = {
- elementWithGuid: function(selector, guid) {
- return $(selector + "[data-guid='" + guid + "']");
- },
addPostToStream: function(html) {
var streamElement = $(html);
- var postId = streamElement.attr("data-guid");
+ var postId = streamElement.id;
- if($(".stream_element[data-guid='" + postId + "']").length === 0) {
+ if($(".stream_element#" + postId).length === 0) {
if($("#no_posts").length) {
$("#no_posts").detach();
}
@@ -27,7 +24,7 @@ var ContentUpdater = {
},
addLikesToPost: function(postId, html) {
- var post = ContentUpdater.elementWithGuid("div", postId);
+ var post = $("div#" + postId);
$(".likes_container", post)
.fadeOut("fast")
@@ -35,4 +32,4 @@ var ContentUpdater = {
.fadeIn("fast");
}
-}; \ No newline at end of file
+};
diff --git a/public/javascripts/view.js b/public/javascripts/view.js
index 4ae588bb6..90b7d500e 100644
--- a/public/javascripts/view.js
+++ b/public/javascripts/view.js
@@ -79,7 +79,7 @@ var View = {
/* notification routing */
$("#notification").delegate('.hard_object_link', 'click', function(evt){
- var post = $("*[data-guid='"+ $(this).attr('data-ref') +"']"),
+ var post = $("#"+ $(this).attr('data-ref')),
lastComment = post.find('.comment.posted').last();
if(post.length > 0){
diff --git a/public/javascripts/web-socket-receiver.js b/public/javascripts/web-socket-receiver.js
index ddd36e354..17dd6e62b 100644
--- a/public/javascripts/web-socket-receiver.js
+++ b/public/javascripts/web-socket-receiver.js
@@ -77,7 +77,7 @@ var WebSocketReceiver = {
},
processRetraction: function(post_id){
- $("*[data-guid='" + post_id + "']").fadeOut(400, function() {
+ $("#" + post_id).fadeOut(400, function() {
$(this).remove();
});
if($("#main_stream")[0].childElementCount === 0) {
@@ -87,9 +87,9 @@ var WebSocketReceiver = {
processComment: function(postId, commentId, html, opts) {
- if( $(".comment[data-guid='"+commentId+"']").length === 0 ) {
+ if( $("#"+commentId).length === 0 ) {
- var post = $("*[data-guid='"+postId+"']'"),
+ var post = $("#"+postId),
prevComments = $('.comment.posted', post);
if(prevComments.length > 0) {
@@ -123,9 +123,8 @@ var WebSocketReceiver = {
Diaspora.widgets.directionDetector.updateBinds();
},
- processLike: function(postId, html) {
- var post = $("*[data-guid='"+postId+"']");
- $('.likes', post).html(html);
+ processLike: function(targetGUID, html) {
+ $('.likes', "#" + targetGUID).first().html(html);
},
processPost: function(className, postId, html, aspectIds) {
diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass
index 8e318cf08..b9892254a 100644
--- a/public/stylesheets/sass/application.sass
+++ b/public/stylesheets/sass/application.sass
@@ -302,10 +302,10 @@ ul.as-selections
:height 370px
:width 500px
- time
- :font
- :weight normal
- :size smaller
+ .comment
+ .comment_info
+ :font
+ :size smaller
.from
a
@@ -667,10 +667,6 @@ form.new_comment
:display inline-block
-.comments
- .timeago
- :color #999
-
.stream.show
ul.comments
li