[dingus] Status and loading and whatnot

This commit is contained in:
John Doty 2024-09-30 22:28:50 -07:00
parent aaa28f6d7f
commit 361f470431
4 changed files with 40 additions and 12 deletions

View file

@ -1,6 +1,8 @@
let pending_grammar = null;
let next_grammar = null;
const STATUS = document.getElementById("status-line");
function submit_grammar(code) {
if (pending_grammar) {
console.log("Grammar still pending, parking it");
@ -16,6 +18,8 @@ const worker = new Worker('worker.js');
worker.onmessage = (e) => {
const message = e.data;
if (message.kind === "grammar_status") {
STATUS.innerText = message.message;
if ((message.status === "ok") || (message.status === "error")) {
pending_grammar = null;
if (next_grammar) {