Move welcome panel link to a 'Show on screen' checkbox. see #11651.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19014 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-10-19 21:43:21 +00:00
parent d0d8eb2aaf
commit 11a800a3d9
5 changed files with 15 additions and 9 deletions

View File

@ -799,7 +799,15 @@ final class WP_Screen {
if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?>
<h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>
<div class="metabox-prefs">
<?php meta_box_prefs( $this ); ?>
<?php
meta_box_prefs( $this );
if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) ) {
echo '<label for="wp_welcome_panel-hide">';
echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) get_user_option( 'show_welcome_panel' ), true, false ) . ' />';
echo __( 'Welcome' ) . "</label>\n";
}
?>
<br class="clear" />
</div>
<?php endif;

View File

@ -30,9 +30,6 @@ else
$overview = '<p>' . __( 'Welcome to your WordPress Dashboard! This is the screen you will see when you log in to your site, and gives you access to all the site management features of WordPress. You can get help for any screen by clicking the Help tab in the top bar.' ) . '</p>';
if ( current_user_can( 'edit_theme_options' ) )
$overview .= '<a href="#" class="welcome-panel-open">' . __('Show the welcome panel.') . '</a>';
add_screen_option( 'overview', $overview );
// Help tabs

View File

@ -14,11 +14,12 @@ jQuery(document).ready( function($) {
$('.welcome-panel-close', welcomePanel).click( function() {
welcomePanel.addClass('hidden');
updateWelcomePanel( 0 );
$('#wp_welcome_panel-hide').prop('checked', false);
});
$('.welcome-panel-open', '#adv-settings').click( function() {
welcomePanel.removeClass('hidden');
updateWelcomePanel( 1 );
$('#wp_welcome_panel-hide').click( function() {
welcomePanel.toggleClass('hidden', ! this.checked );
updateWelcomePanel( this.checked ? 1 : 0 );
});
// These widgets are sometimes populated via ajax

View File

@ -1 +1 @@
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(b){var c=b("#welcome-panel"),a=function(d){b.post(ajaxurl,{action:"update-welcome-panel",visible:d,welcomepanelnonce:b("#welcomepanelnonce").val()})};b(".welcome-panel-close",c).click(function(){c.addClass("hidden");a(0)});b(".welcome-panel-open","#adv-settings").click(function(){c.removeClass("hidden");a(1)});ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(e){function d(f,j){var h,g=b("#"+j+" div.inside:visible").find(".widget-loading");if(g.length){h=g.parent();setTimeout(function(){h.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+j,"",function(){h.hide().slideDown("normal",function(){b(this).css("display","")})})},f*500)}}if(e){e=e.toString();if(b.inArray(e,ajaxWidgets)!=-1){d(0,e)}}else{b.each(ajaxWidgets,d)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var d=b("#quickpost-action"),e;e=b("#quick-press").submit(function(){b("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");b('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==d.val()){d.val("post-quickpress-publish")}b("#dashboard_quick_press div.inside").load(e.attr("action"),e.serializeArray(),function(){b("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");b('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);b("#dashboard_quick_press ul").next("p").remove();b("#dashboard_quick_press ul").find("li").each(function(){b("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});b("#publish").click(function(){d.val("post-quickpress-publish")})};quickPressLoad()});
var ajaxWidgets,ajaxPopulateWidgets,quickPressLoad;jQuery(document).ready(function(b){var c=b("#welcome-panel"),a=function(d){b.post(ajaxurl,{action:"update-welcome-panel",visible:d,welcomepanelnonce:b("#welcomepanelnonce").val()})};b(".welcome-panel-close",c).click(function(){c.addClass("hidden");a(0);b("#wp_welcome_panel-hide").prop("checked",false)});b("#wp_welcome_panel-hide").click(function(){c.toggleClass("hidden",!this.checked);a(this.checked?1:0)});ajaxWidgets=["dashboard_incoming_links","dashboard_primary","dashboard_secondary","dashboard_plugins"];ajaxPopulateWidgets=function(e){function d(f,j){var h,g=b("#"+j+" div.inside:visible").find(".widget-loading");if(g.length){h=g.parent();setTimeout(function(){h.load(ajaxurl.replace("/admin-ajax.php","")+"/index-extra.php?jax="+j,"",function(){h.hide().slideDown("normal",function(){b(this).css("display","")})})},f*500)}}if(e){e=e.toString();if(b.inArray(e,ajaxWidgets)!=-1){d(0,e)}}else{b.each(ajaxWidgets,d)}};ajaxPopulateWidgets();postboxes.add_postbox_toggles(pagenow,{pbshow:ajaxPopulateWidgets});quickPressLoad=function(){var d=b("#quickpost-action"),e;e=b("#quick-press").submit(function(){b("#dashboard_quick_press #publishing-action img.waiting").css("visibility","visible");b('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",true);if("post"==d.val()){d.val("post-quickpress-publish")}b("#dashboard_quick_press div.inside").load(e.attr("action"),e.serializeArray(),function(){b("#dashboard_quick_press #publishing-action img.waiting").css("visibility","hidden");b('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop("disabled",false);b("#dashboard_quick_press ul").next("p").remove();b("#dashboard_quick_press ul").find("li").each(function(){b("#dashboard_recent_drafts ul").prepend(this)}).end().remove();quickPressLoad()});return false});b("#publish").click(function(){d.val("post-quickpress-publish")})};quickPressLoad()});

View File

@ -365,7 +365,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' ), '20111019', 1 );
$scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20111019b', 1 );
$scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102', 1 );