| | |
| | | self.get_user_data(); |
| | | |
| | | var suedDiv = document.querySelector('.sued'); |
| | | //if (suedDiv.classList.contains('sued-open')) { |
| | | suedDiv.classList.remove('sued-open'); |
| | | suedDiv.style.height = '0'; |
| | | //} |
| | | suedDiv.classList.remove('sued-open'); |
| | | suedDiv.style.height = '0'; |
| | | document.querySelector('.zurueck-btn').style.color = '#eee'; |
| | | }; |
| | | |
| | | /* |
| | |
| | | document.querySelector('.user-save-btn').addEventListener('click', self.kennwort_speichern); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | this.kennwort_speichern = function() { |
| | | var userId = document.querySelector('#anmeldename').textContent; |
| | | var aktKw = document.querySelector('#kennwort').value; |
| | | var neuKw = document.querySelector('#kennwortNeu').value; |
| | | var wKw = document.querySelector('#kennwortw').value; |
| | | if(neuKw === wKw) { |
| | | var m = '?c=de.uhilger.um.api.Profil&m=setUserPw&p=' + userId + '&p=' + aktKw + '&p=' + neuKw; |
| | | var u = '../prf' + m; |
| | | self.http_get(u, function(antwort) { |
| | | self.meldung(antwort, 1500); |
| | | }); |
| | | } else { |
| | | // Kennworte unterschiedlich |
| | | self.meldung('Kennworte stimmen nicht überein', 1500); |
| | | } |
| | | }; |
| | | |
| | | this.meldung = function(text, dauer) { |
| | | var suedDiv = document.querySelector('.sued'); |
| | | suedDiv.textContent = 'Kennwort speichern'; |
| | | //if (!suedDiv.classList.contains('sued-open')) { |
| | | suedDiv.classList.add('sued-open'); |
| | | suedDiv.style.height = '1.5em'; |
| | | //} |
| | | suedDiv.textContent = text; |
| | | suedDiv.classList.add('sued-open'); |
| | | suedDiv.style.height = '1.5em'; |
| | | setTimeout(function () { |
| | | var suedDiv = document.querySelector('.sued'); |
| | | if (suedDiv.classList.contains('sued-open')) { |
| | | suedDiv.classList.remove('sued-open'); |
| | | suedDiv.style.height = '0'; |
| | | } |
| | | }, 1500); |
| | | }; |
| | | |
| | | this.get_user_data = function() { |
| | |
| | | if(method === 'GET') { |
| | | xhr.send(); |
| | | } else if(method === 'POST' || method === 'PUT') { |
| | | xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); |
| | | xhr.send(data); |
| | | } |
| | | }; |