Ticket #21583: 21583.14.diff
File 21583.14.diff, 9.9 KB (added by , 12 years ago) |
---|
-
wp-includes/admin-bar.php
657 657 ) ); 658 658 } 659 659 660 function wp_admin_bar_screen_options( $wp_admin_bar ) { 661 662 if ( ! get_current_screen()->show_screen_options() ) 663 return; 664 665 $wp_admin_bar->add_menu( array( 666 'parent' => 'top-secondary', 667 'id' => 'screen-options', 668 'title' => '<span class="ab-icon"></span>', 669 'href' => '', 670 ) ); 671 } 672 673 function wp_admin_bar_contextual_help( $wp_admin_bar ) { 674 $wp_admin_bar->add_menu( array( 675 'parent' => 'top-secondary', 676 'id' => 'screen-help', 677 'title' => 'Help<span class="ab-icon"></span>', 678 'href' => '', 679 ) ); 680 } 681 660 682 /** 661 683 * Add secondary menus. 662 684 * -
wp-includes/js/admin-bar.js
10 10 node.attr('tabindex', '0').attr('tabindex', tab); 11 11 }; 12 12 13 $('#wpadminbar').removeClass('nojq').removeClass('nojs').find('li.menupop'). hoverIntent({13 $('#wpadminbar').removeClass('nojq').removeClass('nojs').find('li.menupop').not('.sticky').hoverIntent({ 14 14 over: function(e){ 15 15 $(this).addClass('hover'); 16 heightCheck($(this)); 16 17 }, 17 18 out: function(e){ 18 19 $(this).removeClass('hover'); … … 22 23 interval: 100 23 24 }); 24 25 26 $('.sticky', '#wpadminbar').click(function(e){ 27 e.preventDefault(); 28 $(this).toggleClass('hover'); 29 }); 30 25 31 $('#wp-admin-bar-get-shortlink').click(function(e){ 26 32 e.preventDefault(); 27 33 $(this).addClass('selected').children('.shortlink-input').blur(function(){ … … 66 72 e.preventDefault(); 67 73 $('html, body').animate({ scrollTop: 0 }, 'fast'); 68 74 }); 75 76 69 77 70 78 }); 79 80 function heightCheck( menu ) { 81 // Add overflow if sub menu height exceeds window height 82 var wHeight = jQuery(window).height(), 83 toolbarPlusPadding = 28 + 23, 84 subWrapper = menu.find('.ab-sub-wrapper'), 85 subMenuHeight = subWrapper.height() + toolbarPlusPadding; 86 87 if ( subMenuHeight > wHeight ) 88 subWrapper.css({ 'overflow-y': 'auto', 'overflow-x': 'hidden', 'height': wHeight - toolbarPlusPadding + 'px'}); 89 } 90 71 91 } else { 72 92 (function(d, w) { 73 93 var addEvent = function( obj, type, fn ) { -
wp-includes/css/admin-bar.css
10 10 font: normal 13px/28px sans-serif; 11 11 color: #ccc; 12 12 text-shadow: #444 0px -1px 0px; 13 } 13 } 14 14 15 15 #wpadminbar ul li:before, 16 16 #wpadminbar ul li:after { … … 517 517 } 518 518 519 519 /** 520 * Sticky menu toggle arrows 521 */ 522 #wpadminbar .sticky .sticky-indicator { 523 position: relative; 524 float: right; 525 width: 20px; 526 height: 16px; 527 margin-top: 6px; 528 background-image: url("../images/admin-bar-sprite.png"); 529 background-position: 0 -254px; 530 background-repeat: no-repeat; 531 cursor: pointer; 532 } 533 534 #wpadminbar .sticky.hover .sticky-indicator { 535 background-position: 0 -228px; 536 } 537 538 /** 520 539 * WP Logo icon 521 540 */ 522 541 #wp-admin-bar-wp-logo > .ab-item .ab-icon { … … 573 592 } 574 593 575 594 /** 595 * Screen Settings icon 596 */ 597 #wpadminbar #wp-admin-bar-screen-options > .ab-item .ab-icon { 598 background-image: url(../images/admin-bar-sprite.png?d=20111130); 599 background-position: -3px -252px; 600 background-repeat: no-repeat; 601 } 602 603 #wpadminbar.nojs #wp-admin-bar-screen-options:hover > .ab-item .ab-icon, 604 #wpadminbar #wp-admin-bar-screen-options.hover > .ab-item .ab-icon { 605 background-image: url(../images/admin-bar-sprite.png?d=20111130); 606 background-position: -3px -228px; 607 background-repeat: no-repeat; 608 } 609 610 /** 576 611 * Customize support classes 577 612 */ 578 613 .no-customize-support .hide-if-no-customize, … … 590 625 #wp-admin-bar-wp-logo > .ab-item .ab-icon, 591 626 #wp-admin-bar-updates > .ab-item .ab-icon, 592 627 #wp-admin-bar-comments > .ab-item .ab-icon, 593 #wpadminbar #wp-admin-bar-new-content > .ab-item .ab-icon { 594 background-image: url(../images/admin-bar-sprite-2x.png?d=20120830); 595 background-size: 20px 220px; 628 #wpadminbar #wp-admin-bar-new-content > .ab-item .ab-icon, 629 #wpadminbar #wp-admin-bar-screen-options > .ab-item .ab-icon, 630 #wpadminbar .sticky .sticky-indicator { 631 background-image: url( "../images/admin-bar-sprite-2x.png?d=20120830" ); 632 background-size: 20px 276px; 596 633 } 597 634 } 598 635 -
wp-includes/class-wp-admin-bar.php
104 104 'parent' => false, 105 105 'href' => false, 106 106 'group' => false, 107 'sticky' => false, 107 108 'meta' => array(), 108 109 ); 109 110 … … 396 397 397 398 $is_parent = ! empty( $node->children ); 398 399 $has_link = ! empty( $node->href ); 400 $has_title = ! empty( $node->title ); 401 $is_sticky = $node->sticky === true ? true : false; 399 402 400 403 $tabindex = isset( $node->meta['tabindex'] ) ? (int) $node->meta['tabindex'] : ''; 401 404 $aria_attributes = $tabindex ? 'tabindex="' . $tabindex . '"' : ''; … … 410 413 if ( ! empty( $node->meta['class'] ) ) 411 414 $menuclass .= $node->meta['class']; 412 415 416 if ( $is_sticky ) 417 $menuclass .= 'sticky'; 418 413 419 if ( $menuclass ) 414 420 $menuclass = ' class="' . esc_attr( trim( $menuclass ) ) . '"'; 415 421 416 422 ?> 417 423 418 424 <li id="<?php echo esc_attr( 'wp-admin-bar-' . $node->id ); ?>"<?php echo $menuclass; ?>><?php 419 if ( $has_link ): 420 ?><a class="ab-item" <?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php 421 if ( ! empty( $node->meta['onclick'] ) ) : 422 ?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php 425 if ( $has_title ): 426 if ( $has_link ): 427 ?><a class="ab-item" <?php echo $aria_attributes; ?> href="<?php echo esc_url( $node->href ) ?>"<?php 428 if ( ! empty( $node->meta['onclick'] ) ) : 429 ?> onclick="<?php echo esc_js( $node->meta['onclick'] ); ?>"<?php 430 endif; 431 if ( ! empty( $node->meta['target'] ) ) : 432 ?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php 423 433 endif; 424 if ( ! empty( $node->meta['target'] ) ) : 425 ?> target="<?php echo esc_attr( $node->meta['target'] ); ?>"<?php 434 if ( ! empty( $node->meta['title'] ) ) : 435 ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php 436 endif; 437 ?>><?php 438 else: 439 ?><a href="#" onclick="return false;" class="ab-item ab-empty-item" <?php echo $aria_attributes; 440 if ( ! empty( $node->meta['title'] ) ) : 441 ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php 442 endif; 443 ?>><?php 426 444 endif; 427 if ( ! empty( $node->meta['title'] ) ) : 428 ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php 445 446 echo $node->title; 447 448 if ( $is_sticky ) : 449 ?><span class="sticky-indicator"></span><?php 429 450 endif; 430 ?>><?php 431 else:432 ?><div class="ab-item ab-empty-item" <?php echo $aria_attributes;433 if ( ! empty( $node->meta['title'] ) ):434 ?> title="<?php echo esc_attr( $node->meta['title'] ); ?>"<?php451 452 if ( $has_link ) : 453 ?></a><?php 454 else: 455 ?></a><?php 435 456 endif; 436 ?>><?php437 457 endif; 438 458 439 echo $node->title;440 441 if ( $has_link ) :442 ?></a><?php443 else:444 ?></div><?php445 endif;446 447 459 if ( $is_parent ) : 448 460 ?><div class="ab-sub-wrapper"><?php 449 461 foreach ( $node->children as $group ) { … … 455 467 if ( ! empty( $node->meta['html'] ) ) 456 468 echo $node->meta['html']; 457 469 470 if ( ! empty( $node->meta['html_callback'] ) ) 471 call_user_func( $node->meta['html_callback'] ); 458 472 ?> 459 473 </li><?php 460 474 } … … 483 497 } 484 498 add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 ); 485 499 500 if ( is_admin() ) { 501 add_action( 'admin_bar_menu', 'wp_admin_bar_screen_options', 90 ); 502 add_action( 'admin_bar_menu', 'wp_admin_bar_contextual_help', 90 ); 503 } 504 486 505 add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 ); 487 506 488 507 do_action( 'add_admin_bar_menus' ); -
wp-admin/includes/screen.php
784 784 785 785 // Time to render! 786 786 ?> 787 <div id="screen-meta" class="metabox-prefs">788 789 787 <div id="contextual-help-wrap" class="<?php echo esc_attr( $help_class ); ?>" tabindex="-1" aria-label="<?php esc_attr_e('Contextual Help Tab'); ?>"> 790 788 <div id="contextual-help-back"></div> 791 789 <div id="contextual-help-columns"> … … 863 861 ?> 864 862 </div> 865 863 <?php 866 if ( ! $this->get_help_tabs() && ! $this->show_screen_options() )867 return;868 ?>869 <div id="screen-meta-links">870 <?php if ( $this->get_help_tabs() ) : ?>871 <div id="contextual-help-link-wrap" class="hide-if-no-js screen-meta-toggle">872 <a href="#contextual-help-wrap" id="contextual-help-link" class="show-settings" aria-controls="contextual-help-wrap" aria-expanded="false"><?php _e( 'Help' ); ?></a>873 </div>874 <?php endif;875 if ( $this->show_screen_options() ) : ?>876 <div id="screen-options-link-wrap" class="hide-if-no-js screen-meta-toggle">877 <a href="#screen-options-wrap" id="show-settings-link" class="show-settings" aria-controls="screen-options-wrap" aria-expanded="false"><?php _e( 'Screen Options' ); ?></a>878 </div>879 <?php endif; ?>880 </div>881 <?php882 864 } 883 865 884 866 public function show_screen_options() { -
wp-admin/admin-header.php
115 115 <div id="wpcontent"> 116 116 117 117 <?php 118 $current_screen->set_parentage( $parent_file ); 118 119 do_action('in_admin_header'); 119 120 ?> 120 121 … … 122 123 <?php 123 124 unset($title_class, $blog_name, $total_update_count, $update_title); 124 125 125 $current_screen->set_parentage( $parent_file );126 127 126 ?> 128 127 129 128 <div id="wpbody-content" aria-label="<?php esc_attr_e('Main content'); ?>">