Adjusted for not needing to set an ip anymore

This commit is contained in:
Kristy Fournier 2026-03-04 19:50:57 -05:00
parent 66b4ce33bf
commit f6e0049229
2 changed files with 24 additions and 24 deletions

View file

@ -1,5 +1,5 @@
// set all the global stuff
let ip;
let ip = URL.parse(document.URL).host;
let alertTime = 2;
let adminPass = "";
let justSkipped = false;
@ -187,7 +187,7 @@ async function searchSongs(searchTerm){
}
image.src = currentSongInJSON["art"];
} catch(err){
image.src = "./images/placeholder.png";
image.src = "/static/images/placeholder.png";
}
image.id = String(fileName)+" image";
let head3 = document.createElement("h3");
@ -317,12 +317,12 @@ async function updateSingleSetting(data) {
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;
}
// 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;
@ -372,7 +372,7 @@ async function addToPlaylist(songObject) {
}
image.src = songObject[newItem.id]["art"];
} catch(err){
image.src = "./images/placeholder.png";
image.src = "static/images/placeholder.png";
}
image.id = String(songObject[newItem.id])+" image";
let head3 = document.createElement("h3");
@ -462,7 +462,7 @@ async function generateVisualPlaylist(conditions="") {
}
image.src = playlist[i]["art"];
} catch(err){
image.src = "./images/placeholder.png";
image.src = "/static/images/placeholder.png";
}
image.id = String(fileName)+" image";
let head3 = document.createElement("h3");
@ -648,7 +648,7 @@ document.getElementById("search-button").addEventListener('click', function(){co
document.getElementById("skip-button").addEventListener('click',function(){controlButton("sk")});
document.getElementById("go-search").addEventListener('click', function(){searchSongs(document.getElementById("songsearch").value)})
document.getElementById("songsearch").addEventListener('keydown', function(e){searchSongsEnter(e)});
document.getElementById("iptextbox").addEventListener('keydown', function(e){ipSetEnter(e)});
// document.getElementById("iptextbox").addEventListener('keydown', function(e){ipSetEnter(e)});
document.getElementById("alerttimetextbox").addEventListener('keydown', function(e){alertTimeEnter(e)});
document.getElementById("adminpasswordbox").addEventListener('keydown',function(e){adminPassEnter(e)});
document.getElementById("admincheckholder").addEventListener('click',function(e){submitPerms(e)});
@ -675,7 +675,7 @@ if (ip == null || ip=="") {
ip=getCookie("ip")
}
if (ip==null || ip==""){
ip = ""
ip = URL.parse(document.URL).host;
}
// saving the cookies (don't tell the EU)

View file

@ -3,8 +3,8 @@
<head>
<title>Jukebox Controller</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<link rel="stylesheet" href="styles.css">
<link rel="manifest" href="manifest.json" />
<link rel="stylesheet" href="/static/styles.css">
<link rel="manifest" href="/static/manifest.json" />
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-sha256/0.11.0/sha256.min.js"></script>
<!-- above allows use of sha256() on http -->
@ -12,7 +12,7 @@
</head>
<body id="test-body">
<!--Cookie Popup(does it matter if im not tracking them? i have no idea)-->
<script type="text/javascript" src="/ext/popper.js"></script><script> window.start.init({Palette:"palette2",Mode:"floating left",Theme:"classic",LinkText:" Learn More!",Message:"This website uses cookies to save necessary data to your device, and no tracking is performed.",Time:"0",})</script>
<script type="text/javascript" src="/static/ext/popper.js"></script><script> window.start.init({Palette:"palette2",Mode:"floating left",Theme:"classic",LinkText:" Learn More!",Message:"This website uses cookies to save necessary data to your device, and no tracking is performed.",Time:"0",})</script>
<div class="intro">
<h1 id="title">Jukebox Remote</h1>
@ -63,11 +63,11 @@ changes visibility with JS-->
<p class="italic">Opposite of light mode</p>
<button title="darkmode-button" id="darkmode-button">Off</button>
</div>
<div class="item">
<!-- <div class="item">
<h2 for="iptextbox">Server IP:</h2>
<p class="italic">IP of the device running the song server</p>
<input title="iptextbox" style="width:200px" type="text" id="iptextbox" enterkeyhint="Done">
</div>
</div> -->
<div class="item">
<h2 for="alerttimetextbox">Alert Time:</h2>
<p class="italic">How long alerts stay on screen for (seconds)</p>
@ -119,15 +119,15 @@ changes visibility with JS-->
</div>
<!--All the buttons are down here but settings is just doing its own thing-->
<div id="controls" class="controls">
<img tabindex=0 class="control-button" id="playlist-button" src="./images/playlist.png" alt="Playlist"></img>
<img tabindex=0 class="control-button" id="play-pause-button" src="./images/play-pause.png" alt="Play pause"></img>
<img tabindex=0 class="control-button" id="skip-button" src="./images/skip.png" alt="Skip"></img>
<img tabindex=0 class="control-button" id="search-button" src="./images/search.png" alt="Search"></img>
<img tabindex=0 class="control-button" id="playlist-button" src="/static/images/playlist.png" alt="Playlist"></img>
<img tabindex=0 class="control-button" id="play-pause-button" src="/static/images/play-pause.png" alt="Play pause"></img>
<img tabindex=0 class="control-button" id="skip-button" src="/static/images/skip.png" alt="Skip"></img>
<img tabindex=0 class="control-button" id="search-button" src="/static/images/search.png" alt="Search"></img>
</div>
<div class="settings-button-holder">
<img tabindex=0 class="settings-button control-button" id="settings-button" src="./images/settings.png" alt="settings"></img>
<img tabindex=0 class="settings-button control-button" id="settings-button" src="/static/images/settings.png" alt="settings"></img>
</div>
<script src="/ext/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="scripts.js"></script>
<script src="/static/ext/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="/static/scripts.js"></script>
</body>
</html>