]> gitweb.michael.orlitzky.com - charm-bypass.git/blobdiff - index.html.in
index.html.in: support changing the service name via querystring
[charm-bypass.git] / index.html.in
index f3281226abcc81388559a794719d42af922f1ced..d1e0be72b18e314d7936425570909baa0581635c 100644 (file)
@@ -81,7 +81,7 @@
           url("data:font/woff2;base64,@CBPBOLD@") format("woff2")
       }
 
-      #serviceletter {
+      #serviceid {
         font-family: "CharmBypass Bold", sans-serif;
         font-weight: bold;
       }
       }
 
 
+      /******************************/
+      /* 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 the service name */
+      /******************************/
+      function set_service_id() {
+        const sid = document.getElementById("servicename");
+
+       /* Get the "servicename" from the querystring if it's there */
+        let params = new URLSearchParams(document.location.search);
+        if (params.get("servicename")) {
+          sid.textContent = params.get("servicename");
+        }
+
+       /* Otherwise, leave it at "BaltimoreLink" */
+      }
+
       /****************************************/
       /* 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 service name when the page has loaded */
+      window.addEventListener("load", set_service_name);
+
       /* Set the security code text when the page has loaded */
       window.addEventListener("load", set_code);