diff client.js @ 42:fe59565063af

mathieui: Add our current JID in the top bar.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 23 May 2020 18:41:45 +0200
parents bd343ef0942f
children 8b69b3a1ef8e
line wrap: on
line diff
--- a/client.js
+++ b/client.js
@@ -118,6 +118,12 @@ document.addEventListener('DOMContentLoa
 
     function onConnected()
     {
+        const new_node = document.createElementNS('http://www.w3.org/1999/xhtml', 'span');
+        const parent_node = connect.parentNode;
+        const text = document.createTextNode('Logged in as ' + connection.authzid + ' ');
+        new_node.appendChild(text);
+        parent_node.insertBefore(new_node, connect);
+
         jid_element.hidden = true;
         pass_element.hidden = true;
         connected_div.hidden = false;