blob: 13f08cefc79883465b8814fdb7758221b108073a (
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
|
var RoomView = View.extend({
events: {
},
initialize: function(name){
app.socket = ws.connect(name)
var base = this
this.name = name
this.chatView = new ChatView (socket)
this.userlist = new UserlistView (socket)
app.socket.emit("join", { nick: user.username })
app.socket.on("welcome", function(room){
room.messages.forEach(base.chat.add)
base.userlist.users = room.users
base.userlist.update()
})
app.socket.on("message", function(msg){
base.chat.add(msg)
})
}
})
|