From 3400c7fabbf382a3690c7df989d458def01aff66 Mon Sep 17 00:00:00 2001
From: ulrich@undisclosed
Date: Mon, 11 May 2020 07:21:23 +0000
Subject: [PATCH] Aufraeumarbeiten

---
 web/ui2/js/app.js |   56 +++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/web/ui2/js/app.js b/web/ui2/js/app.js
index 77ebd3c..07fb0dd 100644
--- a/web/ui2/js/app.js
+++ b/web/ui2/js/app.js
@@ -1,4 +1,4 @@
-function AppVorlage() {
+function NutzerApp() {
   var self = this;
   var appMenu;
   var vorlagen;
@@ -7,12 +7,6 @@
   var pfad = '';
   var loc;
   var modus = 'kacheln';
-  var PERS_DIR = "Persoenlich";
-  var PUB_DIR = "Oeffentlich";
-  var DAV_DIR = "Austausch";
-  var BASE_DIR = "$basis";
-  var DATA_DIR = "$daten";
-  var WWW_DIR = "www";
 
   this.datei_neuer_text = function () {
     self.meldung_mit_timeout("Neuer Text", 1500);
@@ -32,6 +26,9 @@
     document.querySelector('.hamburger').addEventListener('click', function (e) {
       self.menue_umschalten();
     });
+    var dlg = document.querySelector(".dialog");
+    dlg.style.flexBasis = '0em';
+    self.seitenleiste_umschalten();
     self.um_get_login();
     self.um_get_user_list();
     self.loc = window.location.protocol + '//' + window.location.host;
@@ -49,6 +46,11 @@
 
   this.info_dialog_zeigen = function () {
     self.dialog_laden_und_zeigen('data/tpl/dlg-info.tpl', '');
+    self.menue_umschalten();
+  };
+
+  this.nutzer_neu_dialog_zeigen = function () {
+    self.dialog_laden_und_zeigen('data/tpl/dlg-nutzer-neu.tpl', '');
     self.menue_umschalten();
   };
 
@@ -119,21 +121,19 @@
             vurl,
             inhalt,
             function (html) {
-              //dlg.html(html);
-              dlg.style.height = '5em';
-              dlg.innerHTML = html;
-              document.querySelector('.close-btn').addEventListener('click', self.dialog_schliessen);
-              //dlg.slideDown(300);
+              dlg.style.flexBasis = '14em';
+              setTimeout(function () {
+                dlg.innerHTML = html;
+                document.querySelector('.close-btn').addEventListener('click', self.dialog_schliessen);
+              }, 300);
             });
   };
 
   this.dialog_schliessen = function () {
     document.querySelector('.close-btn').removeEventListener('click', self.dialog_schliessen);
-    //$('.dialog').slideUp(300);
     var dlg = document.querySelector('.dialog');
-    //dlg.style.display = "none";
-    dlg.style.height = '0';
     dlg.innerHTML = '';
+    dlg.style.flexBasis = '0em';
   };
 
   /* API functions */
@@ -142,7 +142,7 @@
     //var m = 'getUserNameList';
     var m = 'getUserNameList';
     var u = '../svc/' + m;
-    self.fm_get(u, "json", function (antwort) {
+    self.um_get(u, "json", function (antwort) {
     self.vorlagen.html_erzeugen(
       'data/tpl/inhalt.tpl',
       JSON.parse(antwort),
@@ -158,7 +158,7 @@
   this.um_get_login = function() {
     var m = '?c=de.uhilger.um.pub.SessionManager&m=getSessionUser';
     var u = '../pub' + m;
-    self.fm_get(u, "text", function (resp) {
+    self.um_get(u, "text", function (resp) {
       self.userid = resp;
       self.login_zeigen();
       //document.querySelector("#userMenu").textContent = resp;
@@ -168,7 +168,7 @@
   this.um_logout = function() {
     var m = '?c=de.uhilger.um.pub.SessionManager&m=expireSession';
     var u = '../pub' + m;
-    self.fm_get(u, "text", function (resp) {
+    self.um_get(u, "text", function (resp) {
       //$('#userMenu').text('nicht angemeldet');
       window.location.href = '../logout.html';
     });
@@ -176,7 +176,7 @@
 
   /* -------- ajax helper functions ----------- */
 
-  this.fm_get = function (u, dtype, scallback) {    
+  this.um_get = function (u, dtype, scallback) {    
     var xmlhttp = new XMLHttpRequest();
     var url = u;
     xmlhttp.onreadystatechange = function() {
@@ -187,5 +187,23 @@
     xmlhttp.open("GET", url, true);
     xmlhttp.send();
   };
+  
+/* ----- Hilfsfunktionen ----- */
+
+  this.serialisieren = function(obj) {
+    return '{"' + obj.constructor.name + '":' + JSON.stringify(obj) + '}';
+  };
 
 }
+
+
+/* ----- Objekte ----- */
+
+function User(i, p, fn, ln, em) {
+  this.id = i;
+  this.pw = p;
+  this.firstName = fn;
+  this.lastName = ln;
+  this.email = em;
+}
+

--
Gitblit v1.9.3