From e4305c7b28bde59ead45dbae15d09037c8773733 Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Mon, 13 Jul 2015 22:35:24 +0000 Subject: [PATCH] Passwords: Make show/hide toggle translatable. See #32589. Built from https://develop.svn.wordpress.org/trunk@33249 git-svn-id: http://core.svn.wordpress.org/trunk@33221 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/install.php | 2 +- wp-admin/js/user-profile.js | 6 +++--- wp-admin/js/user-profile.min.js | 2 +- wp-admin/user-edit.php | 2 +- wp-admin/user-new.php | 2 +- wp-includes/script-loader.php | 5 +++++ wp-includes/version.php | 2 +- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/wp-admin/install.php b/wp-admin/install.php index 82818a4f13..006b55a183 100644 --- a/wp-admin/install.php +++ b/wp-admin/install.php @@ -143,7 +143,7 @@ function display_setup_form( $error = null ) {
diff --git a/wp-admin/js/user-profile.js b/wp-admin/js/user-profile.js index 99eae641cc..d689d9a026 100644 --- a/wp-admin/js/user-profile.js +++ b/wp-admin/js/user-profile.js @@ -1,4 +1,4 @@ -/* global ajaxurl, pwsL10n */ +/* global ajaxurl, pwsL10n, userProfileL10n */ (function($){ $(function(){ var pw_new = $('.user-pass1-wrap'), @@ -96,13 +96,13 @@ pw_field.attr( 'type', 'text' ); pw_togglebtn.attr( 'data-toggle', 0 ) .find( '.text' ) - .text( 'hide' ) + .text( userProfileL10n.hide ) ; } else { pw_field.attr( 'type', 'password' ); pw_togglebtn.attr( 'data-toggle', 1 ) .find( '.text' ) - .text( 'show' ) + .text( userProfileL10n.show ) ; } pw_field.focus(); diff --git a/wp-admin/js/user-profile.min.js b/wp-admin/js/user-profile.min.js index 28120b017a..93423fabb5 100644 --- a/wp-admin/js/user-profile.min.js +++ b/wp-admin/js/user-profile.min.js @@ -1 +1 @@ -!function(a){function b(){var b,c=a("#pass1").val(),d=a("#pass2").val();if(a("#pass-strength-result").removeClass("short bad good strong"),!c)return void a("#pass-strength-result").html(" ");switch(b=wp.passwordStrength.meter(c,wp.passwordStrength.userInputBlacklist(),d)){case 2:a("#pass-strength-result").addClass("bad").html(pwsL10n.bad);break;case 3:a("#pass-strength-result").addClass("good").html(pwsL10n.good);break;case 4:a("#pass-strength-result").addClass("strong").html(pwsL10n.strong);break;case 5:a("#pass-strength-result").addClass("short").html(pwsL10n.mismatch);break;default:a("#pass-strength-result").addClass("short").html(pwsL10n["short"])}}a(function(){var b=a(".user-pass1-wrap"),c=b.find(".wp-pwd"),d=a("#pass1"),e=a("#pass2"),f=b.find(".wp-hide-pw"),g=b.find("button.wp-generate-pw"),h=a(".user-pass2-wrap"),i=b.closest("form"),j=a("#pass-strength-result"),k=a("#submit"),l=a("#createusersub"),m=a(".pw-checkbox"),n=a(".pw-weak"),o=window.generatePassword=function(){"function"!=typeof zxcvbn?setTimeout(o,50):(d.val(d.data("pw")),d.trigger("propertychange"),d.attr("type","text").focus(),d[0].setSelectionRange(100,100))};h.hide(),c.hide(),f.show(),g.show(),1==d.data("reveal")&&o(),i.on("submit",function(){e.val(d.val()),d.attr("type","password")}),d.on("input propertychange",function(){setTimeout(function(){var a=j.attr("class");d.removeClass("short bad good strong"),"undefined"!=typeof a&&(d.addClass(a),"short"==a||"bad"==a?(m.attr("checked")||(l.attr("disabled","disabled"),k.attr("disabled","disabled")),n.show()):(l.removeAttr("disabled"),k.removeAttr("disabled"),n.hide()))},1)}),m.change(function(){m.attr("checked")?(l.removeAttr("disabled"),k.removeAttr("disabled")):(l.attr("disabled","disabled"),k.attr("disabled","disabled"))}),e.on("input propertychange",function(){d.val(e.val()),d.trigger("propertychange")}),b.on("click","button.wp-generate-pw",function(){g.hide(),c.show(),o()}),f.on("click",function(){var a=f.attr("data-toggle");1==a?(d.attr("type","text"),f.attr("data-toggle",0).find(".text").text("hide")):(d.attr("type","password"),f.attr("data-toggle",1).find(".text").text("show")),d.focus(),d[0].setSelectionRange(100,100)})}),a(document).ready(function(){var c,d,e,f,g=a("#display_name");a("#pass1").val("").on("input propertychange",b),a("#pass2").val("").on("input propertychange",b),a("#pass-strength-result").show(),a(".color-palette").click(function(){a(this).siblings('input[name="admin_color"]').prop("checked",!0)}),g.length&&a("#first_name, #last_name, #nickname").bind("blur.user_profile",function(){var b=[],c={display_nickname:a("#nickname").val()||"",display_username:a("#user_login").val()||"",display_firstname:a("#first_name").val()||"",display_lastname:a("#last_name").val()||""};c.display_firstname&&c.display_lastname&&(c.display_firstlast=c.display_firstname+" "+c.display_lastname,c.display_lastfirst=c.display_lastname+" "+c.display_firstname),a.each(a("option",g),function(a,c){b.push(c.value)}),a.each(c,function(d,e){if(e){var f=e.replace(/<\/?[a-z][^>]*>/gi,"");c[d].length&&-1===a.inArray(f,b)&&(b.push(f),a("