Re-work user-profile.js so the password meter works in IE8 and password managers can fill multiple times.
props adamsilverstein fixes #32886 Built from https://develop.svn.wordpress.org/trunk@33473 git-svn-id: http://core.svn.wordpress.org/trunk@33440 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
dbcff0beae
commit
0217951e44
|
@ -13,21 +13,23 @@
|
||||||
$weakCheckbox,
|
$weakCheckbox,
|
||||||
|
|
||||||
$submitButtons,
|
$submitButtons,
|
||||||
$submitButton;
|
$submitButton,
|
||||||
|
currentPass;
|
||||||
|
|
||||||
function generatePassword() {
|
function generatePassword() {
|
||||||
if ( typeof zxcvbn !== 'function' ) {
|
if ( typeof zxcvbn !== 'function' ) {
|
||||||
setTimeout( generatePassword, 50 );
|
setTimeout( generatePassword, 50 );
|
||||||
} else {
|
} else {
|
||||||
$pass1.val( $pass1.data( 'pw' ) );
|
$pass1.val( $pass1.data( 'pw' ) );
|
||||||
$pass1.trigger( 'propertychange' );
|
$pass1.trigger( 'pwupdate' );
|
||||||
$pass1Wrap.addClass( 'show-password' );
|
$pass1Wrap.addClass( 'show-password' );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindPass1() {
|
function bindPass1() {
|
||||||
var passStrength = $('#pass-strength-result')[0];
|
var passStrength = $('#pass-strength-result')[0];
|
||||||
var currentPass = $pass1.val();
|
|
||||||
|
currentPass = $pass1.val();
|
||||||
|
|
||||||
$pass1Wrap = $pass1.parent();
|
$pass1Wrap = $pass1.parent();
|
||||||
|
|
||||||
|
@ -40,8 +42,13 @@
|
||||||
.addClass( $pass1[0].className )
|
.addClass( $pass1[0].className )
|
||||||
.data( 'pw', $pass1.data( 'pw' ) )
|
.data( 'pw', $pass1.data( 'pw' ) )
|
||||||
.val( $pass1.val() )
|
.val( $pass1.val() )
|
||||||
.on( 'input', function () {
|
.on( 'input propertychange', function () {
|
||||||
$pass1.val( $pass1Text.val() ).trigger( 'propertychange' );
|
if ( $pass1Text.val() === currentPass ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$pass2.val( $pass1Text.val() );
|
||||||
|
$pass1.val( $pass1Text.val() ).trigger( 'pwupdate' );
|
||||||
|
currentPass = $pass1Text.val();
|
||||||
} );
|
} );
|
||||||
|
|
||||||
$pass1.after( $pass1Text );
|
$pass1.after( $pass1Text );
|
||||||
|
@ -50,7 +57,7 @@
|
||||||
generatePassword();
|
generatePassword();
|
||||||
}
|
}
|
||||||
|
|
||||||
$pass1.on( 'input propertychange', function () {
|
$pass1.on( 'input propertychange pwupdate', function () {
|
||||||
if ( $pass1.val() === currentPass ) {
|
if ( $pass1.val() === currentPass ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -149,12 +156,14 @@
|
||||||
* Fix a LastPass mismatch issue, LastPass only changes pass2.
|
* Fix a LastPass mismatch issue, LastPass only changes pass2.
|
||||||
*
|
*
|
||||||
* This fixes the issue by copying any changes from the hidden
|
* This fixes the issue by copying any changes from the hidden
|
||||||
* pass2 field to the pass1 field.
|
* pass2 field to the pass1 field, then running check_pass_strength.
|
||||||
*/
|
*/
|
||||||
$pass2 = $('#pass2').on( 'input propertychange', function () {
|
$pass2 = $('#pass2').on( 'input propertychange', function () {
|
||||||
if ( $pass2.val().length > 0 ) {
|
if ( $pass2.val().length > 0 ) {
|
||||||
$pass1.val( $pass2.val() );
|
$pass1.val( $pass2.val() );
|
||||||
$pass1.trigger( 'propertychange' );
|
$pass2.val('');
|
||||||
|
currentPass = '';
|
||||||
|
$pass1.trigger( 'pwupdate' );
|
||||||
}
|
}
|
||||||
} );
|
} );
|
||||||
|
|
||||||
|
@ -228,8 +237,7 @@
|
||||||
var $colorpicker, $stylesheet, user_id, current_user_id,
|
var $colorpicker, $stylesheet, user_id, current_user_id,
|
||||||
select = $( '#display_name' );
|
select = $( '#display_name' );
|
||||||
|
|
||||||
$('#pass1').val('').on( 'input propertychange', check_pass_strength );
|
$('#pass1').val('').on( 'input propertychange pwupdate', check_pass_strength );
|
||||||
$('#pass2').val('').on( 'input propertychange', check_pass_strength );
|
|
||||||
$('#pass-strength-result').show();
|
$('#pass-strength-result').show();
|
||||||
$('.color-palette').click( function() {
|
$('.color-palette').click( function() {
|
||||||
$(this).siblings('input[name="admin_color"]').prop('checked', true);
|
$(this).siblings('input[name="admin_color"]').prop('checked', true);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.3-beta4-33472';
|
$wp_version = '4.3-beta4-33473';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue