From d9cd9875e0be3fbadb57d562724f509de9611ab7 Mon Sep 17 00:00:00 2001 From: raghunayyar Date: Mon, 25 Mar 2013 04:30:09 +0530 Subject: [PATCH 1/4] Initial Commit : Password Toggle Button hides if no input present --- core/js/js.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index b237c6fcf5..93d4c0a03e 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -638,9 +638,21 @@ $(document).ready(function(){ }); // 'show password' checkbox - $('#password').showPassword(); - $('#adminpass').showPassword(); - $('#pass2').showPassword(); + + var hideToggleBtn = function(input, label) { + // 'show password' checkbox + input.showPassword().keyup(function(){ + if (input.val().length == 0) { + label.hide(); + } else { + label.css("display", "inline").show(); + } + }); + label.hide(); + }; + hideToggleBtn($('#password'), $('label[for=show]')); + hideToggleBtn($('#adminpass'), $('label[for=show]')); + hideToggleBtn($('#pass2'), $('label[for=personal-show]')); //use infield labels $("label.infield").inFieldLabels({ From 25a869031867f502e5a1cb7b9123306a2b97d6da Mon Sep 17 00:00:00 2001 From: raghunayyar Date: Mon, 25 Mar 2013 16:09:35 +0530 Subject: [PATCH 2/4] Fixes autofill for display / hide toggle button, a better function name. --- core/js/js.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 93d4c0a03e..3f1934241f 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -637,22 +637,23 @@ $(document).ready(function(){ } }); - // 'show password' checkbox - - var hideToggleBtn = function(input, label) { + var setShowPassword = function(input, label) { // 'show password' checkbox - input.showPassword().keyup(function(){ - if (input.val().length == 0) { - label.hide(); - } else { - label.css("display", "inline").show(); - } - }); - label.hide(); + setTimeout(function() { + input.showPassword().keyup(function(){ + if (input.val().length == 0) { + label.hide(); + } + else { + label.css("display", "inline").show(); + } + }); + },200); + label.hide(); }; - hideToggleBtn($('#password'), $('label[for=show]')); - hideToggleBtn($('#adminpass'), $('label[for=show]')); - hideToggleBtn($('#pass2'), $('label[for=personal-show]')); + setShowPassword($('#password'), $('label[for=show]')); + setShowPassword($('#adminpass'), $('label[for=show]')); + setShowPassword($('#pass2'), $('label[for=personal-show]')); //use infield labels $("label.infield").inFieldLabels({ From 8d7aa42b9ac162794ec569c0aea90a9a48b81160 Mon Sep 17 00:00:00 2001 From: raghunayyar Date: Tue, 26 Mar 2013 23:32:26 +0530 Subject: [PATCH 3/4] Removes the setTimeout() method. --- core/js/js.js | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/core/js/js.js b/core/js/js.js index 3f1934241f..0fb491d67c 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -638,18 +638,15 @@ $(document).ready(function(){ }); var setShowPassword = function(input, label) { - // 'show password' checkbox - setTimeout(function() { - input.showPassword().keyup(function(){ - if (input.val().length == 0) { - label.hide(); - } - else { - label.css("display", "inline").show(); - } - }); - },200); - label.hide(); + 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]')); From 3d008b2ff34c844521a9dcea387642cee4290b6f Mon Sep 17 00:00:00 2001 From: raghunayyar Date: Thu, 11 Apr 2013 12:34:46 +0530 Subject: [PATCH 4/4] New Password in Personal Password Page loads fine. --- settings/templates/personal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/templates/personal.php b/settings/templates/personal.php index f3fd3f1010..03073069ab 100644 --- a/settings/templates/personal.php +++ b/settings/templates/personal.php @@ -38,7 +38,7 @@ if($_['passwordChangeSupported']) {
t('Your password was changed');?>
t('Unable to change your password');?>
-