Software /
code /
prosody-modules
Comparison
mod_admin_web/admin_web/www_files/js/main.js @ 914:fa996cfec6da
mod_admin_web: Default the host selection to the administrators domainpart
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Tue, 19 Feb 2013 23:51:28 +0100 |
parent | 614:40ab83736f6e |
child | 915:1d03dc7cf28f |
comparison
equal
deleted
inserted
replaced
913:f42837829d5f | 914:fa996cfec6da |
---|---|
118 alert("You are not an administrator"); | 118 alert("You are not an administrator"); |
119 connection.disconnect(); | 119 connection.disconnect(); |
120 return false; | 120 return false; |
121 } | 121 } |
122 for (i = 0; i < items.length; i++) { | 122 for (i = 0; i < items.length; i++) { |
123 $('#host').append('<option>' + $(items[i]).text() + '</option>'); | 123 var host = $(items[i]).text(); |
124 if (host == Strophe.getDomainFromJid(connection.jid)) { | |
125 $('#host').append('<option selected>' + host + '</option>'); | |
126 } else { | |
127 $('#host').append('<option>' + host + '</option>'); | |
128 } | |
124 } | 129 } |
125 showDisconnect(); | 130 showDisconnect(); |
126 adminsubHost = $(items[0]).text(); | 131 adminsubHost = $(items[0]).text(); |
127 adhocControl.checkFeatures(adminsubHost, | 132 adhocControl.checkFeatures(adminsubHost, |
128 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) }, | 133 function () { adhocControl.getCommandNodes(function (result) { $('#adhocDisplay').empty(); $('#adhocCommands').html(result); }) }, |