From 1a882d4adf6307dfbd764ae6aaf1a62a724851f1 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 4 Aug 2015 10:55:51 -0400 Subject: rearrange stuff and stub in chat --- public/js/lib/chat.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 public/js/lib/chat.js (limited to 'public/js/lib/chat.js') diff --git a/public/js/lib/chat.js b/public/js/lib/chat.js new file mode 100644 index 0000000..946954b --- /dev/null +++ b/public/js/lib/chat.js @@ -0,0 +1,27 @@ +var ChatView = View.extend({ + + template: $("#collaborator-template").html(), + + events: { + "submit form": "send" + }, + + initialize: function(){ + this.$msg = this.$("#message") + this.$messages = this.$("#messages") + }, + + add: function(msg){ + var $el = $( this.template ) + $el.find(".nick").html(msg.nick) + $el.find(".msg").html(msg.msg) + }, + + send: function(){ + }, + + empty: function(){ + this.$messages.empty() + } + +}) -- cgit v1.2.3-70-g09d2