Fix JSHint errors in 3 files.

props atimmer.
fixes #25990, #25993, #26008.


git-svn-id: https://develop.svn.wordpress.org/trunk@26199 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-11-15 05:11:10 +00:00
parent f25abde28f
commit 46a5e7a863
3 changed files with 12 additions and 6 deletions

View File

@ -1,3 +1,4 @@
/* global zxcvbn */
window.wp = window.wp || {};
var passwordStrength;
@ -40,7 +41,7 @@ var passwordStrength;
for ( i = 0; i < userInputFieldsLength; i++ ) {
currentField = $( '#' + userInputFields[ i ] );
if ( 0 == currentField.length ) {
if ( 0 === currentField.length ) {
continue;
}
@ -58,7 +59,7 @@ var passwordStrength;
// Remove empty values, short words, and duplicates. Short words are likely to cause many false positives.
blacklist = $.grep( blacklist, function( value, key ) {
if ( '' == value || 4 > value.length ) {
if ( '' === value || 4 > value.length ) {
return false;
}
@ -67,7 +68,7 @@ var passwordStrength;
return blacklist;
}
}
};
// Backwards compatibility.
passwordStrength = wp.passwordStrength.meter;

View File

@ -1,3 +1,5 @@
/* global plugininstallL10n, tb_click, confirm */
/* Plugin Browser Thickbox related JS*/
var tb_position;
jQuery(document).ready(function($) {
@ -13,7 +15,7 @@ jQuery(document).ready(function($) {
tbWindow.css({'margin-left': '-' + parseInt((( W - 50 ) / 2),10) + 'px'});
if ( typeof document.body.style.maxWidth != 'undefined' )
tbWindow.css({'top': 20 + adminbar_height + 'px','margin-top':'0'});
};
}
return $('a.thickbox').each( function() {
var href = $(this).attr('href');

View File

@ -1,9 +1,12 @@
function WPSetAsThumbnail(id, nonce){
/* global setPostThumbnailL10n, ajaxurl, post_id, alert */
/* exported WPSetAsThumbnail */
function WPSetAsThumbnail( id, nonce ) {
var $link = jQuery('a#wp-post-thumbnail-' + id);
$link.text( setPostThumbnailL10n.saving );
jQuery.post(ajaxurl, {
action:"set-post-thumbnail", post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent(document.cookie)
action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
}, function(str){
var win = window.dialogArguments || opener || parent || top;
$link.text( setPostThumbnailL10n.setThumbnail );