comparison 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
comparison
equal deleted inserted replaced
293:d76f47a608ab 294:5a619d6045a8
76 var button = $('#connect').get(0); 76 var button = $('#connect').get(0);
77 77
78 button.value = 'connect'; 78 button.value = 'connect';
79 pass.show(); 79 pass.show();
80 jid.show(); 80 jid.show();
81 $('.container').hide(); 81 $('#menu').hide();
82 $('#adhoc').hide();
83 $('#s2sList').hide();
82 $('#cred label').show(); 84 $('#cred label').show();
83 $('#cred br').show(); 85 $('#cred br').show();
84 $('ul').empty(); 86 $('ul').empty();
85 } 87 }
86 88
90 var button = $('#connect').get(0); 92 var button = $('#connect').get(0);
91 93
92 button.value = 'disconnect'; 94 button.value = 'disconnect';
93 pass.hide(); 95 pass.hide();
94 jid.hide(); 96 jid.hide();
95 $('.container').show(); 97 $('#menu').show();
98 $('#adhoc').show();
96 $('#cred label').hide(); 99 $('#cred label').hide();
97 $('#cred br').hide(); 100 $('#cred br').hide();
98 } 101 }
99 102
100 $(document).ready(function () { 103 $(document).ready(function () {
105 connection.rawOutput = rawOutput; 108 connection.rawOutput = rawOutput;
106 } 109 }
107 110
108 $("#log_toggle").click(function () { 111 $("#log_toggle").click(function () {
109 $("#log").toggle(); 112 $("#log").toggle();
110 }); 113 });
111 114
112 $('#cred').bind('submit', function (event) { 115 $('#cred').bind('submit', function (event) {
113 var button = $('#connect').get(0); 116 var button = $('#connect').get(0);
114 var jid = $('#jid'); 117 var jid = $('#jid');
115 var pass = $('#pass'); 118 var pass = $('#pass');
124 connection.disconnect(); 127 connection.disconnect();
125 } 128 }
126 event.preventDefault(); 129 event.preventDefault();
127 }); 130 });
128 131
132 $('#adhocMenu').click(function () {
133 $('#s2sList').slideUp();
134 $('#adhoc').slideDown();
135 event.preventDefault();
136 });
137
138 $('#serverMenu').click(function () {
139 $('#adhoc').slideUp();
140 $('#s2sList').slideDown();
141 event.preventDefault();
142 });
129 }); 143 });
130 144
131 window.onunload = window.onbeforeunload = function() { 145 window.onunload = window.onbeforeunload = function() {
132 if (connection) { 146 if (connection) {
133 connection.disconnect(); 147 connection.disconnect();