From 37aa0574c491a4920d9ba2f87ebaadd64b20942d Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 29 Jul 2015 19:21:26 +0000 Subject: [PATCH] Persist (and mask) the password on the install screen if the install does not proceed due to errors. If you forget or enter an invalid username/e-mail, the password choosing shouldn't start over. fixes #33162 git-svn-id: https://develop.svn.wordpress.org/trunk@33495 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/install.php | 4 ++-- src/wp-admin/js/user-profile.js | 17 +++++++++++------ 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/wp-admin/install.php b/src/wp-admin/install.php index 4eab6b303f..2c0c6071bf 100644 --- a/src/wp-admin/install.php +++ b/src/wp-admin/install.php @@ -137,9 +137,9 @@ function display_setup_form( $error = null ) {
- + - diff --git a/src/wp-admin/js/user-profile.js b/src/wp-admin/js/user-profile.js index 799ee97276..bb80a3274f 100644 --- a/src/wp-admin/js/user-profile.js +++ b/src/wp-admin/js/user-profile.js @@ -12,6 +12,7 @@ $weakRow, $weakCheckbox, + $toggleButton, $submitButtons, $submitButton, currentPass; @@ -22,7 +23,11 @@ } else { $pass1.val( $pass1.data( 'pw' ) ); $pass1.trigger( 'pwupdate' ); - $pass1Wrap.addClass( 'show-password' ); + if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) { + $pass1Wrap.addClass( 'show-password' ); + } else { + $toggleButton.trigger( 'click' ); + } } } @@ -82,11 +87,11 @@ } function bindToggleButton() { - var toggleButton = $pass1Row.find('.wp-hide-pw'); - toggleButton.show().on( 'click', function () { - if ( 1 === parseInt( toggleButton.data( 'toggle' ), 10 ) ) { + $toggleButton = $pass1Row.find('.wp-hide-pw'); + $toggleButton.show().on( 'click', function () { + if ( 1 === parseInt( $toggleButton.data( 'toggle' ), 10 ) ) { $pass1Wrap.addClass( 'show-password' ); - toggleButton + $toggleButton .data( 'toggle', 0 ) .attr({ 'aria-label': userProfileL10n.ariaHide @@ -105,7 +110,7 @@ } } else { $pass1Wrap.removeClass( 'show-password' ); - toggleButton + $toggleButton .data( 'toggle', 1 ) .attr({ 'aria-label': userProfileL10n.ariaShow