home · contact · privacy
Fix oninput declaration trigger for gap lines textarea being overwritten by importing...
authorChristian Heller <c.heller@plomlompom.de>
Mon, 2 Feb 2026 05:35:22 +0000 (06:35 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Mon, 2 Feb 2026 05:35:22 +0000 (06:35 +0100)
src/templates/edit_structured.js
src/templates/taint.js

index 4e2da3e3d1cecbb0a24d064a816ce3d460012f61..1bd52e9602008382712ee9ea878f7f56600a8cee 100644 (file)
@@ -21,11 +21,11 @@ eslint
 ],
 "max-lines": [
     "error",
-    {"max": 373, "skipBlankLines": true, "skipComments": true}
+    {"max": 376, "skipBlankLines": true, "skipComments": true}
 ],
 "max-lines-per-function": [
     "error",
-    249
+    250
 ],
 "max-params": [
     "error",
@@ -448,10 +448,13 @@ const fillSink = () => {
     taintAndUpdateForm();
 };
 
-window.onload = () => {
-    document.getElementById("btn_mirror").onclick = mirror;
-    document.getElementById("btn_sink").onclick = fillSink;
-    document.getElementById("btn_replace").onclick = replace;
-    updateForm();
-};
+window.addEventListener(
+    "load",
+    () => {
+        document.getElementById("btn_mirror").onclick = mirror;
+        document.getElementById("btn_sink").onclick = fillSink;
+        document.getElementById("btn_replace").onclick = replace;
+        updateForm();
+    }
+);
 
index 92f89dc09c36a8aff56522110a5ddef2ac3741b2..59db4b3f3e79df66defd9da29dc13fcbedb3026a 100644 (file)
@@ -82,9 +82,12 @@ export const taint = () => {
         forEach((el) => { el.oninput = null; });
 };
 
-window.onload = () => {
-    Array.from(document.getElementsByClassName("tainter")).forEach(
-        (el) => { el.oninput = taint; }
-    );
-};
+window.addEventListener(
+    "load",
+    () => {
+        Array.from(document.getElementsByClassName("tainter")).forEach(
+            (el) => { el.oninput = taint; }
+        );
+    }
+);