Merge pull request #2554 from owncloud/hide-toggle-checkbox

Implements Hide / Display for the Password Toggle Button
This commit is contained in:
Bernhard Posselt 2013-04-11 01:18:40 -07:00
commit 18c873d1e5
2 changed files with 15 additions and 5 deletions

View file

@ -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({

View file

@ -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');?>" />