remove jingle button

This commit is contained in:
2026-05-23 17:27:43 +02:00
parent efc71d0691
commit ff7fcb0ffd
2 changed files with 6 additions and 8 deletions
-1
View File
@@ -254,7 +254,6 @@
<div style="margin-top:8px; display: flex; gap: 8px;"> <div style="margin-top:8px; display: flex; gap: 8px;">
<button id="add-to-queue-btn" class="btn primary" style="flex: 1;">Add to Bottom ▼</button> <button id="add-to-queue-btn" class="btn primary" style="flex: 1;">Add to Bottom ▼</button>
<button id="add-to-queue2-btn" class="btn primary" style="flex: 1;">Add to Top ▲</button> <button id="add-to-queue2-btn" class="btn primary" style="flex: 1;">Add to Top ▲</button>
<button id="add-as-jingle-btn" class="btn primary" style="flex: 1;">Add as Jingle 🕭 to Bottom</button>
</div> </div>
</div> </div>
</div> </div>
+6 -7
View File
@@ -354,13 +354,13 @@ function selectPlaylistItem(i, el) {
updateControls(); updateControls();
} }
function addSelectedFileToQueue(top, jingle) { function addSelectedFileToQueue(top) {
let fullPath = null; let fullPath = null;
if (selectedPlaylistPath != null) { if (selectedPlaylistPath != null) {
const selected = playlist.find(t => t.path === selectedPlaylistPath); const selected = playlist.find(t => t.path === selectedPlaylistPath);
if (!selected) return false; if (!selected) return false;
const path = ((selected.official || !jingle) ? "" : "!") + selected.path; const path = (selected.official ? "" : "!") + selected.path;
wsSend({ action: "add_to_toplay", songs: [path], top }); wsSend({ action: "add_to_toplay", songs: [path], top });
clearListSelections("playlist-ul"); clearListSelections("playlist-ul");
selectedPlaylistPath = null; selectedPlaylistPath = null;
@@ -379,7 +379,7 @@ function addSelectedFileToQueue(top, jingle) {
} }
if (fullPath) { if (fullPath) {
wsSend({ action: "add_to_toplay", songs: [(jingle ? "!" : "") + fullPath], top }); wsSend({ action: "add_to_toplay", songs: [fullPath], top });
// Dir/subdir selections are intentionally preserved here // Dir/subdir selections are intentionally preserved here
return true; return true;
} }
@@ -430,13 +430,12 @@ document.getElementById("clear-btn").addEventListener("click", e => {
wsSend({ action: "clear_toplay" }); wsSend({ action: "clear_toplay" });
}); });
document.getElementById("add-to-queue-btn").addEventListener("click", () => addSelectedFileToQueue(false, false)); document.getElementById("add-to-queue-btn").addEventListener("click", () => addSelectedFileToQueue(false));
document.getElementById("add-to-queue2-btn").addEventListener("click", () => addSelectedFileToQueue(true, false)); document.getElementById("add-to-queue2-btn").addEventListener("click", () => addSelectedFileToQueue(true));
document.getElementById("add-as-jingle-btn").addEventListener("click", () => addSelectedFileToQueue(false, true));
document.addEventListener("keydown", e => { document.addEventListener("keydown", e => {
if (e.target.tagName === "INPUT") return; if (e.target.tagName === "INPUT") return;
if (e.key === "Enter" && addSelectedFileToQueue(e.shiftKey, false)) e.preventDefault(); if (e.key === "Enter" && addSelectedFileToQueue(e.shiftKey)) e.preventDefault();
else if (e.key === "s") wsSend({ action: "skip" }); else if (e.key === "s") wsSend({ action: "skip" });
else if (e.key === "n") wsSend({ action: "skipc", add: 1 }); else if (e.key === "n") wsSend({ action: "skipc", add: 1 });
else if (e.key === "m") wsSend({ action: "skipc", remove: -1 }); else if (e.key === "m") wsSend({ action: "skipc", remove: -1 });