# HG changeset patch # User Emmanuel Gil Peyrot # Date 1545498420 -3600 # Node ID 8724e28ccbd797b4bed3e9a92b323be25de40708 # Parent 139b223dafb0869fd756961539a38e71dbd74a8a Improve styling. diff --git a/avatar.js b/avatar.js --- a/avatar.js +++ b/avatar.js @@ -112,7 +112,7 @@ function initAvatar(connection) { function onAvatarDataUpload(iq) { console.log('Avatar successfully uploaded!', iq); - avatar_change.disabled = true; + avatar_change.hidden = true; avatar_size.innerHTML = ''; spinner_img.hidden = true; } @@ -151,7 +151,7 @@ function initAvatar(connection) { .map(b => b.toString(16).padStart(2, "0")) .join("")); avatar_data.id = sha1; - avatar_change.disabled = false; + avatar_change.hidden = false; } sha1_reader.readAsArrayBuffer(file); }); diff --git a/client.js b/client.js --- a/client.js +++ b/client.js @@ -23,7 +23,7 @@ document.addEventListener('DOMContentLoa } connect_button.addEventListener('click', function (evt) { - if (connect_button.value == 'connect') { + if (!connect_button.classList.contains('disconnect')) { const jid = jid_element.value; getBOSHService(jid).then((bosh_service) => { connection = new Strophe.Connection(bosh_service); @@ -72,7 +72,8 @@ document.addEventListener('DOMContentLoa { if (status == Strophe.Status.CONNECTING) { console.log('Strophe is connecting.'); - connect_button.value = 'disconnect'; + connect_button.value = 'Log out'; + connect_button.classList.add('disconnect'); jid_element.disabled = true; pass_element.disabled = true; spinner_img.hidden = false; @@ -93,6 +94,8 @@ document.addEventListener('DOMContentLoa function onConnected() { + jid_element.hidden = true; + pass_element.hidden = true; connected_div.hidden = false; spinner_img.hidden = true; initRoster(connection); @@ -103,8 +106,11 @@ document.addEventListener('DOMContentLoa function onDisconnected() { - connect_button.value = 'connect'; + connect_button.value = 'Log in'; + connect_button.classList.remove('disconnect'); + jid_element.hidden = false; jid_element.disabled = false; + pass_element.hidden = false; pass_element.disabled = false; spinner_img.hidden = true; connected_div.hidden = true; diff --git a/index.xhtml b/index.xhtml --- a/index.xhtml +++ b/index.xhtml @@ -40,9 +40,9 @@
-
-
- + + +
@@ -50,46 +50,94 @@