From 96f2490058074ca0cbebc43bf7cab63a3797d9f3 Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Sun, 12 Oct 2025 00:48:41 +0100 Subject: [PATCH] webstead: JavaScript is not Perl Remove some braces accordingly. --- webstead.xhtml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/webstead.xhtml b/webstead.xhtml index cc276ee..8188f78 100644 --- a/webstead.xhtml +++ b/webstead.xhtml @@ -51,16 +51,13 @@ var arg = 0; for (var pixel of row.querySelectorAll('input')) { arg *= 2; - if (pixel.checked) { - arg += 1 - } + if (pixel.checked) arg += 1 } args.push(arg.toString()); cstr += "\\" + arg.toString(8).padStart(2, "0"); } - if (c_update_needed) { + if (c_update_needed) document.getElementById("c").value = ` {"${cstr}", U() },`; - } Bedstead({ arguments: args, print: function(charstring) { @@ -81,9 +78,7 @@ document.querySelector('#inpane').reset(); for (row of document.querySelector('#pixels').rows) { match = re.exec(c); - if (match == null) { - break; - } + if (match == null) break; rowbits = Number.parseInt(match[0], 8); for (var pixel of Array.from(row.querySelectorAll('input')).reverse()) { @@ -94,9 +89,8 @@ update_glyph(); } function init() { - for (var e of document.querySelectorAll('#pixels input')) { + for (var e of document.querySelectorAll('#pixels input')) e.onchange = e => update_glyph(true); - } document.querySelector('#c').oninput = function(e) { from_c(this.value); update_glyph(false); @@ -107,11 +101,10 @@ Bedstead = module.default; // This script is loaded asynchronously, so make sure the DOM is // loaded before touching it. - if (document.readyState === "loading") { + if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init); - } else { + else init(); - } }); ]]> -- 2.30.2