comparison mod_admin_web/admin_web/www_files/js/main.js @ 1020:9839198539c8

mod_admin_web: Fix indentation
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 24 May 2013 15:46:23 +0200
parents 7cba8be42d9e
children 83f56d3a07f5
comparison
equal deleted inserted replaced
1019:7cba8be42d9e 1020:9839198539c8
125 for (i = 0; i < items.length; i++) { 125 for (i = 0; i < items.length; i++) {
126 var host = $(items[i]).text(); 126 var host = $(items[i]).text();
127 $('<option/>').text(host).prop('selected', host == domainpart).appendTo('#host'); 127 $('<option/>').text(host).prop('selected', host == domainpart).appendTo('#host');
128 } 128 }
129 showDisconnect(); 129 showDisconnect();
130 adminsubHost = $(items[0]).text(); 130 adminsubHost = $('#host').val();
131 adhocControl.checkFeatures(adminsubHost, 131 adhocControl.checkFeatures(adminsubHost,
132 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) }, 132 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) },
133 function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); }); 133 function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); });
134 connection.addHandler(_cbAdminSub, Strophe.NS.ADMINSUB + '#event', 'message'); 134 connection.addHandler(_cbAdminSub, Strophe.NS.ADMINSUB + '#event', 'message');
135 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) 135 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
136 .c('subscribe', {node: Strophe.NS.C2SSTREAM})); 136 .c('subscribe', {node: Strophe.NS.C2SSTREAM}));
137 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) 137 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
138 .c('subscribe', {node: Strophe.NS.S2SSTREAM})); 138 .c('subscribe', {node: Strophe.NS.S2SSTREAM}));
180 var button = $('#connect').get(0); 180 var button = $('#connect').get(0);
181 var jid = $('#jid'); 181 var jid = $('#jid');
182 var pass = $('#pass'); 182 var pass = $('#pass');
183 localJID = jid.get(0).value; 183 localJID = jid.get(0).value;
184 184
185 $('#log').empty(); 185 $('#log').empty();
186 connection.connect(localJID, pass.get(0).value, onConnect); 186 connection.connect(localJID, pass.get(0).value, onConnect);
187 event.preventDefault(); 187 event.preventDefault();
188 }); 188 });
189 189
190 $('#logout').click(function (event) { 190 $('#logout').click(function (event) {
191 connection.disconnect(); 191 connection.disconnect();
192 event.preventDefault(); 192 event.preventDefault();
193 }); 193 });
194 194
195 $('#adhocMenu, #serverMenu, #clientMenu').click(function (event) { 195 $('#adhocMenu, #serverMenu, #clientMenu').click(function (event) {
196 event.preventDefault(); 196 event.preventDefault();
197 var tab = $(this).attr('href'); 197 var tab = $(this).attr('href');
198 $('#main > div').hide(); 198 $('#main > div').hide();
199 $(tab).fadeIn('fast'); 199 $(tab).fadeIn('fast');
200 }); 200 });
201 201
202 $('#host').bind('change', function (event) { 202 $('#host').bind('change', function (event) {
203 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) 203 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
204 .c('unsubscribe', {node: Strophe.NS.C2SSTREAM})); 204 .c('unsubscribe', {node: Strophe.NS.C2SSTREAM}));
205 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) 205 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
206 .c('unsubscribe', {node: Strophe.NS.S2SSTREAM})); 206 .c('unsubscribe', {node: Strophe.NS.S2SSTREAM}));
207 adminsubHost = $(this).val(); 207 adminsubHost = $(this).val();
208 adhocControl.checkFeatures(adminsubHost, 208 adhocControl.checkFeatures(adminsubHost,
209 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) }, 209 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) },
210 function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); }); 210 function () { $('#adhocCommands').empty(); $('#adhocDisplay').html('<p>This host does not support commands</p>'); });
211 $('#s2sin').empty(); 211 $('#s2sin').empty();
212 $('#s2sout').empty(); 212 $('#s2sout').empty();
213 $('#c2s').empty(); 213 $('#c2s').empty();
214 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB}) 214 connection.send($iq({to: adminsubHost, type: 'set', id: connection.getUniqueId()}).c('adminsub', {xmlns: Strophe.NS.ADMINSUB})
215 .c('subscribe', {node: Strophe.NS.C2SSTREAM})); 215 .c('subscribe', {node: Strophe.NS.C2SSTREAM}));