mirror of
https://bjh21.me.uk/bedstead/.git
synced 2026-08-09 01:40:28 -04:00
webstead: JavaScript is not Perl
Remove some braces accordingly.
This commit is contained in:
parent
4457cf5107
commit
96f2490058
@ -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();
|
||||
}
|
||||
});
|
||||
]]>
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user