Fix JSHint errors in three files.

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

Built from https://develop.svn.wordpress.org/trunk@26232


git-svn-id: http://core.svn.wordpress.org/trunk@26139 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-11-15 23:19:09 +00:00
parent c03d9d3f01
commit ef007d1a40
4 changed files with 36 additions and 22 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 +1 @@
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){function b(){var a=1,b=parseInt(jQuery(window).width());b>799&&1299>b&&(a=2),b>1300&&1799>b&&(a=3),b>1800&&(a=4),jQuery(".metabox-holder").attr("class",jQuery(".metabox-holder").attr("class").replace(/columns-\d+/,"columns-"+a))}var c=a("#welcome-panel"),d=a("#wp_welcome_panel-hide"),e=function(b){a.post(ajaxurl,{action:"update-welcome-panel",visible:b,welcomepanelnonce:a("#welcomepanelnonce").val()})};c.hasClass("hidden")&&d.prop("checked")&&c.removeClass("hidden"),a(".welcome-panel-close, .welcome-panel-dismiss a",c).click(function(b){b.preventDefault(),c.addClass("hidden"),e(0),a("#wp_welcome_panel-hide").prop("checked",!1)}),d.click(function(){c.toggleClass("hidden",!this.checked),e(this.checked?1:0)}),ajaxWidgets=["dashboard_primary"],ajaxPopulateWidgets=function(b){function c(b,c){var d,e=a("#"+c+" div.inside:visible").find(".widget-loading");e.length&&(d=e.parent(),setTimeout(function(){d.load(ajaxurl+"?action=dashboard-widgets&widget="+c+"&pagenow="+pagenow,"",function(){d.hide().slideDown("normal",function(){a(this).css("display","")})})},500*b))}b?(b=b.toString(),-1!=a.inArray(b,ajaxWidgets)&&c(0,b)):a.each(ajaxWidgets,c)},ajaxPopulateWidgets(),postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets}),quickPressLoad=function(){var b,c=a("#quickpost-action");b=a("#quick-press").submit(function(){function c(){var b=a(".drafts ul li").first();b.css("background","#fffbe5"),setTimeout(function(){b.css("background","none")},1e3)}return a("#dashboard_quick_press #publishing-action .spinner").show(),a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!0),a.post(b.attr("action"),b.serializeArray(),function(b){a("#dashboard_quick_press .inside").html(b),a("#quick-press").removeClass("initial-form"),quickPressLoad(),c(),a("#title").focus()}),!1}),a("#publish").click(function(){c.val("post-quickpress-publish")}),a("#title, #tags-input, #content").each(function(){var b=a(this),c=a("#"+this.id+"-prompt-text");""===this.value&&c.removeClass("screen-reader-text"),c.click(function(){a(this).addClass("screen-reader-text"),b.focus()}),b.blur(function(){""===this.value&&c.removeClass("screen-reader-text")}),b.focus(function(){c.addClass("screen-reader-text")})}),a("#quick-press").on("click focusin",function(){a(this).addClass("quickpress-open"),a("#description-wrap, p.submit").slideDown(200),wpActiveEditor="content"})},quickPressLoad(),a(".show-more a").on("click",function(b){a(this).fadeOut().closest(".activity-block").find("li.hidden").fadeIn().removeClass("hidden"),b.preventDefault()}),jQuery(document).ready(function(){b()}),jQuery(window).resize(_.debounce(function(){b()},30))}); var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){function b(){var a=1,b=parseInt(jQuery(window).width(),10);b>799&&1299>b&&(a=2),b>1300&&1799>b&&(a=3),b>1800&&(a=4),jQuery(".metabox-holder").attr("class",jQuery(".metabox-holder").attr("class").replace(/columns-\d+/,"columns-"+a))}var c=a("#welcome-panel"),d=a("#wp_welcome_panel-hide"),e=function(b){a.post(ajaxurl,{action:"update-welcome-panel",visible:b,welcomepanelnonce:a("#welcomepanelnonce").val()})};c.hasClass("hidden")&&d.prop("checked")&&c.removeClass("hidden"),a(".welcome-panel-close, .welcome-panel-dismiss a",c).click(function(b){b.preventDefault(),c.addClass("hidden"),e(0),a("#wp_welcome_panel-hide").prop("checked",!1)}),d.click(function(){c.toggleClass("hidden",!this.checked),e(this.checked?1:0)}),ajaxWidgets=["dashboard_primary"],ajaxPopulateWidgets=function(b){function c(b,c){var d,e=a("#"+c+" div.inside:visible").find(".widget-loading");e.length&&(d=e.parent(),setTimeout(function(){d.load(ajaxurl+"?action=dashboard-widgets&widget="+c+"&pagenow="+pagenow,"",function(){d.hide().slideDown("normal",function(){a(this).css("display","")})})},500*b))}b?(b=b.toString(),-1!==a.inArray(b,ajaxWidgets)&&c(0,b)):a.each(ajaxWidgets,c)},ajaxPopulateWidgets(),postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets}),quickPressLoad=function(){var b,c=a("#quickpost-action");b=a("#quick-press").submit(function(){function c(){var b=a(".drafts ul li").first();b.css("background","#fffbe5"),setTimeout(function(){b.css("background","none")},1e3)}return a("#dashboard_quick_press #publishing-action .spinner").show(),a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",!0),a.post(b.attr("action"),b.serializeArray(),function(b){a("#dashboard_quick_press .inside").html(b),a("#quick-press").removeClass("initial-form"),quickPressLoad(),c(),a("#title").focus()}),!1}),a("#publish").click(function(){c.val("post-quickpress-publish")}),a("#title, #tags-input, #content").each(function(){var b=a(this),c=a("#"+this.id+"-prompt-text");""===this.value&&c.removeClass("screen-reader-text"),c.click(function(){a(this).addClass("screen-reader-text"),b.focus()}),b.blur(function(){""===this.value&&c.removeClass("screen-reader-text")}),b.focus(function(){c.addClass("screen-reader-text")})}),a("#quick-press").on("click focusin",function(){a(this).addClass("quickpress-open"),a("#description-wrap, p.submit").slideDown(200),wpActiveEditor="content"})},quickPressLoad(),a(".show-more a").on("click",function(b){a(this).fadeOut().closest(".activity-block").find("li.hidden").fadeIn().removeClass("hidden"),b.preventDefault()}),jQuery(document).ready(function(){b()}),jQuery(window).resize(_.debounce(function(){b()},30))});

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') || '';