Show the welcome screen when one shows it from Screen Options, advances to a page, then uses the browser's back button to return. see #11651.

git-svn-id: http://svn.automattic.com/wordpress/trunk@19133 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2011-11-03 23:08:24 +00:00
parent 9741ce2773
commit 04915a9b07
3 changed files with 8 additions and 3 deletions

View File

@ -3,6 +3,7 @@ var ajaxWidgets, ajaxPopulateWidgets, quickPressLoad;
jQuery(document).ready( function($) {
/* Dashboard Welcome Panel */
var welcomePanel = $('#welcome-panel'),
welcomePanelHide = $('#wp_welcome_panel-hide'),
updateWelcomePanel = function( visible ) {
$.post( ajaxurl, {
action: 'update-welcome-panel',
@ -11,13 +12,17 @@ jQuery(document).ready( function($) {
});
};
if ( welcomePanel.is(':hidden') && welcomePanelHide.prop('checked') )
welcomePanel.removeClass('hidden');
$('.welcome-panel-close', welcomePanel).click( function() {
welcomePanel.addClass('hidden');
updateWelcomePanel( 0 );
$('#wp_welcome_panel-hide').prop('checked', false);
});
$('#wp_welcome_panel-hide').click( function() {
welcomePanelHide.click( function() {
welcomePanel.toggleClass('hidden', ! this.checked );
updateWelcomePanel( this.checked ? 1 : 0 );
});

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("#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()});
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.is(":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()});

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