WordPress.org

Make WordPress Core

Changeset 17952


Ignore:
Timestamp:
05/18/11 17:06:04 (3 years ago)
Author:
markjaquith
Message:

Prevent the browser-out-of-date dashboard nag from being minimized and hide minimization arrow. props aaroncampbell. fixes #17441. see #17323.

Location:
trunk
Files:
4 edited

Legend:

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

    r17884 r17952  
    958958                    $hidden_class = in_array($box['id'], $hidden) ? ' hide-if-js' : ''; 
    959959                    echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . $hidden_class . '" ' . '>' . "\n"; 
    960                     echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>'; 
     960                    if ( 'dashboard_browser_nag' != $box['id'] ) 
     961                        echo '<div class="handlediv" title="' . esc_attr__('Click to toggle') . '"><br /></div>'; 
    961962                    echo "<h3 class='hndle'><span>{$box['title']}</span></h3>\n"; 
    962963                    echo '<div class="inside">' . "\n"; 
     
    17431744    if ( !empty($wp_current_screen_options) ) 
    17441745        $show_screen = true; 
    1745          
     1746 
    17461747    $show_screen = apply_filters('screen_options_show_screen', $show_screen, $screen); 
    17471748 
  • trunk/wp-admin/js/postbox.dev.js

    r17887 r17952  
    66            $('.postbox h3, .postbox .handlediv').click( function() { 
    77                var p = $(this).parent('.postbox'), id = p.attr('id'); 
     8                if ( 'dashboard_browser_nag' == id ) 
     9                    return; 
    810 
    911                p.toggleClass('closed'); 
  • trunk/wp-admin/js/postbox.js

    r17887 r17952  
    1 var postboxes;(function(a){postboxes={add_postbox_toggles:function(c,b){this.init(c,b);a(".postbox h3, .postbox .handlediv").click(function(){var e=a(this).parent(".postbox"),f=e.attr("id");e.toggleClass("closed");postboxes.save_state(c);if(f){if(!e.hasClass("closed")&&a.isFunction(postboxes.pbshow)){postboxes.pbshow(f)}else{if(e.hasClass("closed")&&a.isFunction(postboxes.pbhide)){postboxes.pbhide(f)}}}});a(".postbox h3 a").click(function(f){f.stopPropagation()});a(".postbox a.dismiss").click(function(g){var f=a(this).parents(".postbox").attr("id")+"-hide";a("#"+f).attr("checked",false).triggerHandler("click");return false});a(".hide-postbox-tog").click(function(){var e=a(this).val();if(a(this).attr("checked")){a("#"+e).show();if(a.isFunction(postboxes.pbshow)){postboxes.pbshow(e)}}else{a("#"+e).hide();if(a.isFunction(postboxes.pbhide)){postboxes.pbhide(e)}}postboxes.save_state(c)});a('.columns-prefs input[type="radio"]').click(function(){var e=a(this).val(),f,g,h=a("#poststuff");if(h.length){if(e==2){h.addClass("has-right-sidebar");a("#side-sortables").addClass("temp-border")}else{if(e==1){h.removeClass("has-right-sidebar");a("#normal-sortables").append(a("#side-sortables").children(".postbox"))}}}else{for(f=4;(f>e&&f>1);f--){g=a("#"+d(f)+"-sortables");a("#"+d(f-1)+"-sortables").append(g.children(".postbox"));g.parent().hide()}for(f=1;f<=e;f++){g=a("#"+d(f)+"-sortables");if(g.parent().is(":hidden")){g.addClass("temp-border").parent().show()}}a(".postbox-container:visible").css("width",98/e+"%")}postboxes.save_order(c)});function d(e){switch(e){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(c,b){a.extend(this,b||{});a("#wpbody-content").css("overflow","hidden");a(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(f,d){a("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(f,d){postboxes.save_order(c);d.item.parent().removeClass("temp-border");a("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(d){var b=a(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),c=a(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");a.post(ajaxurl,{action:"closed-postboxes",closed:b,hidden:c,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:d})},save_order:function(c){var b,d=a(".columns-prefs input:checked").val()||0;b={action:"meta-box-order",_ajax_nonce:a("#meta-box-order-nonce").val(),page_columns:d,page:c};a(".meta-box-sortables").each(function(){b["order["+this.id.split("-")[0]+"]"]=a(this).sortable("toArray").join(",")});a.post(ajaxurl,b)},pbshow:false,pbhide:false}}(jQuery)); 
     1var postboxes;(function($){postboxes={add_postbox_toggles:function(page,args){this.init(page,args);$(".postbox h3, .postbox .handlediv").click(function(){var p=$(this).parent(".postbox"),id=p.attr("id");if("dashboard_browser_nag"==id){return}p.toggleClass("closed");postboxes.save_state(page);if(id){if(!p.hasClass("closed")&&$.isFunction(postboxes.pbshow)){postboxes.pbshow(id)}else{if(p.hasClass("closed")&&$.isFunction(postboxes.pbhide)){postboxes.pbhide(id)}}}});$(".postbox h3 a").click(function(e){e.stopPropagation()});$(".postbox a.dismiss").click(function(e){var hide_id=$(this).parents(".postbox").attr("id")+"-hide";$("#"+hide_id).attr("checked",false).triggerHandler("click");return false});$(".hide-postbox-tog").click(function(){var box=$(this).val();if($(this).attr("checked")){$("#"+box).show();if($.isFunction(postboxes.pbshow)){postboxes.pbshow(box)}}else{$("#"+box).hide();if($.isFunction(postboxes.pbhide)){postboxes.pbhide(box)}}postboxes.save_state(page)});$('.columns-prefs input[type="radio"]').click(function(){var num=$(this).val(),i,el,p=$("#poststuff");if(p.length){if(num==2){p.addClass("has-right-sidebar");$("#side-sortables").addClass("temp-border")}else{if(num==1){p.removeClass("has-right-sidebar");$("#normal-sortables").append($("#side-sortables").children(".postbox"))}}}else{for(i=4;(i>num&&i>1);i--){el=$("#"+colname(i)+"-sortables");$("#"+colname(i-1)+"-sortables").append(el.children(".postbox"));el.parent().hide()}for(i=1;i<=num;i++){el=$("#"+colname(i)+"-sortables");if(el.parent().is(":hidden")){el.addClass("temp-border").parent().show()}}$(".postbox-container:visible").css("width",98/num+"%")}postboxes.save_order(page)});function colname(n){switch(n){case 1:return"normal";break;case 2:return"side";break;case 3:return"column3";break;case 4:return"column4";break;default:return""}}},init:function(page,args){$.extend(this,args||{});$("#wpbody-content").css("overflow","hidden");$(".meta-box-sortables").sortable({placeholder:"sortable-placeholder",connectWith:".meta-box-sortables",items:".postbox",handle:".hndle",cursor:"move",distance:2,tolerance:"pointer",forcePlaceholderSize:true,helper:"clone",opacity:0.65,start:function(e,ui){$("body").css({WebkitUserSelect:"none",KhtmlUserSelect:"none"})},stop:function(e,ui){postboxes.save_order(page);ui.item.parent().removeClass("temp-border");$("body").css({WebkitUserSelect:"",KhtmlUserSelect:""})}})},save_state:function(page){var closed=$(".postbox").filter(".closed").map(function(){return this.id}).get().join(","),hidden=$(".postbox").filter(":hidden").map(function(){return this.id}).get().join(",");$.post(ajaxurl,{action:"closed-postboxes",closed:closed,hidden:hidden,closedpostboxesnonce:jQuery("#closedpostboxesnonce").val(),page:page})},save_order:function(page){var postVars,page_columns=$(".columns-prefs input:checked").val()||0;postVars={action:"meta-box-order",_ajax_nonce:$("#meta-box-order-nonce").val(),page_columns:page_columns,page:page};$(".meta-box-sortables").each(function(){postVars["order["+this.id.split("-")[0]+"]"]=$(this).sortable("toArray").join(",")});$.post(ajaxurl,postVars)},pbshow:false,pbhide:false}}(jQuery)); 
  • trunk/wp-includes/script-loader.php

    r17950 r17952  
    325325        $scripts->add_data( 'xfn', 'group', 1 ); 
    326326 
    327         $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20110511' ); 
     327        $scripts->add( 'postbox', "/wp-admin/js/postbox$suffix.js", array('jquery-ui-sortable'), '20110518' ); 
    328328        $scripts->add_data( 'postbox', 'group', 1 ); 
    329329 
Note: See TracChangeset for help on using the changeset viewer.