Mercurial > prosody-modules
annotate mod_admin_web/admin_web/www_files/js/main.js @ 294:5a619d6045a8
mod_admin_web: Prepare for adding more features
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Thu, 23 Dec 2010 22:40:58 +0100 |
parents | a9e69088e678 |
children | a70284e01453 |
rev | line source |
---|---|
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
1 var BOSH_SERVICE = 'http://localhost:5280/http-bind/'; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
2 var show_log = false; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
3 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
4 Strophe.addNamespace('S2SPUBSUB', 'http://prosody.im/streams/s2s'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
5 Strophe.addNamespace('PUBSUB', 'http://jabber.org/protocol/pubsub'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
6 Strophe.addNamespace('CAPS', 'http://jabber.org/protocol/caps'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
7 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
8 var localJID = null; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
9 var connection = null; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
10 |
292
a9e69088e678
mod_adhoc_web: Put pubsubHost into js from lua. Compat with util.pubsub changes
Florian Zeitz <florob@babelmonkeys.de>
parents:
288
diff
changeset
|
11 var pubsubHost = '%PUBSUBHOST%'; |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
12 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
13 function log(msg) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
14 var entry = $('<div></div>').append(document.createTextNode(msg)); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
15 $('#log').append(entry); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
16 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
17 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
18 function rawInput(data) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
19 log('RECV: ' + data); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
20 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
21 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
22 function rawOutput(data) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
23 log('SENT: ' + data); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
24 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
25 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
26 function _cbNewS2S(e) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
27 var items, retract, id, jid; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
28 items = e.getElementsByTagName('item'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
29 for (i = 0; i < items.length; i++) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
30 id = items[i].attributes['id'].value; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
31 jid = items[i].getElementsByTagName('session')[0].attributes['jid'].value; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
32 if (items[i].getElementsByTagName('out')[0]) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
33 $('#s2sout').append('<li id="' + id + '">' + jid + '</li>'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
34 } else { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
35 $('#s2sin').append('<li id="' + id + '">' + jid + '</li>'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
36 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
37 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
38 retract = e.getElementsByTagName('retract')[0]; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
39 if (retract) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
40 id = retract.attributes['id'].value; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
41 $('#' + id).remove(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
42 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
43 return true; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
44 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
45 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
46 function onConnect(status) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
47 if (status == Strophe.Status.CONNECTING) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
48 log('Strophe is connecting.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
49 } else if (status == Strophe.Status.CONNFAIL) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
50 log('Strophe failed to connect.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
51 showConnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
52 } else if (status == Strophe.Status.DISCONNECTING) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
53 log('Strophe is disconnecting.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
54 } else if (status == Strophe.Status.DISCONNECTED) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
55 log('Strophe is disconnected.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
56 showConnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
57 } else if (status == Strophe.Status.AUTHFAIL) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
58 log('Authentication failed'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
59 if (connection) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
60 connection.disconnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
61 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
62 } else if (status == Strophe.Status.CONNECTED) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
63 log('Strophe is connected.'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
64 showDisconnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
65 connection.send($iq({to: pubsubHost, type: 'set', id: connection.getUniqueId()}).c('pubsub', {xmlns: Strophe.NS.PUBSUB}) |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
66 .c('subscribe', {node: Strophe.NS.S2SPUBSUB, jid: connection.jid})); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
67 connection.addHandler(_cbNewS2S, Strophe.NS.PUBSUB + '#event', 'message'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
68 connection.sendIQ($iq({to: pubsubHost, type: 'get', id: connection.getUniqueId()}).c('pubsub', {xmlns: Strophe.NS.PUBSUB}) |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
69 .c('items', {node: Strophe.NS.S2SPUBSUB}), _cbNewS2S); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
70 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
71 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
72 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
73 function showConnect() { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
74 var jid = $('#jid'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
75 var pass = $('#pass'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
76 var button = $('#connect').get(0); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
77 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
78 button.value = 'connect'; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
79 pass.show(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
80 jid.show(); |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
81 $('#menu').hide(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
82 $('#adhoc').hide(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
83 $('#s2sList').hide(); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
84 $('#cred label').show(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
85 $('#cred br').show(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
86 $('ul').empty(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
87 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
88 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
89 function showDisconnect() { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
90 var jid = $('#jid'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
91 var pass = $('#pass'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
92 var button = $('#connect').get(0); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
93 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
94 button.value = 'disconnect'; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
95 pass.hide(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
96 jid.hide(); |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
97 $('#menu').show(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
98 $('#adhoc').show(); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
99 $('#cred label').hide(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
100 $('#cred br').hide(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
101 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
102 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
103 $(document).ready(function () { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
104 connection = new Strophe.Connection(BOSH_SERVICE); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
105 if (show_log) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
106 $('#log_container').show(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
107 connection.rawInput = rawInput; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
108 connection.rawOutput = rawOutput; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
109 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
110 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
111 $("#log_toggle").click(function () { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
112 $("#log").toggle(); |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
113 }); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
114 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
115 $('#cred').bind('submit', function (event) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
116 var button = $('#connect').get(0); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
117 var jid = $('#jid'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
118 var pass = $('#pass'); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
119 localJID = jid.get(0).value; |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
120 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
121 if (button.value == 'connect') { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
122 $('#log').empty(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
123 connection.connect(localJID, |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
124 pass.get(0).value, |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
125 onConnect); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
126 } else { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
127 connection.disconnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
128 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
129 event.preventDefault(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
130 }); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
131 |
294
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
132 $('#adhocMenu').click(function () { |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
133 $('#s2sList').slideUp(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
134 $('#adhoc').slideDown(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
135 event.preventDefault(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
136 }); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
137 |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
138 $('#serverMenu').click(function () { |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
139 $('#adhoc').slideUp(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
140 $('#s2sList').slideDown(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
141 event.preventDefault(); |
5a619d6045a8
mod_admin_web: Prepare for adding more features
Florian Zeitz <florob@babelmonkeys.de>
parents:
292
diff
changeset
|
142 }); |
288
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
143 }); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
144 |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
145 window.onunload = window.onbeforeunload = function() { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
146 if (connection) { |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
147 connection.disconnect(); |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
148 } |
9233d7ee3c09
mod_admin_web: Initial PoC commit
Florian Zeitz <florob@babelmonkeys.de>
parents:
diff
changeset
|
149 } |