summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-11 01:18:40 -0700
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-11 01:18:40 -0700
commit18c873d1e5746bd0e032c9c6e402da487fa9634a (patch)
treedc2bd8655b8950a0a9c199d6f0a2ead81fc1f5d1
parentb02db643d08fde6bf609e9e2e31c32b4a16518c4 (diff)
parent3d008b2ff34c844521a9dcea387642cee4290b6f (diff)
downloadnextcloud-server-18c873d1e5746bd0e032c9c6e402da487fa9634a.tar.gz
nextcloud-server-18c873d1e5746bd0e032c9c6e402da487fa9634a.zip
Merge pull request #2554 from owncloud/hide-toggle-checkbox
Implements Hide / Display for the Password Toggle Button
-rw-r--r--core/js/js.js18
-rw-r--r--settings/templates/personal.php2
2 files changed, 15 insertions, 5 deletions
diff --git a/core/js/js.js b/core/js/js.js
index e1fbd04a8da..1bb546f7081 100644
--- a/core/js/js.js
+++ b/core/js/js.js
@@ -591,10 +591,20 @@ $(document).ready(function(){
}
});
- // 'show password' checkbox
- $('#password').showPassword();
- $('#adminpass').showPassword();
- $('#pass2').showPassword();
+ var setShowPassword = function(input, label) {
+ input.showPassword().keyup(function(){
+ if (input.val().length == 0) {
+ label.hide();
+ }
+ else {
+ label.css("display", "inline").show();
+ }
+ });
+ label.hide();
+ };
+ setShowPassword($('#password'), $('label[for=show]'));
+ setShowPassword($('#adminpass'), $('label[for=show]'));
+ setShowPassword($('#pass2'), $('label[for=personal-show]'));
//use infield labels
$("label.infield").inFieldLabels({
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index f3fd3f1010d..03073069ab7 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -38,7 +38,7 @@ if($_['passwordChangeSupported']) {
<div id="passwordchanged"><?php echo $l->t('Your password was changed');?></div>
<div id="passworderror"><?php echo $l->t('Unable to change your password');?></div>
<input type="password" id="pass1" name="oldpassword" placeholder="<?php echo $l->t('Current password');?>" />
- <input type="password" id="pass2" name="password"
+ <input type="password" id="pass2" name="new-password"
placeholder="<?php echo $l->t('New password');?>" data-typetoggle="#personal-show" />
<input type="checkbox" id="personal-show" name="show" /><label for="personal-show"></label>
<input id="passwordbutton" type="submit" value="<?php echo $l->t('Change password');?>" />