Changeset 17587
- Timestamp:
- 04/01/2011 08:40:16 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/user-profile.dev.js
r15998 r17587 30 30 } 31 31 32 $(document).ready( 32 $(document).ready(function() { 33 33 $('#pass1').val('').keyup( check_pass_strength ); 34 34 $('#pass2').val('').keyup( check_pass_strength ); 35 35 $('#pass-strength-result').show(); 36 36 $('.color-palette').click(function(){$(this).siblings('input[name=admin_color]').attr('checked', 'checked')}); 37 $('#nickname').blur(function(){ 38 var str = $(this).val() || $('#user_login').val(); 39 var select = $('#display_name'); 40 var sel = select.children('option:selected').attr('id'); 41 select.children('#display_nickname').remove(); 42 if ( ! select.children('option[value=' + str + ']').length ) 43 select.append('<option id="display_nickname" value="' + str + '">' + str + '</option>'); 44 $('#'+sel).attr('selected', 'selected'); 37 $('#first_name, #last_name, #nickname').blur(function(){ 38 var select = $('#display_name'), current = select.find('option:selected').attr('id'), dub = [], 39 inputs = { 40 display_nickname : $('#nickname').val(), 41 display_username : $('#user_login').val(), 42 display_firstname : $('#first_name').val(), 43 display_lastname : $('#last_name').val() 44 }; 45 46 if ( inputs.display_firstname && inputs.display_lastname ) { 47 inputs['display_firstlast'] = inputs.display_firstname + ' ' + inputs.display_lastname; 48 inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname; 49 } 50 51 $('option', select).remove(); 52 $.each(inputs, function( id, value ) { 53 var selected; 54 55 if ( inputs[id].length && $.inArray( value, dub ) == -1 ) { 56 dub.push(value); 57 selected = id == current ? 'selected="selected"' : ''; 58 select.append('<option id="' + id + '" ' + selected + '">' + value + '</option>'); 59 } 60 }); 45 61 }); 46 $('#first_name, #last_name').blur(function(){ 47 var select = $('#display_name'); 48 var first = $('#first_name').val(), last = $('#last_name').val(); 49 var sel = select.children('option:selected').attr('id'); 50 $('#display_firstname, #display_lastname, #display_firstlast, #display_lastfirst').remove(); 51 if ( first && ! select.children('option[value=' + first + ']').length ) 52 select.append('<option id="display_firstname" value="' + first + '">' + first + '</option>'); 53 if ( last && ! select.children('option[value=' + last + ']').length ) 54 select.append('<option id="display_lastname" value="' + last + '">' + last + '</option>'); 55 if ( first && last ) { 56 if ( ! select.children('option[value=' + first + ' ' + last + ']').length ) 57 select.append('<option id="display_firstlast" value="' + first + ' ' + last + '">' + first + ' ' + last + '</option>'); 58 if ( ! select.children('option[value=' + last + ' ' + first + ']').length ) 59 select.append('<option id="display_lastfirst" value="' + last + ' ' + first + '">' + last + ' ' + first + '</option>'); 60 } 61 $('#'+sel).attr('selected', 'selected'); 62 }); 63 }); 62 }); 64 63 65 64 })(jQuery); -
trunk/wp-admin/js/user-profile.js
r17286 r17587 1 (function(a){function b(){var e=a("#pass1").val(),d=a("#user_login").val(),c=a("#pass2").val(),f;a("#pass-strength-result").removeClass("short bad good strong");if(!e){a("#pass-strength-result").html(pwsL10n.empty);return}f=passwordStrength(e,d,c);switch(f){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(document).ready(function(){a("#pass1").val("").keyup(b);a("#pass2").val("").keyup(b);a("#pass-strength-result").show();a(".color-palette").click(function(){a(this).siblings("input[name=admin_color]").attr("checked","checked")});a("# nickname").blur(function(){var e=a(this).val()||a("#user_login").val();var c=a("#display_name");var d=c.children("option:selected").attr("id");c.children("#display_nickname").remove();if(!c.children("option[value="+e+"]").length){c.append('<option id="display_nickname" value="'+e+'">'+e+"</option>")}a("#"+d).attr("selected","selected")});a("#first_name, #last_name").blur(function(){var c=a("#display_name");var f=a("#first_name").val(),d=a("#last_name").val();var e=c.children("option:selected").attr("id");a("#display_firstname, #display_lastname, #display_firstlast, #display_lastfirst").remove();if(f&&!c.children("option[value="+f+"]").length){c.append('<option id="display_firstname" value="'+f+'">'+f+"</option>")}if(d&&!c.children("option[value="+d+"]").length){c.append('<option id="display_lastname" value="'+d+'">'+d+"</option>")}if(f&&d){if(!c.children("option[value="+f+" "+d+"]").length){c.append('<option id="display_firstlast" value="'+f+" "+d+'">'+f+" "+d+"</option>")}if(!c.children("option[value="+d+" "+f+"]").length){c.append('<option id="display_lastfirst" value="'+d+" "+f+'">'+d+" "+f+"</option>")}}a("#"+e).attr("selected","selected")})})})(jQuery);1 (function(a){function b(){var e=a("#pass1").val(),d=a("#user_login").val(),c=a("#pass2").val(),f;a("#pass-strength-result").removeClass("short bad good strong");if(!e){a("#pass-strength-result").html(pwsL10n.empty);return}f=passwordStrength(e,d,c);switch(f){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(document).ready(function(){a("#pass1").val("").keyup(b);a("#pass2").val("").keyup(b);a("#pass-strength-result").show();a(".color-palette").click(function(){a(this).siblings("input[name=admin_color]").attr("checked","checked")});a("#first_name, #last_name, #nickname").blur(function(){var c=a("#display_name"),e=c.find("option:selected").attr("id"),f=[],d={display_nickname:a("#nickname").val(),display_username:a("#user_login").val(),display_firstname:a("#first_name").val(),display_lastname:a("#last_name").val()};if(d.display_firstname&&d.display_lastname){d.display_firstlast=d.display_firstname+" "+d.display_lastname;d.display_lastfirst=d.display_lastname+" "+d.display_firstname}a("option",c).remove();a.each(d,function(i,h){var g;if(d[i].length&&a.inArray(h,f)==-1){f.push(h);g=i==e?'selected="selected"':"";c.append('<option id="'+i+'" '+g+'">'+h+"</option>")}})})})})(jQuery); -
trunk/wp-admin/user-edit.php
r17574 r17587 282 282 <?php 283 283 $public_display = array(); 284 $public_display['display_nickname'] = $profileuser->nickname; 284 285 $public_display['display_username'] = $profileuser->user_login; 285 $public_display['display_nickname'] = $profileuser->nickname; 286 286 287 if ( !empty($profileuser->first_name) ) 287 288 $public_display['display_firstname'] = $profileuser->first_name; 289 288 290 if ( !empty($profileuser->last_name) ) 289 291 $public_display['display_lastname'] = $profileuser->last_name; 292 290 293 if ( !empty($profileuser->first_name) && !empty($profileuser->last_name) ) { 291 294 $public_display['display_firstlast'] = $profileuser->first_name . ' ' . $profileuser->last_name; 292 295 $public_display['display_lastfirst'] = $profileuser->last_name . ' ' . $profileuser->first_name; 293 296 } 297 294 298 if ( !in_array( $profileuser->display_name, $public_display ) ) // Only add this if it isn't duplicated elsewhere 295 299 $public_display = array( 'display_displayname' => $profileuser->display_name ) + $public_display; 300 296 301 $public_display = array_map( 'trim', $public_display ); 297 302 $public_display = array_unique( $public_display ); 303 298 304 foreach ( $public_display as $id => $item ) { 299 305 ?> 300 <option id="<?php echo $id; ?>" value="<?php echo esc_attr($item); ?>"<?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option>306 <option id="<?php echo $id; ?>"<?php selected( $profileuser->display_name, $item ); ?>><?php echo $item; ?></option> 301 307 <?php 302 308 } -
trunk/wp-includes/script-loader.php
r17565 r17587 260 260 ) ); 261 261 262 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110 113' );262 $scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110401' ); 263 263 $scripts->add_data( 'user-profile', 'group', 1 ); 264 264
Note: See TracChangeset
for help on using the changeset viewer.