diff --git a/modules/web.html b/modules/web.html
index 201a4fa..4ee11c2 100644
--- a/modules/web.html
+++ b/modules/web.html
@@ -118,7 +118,8 @@
-
+
+
@@ -419,7 +420,7 @@
document.getElementById("clear-btn").addEventListener("click", () => {ws.send(JSON.stringify({action:"clear_toplay"}))});
- function addSelectedFileToQueue() {
+ function addSelectedFileToQueue(top) {
let fullPath = null;
if(selectedPlaylistIndex != null) {
@@ -451,13 +452,14 @@
}
if (fullPath && ws && ws.readyState === WebSocket.OPEN) {
- ws.send(JSON.stringify({ action:"add_to_toplay", songs:[fullPath] }));
+ ws.send(JSON.stringify({ action:"add_to_toplay", songs:[fullPath], on_top: top}));
return true;
}
return false;
}
- document.getElementById("add-to-queue-btn").addEventListener("click", addSelectedFileToQueue);
+ document.getElementById("add-to-queue-btn").addEventListener("click", addSelectedFileToQueue, false);
+ document.getElementById("add-to-queue2-btn").addEventListener("click", addSelectedFileToQueue, true);
function updateControls() {
document.getElementById("clear-btn").disabled =
@@ -468,7 +470,7 @@
if (e.target.tagName === "INPUT") return;
if (e.key === "Enter") {
- const added = addSelectedFileToQueue();
+ const added = addSelectedFileToQueue(false);
if (added) e.preventDefault();
}
if (e.key === "s") ws.send(JSON.stringify({action:"skip"}));