Persoenliche Mediazentrale
ulrich
2021-04-05 a43e1a055018aab9590c88c45d8495f99bfb6254
www/ui/js/app.js
@@ -12,9 +12,19 @@
  // var vorlagen;
  var cache; // mustache templates
  this.ablageort_liste = function() {
    self.http_get('../api/store/Ablageort/', function (responseText) {
      self.vorlage_laden_und_fuellen("data/tpl/ablageort_liste.tpl", JSON.parse(responseText), function (html) {
        document.querySelector(".zentraler-inhalt").innerHTML = html;
        self.addEvtListener('.entity-eintrag', 'click', function (event) {
          var t = event.target;
          self.meldung_mit_timeout(t.textContent, 1500);
        });
      });
    });
  };
  this.form_ablageort_neu = function () {
  this.ablageort_neu = function () {
    self.vorlage_laden_und_fuellen("data/tpl/form_ablageort.tpl", "", function (html) {
      document.querySelector(".zentraler-inhalt").innerHTML = html;
      self.addEvtListener('#ok-btn', 'click', function () {
@@ -26,7 +36,7 @@
        );
        // {"name":"Katalog","ort":"/home/ulrich/Videos","url":"/media/test"}
        var daten = JSON.stringify(a);
        self.http_post('../api/store/Ablageort', daten, function () {
        self.http_post('../api/store/Ablageort', daten, function (responseText) {
          // hier die Antwort verarbeiten
        });
      });
@@ -159,6 +169,8 @@
  this.meldung_mit_timeout = function (meldung, timeout) {
    var s = document.querySelector('.sued');
    s.classList.add('sued-open');
    s.style.height = '1.5em';
    s.textContent = meldung;
    setTimeout(function () {
      s.textContent = 'Bereit.';
@@ -245,6 +257,8 @@
  };
  this.vorlage_fuellen = function (vurl, inhalt, cb) {
    //console.log("vorlage " + self.cache[vurl]);
    //console.log("render " + inhalt);
    cb(Mustache.render(self.cache[vurl], inhalt));
  };