From e2c06eeea4abb2336642f590463559314ed443b1 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 1 Dec 2010 20:48:52 +0000 Subject: [PATCH] Prevent double Thickbox caption line for Dashboard QuickPress uploads. props ocean90. fixes #15169 git-svn-id: https://develop.svn.wordpress.org/trunk@16671 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/dashboard.dev.js | 7 +------ wp-admin/js/dashboard.js | 2 +- wp-includes/script-loader.php | 2 +- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/wp-admin/js/dashboard.dev.js b/wp-admin/js/dashboard.dev.js index a4c0bad374..a43ffe8637 100644 --- a/wp-admin/js/dashboard.dev.js +++ b/wp-admin/js/dashboard.dev.js @@ -19,12 +19,8 @@ jQuery(document).ready( function($) { p.load( ajaxurl.replace( '/admin-ajax.php', '' ) + '/index-extra.php?jax=' + id, '', function() { p.hide().slideDown('normal', function(){ $(this).css('display', ''); - if ( 'dashboard_plugins' == id && $.isFunction(tb_init) ) - tb_init('#dashboard_plugins a.thickbox'); - if ( 'dashboard_quick_press' == id && $.isFunction(tb_init) ) { - tb_init('#dashboard_quick_press a.thickbox'); + if ( 'dashboard_quick_press' == id ) quickPressLoad(); - } }); }); }, i * 500 ); @@ -62,7 +58,6 @@ jQuery(document).ready( function($) { $('#dashboard_quick_press ul').find('li').each( function() { $('#dashboard_recent_drafts ul').prepend( this ); } ).end().remove(); - tb_init('a.thickbox'); quickPressLoad(); } ); return false; diff --git a/wp-admin/js/dashboard.js b/wp-admin/js/dashboard.js index 63ce1f508c..e36ff3c6e5 100644 --- a/wp-admin/js/dashboard.js +++ b/wp-admin/js/dashboard.js @@ -1 +1 @@ -var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins","dashboard_quick_press"];ajaxPopulateWidgets=function(b){show=function(g,c){var f,d=a("#"+g+" div.inside:visible").find(".widget-loading");if(d.length){f=d.parent();setTimeout(function(){f.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+g,"",function(){f.hide().slideDown("normal",function(){a(this).css("display","");if("dashboard_plugins"==g&&a.isFunction(tb_init)){tb_init("#dashboard_plugins a.thickbox")}if("dashboard_quick_press"==g&&a.isFunction(tb_init)){tb_init("#dashboard_quick_press a.thickbox");quickPressLoad()}})})},c*500)}};if(b){b=b.toString();if(a.inArray(b,ajaxWidgets)!=-1){show(b,0)}}else{a.each(ajaxWidgets,function(c){show(this,c)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var b=a("#quickpost-action"),c;c=a("#quick-press").submit(function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==b.val()){b.val("post-quickpress-publish")}a("#dashboard_quick_press div.inside").load(c.attr("action"),c.serializeArray(),function(){a("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");a('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");a("#dashboard_quick_press ul").next("p").remove();a("#dashboard_quick_press ul").find("li").each(function(){a("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})}}); \ No newline at end of file +var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function($){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins","dashboard_quick_press"];ajaxPopulateWidgets=function(el){show=function(id,i){var p,e=$("#"+id+" div.inside:visible").find(".widget-loading");if(e.length){p=e.parent();setTimeout(function(){p.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+id,"",function(){p.hide().slideDown("normal",function(){$(this).css("display","");if("dashboard_quick_press"==id){quickPressLoad()}})})},i*500)}};if(el){el=el.toString();if($.inArray(el,ajaxWidgets)!=-1){show(el,0)}}else{$.each(ajaxWidgets,function(i){show(this,i)})}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var act=$("#quickpost-action"),t;t=$("#quick-press").submit(function(){$("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==act.val()){act.val("post-quickpress-publish")}$("#dashboard_quick_press div.inside").load(t.attr("action"),t.serializeArray(),function(){$("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");$("#dashboard_quick_press ul").next("p").remove();$("#dashboard_quick_press ul").find("li").each(function(){$("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});$("#publish").click(function(){act.val("post-quickpress-publish")})}}); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index ecb6e0813d..2b7472b3df 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -414,7 +414,7 @@ function wp_default_scripts( &$scripts ) { $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' ); - $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20100819' ); + $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20101201' ); $scripts->add_data( 'dashboard', 'group', 1 ); $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102' );