diff --git a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php index 0354e25..4e88e2a 100644 --- a/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php +++ b/core/lib/Drupal/Core/Installer/Form/SiteConfigureForm.php @@ -177,6 +177,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { '#attributes' => array('class' => array('username')), ); $form['admin_account']['account']['pass'] = array( + '#title' => $this->t('Password'), '#type' => 'password_confirm', '#required' => TRUE, '#size' => 25, diff --git a/core/modules/user/css/user.module.css b/core/modules/user/css/user.module.css index 0b6afcf..6fbec09 100644 --- a/core/modules/user/css/user.module.css +++ b/core/modules/user/css/user.module.css @@ -16,6 +16,3 @@ width: 0; background-color: gray; } -.password-confirm-match { - visibility: hidden; -} diff --git a/core/modules/user/css/user.theme.css b/core/modules/user/css/user.theme.css index 52413e0..7393426 100644 --- a/core/modules/user/css/user.theme.css +++ b/core/modules/user/css/user.theme.css @@ -26,10 +26,8 @@ background-color: #77b259; } -.password-confirm, .password-field, -.password-strength, -.password-confirm-match { +.password-strength { width: 55%; } diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php index 8c14682..d662c7b 100644 --- a/core/modules/user/src/AccountForm.php +++ b/core/modules/user/src/AccountForm.php @@ -119,9 +119,10 @@ public function form(array $form, FormStateInterface $form_state) { // assign a password during registration. if (!$register) { $form['account']['pass'] = array( + '#title' => $this->t('Password'), '#type' => 'password_confirm', '#size' => 25, - '#description' => $this->t('To change the current user password, enter the new password in both fields.'), + '#description' => $this->t('To change the current user password, enter the new password.'), ); // To skip the current password field, the user must have logged in via a @@ -178,9 +179,10 @@ public function form(array $form, FormStateInterface $form_state) { } elseif (!$config->get('verify_mail') || $admin) { $form['account']['pass'] = array( + '#title' => $this->t('Password'), '#type' => 'password_confirm', '#size' => 25, - '#description' => $this->t('Provide a password for the new account in both fields.'), + '#description' => $this->t('Provide a password for the new account.'), '#required' => TRUE, ); } diff --git a/core/modules/user/user.js b/core/modules/user/user.js index ded4c0a..09305eb 100644 --- a/core/modules/user/user.js +++ b/core/modules/user/user.js @@ -9,39 +9,19 @@ Drupal.behaviors.password = { attach: function (context, settings) { var translate = settings.password; - $(context).find('input.password-field').once('password', function () { + $(context).find('input[type=password][data-drupal-revealpass]').once('password', function () { var passwordInput = $(this); var innerWrapper = $(this).parent(); - var outerWrapper = $(this).parent().parent(); - var passwordDescription; - + var passwordDescription = $('
').hide(); // Add identifying class to password element parent. innerWrapper.addClass('password-parent'); - // Add the password confirmation layer. - outerWrapper.find('input.password-confirm').parent().append('
' + translate.confirmTitle + '
').addClass('confirm-parent'); - var confirmInput = outerWrapper.find('input.password-confirm'); - var confirmResult = outerWrapper.find('div.password-confirm-match'); - var confirmChild = confirmResult.find('span'); - // If the password strength indicator is enabled, add its markup. if (settings.password.showStrengthIndicator) { var passwordMeter = '
' + translate.strengthTitle + '
'; - confirmInput.parent().after('
'); - innerWrapper.append(passwordMeter); - passwordDescription = outerWrapper.find('div.password-suggestions').hide(); + innerWrapper.append(passwordMeter).append(passwordDescription); } - // Check that password and confirmation inputs match. - var passwordCheckMatch = function (confirmInputVal) { - var success = passwordInput.val() === confirmInputVal; - var confirmClass = success ? 'ok' : 'error'; - - // Fill in the success message and set the class accordingly. - confirmChild.html(translate['confirm' + (success ? 'Success' : 'Failure')]) - .removeClass('ok error').addClass(confirmClass); - }; - // Check the password strength. var passwordCheck = function () { if (settings.password.showStrengthIndicator) { @@ -65,20 +45,10 @@ // Update the strength indication text. innerWrapper.find('.password-strength__text').html(result.indicatorText); } - - // Check the value in the confirm input and show results. - if (confirmInput.val()) { - passwordCheckMatch(confirmInput.val()); - confirmResult.css({visibility: 'visible'}); - } - else { - confirmResult.css({visibility: 'hidden'}); - } }; // Monitor input events. passwordInput.on('input', passwordCheck); - confirmInput.on('input', passwordCheck); }); } }; diff --git a/core/themes/seven/css/components/form.css b/core/themes/seven/css/components/form.css index 72980e5..1dacd9a 100644 --- a/core/themes/seven/css/components/form.css +++ b/core/themes/seven/css/components/form.css @@ -171,14 +171,6 @@ textarea.form-textarea { width: auto; } -.form-item .password-suggestions { - float: left; /* LTR */ - clear: left; - width: 100%; -} -[dir="rtl"] .form-item .password-suggestions { - float: right; -} .form-item-pass .description { clear: both; } diff --git a/core/themes/seven/css/theme/install-page.css b/core/themes/seven/css/theme/install-page.css index c43b42e..38bf29f 100644 --- a/core/themes/seven/css/theme/install-page.css +++ b/core/themes/seven/css/theme/install-page.css @@ -41,14 +41,7 @@ .install-configure-form .form-type-password { width: 100%; } - .password-confirm, .password-field { float: none; } - .password-confirm-match { - float: none; - width: auto; - max-width: 100%; - } - }