Skip to content

Commit

Permalink
User Profile JS cleanup, props dd32, fixes #17910 for 3.2
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.automattic.com/wordpress/trunk@18364 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
azaozz committed Jun 28, 2011
1 parent 4e0de4a commit b80ad7a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
13 changes: 8 additions & 5 deletions wp-admin/js/user-profile.dev.js
Expand Up @@ -50,12 +50,15 @@

$('option', select).remove();
$.each(inputs, function( id, value ) {
var selected;
var val = value.replace(/<\/?[a-z][^>]*>/gi, '');

if ( inputs[id].length && $.inArray( value, dub ) == -1 ) {
dub.push(value);
selected = id == current ? 'selected="selected"' : '';
select.append('<option id="' + id + '" ' + selected + '">' + value + '</option>');
if ( inputs[id].length && $.inArray( val, dub ) == -1 ) {
dub.push(val);
$('<option />', {
'id': id,
'text': val,
'selected': (id == current)
}).appendTo( select );
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/user-profile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion wp-includes/script-loader.php
Expand Up @@ -266,7 +266,7 @@ function wp_default_scripts( &$scripts ) {
'l10n_print_after' => 'try{convertEntities(pwsL10n);}catch(e){};'
) );

$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110524' );
$scripts->add( 'user-profile', "/wp-admin/js/user-profile$suffix.js", array( 'jquery', 'password-strength-meter' ), '20110628' );
$scripts->add_data( 'user-profile', 'group', 1 );

$scripts->add( 'admin-bar', "/wp-includes/js/admin-bar$suffix.js", false, '20110131' );
Expand Down

0 comments on commit b80ad7a

Please sign in to comment.