mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
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:
parent
c03d9d3f01
commit
ef007d1a40
@ -1,11 +1,11 @@
|
||||
/* global pagenow */
|
||||
/* global pagenow, ajaxurl, postboxes, wpActiveEditor:true */
|
||||
var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
|
||||
|
||||
jQuery(document).ready( function($) {
|
||||
/* Dashboard Welcome Panel */
|
||||
var welcomePanel = $('#welcome-panel'),
|
||||
welcomePanelHide = $('#wp_welcome_panel-hide'),
|
||||
updateWelcomePanel = function( visible ) {
|
||||
updateWelcomePanel = function( visible ) {
|
||||
$.post( ajaxurl, {
|
||||
action: 'update-welcome-panel',
|
||||
visible: visible,
|
||||
@ -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));
|
||||
}
|
||||
|
||||
|
2
wp-admin/js/dashboard.min.js
vendored
2
wp-admin/js/dashboard.min.js
vendored
@ -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))});
|
@ -1,3 +1,4 @@
|
||||
/* global ajaxurl */
|
||||
jQuery(function($){
|
||||
$( 'body' ).bind( 'click.wp-gallery', function(e){
|
||||
var target = $( e.target ), id, img_size;
|
||||
|
@ -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') || '';
|
||||
|
Loading…
Reference in New Issue
Block a user