From: Michael Orlitzky Date: Fri, 3 Nov 2023 00:28:34 +0000 (-0400) Subject: index.html.in: set the service zone when the page loads X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=0b98f3ff8d31a2c35cce93fa51cb4d8b7bc519a4;p=charm-bypass.git index.html.in: set the service zone when the page loads --- diff --git a/index.html.in b/index.html.in index 1b1eaba..5004842 100644 --- a/index.html.in +++ b/index.html.in @@ -435,6 +435,23 @@ /* Otherwise, leave it at "BaltimoreLink" */ } + + /************************/ + /* Set the service zone */ + /************************/ + function set_service_zone() { + const z = document.getElementById("zone"); + + /* Get the "zone" from the querystring if it's there */ + const params = new URLSearchParams(document.location.search); + if (params.get("zone")) { + z.textContent = params.get("zone"); + z.style.display = "block"; /* It's hidden by default */ + } + + /* Otherwise, leave it blank (and hidden) */ + } + /***********************************************************/ /* Resize the ticket background based on the service name */ /***********************************************************/ @@ -711,6 +728,9 @@ /* Set the service name when the page has loaded */ window.addEventListener("load", set_service_name); + /* Set the service zone when the page has loaded */ + window.addEventListener("load", set_service_zone); + /* Resize the ticket background if necessary */ window.addEventListener("load", resize_ticket);