Вычищение старых конструкций PHP + многочисленная доводка по мелочи.
[mpd-web.git] / ajax / mpd.js
index fec89c6fcae9fcd79c28c7ccb6fad82591983baf..1be85a64af41c57b16f48fca915edb6ba6174e51 100644 (file)
@@ -130,6 +130,39 @@ req.send();
 
 }
 
+function SavePlayList() {
+
+var name=window.prompt('List name','');
+
+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();
+
+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();