Don't load the QuickPress widget via XHR. see #16927. Reverts [16725] as it's no longer needed. Reverts part of [14815], which introduced the behavior, see #10917.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17743 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-04-28 12:02:24 +00:00
parent 24ea36e302
commit 8b5122b411
9 changed files with 20 additions and 25 deletions

File diff suppressed because one or more lines are too long

View File

@ -277,14 +277,6 @@ div.postbox div.inside {
margin-right: 10px;
}
#dashboard_quick_press {
min-height: 200px;
}
#dashboard_quick_press.closed {
min-height: 0;
}
#dashboard_quick_press .input-text-wrap,
#dashboard_quick_press .textarea-wrap {
margin: 0 0 1em 5em;

View File

@ -457,7 +457,7 @@ function wp_network_dashboard_right_now() {
do_action( 'mu_activity_box_end' );
}
function wp_dashboard_quick_press_output() {
function wp_dashboard_quick_press() {
global $post_ID;
$drafts = false;
@ -550,10 +550,6 @@ function wp_dashboard_quick_press_output() {
wp_dashboard_recent_drafts( $drafts );
}
function wp_dashboard_quick_press() {
echo '<p class="widget-loading hide-if-no-js">' . __( 'Loading&#8230;' ) . '</p><p class="describe hide-if-js">' . __('This widget requires JavaScript.') . '</p>';
}
function wp_dashboard_recent_drafts( $drafts = false ) {
if ( !$drafts ) {
$drafts_query = new WP_Query( array(

View File

@ -688,3 +688,16 @@ function get_others_pending($user_id) {
return get_others_unpublished_posts($user_id, 'pending');
}
/**
* Output the QuickPress dashboard widget.
*
* @since 3.0.0
* @deprecated 3.2.0
* @deprecated Use wp_dashboard_quick_press()
* @see wp_dashboard_quick_press()
*/
function wp_dashboard_quick_press_output() {
_deprecated_function( __FUNCTION__, '3.2', 'wp_dashboard_quick_press()' );
wp_dashboard_quick_press();
}

View File

@ -33,10 +33,6 @@ case 'dashboard_plugins' :
wp_dashboard_plugins_output();
break;
case 'dashboard_quick_press' :
wp_dashboard_quick_press_output();
break;
}
?>

View File

@ -7,7 +7,6 @@ jQuery(document).ready( function($) {
'dashboard_primary',
'dashboard_secondary',
'dashboard_plugins',
'dashboard_quick_press'
];
ajaxPopulateWidgets = function(el) {
@ -19,8 +18,6 @@ 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_quick_press' == id )
quickPressLoad();
});
});
}, i * 500 );
@ -66,5 +63,6 @@ jQuery(document).ready( function($) {
$('#publish').click( function() { act.val( 'post-quickpress-publish' ); } );
};
quickPressLoad();
} );

View File

@ -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_quick_press"==g){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();quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})}});
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(a){ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins",];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","")})})},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();quickPressLoad()});return false});a("#publish").click(function(){b.val("post-quickpress-publish")})};quickPressLoad()});

View File

@ -127,7 +127,7 @@ case 'post-quickpress-save':
$_POST['post_ID'] = $post_id;
// output the quickpress dashboard widget
require_once(ABSPATH . 'wp-admin/includes/dashboard.php');
wp_dashboard_quick_press_output();
wp_dashboard_quick_press();
exit;
}

View File

@ -412,7 +412,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' ), '20110113' );
$scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20110428' );
$scripts->add_data( 'dashboard', 'group', 1 );
$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102' );
@ -502,7 +502,7 @@ function wp_default_styles( &$styles ) {
$styles->add( 'global', "/wp-admin/css/global$suffix.css", array(), '20110424' );
$styles->add( 'media', "/wp-admin/css/media$suffix.css", array(), '20110121' );
$styles->add( 'widgets', "/wp-admin/css/widgets$suffix.css", array(), '20110104' );
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20110121' );
$styles->add( 'dashboard', "/wp-admin/css/dashboard$suffix.css", array(), '20110428' );
$styles->add( 'install', "/wp-admin/css/install$suffix.css", array(), '20110121' ); // Readme as well
$styles->add( 'theme-editor', "/wp-admin/css/theme-editor$suffix.css", array(), '20101203' );
$styles->add( 'press-this', "/wp-admin/css/press-this$suffix.css", array(), '20110121' );