Mercurial > xmpp-account-manager
annotate client.js @ 39:faf2283e2bd6
mathieui: Add a margin around the navtabs.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Sat, 23 May 2020 18:03:05 +0200 |
parents | d9da5c3e305d |
children | bd343ef0942f |
rev | line source |
---|---|
0 | 1 'use strict'; |
2 | |
3 document.addEventListener('DOMContentLoaded', function () { | |
1
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
4 let connection = null; |
0 | 5 |
6 const jid_element = document.getElementById('jid'); | |
7 const pass_element = document.getElementById('pass'); | |
8 const connect_button = document.getElementById('connect'); | |
10
e47b9bd55192
Also use a spinner on nickname get/set.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
5
diff
changeset
|
9 const spinner_img = document.getElementById('connect-spinner'); |
0 | 10 |
11 const connected_div = document.getElementById('connected'); | |
12 | |
13 const avatar_img = document.getElementById('avatar'); | |
14 | |
23
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
15 const tabs = ['profile', 'mam', 'pep', 'account']; |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
16 function onHashChange() { |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
17 const hash = location.hash.substr(1); |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
18 if (!tabs.includes(hash)) |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
19 return; |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
20 for (let tab of tabs) { |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
21 const tab_name = 'tab-' + tab; |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
22 const tab_element = document.getElementById(tab_name); |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
23 if (tab == hash) { |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
24 tab_element.classList.add('active') |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
25 const content_elements = document.getElementsByClassName(tab_name); |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
26 for (let element of content_elements) |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
27 element.hidden = false; |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
28 } else { |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
29 tab_element.classList.remove('active') |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
30 const content_elements = document.getElementsByClassName(tab_name); |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
31 for (let element of content_elements) |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
32 element.hidden = true; |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
33 } |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
34 } |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
35 } |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
36 |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
37 onHashChange(); |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
38 window.addEventListener('hashchange', onHashChange); |
e99984564b17
Implement a tab system, thanks Zash!
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
17
diff
changeset
|
39 |
1
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
40 function rawInput(data) |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
41 { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
42 console.log('RECV', data); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
43 } |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
44 |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
45 function rawOutput(data) |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
46 { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
47 console.log('SENT', data); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
48 } |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
49 |
0 | 50 connect_button.addEventListener('click', function (evt) { |
13
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
51 if (!connect_button.classList.contains('disconnect')) { |
1
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
52 const jid = jid_element.value; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
53 getBOSHService(jid).then((bosh_service) => { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
54 connection = new Strophe.Connection(bosh_service); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
55 connection.rawInput = rawInput; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
56 connection.rawOutput = rawOutput; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
57 connection.connect(jid, |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
58 pass_element.value, |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
59 onConnect); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
60 }); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
61 } else if (connection != null) { |
0 | 62 connection.disconnect(); |
63 } | |
64 evt.preventDefault(); | |
65 }); | |
66 | |
1
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
67 function getBOSHService(jid) |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
68 { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
69 return new Promise((resolve, reject) => { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
70 const [nodepart, domainpart] = jid.split('@', 2); |
14
962f64b156dd
Stop hardcoding XEP-0156 file to the current domain.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
13
diff
changeset
|
71 const url = 'https://' + domainpart + '/.well-known/host-meta'; |
1
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
72 const xhr = new XMLHttpRequest(); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
73 xhr.onload = function (evt) { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
74 const xml = evt.target.responseXML; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
75 const links = parseXPath(xml, './xrd:XRD/xrd:Link', XPathResult.ORDERED_NODE_ITERATOR_TYPE); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
76 let bosh_service = null; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
77 while (true) { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
78 const link = links.iterateNext(); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
79 if (!link) |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
80 break; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
81 if (link.getAttributeNS(null, 'rel') == 'urn:xmpp:alt-connections:xbosh') { |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
82 bosh_service = link.getAttributeNS(null, 'href'); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
83 break; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
84 } |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
85 // TODO: also support WebSocket. |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
86 } |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
87 console.log('bosh_service', bosh_service); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
88 resolve(bosh_service); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
89 }; |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
90 xhr.open('GET', url); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
91 xhr.send(); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
92 }); |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
93 } |
d6df73b466f6
Implement XEP-0156 to discover the right BOSH endpoint.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
0
diff
changeset
|
94 |
0 | 95 function onConnect(status) |
96 { | |
97 if (status == Strophe.Status.CONNECTING) { | |
98 console.log('Strophe is connecting.'); | |
13
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
99 connect_button.value = 'Log out'; |
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
100 connect_button.classList.add('disconnect'); |
0 | 101 jid_element.disabled = true; |
102 pass_element.disabled = true; | |
15
3eed9fe0bd7c
End spinners with either a green ✔ or a red ✘.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
14
diff
changeset
|
103 displaySpinner(spinner_img); |
0 | 104 } else if (status == Strophe.Status.CONNFAIL) { |
105 console.log('Strophe failed to connect.'); | |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
106 onDisconnected(); |
0 | 107 } else if (status == Strophe.Status.DISCONNECTING) { |
108 console.log('Strophe is disconnecting.'); | |
15
3eed9fe0bd7c
End spinners with either a green ✔ or a red ✘.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
14
diff
changeset
|
109 displaySpinner(spinner_img); |
0 | 110 } else if (status == Strophe.Status.DISCONNECTED) { |
111 console.log('Strophe is disconnected.'); | |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
112 onDisconnected(); |
0 | 113 } else if (status == Strophe.Status.CONNECTED) { |
114 console.log('Strophe is connected.'); | |
115 onConnected(); | |
116 } | |
117 } | |
118 | |
119 function onConnected() | |
120 { | |
13
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
121 jid_element.hidden = true; |
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
122 pass_element.hidden = true; |
0 | 123 connected_div.hidden = false; |
15
3eed9fe0bd7c
End spinners with either a green ✔ or a red ✘.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
14
diff
changeset
|
124 hideSpinner(spinner_img); |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
125 initRoster(connection); |
3
5aa1bf7154b0
Add a simple PEP node viewer and editor.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
1
diff
changeset
|
126 initPEP(connection); |
0 | 127 initNickname(connection); |
128 initAvatar(connection); | |
25
d9da5c3e305d
Add support for setting some vCard4 fields.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
23
diff
changeset
|
129 initVCard(connection); |
17
07543f7f5e89
Retrieve and change the default MAM prefs.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
15
diff
changeset
|
130 initMAM(connection); |
0 | 131 } |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
132 |
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
133 function onDisconnected() |
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
134 { |
13
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
135 connect_button.value = 'Log in'; |
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
136 connect_button.classList.remove('disconnect'); |
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
137 jid_element.hidden = false; |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
138 jid_element.disabled = false; |
13
8724e28ccbd7
Improve styling.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
12
diff
changeset
|
139 pass_element.hidden = false; |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
140 pass_element.disabled = false; |
15
3eed9fe0bd7c
End spinners with either a green ✔ or a red ✘.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
14
diff
changeset
|
141 hideSpinner(spinner_img); |
12
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
142 connected_div.hidden = true; |
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
143 let table = document.getElementById('roster-table'); |
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
144 while (table.hasChildNodes()) { |
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
145 table.removeChild(table.lastChild); |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
146 } |
12
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
147 table = document.getElementById('pep-table'); |
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
148 while (table.hasChildNodes()) { |
139b223dafb0
Actually remove all of the extra data on disconnect.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
10
diff
changeset
|
149 table.removeChild(table.lastChild); |
4
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
150 } |
5e97e1808a35
Add support for the roster.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents:
3
diff
changeset
|
151 } |
0 | 152 }); |