Make WordPress Core

Changeset 26266


Ignore:
Timestamp:
11/19/2013 04:39:05 AM (13 years ago)
Author:
nacin
Message:

Fix JShint errors in user-profile.js.

props dougwollison.
fixes #26016.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/user-profile.js

    r26137 r26266  
     1/* global ajaxurl, pwsL10n, svgPainter */
    12(function($){
    23
    34        function check_pass_strength() {
    4                 var pass1 = $('#pass1').val(), user = $('#user_login').val(), pass2 = $('#pass2').val(), strength;
     5                var pass1 = $('#pass1').val(), pass2 = $('#pass2').val(), strength;
    56
    67                $('#pass-strength-result').removeClass('short bad good strong');
    … …  
    1415                switch ( strength ) {
    1516                        case 2:
    16                                 $('#pass-strength-result').addClass('bad').html( pwsL10n['bad'] );
     17                                $('#pass-strength-result').addClass('bad').html( pwsL10n.bad );
    1718                                break;
    1819                        case 3:
    19                                 $('#pass-strength-result').addClass('good').html( pwsL10n['good'] );
     20                                $('#pass-strength-result').addClass('good').html( pwsL10n.good );
    2021                                break;
    2122                        case 4:
    22                                 $('#pass-strength-result').addClass('strong').html( pwsL10n['strong'] );
     23                                $('#pass-strength-result').addClass('strong').html( pwsL10n.strong );
    2324                                break;
    2425                        case 5:
    25                                 $('#pass-strength-result').addClass('short').html( pwsL10n['mismatch'] );
     26                                $('#pass-strength-result').addClass('short').html( pwsL10n.mismatch );
    2627                                break;
    2728                        default:
    … …  
    3132
    3233        $(document).ready( function() {
    33                 var select = $('#display_name');
     34                var $colorpicker, $stylesheet, user_id, current_user_id,
     35                        select = $( '#display_name' );
    3436
    3537                $('#pass1').val('').keyup( check_pass_strength );
    … …  
    5153
    5254                                if ( inputs.display_firstname && inputs.display_lastname ) {
    53                                         inputs['display_firstlast'] = inputs.display_firstname + ' ' + inputs.display_lastname;
    54                                         inputs['display_lastfirst'] = inputs.display_lastname + ' ' + inputs.display_firstname;
     55                                        inputs.display_firstlast = inputs.display_firstname + ' ' + inputs.display_lastname;
     56                                        inputs.display_lastfirst = inputs.display_lastname + ' ' + inputs.display_firstname;
    5557                                }
    5658
    … …  
    6062
    6163                                $.each(inputs, function( id, value ) {
    62                                         if ( ! value )
     64                                        if ( ! value ) {
    6365                                                return;
     66                                        }
    6467
    6568                                        var val = value.replace(/<\/?[a-z][^>]*>/gi, '');
    6669
    67                                         if ( inputs[id].length && $.inArray( val, dub ) == -1 ) {
     70                                        if ( inputs[id].length && $.inArray( val, dub ) === -1 ) {
    6871                                                dub.push(val);
    6972                                                $('<option />', {
    … …  
    7578                }
    7679
    77                 var $colorpicker = $( '#color-picker' ),
    78                         $stylesheet = $( '#colors-css' ),
    79                         user_id = $( 'input#user_id' ).val(),
    80                         current_user_id = $( 'input[name="checkuser_id"]' ).val();
     80                $colorpicker = $( '#color-picker' );
     81                $stylesheet = $( '#colors-css' );
     82                user_id = $( 'input#user_id' ).val();
     83                current_user_id = $( 'input[name="checkuser_id"]' ).val();
    8184
    8285                // dropdown toggle
    … …  
    9093
    9194                        // update selected
    92                         $( this ).siblings( '.selected' ).removeClass( 'selected' )
     95                        $( this ).siblings( '.selected' ).removeClass( 'selected' );
    9396                        $( this ).addClass( 'selected' );
    9497                        $( this ).find( 'input' ).prop( 'checked', true );
    … …  
    100103
    101104                        // preview/save color scheme
    102                         if ( user_id == current_user_id ) {
     105                        if ( user_id === current_user_id ) {
    103106
    104107                                // repaint icons
Note: See TracChangeset for help on using the changeset viewer.