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;
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');
}
$('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function(e) {
e.preventDefault();
@ -48,8 +49,9 @@ jQuery(document).ready( function($) {
if ( el ) {
el = el.toString();
if ( $.inArray(el, ajaxWidgets) != -1 )
if ( $.inArray(el, ajaxWidgets) !== -1 ) {
show(0, el);
}
} else {
$.each( ajaxWidgets, show );
}
@ -90,8 +92,9 @@ jQuery(document).ready( function($) {
$('#title, #tags-input, #content').each( function() {
var input = $(this), prompt = $('#' + this.id + '-prompt-text');
if ( '' === this.value )
if ( '' === this.value ) {
prompt.removeClass('screen-reader-text');
}
prompt.click( function() {
$(this).addClass('screen-reader-text');
@ -99,8 +102,9 @@ jQuery(document).ready( function($) {
});
input.blur( function() {
if ( '' === this.value )
if ( '' === this.value ) {
prompt.removeClass('screen-reader-text');
}
});
input.focus( function() {
@ -109,8 +113,8 @@ jQuery(document).ready( function($) {
});
$('#quick-press').on( 'click focusin', function() {
$(this).addClass("quickpress-open");
$("#description-wrap, p.submit").slideDown(200);
$(this).addClass('quickpress-open');
$('#description-wrap, p.submit').slideDown(200);
wpActiveEditor = 'content';
});
};
@ -120,10 +124,10 @@ jQuery(document).ready( function($) {
$( '.show-more a' ).on( 'click', function(e) {
$( this ).fadeOut().closest('.activity-block').find( 'li.hidden' ).fadeIn().removeClass( 'hidden' );
e.preventDefault();
})
});
// Dashboard columns
jQuery(document).ready(function ($) {
jQuery(document).ready(function () {
// Update main column count on load
updateColumnCount();
});
@ -134,13 +138,19 @@ jQuery(document).ready( function($) {
function updateColumnCount() {
var cols = 1,
windowWidth = parseInt(jQuery(window).width());
if (799 < windowWidth && 1299 > windowWidth)
windowWidth = parseInt(jQuery(window).width(), 10);
if (799 < windowWidth && 1299 > windowWidth) {
cols = 2;
if (1300 < windowWidth && 1799 > windowWidth)
}
if (1300 < windowWidth && 1799 > windowWidth) {
cols = 3;
if (1800 < windowWidth)
}
if (1800 < windowWidth) {
cols = 4;
}
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($){
$( 'body' ).bind( 'click.wp-gallery', function(e){
var target = $( e.target ), id, img_size;

View File

@ -1,4 +1,4 @@
/* global tb_click */
var thickDims, tbWidth, tbHeight;
jQuery(document).ready(function($) {
@ -12,28 +12,31 @@ jQuery(document).ready(function($) {
tbWindow.width(w).height(h);
$('#TB_iframeContent').width(w).height(h - 27);
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'});
}
}
};
thickDims();
$(window).resize( function() { thickDims() } );
$(window).resize( function() { thickDims(); } );
$('a.thickbox-preview').click( function() {
tb_click.call(this);
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);
else
} else {
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);
else
} else {
tbHeight = $(window).height() - 60;
}
if ( alink.length ) {
url = alink.attr('href') || '';