summaryrefslogtreecommitdiff
path: root/public/js/lib/chat.js
blob: 6c227eb3e550eeedbc8b9d92509f0b063af2da70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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(){
    var msg = {}
    msg.room = room.name()
    msg.msg = 
    // app.socket.send("message", msg)
  },
  
  empty: function(){
    this.$messages.empty()
  }

})