put all initializations together

This commit is contained in:
filifa 2025-12-11 23:49:35 -05:00
parent 9efbe26cdd
commit 6d9b095778
1 changed files with 4 additions and 4 deletions

View File

@ -51,10 +51,6 @@ function evaluate() {
}, 500); }, 500);
} }
const expr = document.querySelector("#expr");
let selectionStart = 0;
let selectionEnd = 0;
function setupExprInput() { function setupExprInput() {
selectionStart = expr.selectionStart; selectionStart = expr.selectionStart;
selectionEnd = expr.selectionEnd; selectionEnd = expr.selectionEnd;
@ -121,6 +117,10 @@ function switchInputs(enabled) {
document.querySelector("#modulus").disabled = !enabled; document.querySelector("#modulus").disabled = !enabled;
} }
const expr = document.querySelector("#expr");
let selectionStart = 0;
let selectionEnd = 0;
let timeoutId = null; let timeoutId = null;
const worker = new Worker("./workers/compute.js"); const worker = new Worker("./workers/compute.js");
worker.addEventListener("message", (message) => { worker.addEventListener("message", (message) => {