Fix Skald accessibility audit issues
This commit is contained in:
+13
-15
@@ -265,7 +265,7 @@ function reflectSettings() {
|
|||||||
/** @type {AudioContext} */
|
/** @type {AudioContext} */
|
||||||
let notificationAudioContext = null;
|
let notificationAudioContext = null;
|
||||||
let userNotificationSoundsReady = false;
|
let userNotificationSoundsReady = false;
|
||||||
let notificationSoundGainScale = 7.5;
|
let notificationSoundGainScale = 15;
|
||||||
|
|
||||||
function notificationSoundsEnabled() {
|
function notificationSoundsEnabled() {
|
||||||
return !!getSettings().notificationSounds;
|
return !!getSettings().notificationSounds;
|
||||||
@@ -1835,22 +1835,20 @@ function setUserStatus(id, elt, userinfo, notify) {
|
|||||||
elt.textContent = username;
|
elt.textContent = username;
|
||||||
|
|
||||||
let wasRaised = elt.classList.contains('user-status-raisehand');
|
let wasRaised = elt.classList.contains('user-status-raisehand');
|
||||||
let isRemote = id !== (serverConnection && serverConnection.id);
|
|
||||||
if(userinfo.data.raisehand) {
|
if(userinfo.data.raisehand) {
|
||||||
elt.classList.add('user-status-raisehand');
|
elt.classList.add('user-status-raisehand');
|
||||||
elt.setAttribute('aria-label', `${username} (hand raised)`);
|
elt.setAttribute('aria-label', `${username} (hand raised)`);
|
||||||
if(notify && !wasRaised) {
|
if(notify && !wasRaised) {
|
||||||
let announcement = document.getElementById('chat-announcements');
|
announceUrgent(`${username} raised their hand`);
|
||||||
if(announcement && isRemote) {
|
|
||||||
announcement.textContent = `${username} raised their hand`;
|
|
||||||
}
|
|
||||||
playNotificationSound('hand-raised');
|
playNotificationSound('hand-raised');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
elt.classList.remove('user-status-raisehand');
|
elt.classList.remove('user-status-raisehand');
|
||||||
elt.setAttribute('aria-label', username);
|
elt.setAttribute('aria-label', username);
|
||||||
if(notify && wasRaised)
|
if(notify && wasRaised) {
|
||||||
|
announceUrgent(`${username} lowered their hand`);
|
||||||
playNotificationSound('hand-lowered');
|
playNotificationSound('hand-lowered');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let microphone=false;
|
let microphone=false;
|
||||||
@@ -3623,9 +3621,12 @@ function setAccessibleHidden(elt, hidden) {
|
|||||||
function openNav() {
|
function openNav() {
|
||||||
let sidebarnav = document.getElementById("sidebarnav");
|
let sidebarnav = document.getElementById("sidebarnav");
|
||||||
let openside = document.getElementById("openside");
|
let openside = document.getElementById("openside");
|
||||||
|
let closeside = document.getElementById("closeside");
|
||||||
sidebarnav.style.width = "250px";
|
sidebarnav.style.width = "250px";
|
||||||
setAccessibleHidden(sidebarnav, false);
|
setAccessibleHidden(sidebarnav, false);
|
||||||
openside.setAttribute("aria-expanded", "true");
|
openside.setAttribute("aria-expanded", "true");
|
||||||
|
if(closeside)
|
||||||
|
closeside.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeNav() {
|
function closeNav() {
|
||||||
@@ -3688,6 +3689,7 @@ document.getElementById('close-chat').onclick = function(e) {
|
|||||||
setVisibility('left', false);
|
setVisibility('left', false);
|
||||||
setVisibility('show-chat', true);
|
setVisibility('show-chat', true);
|
||||||
resizePeers();
|
resizePeers();
|
||||||
|
document.getElementById('show-chat').focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
document.getElementById('close-chat').onkeydown = function(e) {
|
document.getElementById('close-chat').onkeydown = function(e) {
|
||||||
@@ -3696,6 +3698,7 @@ document.getElementById('close-chat').onkeydown = function(e) {
|
|||||||
setVisibility('left', false);
|
setVisibility('left', false);
|
||||||
setVisibility('show-chat', true);
|
setVisibility('show-chat', true);
|
||||||
resizePeers();
|
resizePeers();
|
||||||
|
document.getElementById('show-chat').focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3704,6 +3707,7 @@ document.getElementById('show-chat').onclick = function(e) {
|
|||||||
setVisibility('left', true);
|
setVisibility('left', true);
|
||||||
setVisibility('show-chat', false);
|
setVisibility('show-chat', false);
|
||||||
resizePeers();
|
resizePeers();
|
||||||
|
document.getElementById('close-chat').focus();
|
||||||
};
|
};
|
||||||
|
|
||||||
document.getElementById('show-chat').onkeydown = function(e) {
|
document.getElementById('show-chat').onkeydown = function(e) {
|
||||||
@@ -3712,6 +3716,7 @@ document.getElementById('show-chat').onkeydown = function(e) {
|
|||||||
setVisibility('left', true);
|
setVisibility('left', true);
|
||||||
setVisibility('show-chat', false);
|
setVisibility('show-chat', false);
|
||||||
resizePeers();
|
resizePeers();
|
||||||
|
document.getElementById('close-chat').focus();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -3809,12 +3814,6 @@ document.addEventListener('keydown', function(e) {
|
|||||||
{'raisehand': isRaised ? null : true}
|
{'raisehand': isRaised ? null : true}
|
||||||
);
|
);
|
||||||
|
|
||||||
// Announce the action
|
|
||||||
let announcement = document.getElementById('chat-announcements');
|
|
||||||
if(announcement) {
|
|
||||||
announcement.textContent = isRaised ? 'Hand lowered' : 'Hand raised';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Focus on user's name button in the user list (delayed to ensure announcement is read)
|
// Focus on user's name button in the user list (delayed to ensure announcement is read)
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
let userButton = document.getElementById('user-' + serverConnection.id);
|
let userButton = document.getElementById('user-' + serverConnection.id);
|
||||||
@@ -3832,8 +3831,7 @@ document.addEventListener('keydown', function(e) {
|
|||||||
let showChatButton = document.getElementById('show-chat');
|
let showChatButton = document.getElementById('show-chat');
|
||||||
let closeChatButton = document.getElementById('close-chat');
|
let closeChatButton = document.getElementById('close-chat');
|
||||||
|
|
||||||
// Check if chat is currently visible
|
let isChatVisible = leftPanel && !leftPanel.classList.contains('invisible');
|
||||||
let isChatVisible = leftPanel && leftPanel.style.display !== 'none';
|
|
||||||
|
|
||||||
if(isChatVisible) {
|
if(isChatVisible) {
|
||||||
// Collapse chat
|
// Collapse chat
|
||||||
|
|||||||
Reference in New Issue
Block a user