| | |
| | | document.querySelector('#top-logout-btn').addEventListener('click', self.logout); |
| | | document.querySelector('.west').style.flexBasis = '0em'; |
| | | document.querySelector('.ost').style.flexBasis = '0em'; |
| | | self.zurueck_btn_aus(); |
| | | self.get_login(); |
| | | self.get_user_list(); |
| | | }; |
| | |
| | | /* Nutzerverwaltung */ |
| | | |
| | | this.nutzer_neu_dialog_zeigen = function () { |
| | | self.html_erzeugen( |
| | | 'data/tpl/dlg-nutzer-neu.tpl', |
| | | '', |
| | | function (html) { |
| | | document.querySelector("#nutzer").innerHTML = html; |
| | | var btn = document.getElementById('nutzer-speichern-btn'); |
| | | if(btn !== null) { |
| | | btn.addEventListener('click', self.nutzer_speichern); |
| | | } |
| | | self.zurueck_btn_ein(self.zurueck_zu_user_liste); |
| | | } |
| | | ); |
| | | |
| | | /* |
| | | 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); |
| | | } |
| | | }); |
| | | */ |
| | | }; |
| | | |
| | | this.nutzerliste_klick = function(event) { |
| | |
| | | self.alle_rollen_zeigen(); |
| | | }); |
| | | }); |
| | | document.querySelector('.zurueck-btn').style.color = 'black'; |
| | | //document.querySelector('.zurueck-btn').style.color = 'black'; |
| | | }; |
| | | |
| | | this.nutzer_loeschen_bestaetigen = function() { |
| | |
| | | }); |
| | | }; |
| | | |
| | | this.zurueck_zu_user_liste = function() { |
| | | self.zurueck_btn_aus(self.zurueck_zu_user_liste); |
| | | self.get_user_list(); |
| | | }; |
| | | |
| | | this.alle_rollen_zeigen = function() { |
| | | var m = 'getRoleNamesGranted'; |
| | | var u = '../svc/' + m; |
| | |
| | | JSON.parse(antwort2), |
| | | function (html) { |
| | | document.querySelector(".alle-rollen-behaelter").innerHTML = html; |
| | | self.zurueck_btn_ein(self.zurueck_zu_user_liste); |
| | | /* |
| | | document.querySelector('.zurueck-btn').addEventListener('click', function (e) { |
| | | self.get_user_list(); |
| | | }); |
| | | */ |
| | | self.addEvtListener('.avl-role-btn', 'click', self.grant_role_klick); |
| | | }); |
| | | }); |
| | |
| | | vurl, |
| | | inhalt, |
| | | function (html) { |
| | | dlg.style.flexBasis = '18em'; |
| | | dlg.style.flexBasis = '9em'; |
| | | setTimeout(function () { |
| | | dlg.innerHTML = html; |
| | | document.querySelector('.close-btn').addEventListener( |
| | |
| | | var elem = document.getElementById('nutzer'); |
| | | elem.innerHTML = h; |
| | | self.addEvtListener('p.nutzer-liste-eintrag', 'click', self.nutzerliste_klick); |
| | | document.querySelector('.zurueck-btn').style.color = '#eee'; |
| | | //document.querySelector('.zurueck-btn').style.color = '#eee'; |
| | | self.removeAllListeners('top-neu-btn'); |
| | | var topBtn = document.querySelector('#top-neu-btn'); |
| | | topBtn.title = "Neuer Benutzer"; |
| | |
| | | self.get_user_list(); |
| | | document.getElementById('nutzer-speichern-btn').removeEventListener( |
| | | 'click', self.nutzer_speichern); |
| | | self.dialog_schliessen(); |
| | | //self.dialog_schliessen(); |
| | | self.zurueck_zu_user_liste(); |
| | | }); |
| | | }; |
| | | |
| | |
| | | } |
| | | }; |
| | | |
| | | /* ----- Hilfsfunktionen ----- */ |
| | | /* ---- Steuerung Bedienelemente ---- */ |
| | | |
| | | this.zurueck_btn_ein = function(callback) { |
| | | var btn = document.querySelector('.zurueck-btn'); |
| | | btn.addEventListener('click', callback); |
| | | btn.style.color = 'black'; |
| | | }; |
| | | |
| | | this.zurueck_btn_aus = function(listener) { |
| | | var btn = document.querySelector('.zurueck-btn'); |
| | | btn.removeEventListener('click', listener); |
| | | btn.style.color = '#eee'; |
| | | }; |
| | | |
| | | /* ----- Hilfsfunktionen ----- */ |
| | | |
| | | this.serialisieren = function(obj) { |
| | | return '{"' + obj.constructor.name + '":' + JSON.stringify(obj) + '}'; |
| | |
| | | } |
| | | }; |
| | | |
| | | this.removeAllListeners = function(elementId) { |
| | | var el = document.getElementById(elementId); |
| | | this.removeAllListeners = function(id) { |
| | | var el = document.getElementById(id); |
| | | elClone = el.cloneNode(true); |
| | | el.parentNode.replaceChild(elClone, el); |
| | | }; // https://stackoverflow.com/questions/19469881/remove-all-event-listeners-of-specific-type |