From 34c03f5eff6aa63917b3ab74cc69ce80691e8f41 Mon Sep 17 00:00:00 2001 From: ulrich <ulrich@ulrich-vaio> Date: Mon, 26 Apr 2021 21:52:10 +0000 Subject: [PATCH] Weiterspielen repariert --- www/ui/js/app.js | 22 ++++++++++++++++------ 1 files changed, 16 insertions(+), 6 deletions(-) diff --git a/www/ui/js/app.js b/www/ui/js/app.js index 7f91809..af2c49d 100644 --- a/www/ui/js/app.js +++ b/www/ui/js/app.js @@ -309,7 +309,7 @@ this.ablageort_form = function(ort) { self.entitaet_form('Katalog', ort, ort.name, "data/tpl/form_ablageort.txt", '../api/store/Ablageort/', - '#ablageort-name', function() { + '#ablageort-name', 'name', function() { self.ablageort_liste(); }); }; @@ -358,9 +358,7 @@ self.addEvtListener('#pause-btn', 'click', function() { self.kommando('pause'); }); - self.addEvtListener('#weiter-btn', 'click', function() { - self.kommando('weiter'); - }); + self.addEvtListener('#weiter-btn', 'click', self.weiter); self.addEvtListener('#hier-btn', 'click', self.hier_spielen); @@ -408,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 + '/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 + '/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 { @@ -430,6 +428,18 @@ } }; + this.weiter = function() { + var bereichName = document.querySelector('.bereich-name').textContent; + if(bereichName === '') { + 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.meldung_mit_timeout(responseText, 1500); + }); + } + }; + this.kommando = function(kommando) { var abs = document.querySelector('#abspieler').value; self.http_get('../api/strg/' + abs + '/' + kommando, function(responseText) { -- Gitblit v1.9.3