diff options
author | danielgrippi <danielgrippi@gmail.com> | 2011-07-09 07:01:07 +0400 |
---|---|---|
committer | Raphael Sofaer <raphael@joindiaspora.com> | 2011-07-12 02:05:55 +0400 |
commit | d364f158b8c08700a468b3fd28bbc1169a70bb67 (patch) | |
tree | 0bd32789ca74b6f9d5cac38d4eef190131dfa083 /public | |
parent | e0bbde4ce2ba16d8a8dab0787803f8178e2126f4 (diff) |
cache counters in for likes. pending Diaspora::Likeable module...
Diffstat (limited to 'public')
-rw-r--r-- | public/javascripts/content-updater.js | 10 | ||||
-rw-r--r-- | public/javascripts/web-socket-receiver.js | 7 |
2 files changed, 11 insertions, 6 deletions
diff --git a/public/javascripts/content-updater.js b/public/javascripts/content-updater.js index c9b074cc8..028670c65 100644 --- a/public/javascripts/content-updater.js +++ b/public/javascripts/content-updater.js @@ -6,9 +6,9 @@ var ContentUpdater = { addPostToStream: function(html) { var streamElement = $(html); - var postId = streamElement.id; + var postGUID = streamElement.id; - if($(".stream_element#" + postId).length === 0) { + if($("#"+postGUID).length === 0) { if($("#no_posts").length) { $("#no_posts").detach(); } @@ -17,14 +17,14 @@ var ContentUpdater = { streamElement.find("label").inFieldLabels(); }); - Diaspora.widgets.publish("stream/postAdded", [postId]); + Diaspora.widgets.publish("stream/postAdded", [postGUID]); Diaspora.widgets.timeago.updateTimeAgo(); Diaspora.widgets.directionDetector.updateBinds(); } }, - addLikesToPost: function(postId, html) { - var post = $("div#" + postId); + addLikesToPost: function(postGUID, html) { + var post = $("#" + postGUID); $(".likes_container", post) .fadeOut("fast") diff --git a/public/javascripts/web-socket-receiver.js b/public/javascripts/web-socket-receiver.js index e7f32eeb2..1ae0db45a 100644 --- a/public/javascripts/web-socket-receiver.js +++ b/public/javascripts/web-socket-receiver.js @@ -33,7 +33,12 @@ var WebSocketReceiver = { WebSocketReceiver.processPerson(obj); } else { - WSR.debug("got a " + obj['class'] + " for aspects " + obj.aspect_ids); + debug_string = "got a " + obj['class']; + if(obj.aspect_ids !== undefined){ + debug_string += " for aspects " + obj.aspect_ids; + } + + WSR.debug(debug_string); if (obj['class']=="retractions") { WebSocketReceiver.processRetraction(obj.post_id); |