From db8da45ab6e7467a58501d434e1ca2ebc92c0dbf Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Wed, 1 Nov 2023 14:10:32 -0400 Subject: [PATCH] index.html.in: support changing the service name via querystring --- index.html.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/index.html.in b/index.html.in index 345c432..d1e0be7 100644 --- a/index.html.in +++ b/index.html.in @@ -272,6 +272,21 @@ /* 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 */ /****************************************/ @@ -411,6 +426,9 @@ /* 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); -- 2.44.2