Fix JSHint errors in three files.

props tommcfarlin.
fixes #25942, #25943, #25944.


git-svn-id: https://develop.svn.wordpress.org/trunk@26232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-11-15 23:18:18 +00:00
parent b05fb903ac
commit 3d0c903bfd
3 changed files with 35 additions and 21 deletions

View File

@ -1,4 +1,4 @@
/* global pagenow */ /* global pagenow, ajaxurl, postboxes, wpActiveEditor:true */
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad; var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
jQuery(document).ready( function($) { jQuery(document).ready( function($) {
@ -13,8 +13,9 @@ jQuery(document).ready( function($) {
}); });
}; };
if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') ) if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') ) {
welcomePanel.removeClass('hidden'); welcomePanel.removeClass('hidden');
}
$('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) { $('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) {
e.preventDefault(); e.preventDefault();
@ -48,8 +49,9 @@ jQuery(document).ready( function($) {
if ( el ) { if ( el ) {
el = el.toString(); el = el.toString();
if ( $.inArray(el, ajaxWidgets) != -1 ) if ( $.inArray(el, ajaxWidgets) !== -1 ) {
show(0, el); show(0, el);
}
} else { } else {
$.each( ajaxWidgets, show ); $.each( ajaxWidgets, show );
} }
@ -90,8 +92,9 @@ jQuery(document).ready( function($) {
$('#title, #tags-input, #content').each( function() { $('#title, #tags-input, #content').each( function() {
var input = $(this), prompt = $('#' + this.id + '-prompt-text'); var input = $(this), prompt = $('#' + this.id + '-prompt-text');
if ( '' === this.value ) if ( '' === this.value ) {
prompt.removeClass('screen-reader-text'); prompt.removeClass('screen-reader-text');
}
prompt.click( function() { prompt.click( function() {
$(this).addClass('screen-reader-text'); $(this).addClass('screen-reader-text');
@ -99,8 +102,9 @@ jQuery(document).ready( function($) {
}); });
input.blur( function() { input.blur( function() {
if ( '' === this.value ) if ( '' === this.value ) {
prompt.removeClass('screen-reader-text'); prompt.removeClass('screen-reader-text');
}
}); });
input.focus( function() { input.focus( function() {
@ -109,8 +113,8 @@ jQuery(document).ready( function($) {
}); });
$('#quick-press').on( 'click focusin', function() { $('#quick-press').on( 'click focusin', function() {
$(this).addClass("quickpress-open"); $(this).addClass('quickpress-open');
$("#description-wrap, p.submit").slideDown(200); $('#description-wrap, p.submit').slideDown(200);
wpActiveEditor = 'content'; wpActiveEditor = 'content';
}); });
}; };
@ -120,10 +124,10 @@ jQuery(document).ready( function($) {
$( '.show-more a' ).on( 'click', function(e) { $( '.show-more a' ).on( 'click', function(e) {
$( this ).fadeOut().closest('.activity-block').find( 'li.hidden' ).fadeIn().removeClass( 'hidden' ); $( this ).fadeOut().closest('.activity-block').find( 'li.hidden' ).fadeIn().removeClass( 'hidden' );
e.preventDefault(); e.preventDefault();
}) });
// Dashboard columns // Dashboard columns
jQuery(document).ready(function ($) { jQuery(document).ready(function () {
// Update main column count on load // Update main column count on load
updateColumnCount(); updateColumnCount();
}); });
@ -134,13 +138,19 @@ jQuery(document).ready( function($) {
function updateColumnCount() { function updateColumnCount() {
var cols = 1, var cols = 1,
windowWidth = parseInt(jQuery(window).width()); windowWidth = parseInt(jQuery(window).width(), 10);
if (799 < windowWidth && 1299 > windowWidth)
if (799 < windowWidth && 1299 > windowWidth) {
cols = 2; cols = 2;
if (1300 < windowWidth && 1799 > windowWidth) }
if (1300 < windowWidth && 1799 > windowWidth) {
cols = 3; cols = 3;
if (1800 < windowWidth) }
if (1800 < windowWidth) {
cols = 4; cols = 4;
}
jQuery('.metabox-holder').attr('class', jQuery('.metabox-holder').attr('class').replace(/columns-\d+/, 'columns-' + cols)); jQuery('.metabox-holder').attr('class', jQuery('.metabox-holder').attr('class').replace(/columns-\d+/, 'columns-' + cols));
} }

View File

@ -1,3 +1,4 @@
/* global ajaxurl */
jQuery(function($){ jQuery(function($){
$( 'body' ).bind( 'click.wp-gallery', function(e){ $( 'body' ).bind( 'click.wp-gallery', function(e){
var target = $( e.target ), id, img_size; var target = $( e.target ), id, img_size;

View File

@ -1,4 +1,4 @@
/* global tb_click */
var thickDims, tbWidth, tbHeight; var thickDims, tbWidth, tbHeight;
jQuery(document).ready(function($) { jQuery(document).ready(function($) {
@ -12,28 +12,31 @@ jQuery(document).ready(function($) {
tbWindow.width(w).height(h); tbWindow.width(w).height(h);
$('#TB_iframeContent').width(w).height(h - 27); $('#TB_iframeContent').width(w).height(h - 27);
tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'}); tbWindow.css({'margin-left': '-' + parseInt((w / 2),10) + 'px'});
if ( typeof document.body.style.maxWidth != 'undefined' ) if ( typeof document.body.style.maxWidth !== 'undefined' ) {
tbWindow.css({'top':'30px','margin-top':'0'}); tbWindow.css({'top':'30px','margin-top':'0'});
} }
}
}; };
thickDims(); thickDims();
$(window).resize( function() { thickDims() } ); $(window).resize( function() { thickDims(); } );
$('a.thickbox-preview').click( function() { $('a.thickbox-preview').click( function() {
tb_click.call(this); tb_click.call(this);
var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text; var alink = $(this).parents('.available-theme').find('.activatelink'), link = '', href = $(this).attr('href'), url, text;
if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) if ( tbWidth = href.match(/&tbWidth=[0-9]+/) ) {
tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10); tbWidth = parseInt(tbWidth[0].replace(/[^0-9]+/g, ''), 10);
else } else {
tbWidth = $(window).width() - 90; tbWidth = $(window).width() - 90;
}
if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) if ( tbHeight = href.match(/&tbHeight=[0-9]+/) ) {
tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10); tbHeight = parseInt(tbHeight[0].replace(/[^0-9]+/g, ''), 10);
else } else {
tbHeight = $(window).height() - 60; tbHeight = $(window).height() - 60;
}
if ( alink.length ) { if ( alink.length ) {
url = alink.attr('href') || ''; url = alink.attr('href') || '';