]> gitweb.michael.orlitzky.com - charm-bypass.git/commitdiff
index.html.in: support changing the service id via querystring
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 1 Nov 2023 18:08:07 +0000 (14:08 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 1 Nov 2023 18:08:07 +0000 (14:08 -0400)
index.html.in

index 74fa30a117d961f54f277a1e662fa67963c27d4e..345c432b5d591b325f2aa5c39000a19392e44fe7 100644 (file)
       }
 
 
+      /******************************/
+      /* Set the service identifier */
+      /******************************/
+      function set_service_id() {
+        const sid = document.getElementById("serviceid");
+
+       /* Get the "serviceid" from the querystring if it's there */
+        let params = new URLSearchParams(document.location.search);
+        if (params.get("serviceid")) {
+          sid.textContent = params.get("serviceid");
+        }
+
+       /* Otherwise, leave it at "F" */
+      }
+
       /****************************************/
       /* Set and reposition the security code */
       /****************************************/
       /* Re-center the ticket when the window is resized */
       window.addEventListener("resize", center_ticket);
 
+      /* Set the service identifier when the page has loaded */
+      window.addEventListener("load", set_service_id);
+
       /* Set the security code text when the page has loaded */
       window.addEventListener("load", set_code);