Disable QuickPress buttons while saving, change "Cancel" to "Reset"
git-svn-id: http://svn.automattic.com/wordpress/trunk@10479 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
af04dea7db
commit
fc511373de
|
@ -369,7 +369,7 @@ function wp_dashboard_quick_press() {
|
||||||
<input type="hidden" name="quickpress_post_ID" value="<?php echo (int) $post->ID; ?>" />
|
<input type="hidden" name="quickpress_post_ID" value="<?php echo (int) $post->ID; ?>" />
|
||||||
<?php wp_nonce_field('add-post'); ?>
|
<?php wp_nonce_field('add-post'); ?>
|
||||||
<input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php _e('Save Draft'); ?>" />
|
<input type="submit" name="save" id="save-post" class="button" tabindex="4" value="<?php _e('Save Draft'); ?>" />
|
||||||
<input type="reset" value="<?php _e( 'Cancel' ); ?>" class="cancel" />
|
<input type="reset" value="<?php _e( 'Reset' ); ?>" class="button" />
|
||||||
<?php if ( current_user_can('publish_posts') ) { ?>
|
<?php if ( current_user_can('publish_posts') ) { ?>
|
||||||
<input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php _e('Publish'); ?>" />
|
<input type="submit" name="publish" id="publish" accesskey="p" tabindex="5" class="button-primary" value="<?php _e('Publish'); ?>" />
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
|
|
|
@ -24,6 +24,7 @@ jQuery(document).ready( function($) {
|
||||||
var act = $('#quickpost-action'), t;
|
var act = $('#quickpost-action'), t;
|
||||||
t = $('#quick-press').submit( function() {
|
t = $('#quick-press').submit( function() {
|
||||||
$('#dashboard_quick_press h3').append( '<img src="images/loading.gif" style="margin: 0 6px 0 0; vertical-align: middle" />' );
|
$('#dashboard_quick_press h3').append( '<img src="images/loading.gif" style="margin: 0 6px 0 0; vertical-align: middle" />' );
|
||||||
|
$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr('disabled','disabled');
|
||||||
|
|
||||||
if ( 'post' == act.val() ) {
|
if ( 'post' == act.val() ) {
|
||||||
act.val( 'post-quickpress-publish' );
|
act.val( 'post-quickpress-publish' );
|
||||||
|
@ -31,6 +32,7 @@ jQuery(document).ready( function($) {
|
||||||
|
|
||||||
$('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
|
$('#dashboard_quick_press div.inside').load( t.attr( 'action' ), t.serializeArray(), function() {
|
||||||
$('#dashboard_quick_press h3 img').remove();
|
$('#dashboard_quick_press h3 img').remove();
|
||||||
|
$('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr('disabled','');
|
||||||
$('#dashboard_quick_press ul').find('li').each( function() {
|
$('#dashboard_quick_press ul').find('li').each( function() {
|
||||||
$('#dashboard_recent_drafts ul').prepend( this );
|
$('#dashboard_recent_drafts ul').prepend( this );
|
||||||
} ).end().remove();
|
} ).end().remove();
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
jQuery(document).ready(function(c){var a,b,d;a=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];b=function(){c.each(a,function(){var f=jQuery("#"+this+":visible div.inside").find(".widget-loading");if(f.size()){f.parent().load("index-extra.php?jax="+this)}})};b();postboxes.add_postbox_toggles("dashboard",{onShow:b});d=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press h3").append('<img src="images/loading.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press h3 img").remove();c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");d()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};d()});
|
jQuery(document).ready(function(c){var a,b,d;a=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];b=function(){c.each(a,function(){var f=jQuery("#"+this+":visible div.inside").find(".widget-loading");if(f.size()){f.parent().load("index-extra.php?jax="+this)}})};b();postboxes.add_postbox_toggles("dashboard",{onShow:b});d=function(){var e=c("#quickpost-action"),f;f=c("#quick-press").submit(function(){c("#dashboard_quick_press h3").append('<img src="images/loading.gif" style="margin: 0 6px 0 0; vertical-align: middle" />');c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","disabled");if("post"==e.val()){e.val("post-quickpress-publish")}c("#dashboard_quick_press div.inside").load(f.attr("action"),f.serializeArray(),function(){c("#dashboard_quick_press h3 img").remove();c('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').attr("disabled","");c("#dashboard_quick_press ul").find("li").each(function(){c("#dashboard_recent_drafts ul").prepend(this)}).end().remove();tb_init("a.thickbox");d()});return false});c("#publish").click(function(){e.val("post-quickpress-publish")})};d()});
|
|
@ -370,7 +370,7 @@ function wp_default_scripts( &$scripts ) {
|
||||||
$scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
|
$scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
|
||||||
$scripts->add_data( 'farbtastic', 'group', 1 );
|
$scripts->add_data( 'farbtastic', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090102' );
|
$scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20090201' );
|
||||||
$scripts->add_data( 'dashboard', 'group', 1 );
|
$scripts->add_data( 'dashboard', 'group', 1 );
|
||||||
|
|
||||||
$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102' );
|
$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102' );
|
||||||
|
|
Loading…
Reference in New Issue