remove button

This commit is contained in:
2026-05-21 21:12:33 +02:00
parent 5d5a70ec25
commit 691763f2e0
4 changed files with 23 additions and 16 deletions
+2
View File
@@ -51,6 +51,8 @@
ul.playlist li.selected{background:rgba(62, 165, 255, 0.305)}
ul.playlist li.pointer{background:rgba(255,255,255,0.04)}
#queue-ul li:hover {text-decoration: line-through;}
.controls{display:flex; gap:4px; margin-top:4px}
.listbox{
+9 -6
View File
@@ -214,17 +214,13 @@ function renderPlaylist() {
li.style.textDecoration = "line-through";
skipCountToRender--;
}
if (skippedIndices.includes(i)) {
li.style.textDecoration = "line-through";
}
if (skippedIndices.includes(i)) li.style.textDecoration = "line-through";
li.textContent = `${i === currentTrackIndex ? "▶ " : " "}${String(i).padStart(indexDigits, "0")}: ${displayPath}`;
ul.appendChild(li);
});
if (currentIndex !== null) {
ul.children[currentIndex]?.scrollIntoView({ block: "center", behavior: "smooth" });
}
if (currentIndex !== null) ul.children[currentIndex]?.scrollIntoView({ block: "center", behavior: "smooth" });
updateControls();
}
@@ -234,6 +230,8 @@ function renderQueue() {
queue.forEach(path => {
const li = document.createElement("li");
var c = path.replace(basePath, "");
li.dataset.line = c;
if(c.startsWith("!")) c = "(unofficial) " + c.slice(2)
else c = "(official) " + c.slice(1)
li.textContent = c;
@@ -241,6 +239,11 @@ function renderQueue() {
li.style.textDecoration = "line-through";
skipCountToRender--;
}
li.addEventListener("click", () => {
wsSend({ action: "remove_toplay", songs: [li.dataset.line] });
renderAll();
});
ul.appendChild(li);
});
updateControls();