diaspora/public/javascripts/widgets/stream-element.js
Dan Hansen 545611fffa green?
2011-08-21 20:45:51 -05:00

26 lines
917 B
JavaScript

(function() {
var StreamElement = function() {
var self = this;
this.subscribe("widget/ready", function(evt, element) {
self.postGuid = element.attr("id");
$.extend(self, {
commentForm: self.instantiate("CommentForm", element.find("form.new_comment")),
commentStream: self.instantiate("CommentStream", element.find("ul.comments")),
embedder: self.instantiate("Embedder", element.find("div.content")),
likes: self.instantiate("Likes", element.find("div.likes_container")),
lightBox: self.instantiate("Lightbox", element),
timeAgo: self.instantiate("TimeAgo", element.find("abbr.timeago"))
});
self.globalSubscribe("post/" + self.postGuid + "/comment/added", function(evt, comment) {
self.commentStream.publish("comment/added", comment);
});
});
};
Diaspora.Widgets.StreamElement = StreamElement;
})();