| | |
| | | function NutzerApp() { |
| | | var self = this; |
| | | var appMenu; |
| | | //var appMenu; |
| | | var vorlagen; |
| | | var api; |
| | | //var api; |
| | | var userid; |
| | | var pfad = ''; |
| | | //var pfad = ''; |
| | | var loc; |
| | | var modus = 'kacheln'; |
| | | //var modus = 'kacheln'; |
| | | |
| | | this.init = function () { |
| | | self.vorlagen = new Vorlagen(); |
| | | var dlg = document.querySelector(".dialog"); |
| | | dlg.style.flexBasis = '0em'; |
| | | document.querySelector('#nutzer-neu-btn').addEventListener('click', self.nutzer_neu_dialog_zeigen); |
| | | document.querySelector('.west').style.flexBasis = '0em'; |
| | | document.querySelector('.ost').style.flexBasis = '0em'; |
| | | self.get_login(); |
| | | self.get_user_list(); |
| | | self.loc = window.location.protocol + '//' + window.location.host; |
| | | }; |
| | | |
| | | this.datei_neuer_text = function () { |
| | | self.meldung_mit_timeout("Neuer Text", 1500); |
| | |
| | | |
| | | /* Nutzerverwaltung */ |
| | | |
| | | this.nutzer_neu_dialog_zeigen = function () { |
| | | self.dialog_zeigen('data/tpl/dlg-nutzer-neu.tpl', '', function(){ |
| | | var btn = document.getElementById('nutzer-speichern-btn'); |
| | | if(btn !== null) { |
| | | btn.addEventListener('click', self.nutzer_speichern); |
| | | } |
| | | }); |
| | | //self.menue_umschalten(); |
| | | }; |
| | | |
| | | this.nutzerliste_klick = function(event) { |
| | | var target = event.target; |
| | | var gewaehlterNutzer = document.querySelector(".nutzer-gewaehlt"); |
| | |
| | | return user; |
| | | }; |
| | | |
| | | /* Funktionen aus App-Vorlage */ |
| | | |
| | | this.init = function () { |
| | | self.vorlagen = new Vorlagen(); |
| | | /* |
| | | self.appMenu = new AppMenu(); |
| | | self.appMenu.init( |
| | | "data/menu/", |
| | | "hauptmenue.json", |
| | | "data/tpl/app-menu.tpl", |
| | | ".west", |
| | | "8em"); |
| | | document.querySelector('.hamburger').addEventListener('click', function (e) { |
| | | self.menue_umschalten(); |
| | | }); |
| | | */ |
| | | var dlg = document.querySelector(".dialog"); |
| | | dlg.style.flexBasis = '0em'; |
| | | document.querySelector('#nutzer-neu-btn').addEventListener('click', self.nutzer_neu_dialog_zeigen); |
| | | self.seitenleiste_umschalten(); |
| | | self.west_umschalten(); |
| | | self.west_umschalten(); |
| | | self.get_login(); |
| | | self.get_user_list(); |
| | | self.loc = window.location.protocol + '//' + window.location.host; |
| | | }; |
| | | |
| | | this.login_zeigen = function() { |
| | | self.meldung_mit_timeout("Benutzer: " + self.userid, 1500); |
| | | }; |
| | | /* Rollen erteilen und entziehen */ |
| | | |
| | | this.menue_umschalten = function () { |
| | | var ham = document.querySelector(".hamburger"); |
| | | ham.classList.toggle("is-active"); // hamburger-icon umschalten |
| | | self.appMenu.toggle(); // menue oeffnen/schliessen |
| | | }; |
| | | |
| | | this.rollen_dialog_zeigen = function(nutzerId) { |
| | | var m = 'getUserRoleNames'; |
| | | var u = '../svc/' + m + '?p=' + nutzerId; |
| | |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | /* Funktionen aus App-Vorlage */ |
| | | |
| | | this.login_zeigen = function() { |
| | | self.meldung_mit_timeout("Benutzer: " + self.userid, 1500); |
| | | }; |
| | | |
| | | |
| | | this.info_dialog_zeigen = function () { |
| | | self.dialog_zeigen('data/tpl/dlg-info.tpl', ''); |
| | | //self.menue_umschalten(); |
| | | }; |
| | | |
| | | this.nutzer_neu_dialog_zeigen = function () { |
| | | self.dialog_zeigen('data/tpl/dlg-nutzer-neu.tpl', '', function(){ |
| | | var btn = document.getElementById('nutzer-speichern-btn'); |
| | | if(btn !== null) { |
| | | btn.addEventListener('click', self.nutzer_speichern); |
| | | } |
| | | }); |
| | | //self.menue_umschalten(); |
| | | }; |
| | | |
| | | this.seitenleiste_umschalten = function () { |
| | |
| | | ostDiv.classList.add('ost-open'); |
| | | ostDiv.style.flexBasis = '6em'; |
| | | } |
| | | //self.menue_umschalten(); |
| | | }; |
| | | |
| | | this.west_umschalten = function() { |
| | | var westDiv = document.querySelector('.west'); |
| | | if (westDiv.classList.contains('west-open')) { |
| | | westDiv.classList.remove('west-open'); |
| | | westDiv.style.flexBasis = '0em'; |
| | | } else { |
| | | westDiv.classList.add('west-open'); |
| | | westDiv.style.flexBasis = '6em'; |
| | | } |
| | | //self.menue_umschalten(); |
| | | }; |
| | | |
| | | this.fusszeile_umschalten = function () { |
| | | var suedDiv = document.querySelector('.sued'); |
| | | if (suedDiv.classList.contains('sued-open')) { |
| | |
| | | suedDiv.classList.add('sued-open'); |
| | | suedDiv.style.height = '1.5em'; |
| | | } |
| | | //self.menue_umschalten(); |
| | | }; |
| | | |
| | | this.meldung_mit_timeout = function (meldung, timeout) { |