Welcome Screen: remove white space, make the second dismiss link work, see #11651

git-svn-id: http://svn.automattic.com/wordpress/trunk@19345 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-19 00:42:22 +00:00
parent 931fbf8b36
commit 507643807a
4 changed files with 69 additions and 142 deletions

View File

@ -1282,92 +1282,36 @@ function wp_welcome_panel() {
list( $display_version ) = explode( '-', $wp_version );
?>
<div id="welcome-panel" class="<?php echo esc_attr( $classes ); ?>">
<?php wp_nonce_field( 'welcome-panel-nonce', 'welcomepanelnonce', false ); ?>
<a class="welcome-panel-close" href="#"><?php _e('Dismiss'); ?></a>
<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
<div class="welcome-panel-content">
<h3><?php _e( 'Welcome to your new WordPress site! ' ); ?></h3>
<p class="about-description"><?php _e( 'If you need help getting started, check out our documentation on <a href="http://codex.wordpress.org/First_Steps_With_WordPress">First Steps with WordPress</a>. If you&#8217;d rather dive right in, here are a few things most people do first when they set up a new WordPress site. If you need help, use the Help tabs in the upper right corner to get information on how to use your current screen and where to go for more assistance.' ); ?></p>
<div class="welcome-panel-column-container">
<div class="welcome-panel-column">
<h4>
<span class="icon16 icon-settings"></span>
<?php _e( 'Basic Settings' ); ?>
</h4>
<h4><span class="icon16 icon-settings"></span> <?php _e( 'Basic Settings' ); ?></h4>
<p><?php _e( 'Here are a few easy things you can do to get your feet wet. Make sure to click Save on each Settings screen.' ); ?></p>
<ul>
<li>
<?php echo sprintf(
__( '<a href="%s">Choose your privacy setting</a>' ),
esc_url( admin_url('options-privacy.php') )
); ?>
</li>
<li>
<?php echo sprintf(
__( '<a href="%s">Select your tagline and time zone</a>' ),
esc_url( admin_url('options-general.php') )
); ?>
</li>
<li>
<?php echo sprintf(
__( '<a href="%s">Turn comments on or off</a>' ),
esc_url( admin_url('options-discussion.php') )
); ?>
</li>
<li>
<?php echo sprintf(
__( '<a href="%s">Fill in your profile</a>' ),
esc_url( admin_url('profile.php') )
); ?>
</li>
<li><?php echo sprintf( __( '<a href="%s">Choose your privacy setting</a>' ), esc_url( admin_url('options-privacy.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Select your tagline and time zone</a>' ), esc_url( admin_url('options-general.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Turn comments on or off</a>' ), esc_url( admin_url('options-discussion.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Fill in your profile</a>' ), esc_url( admin_url('profile.php') ) ); ?></li>
</ul>
</div>
<div class="welcome-panel-column">
<h4>
<span class="icon16 icon-page"></span>
<?php _e( 'Add Real Content' ); ?>
</h4>
<h4><span class="icon16 icon-page"></span> <?php _e( 'Add Real Content' ); ?></h4>
<p><?php _e( 'Check out the sample page & post editors to see how it all works, then delete the default content and write your own!' ); ?></p>
<ul>
<li>
<?php echo sprintf(
__( 'View the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ),
esc_url( get_permalink( 2 ) ),
esc_url( get_permalink( 1 ) )
); ?>
</li>
<li>
<?php echo sprintf(
__( 'Delete the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ),
esc_url( admin_url('edit.php?post_type=page') ),
esc_url( admin_url('edit.php') )
); ?>
</li>
<li>
<?php echo sprintf(
__( '<a href="%s">Create an About Me page</a>' ),
esc_url( admin_url('edit.php?post_type=page') )
); ?>
</li>
<li>
<?php echo sprintf(
__( '<a href="%s">Write your first post</a>' ),
esc_url( admin_url('post-new.php') )
); ?>
</li>
<li><?php echo sprintf( __( 'View the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_url( get_permalink( 2 ) ), esc_url( get_permalink( 1 ) ) ); ?></li>
<li><?php echo sprintf( __( 'Delete the <a href="%1$s">sample page</a> and <a href="%2$s">post</a>' ), esc_url( admin_url('edit.php?post_type=page') ), esc_url( admin_url('edit.php') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Create an About Me page</a>' ), esc_url( admin_url('edit.php?post_type=page') ) ); ?></li>
<li><?php echo sprintf( __( '<a href="%s">Write your first post</a>' ), esc_url( admin_url('post-new.php') ) ); ?></li>
</ul>
</div>
<div class="welcome-panel-column">
<h4>
<span class="icon16 icon-appearance"></span>
<?php _e( 'Customize Your Site' ); ?>
</h4>
<h4><span class="icon16 icon-appearance"></span> <?php _e( 'Customize Your Site' ); ?></h4>
<?php
$ct = current_theme_info();
if ( empty ( $ct->stylesheet_dir ) ) :
@ -1380,49 +1324,32 @@ function wp_welcome_panel() {
echo '</p>';
?>
<ul>
<?php if ( 'twentyeleven' == $ct->stylesheet ) : ?>
<li>
<?php echo sprintf(
__( '<a href="%s">Choose light or dark</a>' ),
esc_url( admin_url( 'themes.php?page=theme_options' ) )
); ?>
</li>
<?php
if ( 'twentyeleven' == $ct->stylesheet ) : ?>
<li><?php echo sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) ); ?></li>
<?php
endif;
if ( current_theme_supports( 'custom-background' ) ) :
?>
<li>
<?php echo sprintf(
__( '<a href="%s">Set a background color</a>' ),
esc_url( admin_url( 'themes.php?page=custom-background' ) )
); ?>
</li>
if ( current_theme_supports( 'custom-background' ) ) : ?>
<li><?php echo sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) ); ?></li>
<?php
endif;
if ( current_theme_supports( 'custom-header' ) ) :
?>
<li>
<?php echo sprintf(
__( '<a href="%s">Select a new header image</a>' ),
esc_url( admin_url( 'themes.php?page=custom-header' ) )
); ?>
</li>
if ( current_theme_supports( 'custom-header' ) ) : ?>
<li><?php echo sprintf( __( '<a href="%s">Select a new header image</a>' ), esc_url( admin_url( 'themes.php?page=custom-header' ) ) ); ?></li>
<?php
endif;
if ( current_theme_supports( 'widgets' ) ) :
?>
<li>
<?php echo sprintf(
__( '<a href="%s">Add some widgets</a>' ),
esc_url( admin_url( 'widgets.php' ) )
); ?>
</li>
<?php endif; ?>
if ( current_theme_supports( 'widgets' ) ) : ?>
<li><?php echo sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) ); ?></li>
<?php
endif; ?>
</ul>
<?php endif; ?>
<?php
endif; ?>
</div>
</div>
<p class="welcome-panel-dismiss"><?php printf( __( 'Already know what you&#8217;re doing? <a href="%s">Dismiss this message</a>.' ), '#' ) ?></p>
<p class="welcome-panel-dismiss"><?php _e( 'Already know what you&#8217;re doing? <a href="#">Dismiss this message</a>.' ); ?></p>
</div>
</div>
<?php

View File

@ -15,7 +15,7 @@ jQuery(document).ready( function($) {
if ( welcomePanel.hasClass('hidden') && welcomePanelHide.prop('checked') )
welcomePanel.removeClass('hidden');
$('.welcome-panel-close', welcomePanel).click( function() {
$('.welcome-panel-close, .welcome-panel-dismiss a', welcomePanel).click( function() {
welcomePanel.addClass('hidden');
updateWelcomePanel( 0 );
$('#wp_welcome_panel-hide').prop('checked', false);

View File

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

View File

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