Удаление списков.
[mpd-web.git] / ajax / mpd.js
index fec89c6fcae9fcd79c28c7ccb6fad82591983baf..37176039def197a4fce50871e54939d3b518628a 100644 (file)
@@ -130,6 +130,41 @@ req.send();
 
 }
 
+function SavePlayList() {
+
+var name=window.prompt('Имя списка','');
+
+var req = new XMLHttpRequest();
+
+req.onreadystatechange = function () {
+  if (this.readyState != 4 || this.status != 200) return;
+  if (this.responseText != 'OK') {
+    window.alert(this.responseText);
+  }
+};
+
+req.open("GET", "ajax/save.php?item="+name, true);
+req.send();
+
+}
+
+function DelPlayList(item) {
+
+var req = new XMLHttpRequest();
+
+//if (! window.alert("Удалить список "+item+"?")) return;
+
+req.onreadystatechange = function () {
+  if (this.readyState != 4 || this.status != 200) return;
+  RefreshPageStatus();
+  LoadPlayList();
+};
+
+req.open("GET", "ajax/playlist-command.php?task=dellist&item="+item, true);
+req.send();
+
+}
+
 function RefreshPageContent() {
 
   RefreshPageStatus();