From 993d664ba26444f713bbfcde2a5184205323be99 Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Mon, 27 Dec 2021 21:58:15 +0100 Subject: [PATCH] frontend: add support for showing raised hand Show the "hand-paper" symbol instead of the "circle" symbol while a user is raising their hand. --- static/galene.css | 4 ++++ static/galene.js | 12 ++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/static/galene.css b/static/galene.css index 736eaa92d..c0c8c41 100644 --- a/static/galene.css +++ b/static/galene.css @@ -1204,6 +1204,10 @@ header .collapse { font-weight: 900; } +#users > div.user-status-raisehand::before { + content: "\f256"; +} + .close-icon { font: normal 1em/1 Arial, sans-serif; display: inline-block; diff --git a/static/galene.js b/static/galene.js index 0ab7fd8..46e16aa 100644 --- a/static/galene.js +++ b/static/galene.js @@ -1997,15 +1997,19 @@ function addUser(id, name) { /** * @param {string} id - * @param {string} name + * @param {user} userinfo */ -function changeUser(id, name) { +function changeUser(id, userinfo) { let user = document.getElementById('user-' + id); if(!user) { console.warn('Unknown user ' + id); return; } - user.textContent = name ? name : '(anon)'; + user.textContent = userinfo.username ? userinfo.username : '(anon)'; + if (userinfo.status.raisehand) + user.classList.add('user-status-raisehand'); + else + user.classList.remove('user-status-raisehand'); } /** @@ -2034,7 +2038,7 @@ function gotUser(id, kind) { scheduleReconsiderParameters(); break; case 'change': - changeUser(id, serverConnection.users[id].username); + changeUser(id, serverConnection.users[id]); break; default: console.warn('Unknown user kind', kind);