First pass at full fork pretty much complete.
This commit is contained in:
@@ -71,6 +71,7 @@
|
||||
<h2 id="chat-history-heading" class="sr-only">Chat History</h2>
|
||||
<div id="box"></div>
|
||||
<div id="chat-announcements" role="status" aria-live="polite" aria-atomic="true" class="sr-only"></div>
|
||||
<div id="urgent-announcements" role="alert" aria-live="assertive" aria-atomic="true" class="sr-only"></div>
|
||||
<div id="audio-streams" aria-hidden="true"></div>
|
||||
<div class="reply">
|
||||
<form id="inputform">
|
||||
|
||||
+30
-2
@@ -2101,6 +2101,19 @@ function gotUserMessage(id, dest, username, time, privileged, kind, error, messa
|
||||
displayError(`${from} said: ${message}`, kind);
|
||||
break;
|
||||
}
|
||||
case 'recording': {
|
||||
if(!privileged) {
|
||||
console.error(`Got unprivileged message of kind ${kind}`);
|
||||
return;
|
||||
}
|
||||
let text = '' + message;
|
||||
if(text === 'Recording started')
|
||||
announceUrgent(text);
|
||||
else
|
||||
announceChat(text);
|
||||
displayMessage(text);
|
||||
break;
|
||||
}
|
||||
case 'mute': {
|
||||
if(!privileged) {
|
||||
console.error(`Got unprivileged message of kind ${kind}`);
|
||||
@@ -2283,9 +2296,10 @@ let lastMessage = {};
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
* @param {string} elementId
|
||||
*/
|
||||
function announceChat(text) {
|
||||
let announcement = document.getElementById('chat-announcements');
|
||||
function announceLiveRegion(text, elementId) {
|
||||
let announcement = document.getElementById(elementId);
|
||||
if(!announcement)
|
||||
return;
|
||||
|
||||
@@ -2295,6 +2309,20 @@ function announceChat(text) {
|
||||
}, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
*/
|
||||
function announceChat(text) {
|
||||
announceLiveRegion(text, 'chat-announcements');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} text
|
||||
*/
|
||||
function announceUrgent(text) {
|
||||
announceLiveRegion(text, 'urgent-announcements');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} id
|
||||
* @param {string} peerId
|
||||
|
||||
Reference in New Issue
Block a user