chiark / gitweb /
webstead: JavaScript is not Perl
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 11 Oct 2025 23:48:41 +0000 (00:48 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Tue, 13 Jan 2026 21:42:18 +0000 (21:42 +0000)
Remove some braces accordingly.

webstead.xhtml

index cc276eecd652c83ce90ed9d6e6a5248b3b57569b..8188f78098bd545b96cbca777a05c2f237be8c19 100644 (file)
             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);
         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();
-        }
     });
 ]]>
     </script>