From fe64fd48133a3d77a824615ab1534971825189e9 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 1 Nov 2023 14:08:07 -0400 Subject: [PATCH] index.html.in: support changing the service id via querystring --- index.html.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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); -- 2.44.2