Make WordPress Core

Changeset 19014


Ignore:
Timestamp:
10/19/2011 09:43:21 PM (13 years ago)
Author:
nacin
Message:

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

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/screen.php

    r18950 r19014  
    800800            <h5><?php _ex('Show on screen', 'Metaboxes') ?></h5>
    801801            <div class="metabox-prefs">
    802                 <?php meta_box_prefs( $this ); ?>
     802                <?php
     803                    meta_box_prefs( $this );
     804
     805                    if ( 'dashboard' === $this->id && current_user_can( 'edit_theme_options' ) ) {
     806                        echo '<label for="wp_welcome_panel-hide">';
     807                        echo '<input type="checkbox" id="wp_welcome_panel-hide"' . checked( (bool) get_user_option( 'show_welcome_panel' ), true, false )  . ' />';
     808                        echo __( 'Welcome' ) . "</label>\n";
     809                    }
     810                ?>
    803811                <br class="clear" />
    804812            </div>
  • trunk/wp-admin/index.php

    r19007 r19014  
    3030
    3131$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>';
    32 
    33 if ( current_user_can( 'edit_theme_options' ) )
    34     $overview .= '<a href="#" class="welcome-panel-open">' . __('Show the welcome panel.') . '</a>';
    3532
    3633add_screen_option( 'overview', $overview );
  • trunk/wp-admin/js/dashboard.dev.js

    r19007 r19014  
    1515        welcomePanel.addClass('hidden');
    1616        updateWelcomePanel( 0 );
     17        $('#wp_welcome_panel-hide').prop('checked', false);
    1718    });
    1819
    19     $('.welcome-panel-open', '#adv-settings').click( function() {
    20         welcomePanel.removeClass('hidden');
    21         updateWelcomePanel( 1 );
     20    $('#wp_welcome_panel-hide').click( function() {
     21        welcomePanel.toggleClass('hidden', ! this.checked );
     22        updateWelcomePanel( this.checked ? 1 : 0 );
    2223    });
    2324
  • trunk/wp-admin/js/dashboard.js

    r19007 r19014  
    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()});
     1var 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()});
  • trunk/wp-includes/script-loader.php

    r19008 r19014  
    366366        $scripts->add( 'farbtastic', '/wp-admin/js/farbtastic.js', array('jquery'), '1.2' );
    367367
    368         $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20111019', 1 );
     368        $scripts->add( 'dashboard', "/wp-admin/js/dashboard$suffix.js", array( 'jquery', 'admin-comments', 'postbox' ), '20111019b', 1 );
    369369
    370370        $scripts->add( 'hoverIntent', "/wp-includes/js/hoverIntent$suffix.js", array('jquery'), '20090102', 1 );
Note: See TracChangeset for help on using the changeset viewer.