From 6c8c746dbcac3b4b4e74482ed27d41bd56984cb8 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 19 Oct 2011 21:43:21 +0000 Subject: [PATCH] Move welcome panel link to a 'Show on screen' checkbox. see #11651. git-svn-id: https://develop.svn.wordpress.org/trunk@19014 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/screen.php | 10 +++++++++- wp-admin/index.php | 3 --- wp-admin/js/dashboard.dev.js | 7 ++++--- wp-admin/js/dashboard.js | 2 +- wp-includes/script-loader.php | 2 +- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/wp-admin/includes/screen.php b/wp-admin/includes/screen.php index 37ecc09155..9cff3612f4 100644 --- a/wp-admin/includes/screen.php +++ b/wp-admin/includes/screen.php @@ -799,7 +799,15 @@ final class WP_Screen { if ( isset( $wp_meta_boxes[ $this->id ] ) ) : ?>
- + id && current_user_can( 'edit_theme_options' ) ) { + echo '\n"; + } + ?>
' . __( '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.' ) . '

'; -if ( current_user_can( 'edit_theme_options' ) ) - $overview .= '' . __('Show the welcome panel.') . ''; - add_screen_option( 'overview', $overview ); // Help tabs diff --git a/wp-admin/js/dashboard.dev.js b/wp-admin/js/dashboard.dev.js index 7803ca4850..64815f82dc 100644 --- a/wp-admin/js/dashboard.dev.js +++ b/wp-admin/js/dashboard.dev.js @@ -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 diff --git a/wp-admin/js/dashboard.js b/wp-admin/js/dashboard.js index 5ef4e337fe..7fe7704cd5 100644 --- a/wp-admin/js/dashboard.js +++ b/wp-admin/js/dashboard.js @@ -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()}); \ No newline at end of file +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()}); \ No newline at end of file diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 1b91f1e531..1dcf5ec6d4 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -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 );