Persoenliche Mediazentrale
ulrich
2022-05-11 392dc977ae7d13188f07db1d6d865a964bb96858
www/js/app.js
@@ -4,8 +4,8 @@
  var cache; // mustache templates
  var ortPfad;
  var mediaPfad;
  var katUrl;
  var selTitel;
  //var katUrl;
  //var selTitel;
  var katName;
  this.init = function () {
@@ -38,7 +38,7 @@
    self.seitenleiste_umschalten();
    self.dialog_unten_zeigen();
  };
  /* ---------------- Entitaets-Listen ----------------- */
  
  this.livestream_selection = function() {
@@ -108,7 +108,8 @@
        self.mediaPfad = neuerPfad;
        self.media_liste();
      });
      var url = '/tango' + self.ortPfad + self.mediaPfad;
      //var url = '/tango' + self.ortPfad + self.mediaPfad;
      var url = '.' + self.ortPfad + self.mediaPfad;
      if(!url.endsWith('/')) {
        url = url + '/';
      }
@@ -373,7 +374,14 @@
      self.addEvtListener('#plst-btn', 'click', self.titel_liste);
      self.addEvtListener('#live-btn', 'click', self.livestream_selection);
      self.addEvtListener('#switch-btn', 'click', self.geraet_schalt_liste);
      self.addEvtListener('#voldn-btn', 'click', function() {
        self.kommando('voldn');
      });
      self.addEvtListener('#volup-btn', 'click', function() {
        self.kommando('volup');
      });
      self.media_liste();
    });
  };
@@ -711,15 +719,14 @@
    self.http_call('DELETE', u, data, cb);
  };
  
  this.http_call = function (method, u, data, scallback) {
  this.http_call = function (method, callurl, data, scallback) {
    var xhr = new XMLHttpRequest();
    var url = u;
    xhr.onreadystatechange = function () {
      if (this.readyState === 4 && this.status === 200) {
        scallback(this.responseText);
      }
    };
    xhr.open(method, url);
    xhr.open(method, callurl);
    if (method === 'GET') {
      xhr.send();
    } else if (method === 'POST' || method === 'PUT' || method === 'DELETE') {