From 9603599a1d0f161d1365fe8d0d60ce1d3133e197 Mon Sep 17 00:00:00 2001 From: ulrich Date: Tue, 27 Apr 2021 14:53:03 +0000 Subject: [PATCH] ui nach www geschoben, Steuerung daran angepasst --- www/js/app.js | 78 +++++++++++++++++++------------------- 1 files changed, 39 insertions(+), 39 deletions(-) diff --git a/www/ui/js/app.js b/www/js/app.js similarity index 91% rename from www/ui/js/app.js rename to www/js/app.js index af2c49d..ac8ada4 100644 --- a/www/ui/js/app.js +++ b/www/js/app.js @@ -44,7 +44,7 @@ this.livestream_selection = function() { document.querySelector('.breadcrumb-behaelter').textContent = ''; document.querySelector('.bereich-name').textContent = 'Livestream-Auswahl'; - self.http_get('../api/store/Livestream/liste/', function(responseText) { + self.http_get('api/store/Livestream/liste/', function(responseText) { self.html_erzeugen("data/tpl/livestream_liste.txt", JSON.parse(responseText), function (html) { document.querySelector(".zentraler-inhalt").innerHTML = html; self.addEvtListener('.entity-eintrag', 'click', function (event) { @@ -66,7 +66,7 @@ var bb = document.querySelector('.breadcrumb-behaelter'); bb.textContent = "Kataloge"; // Kataloge listen - self.http_get('../api/store/Ablageort/liste/', function (responseText) { + self.http_get('api/store/Ablageort/liste/', function (responseText) { //document.querySelector('#top-up-btn').removeEventListener('click', self.media_liste_herauf); self.html_erzeugen("data/tpl/katalog_root_liste.txt", JSON.parse(responseText), function (html) { document.querySelector(".zentraler-inhalt").innerHTML = html; @@ -74,7 +74,7 @@ var t = event.target; self.katName = t.textContent; if(self.katName !== "Livestreams") { - self.http_get('../api/store/Ablageort/' + t.textContent, function(responseText) { + self.http_get('api/store/Ablageort/' + t.textContent, function(responseText) { var ablageort = JSON.parse(responseText); self.ortPfad = ablageort.url; self.media_liste(); @@ -108,7 +108,7 @@ self.mediaPfad = neuerPfad; self.media_liste(); }); - var url = '..' + self.ortPfad + self.mediaPfad; + var url = self.ortPfad + self.mediaPfad; if(!url.endsWith('/')) { url = url + '/'; } @@ -162,13 +162,13 @@ var nameElem = event.target.parentNode.querySelector('.schalt-geraet-name'); if(nameElem.classList.contains('schalt-geraet-true')) { // ausschalten - self.http_get('../api/gstrg/geraet/' + geraetName + "/aus", function(responseText) { + self.http_get('api/gstrg/geraet/' + geraetName + "/aus", function(responseText) { // console.log(responseText); self.geraet_schalt_liste(); }); } else { // einschalten - self.http_get('../api/gstrg/geraet/' + geraetName + "/ein", function(responseText) { + self.http_get('api/gstrg/geraet/' + geraetName + "/ein", function(responseText) { // console.log(responseText); self.geraet_schalt_liste(); }); @@ -180,8 +180,8 @@ /*self.entitaet_liste('Geräte schalten','../api/store/Geraet/listealles/', "data/tpl/geraet_schalt_liste.txt", '../api/store/Geraet/', "self.form_geraet_status", function(responseText) {*/ - self.entitaet_liste('Geräte schalten','../api/store/Geraet/listealles/', - "data/tpl/geraet_schalt_liste.txt", '../api/store/Geraet/', + self.entitaet_liste('Geräte schalten','api/store/Geraet/listealles/', + "data/tpl/geraet_schalt_liste.txt", 'api/store/Geraet/', "", function(responseText) { //var geraet = JSON.parse(responseText); //self.geraet_status_form(geraet); @@ -189,8 +189,8 @@ }; this.geraet_liste = function() { - self.entitaet_liste('Geräte','../api/store/Geraet/liste/', - "data/tpl/geraet_liste.txt", '../api/store/Geraet/', + self.entitaet_liste('Geräte','api/store/Geraet/liste/', + "data/tpl/geraet_liste.txt", 'api/store/Geraet/', "self.geraet_form", function(responseText) { var geraet = JSON.parse(responseText); self.geraet_form(geraet); @@ -198,8 +198,8 @@ }; this.ablageort_liste = function() { - self.entitaet_liste('Kataloge','../api/store/Ablageort/liste/', - "data/tpl/ablageort_liste.txt", '../api/store/Ablageort/', + self.entitaet_liste('Kataloge','api/store/Ablageort/liste/', + "data/tpl/ablageort_liste.txt", 'api/store/Ablageort/', "self.ablageort_form", function(responseText) { var ablageort = JSON.parse(responseText); self.ablageort_form(ablageort); @@ -207,8 +207,8 @@ }; this.prefs_liste = function() { - self.entitaet_liste('Einstellungen','../api/store/Einstellung/liste/', - "data/tpl/einstellung_liste.txt", '../api/store/Einstellung/', + self.entitaet_liste('Einstellungen','api/store/Einstellung/liste/', + "data/tpl/einstellung_liste.txt", 'api/store/Einstellung/', "self.prefs_form", function(responseText) { var einstellung = JSON.parse(responseText); self.prefs_form(einstellung); @@ -216,8 +216,8 @@ }; this.abspieler_liste = function() { - self.entitaet_liste('Abspieler','../api/store/Abspieler/liste/', - "data/tpl/abspieler_liste.txt", '../api/store/Abspieler/', + self.entitaet_liste('Abspieler','api/store/Abspieler/liste/', + "data/tpl/abspieler_liste.txt", 'api/store/Abspieler/', "self.abspieler_form", function(responseText) { var abspieler = JSON.parse(responseText); self.abspieler_form(abspieler); @@ -225,8 +225,8 @@ }; this.livestream_liste = function() { - self.entitaet_liste('Livestreams','../api/store/Livestream/liste/', - "data/tpl/livestream_liste.txt", '../api/store/Livestream/', + self.entitaet_liste('Livestreams','api/store/Livestream/liste/', + "data/tpl/livestream_liste.txt", 'api/store/Livestream/', "self.livestream_form", function(responseText) { var livestream = JSON.parse(responseText); self.livestream_form(livestream); @@ -234,8 +234,8 @@ }; this.abspielliste_liste = function() { - self.entitaet_liste('Abspielliste','../api/store/Abspielliste/liste/', - "data/tpl/abspielliste_liste.txt", '../api/store/Abspielliste/', + self.entitaet_liste('Abspielliste','api/store/Abspielliste/liste/', + "data/tpl/abspielliste_liste.txt", 'api/store/Abspielliste/', "self.abspielliste_form", function(responseText) { //console.log("responseTest: '" + responseText + "'"); var abspielliste = JSON.parse(responseText); @@ -247,7 +247,7 @@ this.abspielliste_form = function(al) { self.entitaet_form('Abspielliste', al, al.name, - "data/tpl/form_abspielliste.txt", '../api/store/Abspielliste/', + "data/tpl/form_abspielliste.txt", 'api/store/Abspielliste/', '#abspielliste-name', 'name', function(event) { if(event !== undefined) { event.preventDefault(); @@ -259,7 +259,7 @@ this.abspieler_form = function(pl) { self.entitaet_form('Abspieler', pl, pl.key, - "data/tpl/form_abspieler.txt", '../api/store/Abspieler/', + "data/tpl/form_abspieler.txt", 'api/store/Abspieler/', '#abspieler-name', 'name', function() { self.abspieler_auswahl_fuellen(); self.abspieler_liste(); @@ -268,7 +268,7 @@ this.livestream_form = function(ls) { self.entitaet_form('Livestream', ls, ls.name, - "data/tpl/form_livestream.txt", '../api/store/Livestream/', + "data/tpl/form_livestream.txt", 'api/store/Livestream/', '#livestream-name', 'name', function() { self.livestream_liste(); }); @@ -276,7 +276,7 @@ this.geraet_form = function(ge) { self.entitaet_form('Gerät', ge, ge.name, - "data/tpl/form_geraet.txt", '../api/store/Geraet/', + "data/tpl/form_geraet.txt", 'api/store/Geraet/', '#geraet-name', 'name', function() { self.geraet_liste(); }); @@ -284,7 +284,7 @@ this.geraet_status_form = function(ge) { self.entitaet_form('Gerät', ge, ge.name, - "data/tpl/form_geraet_status.txt", '../api/store/Geraet/', + "data/tpl/form_geraet_status.txt", 'api/store/Geraet/', '#geraet-name', 'name', function() { self.geraet_schalt_liste(); }); @@ -292,7 +292,7 @@ this.prefs_form = function(k) { self.entitaet_form('Einstellung', k, k.key, - "data/tpl/form_einstellung.txt", '../api/store/Einstellung/', + "data/tpl/form_einstellung.txt", 'api/store/Einstellung/', '#einstellung-key', 'key', function() { self.prefs_liste(); }); @@ -308,7 +308,7 @@ */ this.ablageort_form = function(ort) { self.entitaet_form('Katalog', ort, ort.name, - "data/tpl/form_ablageort.txt", '../api/store/Ablageort/', + "data/tpl/form_ablageort.txt", 'api/store/Ablageort/', '#ablageort-name', 'name', function() { self.ablageort_liste(); }); @@ -323,7 +323,7 @@ }; this.abspieler_auswahl_fuellen = function() { - self.http_get('../api/store/Abspieler/liste/', function (responseText) { + self.http_get('api/store/Abspieler/liste/', function (responseText) { self.html_erzeugen("data/tpl/abs_sel.txt", JSON.parse(responseText), function (html) { document.querySelector(".abs-sel").innerHTML = html; }); @@ -331,7 +331,7 @@ }; this.abspielliste_auswahl_fuellen = function() { - self.http_get('../api/store/Abspielliste/', function (responseText) { + self.http_get('api/store/Abspielliste/', function (responseText) { self.html_erzeugen("data/tpl/pl_sel.txt", JSON.parse(responseText), function (html) { document.querySelector(".pl-sel").innerHTML = html; self.addEvtListener('#playlist', 'change', function() { @@ -386,7 +386,7 @@ document.querySelector('.bereich-name').textContent = 'Abspielliste ' + plname; var bb = document.querySelector('.breadcrumb-behaelter'); bb.textContent = ""; - self.http_get('../api/alist/' + plname, function (responseText) { + self.http_get('api/alist/' + plname, function (responseText) { self.html_erzeugen("data/tpl/titel_liste.txt", JSON.parse(responseText), function (html) { document.querySelector(".zentraler-inhalt").innerHTML = html; self.addEvtListener('.entity-eintrag', 'click', function (event) { @@ -406,14 +406,14 @@ var titel = self.titelErmitteln(document.querySelector(".selected")); var playername = document.querySelector('#abspieler').value; console.log('plname: ' + playername + ' url: ' + titel.katalogUrl + titel.pfad + titel.name); - self.http_post('../api/strg/' + playername + '/play/titel', JSON.stringify(titel), function(responseText) { + self.http_post('api/strg/' + playername + '/play/titel', JSON.stringify(titel), function(responseText) { self.meldung_mit_timeout(responseText, 1500); }); } else if(bereichName === 'Livestream-Auswahl') { var streamName = document.querySelector(".selected").textContent; var playername = document.querySelector('#abspieler').value; var stream = new Livestream(streamName, '-'); - self.http_post('../api/strg/' + playername + '/play/stream', JSON.stringify(stream), function(responseText) { + self.http_post('api/strg/' + playername + '/play/stream', JSON.stringify(stream), function(responseText) { self.meldung_mit_timeout(responseText, 1500); }); } else { @@ -422,7 +422,7 @@ console.log( "play playlist.value: " + document.querySelector('#playlist').value + ", abspieler.value: " + document.querySelector('#abspieler').value); - self.http_get('../api/strg/' + abs + '/play/liste/' + lst, function(responseText) { + self.http_get('api/strg/' + abs + '/play/liste/' + lst, function(responseText) { self.meldung_mit_timeout(responseText, 1500); }); } @@ -434,7 +434,7 @@ var titel = self.titelErmitteln(document.querySelector(".selected")); var playername = document.querySelector('#abspieler').value; console.log('plname: ' + playername + ' url: ' + titel.katalogUrl + titel.pfad + titel.name); - self.http_post('../api/strg/' + playername + '/weiter/titel', JSON.stringify(titel), function(responseText) { + self.http_post('api/strg/' + playername + '/weiter/titel', JSON.stringify(titel), function(responseText) { self.meldung_mit_timeout(responseText, 1500); }); } @@ -442,7 +442,7 @@ this.kommando = function(kommando) { var abs = document.querySelector('#abspieler').value; - self.http_get('../api/strg/' + abs + '/' + kommando, function(responseText) { + self.http_get('api/strg/' + abs + '/' + kommando, function(responseText) { self.meldung_mit_timeout(responseText, 1500); }); }; @@ -466,7 +466,7 @@ var streamName = document.querySelector(".selected").textContent; // hier den Stream-URL abrufen //GET /mz/api/store/[typname]/[name] - self.http_get('../api/store/Livestream/' + streamName, function(responseText) { + self.http_get('api/store/Livestream/' + streamName, function(responseText) { var stream = JSON.parse(responseText); url = stream.url; window.open(url); @@ -489,7 +489,7 @@ self.alleTitelEntfernen = function() { var plname = document.querySelector('#playlist').value; - self.http_delete('../api/alist/' + plname + '/alle', '', function(responseText) { + self.http_delete('api/alist/' + plname + '/alle', '', function(responseText) { // DELETE http://localhost:9090/mz/api/alist/liste1/0 //self.meldung_mit_timeout(responseText, 1500); self.titel_liste(); @@ -512,7 +512,7 @@ } */ var plname = document.querySelector('#playlist').value; - self.http_put('../api/alist/' + plname, JSON.stringify(titel), function(responseText) { + self.http_put('api/alist/' + plname, JSON.stringify(titel), function(responseText) { //self.meldung_mit_timeout(responseText, 1500); }); }; @@ -534,7 +534,7 @@ } // /mz/api/alist/[pl-name]/[nr] var plname = document.querySelector('#playlist').value; - self.http_delete('../api/alist/' + plname + '/' + index,'', function(responseText) { + self.http_delete('api/alist/' + plname + '/' + index,'', function(responseText) { // DELETE http://localhost:9090/mz/api/alist/liste1/0 //self.meldung_mit_timeout(responseText, 1500); self.titel_liste(); -- Gitblit v1.9.3