Ticket #31575: 31575.patch
| File 31575.patch, 6.7 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/css/press-this.css
854 854 855 855 .add-cat-toggle { 856 856 float: right; 857 margin-top: -33px; 857 margin-top: -45px; 858 line-height: 20px; 859 padding: 12px 10px 8px; 858 860 } 859 861 862 .add-cat-toggle.is-toggled { 863 padding: 10px; 864 } 865 860 866 .add-cat-toggle:focus { 861 867 text-decoration: none; 862 868 color: #2ea2cc; 863 869 } 864 870 865 .add-cat-toggle.is-toggled {866 margin-top: -36px;867 }868 869 871 .add-cat-toggle.is-toggled .dashicons:before { 870 872 content: "\f179"; 871 873 } … … 1210 1212 vertical-align: middle; 1211 1213 } 1212 1214 1213 .options-open, 1214 .options-close { 1215 .options-toggle { 1215 1216 display: none; 1216 1217 } 1217 1218 1218 1219 @media (max-width: 900px) { 1219 .options-open, 1220 .options-close { 1220 .options-toggle { 1221 1221 display: block; 1222 1222 } 1223 1223 } 1224 1224 1225 .options-open .is-hidden,1226 .options-close .is-hidden,1225 .options-open-label.is-hidden, 1226 .options-close-label.is-hidden, 1227 1227 .options-panel-back.is-hidden { 1228 1228 display: none; 1229 1229 } 1230 1230 1231 .options-open:focus .dashicons { 1231 .options-toggle:hover .dashicons, 1232 .options-toggle:focus .dashicons { 1232 1233 color: #fff; 1233 1234 text-decoration: none; 1234 1235 } 1235 1236 1236 .options- open.dashicons {1237 .options-toggle .dashicons { 1237 1238 margin-top: 3px; 1238 1239 } 1239 1240 1240 .options-close {1241 .options-close-label { 1241 1242 color: #2ea2cc; 1242 1243 } 1243 1244 -
src/wp-admin/includes/class-wp-press-this.php
959 959 $admin_body_class .= ' version-' . str_replace( '.', '-', preg_replace( '/^([.0-9]+).*/', '$1', $wp_version ) ); 960 960 $admin_body_class .= ' admin-color-' . sanitize_html_class( get_user_option( 'admin_color' ), 'fresh' ); 961 961 $admin_body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_locale() ) ) ); 962 962 963 963 /** This filter is documented in wp-admin/admin-header.php */ 964 964 $admin_body_classes = apply_filters( 'admin_body_class', '' ); 965 965 … … 970 970 <span class="dashicons dashicons-wordpress"></span> 971 971 <span><?php bloginfo( 'name' ); ?></span> 972 972 </h1> 973 <button type="button" class="options-open button-subtle"> 974 <span class="dashicons dashicons-tag"></span><span class="screen-reader-text"><?php _e( 'Show post options' ); ?></span> 973 <button type="button" class="options-toggle button-subtle" aria-expanded="false" aria-controls="options-panel"> 974 <span class="options-open-label"><span class="dashicons dashicons-tag"></span><span class="screen-reader-text"><?php _e( 'Show post options' ); ?></span></span> 975 <span class="options-close-label is-hidden"><span aria-hidden="true"><?php _e( 'Done' ); ?></span><span class="screen-reader-text"><?php _e( 'Close post options' ); ?></span></span> 975 976 </button> 976 <button type="button" class="options-close button-subtle is-hidden"><?php _e( 'Done' ); ?></button>977 977 </div> 978 978 979 979 <div id="scanbar" class="scan"> … … 1039 1039 </div> 1040 1040 </div> 1041 1041 1042 <div class="options-panel-back is-hidden" tabindex="-1"></div> 1043 <div class="options-panel is-off-screen is-hidden" tabindex="-1" >1042 <div class="options-panel-back is-hidden" tabindex="-1"></div> 1043 <div class="options-panel is-off-screen is-hidden" tabindex="-1" id="options-panel"> 1044 1044 <div class="post-options"> 1045 1045 1046 1046 <?php if ( $supports_formats ) : ?> -
src/wp-admin/js/press-this.js
691 691 692 692 /** 693 693 * Interactive behavior for the sidebar toggle, to show the options modals 694 * 695 * @param action string Optional toggle|close (defaults to toggle) 694 696 */ 695 function openSidebar() { 696 sidebarIsOpen = true; 697 function toggleSidebar( event, action ) { 697 698 698 $( '.options-open, .press-this-actions, #scanbar' ).addClass( isHidden ); 699 $( '.options-close, .options-panel-back' ).removeClass( isHidden ); 699 if ( ! action ) { 700 action = 'toggle'; 701 } 700 702 701 $( '.options-panel' ).removeClass( offscreenHidden ) 702 .one( 'transitionend', function() { 703 $( '.post-option:first' ).focus(); 704 } ); 705 } 703 if ( ! sidebarIsOpen ) { 704 sidebarIsOpen = true; 706 705 707 function closeSidebar() { 708 sidebarIsOpen = false; 706 $( '.options-toggle' ).attr( 'aria-expanded', 'true' ); 707 $( '.options-open-label, .press-this-actions, #scanbar' ).addClass( isHidden ); 708 $( '.options-close-label, .options-panel-back' ).removeClass( isHidden ); 709 709 710 $( '.options-close, .options-panel-back' ).addClass( isHidden ); 711 $( '.options-open, .press-this-actions, #scanbar' ).removeClass( isHidden ); 710 $( '.options-panel' ).removeClass( offscreenHidden ) 711 .one( 'transitionend', function() { 712 $( '.post-option:first' ).focus(); 713 } ); 714 return; 715 } 712 716 713 $( '.options-panel' ).addClass( isOffScreen ) 714 .one( 'transitionend', function() { 715 $( this ).addClass( isHidden ); 716 // Reset to options list 717 $( '.post-options' ).removeClass( offscreenHidden ); 718 $( '.setting-modal').addClass( offscreenHidden ); 719 } ); 717 if ( 'close' === action || sidebarIsOpen ) { 718 sidebarIsOpen = false; 719 720 $( '.options-toggle' ).attr( 'aria-expanded', 'false' ); 721 $( '.options-close-label, .options-panel-back' ).addClass( isHidden ); 722 $( '.options-open-label, .press-this-actions, #scanbar' ).removeClass( isHidden ); 723 724 $( '.options-panel' ).addClass( isOffScreen ) 725 .one( 'transitionend', function() { 726 $( this ).addClass( isHidden ); 727 // Reset to options list 728 $( '.post-options' ).removeClass( offscreenHidden ); 729 $( '.setting-modal').addClass( offscreenHidden ); 730 } ); 731 return; 732 } 720 733 } 721 734 722 735 /** … … 788 801 monitorOptionsModal(); 789 802 monitorPlaceholder(); 790 803 791 $( '.options-open' ).on( 'click.press-this', openSidebar ); 792 $( '.options-close' ).on( 'click.press-this', closeSidebar ); 804 $( '.options-toggle' ).on( 'click.press-this', toggleSidebar ); 793 805 794 806 // Close the sidebar when focus moves outside of it. 795 $( '.options-panel, .options-panel-back' ).on( 'focusout.press-this', function( ) {807 $( '.options-panel, .options-panel-back' ).on( 'focusout.press-this', function( event ) { 796 808 setTimeout( function() { 797 809 var node = document.activeElement, 798 810 $node = $( node ); … … 800 812 if ( sidebarIsOpen && node && ! $node.hasClass( 'options-panel-back' ) && 801 813 ( node.nodeName === 'BODY' || 802 814 ( ! $node.closest( '.options-panel' ).length && 803 ! $node.closest( '.options- open' ).length ) ) ) {815 ! $node.closest( '.options-toggle' ).length ) ) ) { 804 816 805 closeSidebar();817 toggleSidebar( event, 'close' ); 806 818 } 807 819 }, 50 ); 808 820 });