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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
//config
var conf={
remote:{
base : 'http://chaos-audio-platform.riaevangelist.c9.io',
socket : '',
port : ':80'
}
};
//begin chat app code
if(!io)
document.location.reload();
var socket = io.connect(
[
conf.remote.base,
conf.remote.socket,
conf.remote.port
].join(''),
{
'max reconnection attempts':'Infinity',
'reconnection delay':1500
}
);
function init(){
var setHandle = document.getElementById('set-handle'),
roomJoin = document.getElementById('room-join'),
chatPost = document.getElementById('chat-primary-post');
var chat = new Chat(),
playlist= new PlayList(
document.getElementById('playlist')
);
setHandle.addEventListener(
'click',
chat.set.handle
);
roomJoin.addEventListener(
'click',
chat.room.join
);
chatPost.addEventListener(
'click',
chat.room.chat
);
socket.on(
'room.chat',
chat.on.room.chat
)
socket.on(
'online',
chat.on.user.online
)
socket.on(
'connect',
chat.on.connect
)
socket.on(
'playlist.add',
playlist.on.add
)
//NEED to add private chatting functionality and UI
}
window.addEventListener(
'load',
init
);
|