diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2014-06-30 15:49:33 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-08-15 20:02:46 +0200 |
| commit | 1c332d8a52e9a7fcfcca9b38542529f6b06f064d (patch) | |
| tree | 4eaa1632f45e141ed89a72f3fc29d20a04161290 /www | |
| parent | dda22b6eef396762a5525c94996179738e1a462b (diff) | |
| download | wvs-vplan-1c332d8a52e9a7fcfcca9b38542529f6b06f064d.tar.gz wvs-vplan-1c332d8a52e9a7fcfcca9b38542529f6b06f064d.zip | |
füge optionales Vergessen des Passworts hinzu
Diffstat (limited to 'www')
| -rw-r--r-- | www/index.html | 9 | ||||
| -rw-r--r-- | www/js/index.js | 15 |
2 files changed, 23 insertions, 1 deletions
diff --git a/www/index.html b/www/index.html index d611028..bf5c99c 100644 --- a/www/index.html +++ b/www/index.html @@ -97,6 +97,15 @@ <input type="text" id="username" hint="Benutzername" autofocus required> <label for="password">Moodle-Passwort:</label> <input type="password" id="password" hint="Passwort" required> + + <div class="ui-field-contain"> + <label for="saveflip">Speichern:</label> + <select id="saveflip" data-role="slider" data-mini="true" data-inline> + <option value="false">Nein</option> + <option value="true" selected>Ja</option> + </select> + </div> + <button class="ui-btn ui-corner-all ui-btn-icon-left ui-icon-user" id="loginsubmit" type="submit">Einloggen</button> </form> diff --git a/www/js/index.js b/www/js/index.js index 089f737..58ab685 100644 --- a/www/js/index.js +++ b/www/js/index.js @@ -108,6 +108,13 @@ $('#settingspanel').change(function(){ localStorage.setItem('apptheme', $('#themeselect').val()); }); +$('#saveflip').change(function(){ + localStorage.setItem('savepass', $('#saveflip').val()); + if($('#saveflip').val() === 'false'){ + localStorage.removeItem('password'); + } +}); + document.addEventListener('offline', function(){ $('#loginsubmit').prop('disabled', true); $('#error_noconn').show('fast'); @@ -145,6 +152,7 @@ $('#mainpage').on('pagebeforeshow', function(){ var premium = localStorage.getItem('premium'); var easteregg = localStorage.getItem('easteregg'); var apptheme = localStorage.getItem('apptheme'); + var savepass = localStorage.getItem('savepass'); if(dntrack === null || dntrack.length === 0){ dntrack = 'false'; @@ -192,6 +200,11 @@ $('#mainpage').on('pagebeforeshow', function(){ } $('#themeselect').val(apptheme).selectmenu('refresh'); + if(savepass === null || savepass.length === 0){ + savepass = 'true'; + } + $('#saveflip').val(savepass).slider('refresh'); + /* Piwik initialisieren */ _paq.push(['setDoNotTrack', dntrack]); }); @@ -890,7 +903,7 @@ function getUserData(){ if(password === ''){ password = localStorage.getItem('password'); - }else{ + }else if($('#saveflip').val() === 'true'){ localStorage.setItem('password', password); } |
