comparison 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
comparison
equal deleted inserted replaced
538:de64963d8e7a 539:99465bbfa205
136 }); 136 });
137 } 137 }
138 } 138 }
139 139
140 function showConnect() { 140 function showConnect() {
141 var jid = $('#jid'); 141 $('#pass').show();
142 var pass = $('#pass'); 142 $('#jid').show();
143 var button = $('#connect').get(0); 143 $('#login').show();
144
145 button.value = 'connect';
146 pass.show();
147 jid.show();
148 $('#menu').hide(); 144 $('#menu').hide();
149 $('#right').hide(); 145 $('#main').hide();
150 $('#cred label').show();
151 $('#cred br').show();
152 $('#s2sin').empty(); 146 $('#s2sin').empty();
153 $('#s2sout').empty(); 147 $('#s2sout').empty();
154 $('#c2s').empty(); 148 $('#c2s').empty();
155 $('#host').empty(); 149 $('#host').empty();
156 } 150 }
157 151
158 function showDisconnect() { 152 function showDisconnect() {
159 var jid = $('#jid'); 153 $('#jid').hide();
160 var pass = $('#pass'); 154 $('#pass').hide();
161 var button = $('#connect').get(0);
162
163 button.value = 'disconnect';
164 pass.hide();
165 jid.hide();
166 $('#menu').show();
167 $('#right').show();
168 $('#adhoc').show();
169 $('#s2sList').hide(); 155 $('#s2sList').hide();
170 $('#c2sList').hide(); 156 $('#c2sList').hide();
171 $('#cred label').hide(); 157 $('#login').hide();
172 $('#cred br').hide(); 158
159 $('#menu').show();
160 $('#main').show();
161 $('#adhoc').show();
173 } 162 }
174 163
175 $(document).ready(function () { 164 $(document).ready(function () {
176 connection = new Strophe.Connection(BOSH_SERVICE); 165 connection = new Strophe.Connection(BOSH_SERVICE);
177 if (show_log) { 166 if (show_log) {
188 var button = $('#connect').get(0); 177 var button = $('#connect').get(0);
189 var jid = $('#jid'); 178 var jid = $('#jid');
190 var pass = $('#pass'); 179 var pass = $('#pass');
191 localJID = jid.get(0).value; 180 localJID = jid.get(0).value;
192 181
193 if (button.value == 'connect') { 182 $('#log').empty();
194 $('#log').empty(); 183 connection.connect(localJID, pass.get(0).value, onConnect);
195 connection.connect(localJID, pass.get(0).value, onConnect); 184 event.preventDefault();
196 } else { 185 });
197 connection.disconnect(); 186
198 } 187 $('#logout').click(function (event) {
199 event.preventDefault(); 188 connection.disconnect();
189 event.preventDefault();
200 }); 190 });
201 191
202 $('#adhocMenu').click(function (event) { 192 $('#adhocMenu').click(function (event) {
203 $('#s2sList').slideUp(); 193 $('#s2sList').slideUp();
204 $('#c2sList').slideUp(); 194 $('#c2sList').slideUp();