Mercurial > prosody-modules
diff mod_admin_web/admin_web/www_files/js/main.js @ 539:99465bbfa205
First pass of web-admin redesign
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Tue, 10 Jan 2012 19:16:28 +0100 |
parents | 8cb21ef24e5d |
children | f0ef6e285d69 |
line wrap: on
line diff
--- a/mod_admin_web/admin_web/www_files/js/main.js Sun Jan 08 17:25:34 2012 +0000 +++ b/mod_admin_web/admin_web/www_files/js/main.js Tue Jan 10 19:16:28 2012 +0100 @@ -138,17 +138,11 @@ } function showConnect() { - var jid = $('#jid'); - var pass = $('#pass'); - var button = $('#connect').get(0); - - button.value = 'connect'; - pass.show(); - jid.show(); + $('#pass').show(); + $('#jid').show(); + $('#login').show(); $('#menu').hide(); - $('#right').hide(); - $('#cred label').show(); - $('#cred br').show(); + $('#main').hide(); $('#s2sin').empty(); $('#s2sout').empty(); $('#c2s').empty(); @@ -156,20 +150,15 @@ } function showDisconnect() { - var jid = $('#jid'); - var pass = $('#pass'); - var button = $('#connect').get(0); - - button.value = 'disconnect'; - pass.hide(); - jid.hide(); - $('#menu').show(); - $('#right').show(); - $('#adhoc').show(); + $('#jid').hide(); + $('#pass').hide(); $('#s2sList').hide(); $('#c2sList').hide(); - $('#cred label').hide(); - $('#cred br').hide(); + $('#login').hide(); + + $('#menu').show(); + $('#main').show(); + $('#adhoc').show(); } $(document).ready(function () { @@ -190,15 +179,16 @@ var pass = $('#pass'); localJID = jid.get(0).value; - if (button.value == 'connect') { - $('#log').empty(); - connection.connect(localJID, pass.get(0).value, onConnect); - } else { - connection.disconnect(); - } + $('#log').empty(); + connection.connect(localJID, pass.get(0).value, onConnect); event.preventDefault(); }); + $('#logout').click(function (event) { + connection.disconnect(); + event.preventDefault(); + }); + $('#adhocMenu').click(function (event) { $('#s2sList').slideUp(); $('#c2sList').slideUp();