diff options
| author | Pitu <[email protected]> | 2017-03-17 01:17:51 -0300 |
|---|---|---|
| committer | Pitu <[email protected]> | 2017-03-17 01:17:51 -0300 |
| commit | 22fb95d7bd40d4138dd2e7dce744aafd5611ff8d (patch) | |
| tree | ca560c4240c8f96770caf665b6cb9fae0b953408 /public/js/dashboard.js | |
| parent | Refactor (diff) | |
| parent | Merge pull request #20 from RyoshiKayo/patch-1 (diff) | |
| download | host.fuwn.me-22fb95d7bd40d4138dd2e7dce744aafd5611ff8d.tar.xz host.fuwn.me-22fb95d7bd40d4138dd2e7dce744aafd5611ff8d.zip | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'public/js/dashboard.js')
| -rw-r--r-- | public/js/dashboard.js | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/public/js/dashboard.js b/public/js/dashboard.js index 76b8ec4..7309908 100644 --- a/public/js/dashboard.js +++ b/public/js/dashboard.js @@ -559,6 +559,10 @@ panel.changePassword = function(){ <label class="label">New password:</label> <p class="control has-addons"> <input id="password" class="input is-expanded" type="password" placeholder="Your new password"> + </p> + <label class="label">Confirm password:</label> + <p class="control has-addons"> + <input id="passwordConfirm" class="input is-expanded" type="password" placeholder="Verify your new password"> <a id="sendChangePassword" class="button is-primary">Set new password</a> </p> `; @@ -566,9 +570,18 @@ panel.changePassword = function(){ panel.page.appendChild(container); document.getElementById('sendChangePassword').addEventListener('click', function(){ - panel.sendNewPassword(document.getElementById('password').value); + if (document.getElementById('password').value === document.getElementById('passwordConfirm').value) { + panel.sendNewPassword(document.getElementById('password').value); + } else { + swal({ + title: "Password mismatch!", + text: 'Your passwords do not match, please try again.', + type: "error" + }, function() { + panel.changePassword(); + }); + } }); - } panel.sendNewPassword = function(pass){ |