From: Michael Orlitzky Date: Wed, 1 Nov 2023 18:08:07 +0000 (-0400) Subject: index.html.in: support changing the service id via querystring X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=fe64fd48133a3d77a824615ab1534971825189e9;p=charm-bypass.git index.html.in: support changing the service id via querystring --- diff --git a/index.html.in b/index.html.in index 74fa30a..345c432 100644 --- a/index.html.in +++ b/index.html.in @@ -257,6 +257,21 @@ } + /******************************/ + /* 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 */ /****************************************/ @@ -393,6 +408,9 @@ /* 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);