Hopefully present chalkboard to people without write permissions in a cleaner format.

This commit is contained in:
Storm Dragon
2026-06-23 01:33:35 -04:00
parent 6cd3ec1601
commit 0d2bd1cf1f
5 changed files with 20 additions and 8 deletions
+4 -1
View File
@@ -845,9 +845,12 @@ h1 {
border: 1px solid #767676;
border-radius: 2px;
font-family: monospace;
margin: 0;
overflow: auto;
padding: 2px;
}
#chalkboard-view-text {
margin: 0;
white-space: pre-wrap;
}
+3 -1
View File
@@ -79,7 +79,9 @@
<div id="chalkboard-area">
<h2 id="chalkboard-heading">Virtual chalkboard</h2>
<textarea id="chalkboard" aria-labelledby="chalkboard-heading" hidden></textarea>
<pre id="chalkboard-view" tabindex="0" role="region" aria-labelledby="chalkboard-heading" hidden></pre>
<div id="chalkboard-view" tabindex="0" aria-labelledby="chalkboard-heading" hidden>
<pre id="chalkboard-view-text"></pre>
</div>
<button id="chalkboard-copy" type="button" class="btn btn-default" disabled>Copy to clipboard</button>
</div>
</div>
+8 -3
View File
@@ -2650,6 +2650,7 @@ function flushLiveRegion(elementId) {
let text = state.queue.shift();
if(text === undefined) {
announcement.replaceChildren();
state.active = false;
return;
}
@@ -2690,6 +2691,10 @@ function getChalkboardView() {
return document.getElementById('chalkboard-view');
}
function getChalkboardViewText() {
return document.getElementById('chalkboard-view-text');
}
/**
* @param {string} text
*/
@@ -2700,9 +2705,9 @@ function setChalkboardText(text) {
if(editor && editor.value !== text)
editor.value = text;
let view = getChalkboardView();
if(view && view.textContent !== text)
view.textContent = text;
let viewText = getChalkboardViewText();
if(viewText && viewText.textContent !== text)
viewText.textContent = text;
}
function chalkboardHasFocus() {