diff options
Diffstat (limited to 'public/js/lib/chat.js')
| -rw-r--r-- | public/js/lib/chat.js | 27 |
1 files changed, 27 insertions, 0 deletions
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() + } + +}) |
