From a43e1a055018aab9590c88c45d8495f99bfb6254 Mon Sep 17 00:00:00 2001
From: ulrich
Date: Mon, 05 Apr 2021 18:39:49 +0000
Subject: [PATCH] Ablageort-Liste

---
 www/ui/js/app.js |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/www/ui/js/app.js b/www/ui/js/app.js
index c3a2888..04db53f 100644
--- a/www/ui/js/app.js
+++ b/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));
   };
 

--
Gitblit v1.9.3