| | |
| | | } |
| | | }; |
| | | |
| | | this.addSelectedTitel = function() { |
| | | var elem = document.querySelector(".selected"); |
| | | var titelName = elem.textContent; |
| | | var album = elem.attributes.album.nodeValue; |
| | | var interpret = elem.attributes.interpret.nodeValue; |
| | | var anzName = elem.attributes.titelAnzName.nodeValue; |
| | | var titel; |
| | | if(self.mediaPfad.endsWith('/')) { |
| | | titel = new Titel(titelName, self.mediaPfad, self.ortPfad, interpret, anzName, album); |
| | | } else { |
| | | titel = new Titel(titelName, self.mediaPfad + '/', self.ortPfad, interpret, anzName, album); |
| | | } |
| | | var plname = document.querySelector('#playlist').value; |
| | | self.http_put('../api/alist/' + plname, JSON.stringify(titel), function(responseText) { |
| | | self.meldung_mit_timeout(responseText, 1500); |
| | | /* |
| | | * url: '../api/store/Ablageort/liste/' |
| | | * tpl: "data/tpl/ablageort_liste.tpl" |
| | | * storeUrl: '../api/store/Ablageort/' |
| | | * formFunc: "self.ablageort_form" |
| | | * cb: etwas wie |
| | | * |
| | | * function(responseText){ |
| | | * var ablageort = JSON.parse(responseText); |
| | | * self.ablageort_form(ablageort); |
| | | * }); |
| | | */ |
| | | this.entitaet_liste = function(listUrl, tpl, storeUrl, formFunc, cb) { |
| | | self.reset_top_buttons(); |
| | | self.http_get(listUrl, function (responseText) { |
| | | self.vorlage_laden_und_fuellen(tpl, JSON.parse(responseText), function (html) { |
| | | document.querySelector(".zentraler-inhalt").innerHTML = html; |
| | | self.addEvtListener('.entity-eintrag', 'click', function (event) { |
| | | var t = event.target; |
| | | self.http_get(storeUrl + t.textContent, cb); |
| | | }); |
| | | //self.addEvtListener('#neu-btn', 'click', function (event) { |
| | | self.addEvtListener('#top-neu-btn', 'click', function(event) { |
| | | eval(formFunc + "(this)"); |
| | | }); |
| | | }); |
| | | }); |
| | | }; |
| | | |
| | | this.ablageort_liste = function() { |
| | | self.entitaet_liste('../api/store/Ablageort/liste/', |
| | | "data/tpl/ablageort_liste.tpl", '../api/store/Ablageort/', |
| | | "self.ablageort_form", function(responseText) { |
| | | var ablageort = JSON.parse(responseText); |
| | | self.ablageort_form(ablageort); |
| | | }); |
| | | /* |
| | | self.reset_top_buttons(); |
| | | self.http_get('../api/store/Ablageort/liste/', function (responseText) { |
| | | self.vorlage_laden_und_fuellen("data/tpl/ablageort_liste.tpl", JSON.parse(responseText), function (html) { |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | */ |
| | | }; |
| | | |
| | | this.prefs_liste = function() { |
| | | self.entitaet_liste('../api/store/Einstellung/liste/', |
| | | "data/tpl/einstellung_liste.tpl", '../api/store/Einstellung/', |
| | | "self.prefs_form", function(responseText) { |
| | | var einstellung = JSON.parse(responseText); |
| | | self.prefs_form(einstellung); |
| | | }); |
| | | /* |
| | | self.reset_top_buttons(); |
| | | self.http_get('../api/store/Einstellung/liste/', function (responseText) { |
| | | self.vorlage_laden_und_fuellen("data/tpl/einstellung_liste.tpl", JSON.parse(responseText), function (html) { |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | */ |
| | | }; |
| | | |
| | | this.abspieler_liste = function() { |
| | | self.entitaet_liste('../api/store/Abspieler/liste/', |
| | | "data/tpl/abspieler_liste.tpl", '../api/store/Abspieler/', |
| | | "self.abspieler_form", function(responseText) { |
| | | var abspieler = JSON.parse(responseText); |
| | | self.abspieler_form(abspieler); |
| | | }); |
| | | /* |
| | | self.http_get('../api/store/Abspieler/liste/', function (responseText) { |
| | | self.vorlage_laden_und_fuellen("data/tpl/abspieler_liste.tpl", JSON.parse(responseText), function (html) { |
| | | document.querySelector(".zentraler-inhalt").innerHTML = html; |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | */ |
| | | }; |
| | | |
| | | this.abspielliste_liste = function() { |
| | | self.entitaet_liste('../api/store/Abspielliste/liste/', |
| | | "data/tpl/abspielliste_liste.tpl", '../api/store/Abspielliste/', |
| | | "self.abspielliste_form", function(responseText) { |
| | | var abspielliste = JSON.parse(responseText); |
| | | self.abspielliste_form(abspielliste); |
| | | }); |
| | | /* |
| | | self.http_get('../api/store/Abspielliste/liste/', function (responseText) { |
| | | self.vorlage_laden_und_fuellen("data/tpl/abspielliste_liste.tpl", JSON.parse(responseText), function (html) { |
| | | document.querySelector(".zentraler-inhalt").innerHTML = html; |
| | |
| | | }); |
| | | }); |
| | | }); |
| | | */ |
| | | }; |
| | | |
| | | /* -------------------- Entitaets-Formulare ------------------ */ |
| | |
| | | const form = document.querySelector('form'); |
| | | form.addEventListener('submit', function(event) { |
| | | self.handle_submit(event, al.name, '../api/store/Abspielliste/', '#abspielliste-name', function() { |
| | | self.abspielliste_auswahl_fuellen(); |
| | | self.abspielliste_liste(); |
| | | }); |
| | | }); |
| | |
| | | const form = document.querySelector('form'); |
| | | form.addEventListener('submit', function(event) { |
| | | self.handle_submit(event, pl.key, '../api/store/Abspieler/', '#abspieler-name', function() { |
| | | self.abspieler_auswahl_fuellen(); |
| | | self.abspieler_liste(); |
| | | }); |
| | | }); |
| | |
| | | }); |
| | | }; |
| | | |
| | | this.addSelectedTitel = function() { |
| | | var elem = document.querySelector(".selected"); |
| | | var titelName = elem.textContent; |
| | | var album = elem.attributes.album.nodeValue; |
| | | var interpret = elem.attributes.interpret.nodeValue; |
| | | var anzName = elem.attributes.titelAnzName.nodeValue; |
| | | var titel; |
| | | if(self.mediaPfad.endsWith('/')) { |
| | | titel = new Titel(titelName, self.mediaPfad, self.ortPfad, interpret, anzName, album); |
| | | } else { |
| | | titel = new Titel(titelName, self.mediaPfad + '/', self.ortPfad, interpret, anzName, album); |
| | | } |
| | | var plname = document.querySelector('#playlist').value; |
| | | self.http_put('../api/alist/' + plname, JSON.stringify(titel), function(responseText) { |
| | | self.meldung_mit_timeout(responseText, 1500); |
| | | }); |
| | | }; |
| | | |
| | | /* Unterer Einblendbereich */ |
| | | |
| | | this.dialog_unten_zeigen = function() { |