Fix JSHint errors in 3 files.
props atimmer. fixes #25990, #25993, #26008. Built from https://develop.svn.wordpress.org/trunk@26199 git-svn-id: http://core.svn.wordpress.org/trunk@26107 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8daa128928
commit
12acfa4e81
|
@ -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;
|
||||
|
|
|
@ -1 +1 @@
|
|||
window.wp=window.wp||{};var passwordStrength;!function(a){wp.passwordStrength={meter:function(b,c,d){if(a.isArray(c)||(c=[c.toString()]),b!=d&&d&&d.length>0)return 5;var e=zxcvbn(b,c);return e.score},userInputBlacklist:function(){var b,c,d,e,f=[],g=[],h=["user_login","first_name","last_name","nickname","display_name","email","url","description","weblog_title","admin_email"];for(f.push(document.title),f.push(document.URL),c=h.length,b=0;c>b;b++)e=a("#"+h[b]),0!=e.length&&(f.push(e[0].defaultValue),f.push(e.val()));for(d=f.length,b=0;d>b;b++)f[b]&&(g=g.concat(f[b].replace(/\W/g," ").split(" ")));return g=a.grep(g,function(b,c){return""==b||4>b.length?!1:a.inArray(b,g)===c})}},passwordStrength=wp.passwordStrength.meter}(jQuery);
|
||||
window.wp=window.wp||{};var passwordStrength;!function(a){wp.passwordStrength={meter:function(b,c,d){if(a.isArray(c)||(c=[c.toString()]),b!=d&&d&&d.length>0)return 5;var e=zxcvbn(b,c);return e.score},userInputBlacklist:function(){var b,c,d,e,f=[],g=[],h=["user_login","first_name","last_name","nickname","display_name","email","url","description","weblog_title","admin_email"];for(f.push(document.title),f.push(document.URL),c=h.length,b=0;c>b;b++)e=a("#"+h[b]),0!==e.length&&(f.push(e[0].defaultValue),f.push(e.val()));for(d=f.length,b=0;d>b;b++)f[b]&&(g=g.concat(f[b].replace(/\W/g," ").split(" ")));return g=a.grep(g,function(b,c){return""===b||4>b.length?!1:a.inArray(b,g)===c})}},passwordStrength=wp.passwordStrength.meter}(jQuery);
|
|
@ -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');
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue