From 49d50462ab92a1000d674aaa34e4b49418bc8f24 Mon Sep 17 00:00:00 2001 From: Kristy Fournier <124598538+kristy-fournier@users.noreply.github.com> Date: Thu, 6 Mar 2025 11:24:06 -0500 Subject: [PATCH] made the qrcode generator a function its now called when the ip is changed too, so you don't need to refresh --- Client/index.html | 1 + Client/scripts.js | 31 ++++++++++++++----------------- Client/styles.css | 7 +++++++ 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/Client/index.html b/Client/index.html index c2f2400..b56f759 100644 --- a/Client/index.html +++ b/Client/index.html @@ -86,6 +86,7 @@ changes visibility with JS-->
Hit settings icon to refresh the code
+Version 1.0.0
diff --git a/Client/scripts.js b/Client/scripts.js index bf0f463..e543aa6 100644 --- a/Client/scripts.js +++ b/Client/scripts.js @@ -164,17 +164,11 @@ function ipSetter(){ alertText("Your IP is now set to "+ipBox+" at port 19054 (Default)") } } + qrCodeGenerate() } -async function checkSettings(skipServer=false) { - //check client stuff first so if the server doesn't exist it can still be changed and seen - if (ip.slice(-5)=="19054") { - // don't show the port if it is the default - document.getElementById("iptextbox").value = ip.slice(0,-6) - } else { - document.getElementById("iptextbox").value = ip; - } +function qrCodeGenerate() { let tempURL = "http://" + document.location.href.split("/")[2] + "/?ip=" + ip; document.getElementById("qrcode").innerHTML = "" new QRCode(document.getElementById("qrcode"), { @@ -185,6 +179,17 @@ async function checkSettings(skipServer=false) { colorLight : "#eeeeee", correctLevel : QRCode.CorrectLevel.H }); +} + +async function checkSettings(skipServer=false) { + //check client stuff first so if the server doesn't exist it can still be changed and seen + if (ip.slice(-5)=="19054") { + // don't show the port if it is the default + document.getElementById("iptextbox").value = ip.slice(0,-6) + } else { + document.getElementById("iptextbox").value = ip; + } + qrCodeGenerate() document.getElementById("alerttimetextbox").value = alertTime partyButtonState = document.getElementById("partymode-button").innerHTML; x = await getFromServer({setting: "getsettings"}, "settings"); @@ -361,12 +366,4 @@ if (alertTime == "") { document.cookie = "alertTime="+alertTime+"; path=/;" } // this is the code that makes the qr code at the very start -let tempURL = "http://" + document.location.href.split("/")[2] + "/?ip=" + ip; -new QRCode(document.getElementById("qrcode"), { -text: tempURL, -width: 256, -height: 256, -colorDark : "#000000", -colorLight : "#eeeeee", -correctLevel : QRCode.CorrectLevel.H -}); \ No newline at end of file +qrCodeGenerate() \ No newline at end of file diff --git a/Client/styles.css b/Client/styles.css index bfcd94d..a00db3b 100644 --- a/Client/styles.css +++ b/Client/styles.css @@ -172,6 +172,13 @@ h4 { border-bottom: 0; } +.versionNumber { + font-size: 8px; + font-style: italic; + text-align: left; + width: 80%; +} + #volumerange { background-color: #4477AA; color: #4477ff;