Make WordPress Core

Ticket #31575: 31575.3.patch

File 31575.3.patch, 4.8 KB (added by azaozz, 11 years ago)
  • src/wp-admin/css/press-this.css

     
    11851185        vertical-align: middle;
    11861186}
    11871187
    1188 .options-open,
    1189 .options-close {
     1188.options,
     1189.options.open .on-closed,
     1190.options.closed .on-open {
    11901191        display: none;
    11911192}
    11921193
    11931194@media (max-width: 900px) {
    1194         .options-open,
    1195         .options-close {
     1195        .options {
    11961196                display: block;
    11971197        }
    11981198}
    11991199
    1200 .options-open.is-hidden,
    1201 .options-close.is-hidden,
    12021200.options-panel-back.is-hidden {
    12031201        display: none;
    12041202}
    12051203
    1206 .options-open:focus .dashicons {
     1204.options:focus .dashicons {
    12071205        color: #fff;
    12081206        text-decoration: none;
    12091207}
    12101208
    1211 .options-open .dashicons {
     1209.options .dashicons {
    12121210        margin-top: 3px;
    12131211}
    12141212
    1215 .options-close {
     1213.options {
    12161214        color: #2ea2cc;
    12171215}
    12181216
  • src/wp-admin/includes/class-wp-press-this.php

     
    12011201                                <span class="current-site-name"><?php bloginfo( 'name' ); ?></span>
    12021202                        </a>
    12031203                </h1>
    1204                 <button type="button" class="options-open button-subtle">
    1205                         <span class="dashicons dashicons-tag"></span><span class="screen-reader-text"><?php _e( 'Show post options' ); ?></span>
     1204                <button type="button" class="options button-subtle closed">
     1205                        <span class="dashicons dashicons-tag on-closed"></span>
     1206                        <span class="screen-reader-text on-closed"><?php _e( 'Show post options' ); ?></span>
     1207                        <span aria-hidden="true" class="on-open"><?php _e( 'Done' ); ?></span>
     1208                        <span class="screen-reader-text on-open"><?php _e( 'Hide post options' ); ?></span>
    12061209                </button>
    1207                 <button type="button" class="options-close button-subtle is-hidden"><?php _e( 'Done' ); ?></button>
    12081210        </div>
    12091211
    12101212        <div id="scanbar" class="scan">
     
    12731275                </div>
    12741276
    12751277                <div class="options-panel-back is-hidden" tabindex="-1"></div>
    1276                 <div class="options-panel is-off-screen is-hidden" tabindex="-1">
     1278                <div class="options-panel is-off-screen is-hidden" tabindex="-1" aria-expanded="false">
    12771279                        <div class="post-options">
    12781280
    12791281                                <?php if ( $supports_formats ) : ?>
  • src/wp-admin/js/press-this.js

     
    286286                        if ( data.hasData ) {
    287287                                $( '#scanbar' ).hide();
    288288                        }
     289
     290                        if ( $( window ).width() > 900 ) {
     291                                $( '.options-panel' ).attr( 'aria-expanded', 'true' );
     292                        }
    289293                }
    290294
    291295                /**
     
    474478                function openSidebar() {
    475479                        sidebarIsOpen = true;
    476480
    477                         $( '.options-open, .press-this-actions, #scanbar' ).addClass( isHidden );
    478                         $( '.options-close, .options-panel-back' ).removeClass( isHidden );
     481                        $( '.options' ).removeClass( 'closed' ).addClass( 'open' );
     482                        $( '.press-this-actions, #scanbar' ).addClass( isHidden );
     483                        $( '.options-panel-back' ).removeClass( isHidden );
    479484
    480485                        $( '.options-panel' ).removeClass( offscreenHidden )
    481                                 .one( 'transitionend', function() {
     486                                .attr( 'aria-expanded', 'true' )
     487                                .one( transitionEndEvent, function() {
    482488                                        $( '.post-option:first' ).focus();
    483489                                } );
    484490                }
     
    486492                function closeSidebar() {
    487493                        sidebarIsOpen = false;
    488494
    489                         $( '.options-close, .options-panel-back' ).addClass( isHidden );
    490                         $( '.options-open, .press-this-actions, #scanbar' ).removeClass( isHidden );
     495                        $( '.options' ).removeClass( 'open' ).addClass( 'closed' );
     496                        $( '.options-panel-back' ).addClass( isHidden );
     497                        $( '.press-this-actions, #scanbar' ).removeClass( isHidden );
    491498
    492499                        $( '.options-panel' ).addClass( isOffScreen )
    493                                 .one( 'transitionend', function() {
     500                                .attr( 'aria-expanded', 'false' )
     501                                .one( transitionEndEvent, function() {
    494502                                        $( this ).addClass( isHidden );
    495503                                        // Reset to options list
    496504                                        $( '.post-options' ).removeClass( offscreenHidden );
     
    598606                        monitorPlaceholder();
    599607                        monitorCatList();
    600608
    601                         $( '.options-open' ).on( 'click.press-this', openSidebar );
    602                         $( '.options-close' ).on( 'click.press-this', closeSidebar );
     609                        $( '.options' ).on( 'click.press-this', function() {
     610                                if ( $( this ).hasClass( 'open' ) ) {
     611                                        closeSidebar();
     612                                } else {
     613                                        openSidebar();
     614                                }
     615                        });
    603616
    604617                        // Close the sidebar when focus moves outside of it.
    605618                        $( '.options-panel, .options-panel-back' ).on( 'focusout.press-this', function() {
     
    610623                                        if ( sidebarIsOpen && node && ! $node.hasClass( 'options-panel-back' ) &&
    611624                                                ( node.nodeName === 'BODY' ||
    612625                                                        ( ! $node.closest( '.options-panel' ).length &&
    613                                                         ! $node.closest( '.options-open' ).length ) ) ) {
     626                                                        ! $node.closest( '.options' ).length ) ) ) {
    614627
    615628                                                closeSidebar();
    616629                                        }