From 0b98f3ff8d31a2c35cce93fa51cb4d8b7bc519a4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Thu, 2 Nov 2023 20:28:34 -0400 Subject: [PATCH] index.html.in: set the service zone when the page loads --- index.html.in | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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); -- 2.44.2