Make WordPress Core

Changeset 32948


Ignore:
Timestamp:
06/25/2015 08:31:51 PM (10 years ago)
Author:
wonderboymusic
Message:

List tables: when post navigation links point to the current page, use <span>s and text instead of <a>s.

Props afercia.
Fixes #32253.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r32945 r32948  
    514514
    515515/* Bulk Actions */
    516 .tablenav-pages a {
     516.tablenav-pages a,
     517.tablenav-pages-navspan {
    517518    font-weight: 600;
    518     margin-right: 1px;
    519519    padding: 0 2px;
    520520}
     521
    521522.tablenav-pages .current-page {
    522     padding-top: 0;
     523    margin: 0 2px 0 0;
     524    padding-bottom: 5px;
     525    font-size: 13px;
    523526    text-align: center;
    524527}
    525 .tablenav-pages .next-page {
     528
     529.tablenav .total-pages {
     530    margin-right: 2px;
     531}
     532
     533.tablenav #table-paging {
    526534    margin-left: 2px;
    527535}
     
    545553.tablenav .tablenav-pages {
    546554    float: right;
    547     display: block;
     555    height: 28px;
     556    margin-top: 3px;
    548557    cursor: default;
    549     height: 30px;
    550558    color: #555;
    551     line-height: 2.5;
    552     font-size: 12px;
    553559}
    554560
     
    564570}
    565571
    566 .tablenav .tablenav-pages a {
    567     padding: 0 10px 3px;
    568     background: #eee;
    569     background: rgba( 0, 0, 0, 0.05 );
     572.tablenav .tablenav-pages a,
     573.tablenav-pages-navspan {
    570574    display: inline-block;
     575    width: 7px;
     576    border: 1px solid #d2d2d2;
     577    padding: 3px 10px 7px;
     578    background: #e4e4e4;
    571579    font-size: 16px;
     580    line-height: 1;
    572581    font-weight: normal;
    573     line-height: 1.3333;
     582    text-align: center;
     583}
     584
     585.tablenav-pages-navspan {
     586    height: 16px;
     587    border-color: #e8e8e8;
     588    background: #ebebeb;
     589    color: #b4b4b4;
    574590}
    575591
    576592.tablenav .tablenav-pages a:hover,
    577593.tablenav .tablenav-pages a:focus {
     594    border-color: #5b9dd9;
    578595    color: #fff;
    579596    background: #00a0d2;
    580 }
    581 
    582 .tablenav .tablenav-pages a.disabled,
    583 .tablenav .tablenav-pages a.disabled:hover,
    584 .tablenav .tablenav-pages a.disabled:focus,
    585 .tablenav .tablenav-pages a.disabled:active {
    586     color: #a0a5aa;
    587     background: #eee;
    588     background: rgba( 0, 0, 0, 0.05 );
     597    -webkit-box-shadow: none;
     598    box-shadow: none;
     599    outline: none; /* IE8 */
    589600}
    590601
    591602.tablenav .displaying-num {
    592603    margin-right: 7px;
    593     color: #777;
    594     font-size: 12px;
    595     font-style: italic;
    596604}
    597605
    598606.tablenav .one-page .displaying-num {
    599607    display: inline-block;
    600     margin-top: 2px;
     608    margin-top: 5px;
    601609    margin-right: 0;
    602610}
     
    638646    margin: 0 5px;
    639647    padding-top: 3px;
    640     /* line-height in px same as .tablenav height */
    641     line-height: 30px;
    642648}
    643649
     
    659665    text-align: center;
    660666    line-height: 24px;
     667    text-decoration: none;
    661668}
    662669
     
    16171624        position: absolute;
    16181625        right: 0;
    1619         top: 10px;
     1626        top: 11px;
     1627        margin: 0;
    16201628        font-size: 14px;
    16211629    }
    16221630
    1623     .tablenav-pages {
     1631    .tablenav .tablenav-pages {
    16241632        width: 100%;
     1633        height: auto;
    16251634        text-align: center;
    16261635        margin: 0 0 25px;
     
    16401649    }
    16411650
    1642     .tablenav-pages .pagination-links .paging-input {
     1651    .tablenav-pages .pagination-links {
     1652        font-size: 16px;
     1653    }
     1654
     1655    .tablenav-pages .pagination-links a,
     1656    .tablenav-pages-navspan {
     1657        padding: 9px 16px 12px;
    16431658        font-size: 18px;
    16441659    }
    16451660
    1646     .tablenav-pages .pagination-links a {
    1647         padding: 8px 20px 11px;
    1648         display: inline;
    1649         font-size: 18px;
    1650         background: rgba(0, 0, 0, 0.05);
     1661    .tablenav-pages-navspan {
     1662        height: 18px;
    16511663    }
    16521664
    16531665    .tablenav-pages .pagination-links .current-page {
    1654         padding: 10px;
    1655         font-size: 14px;
     1666        padding: 8px 9px 9px;
     1667        font-size: 16px;
    16561668    }
    16571669
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r32800 r32948  
    705705        $total_pages_after  = '</span>';
    706706
    707         $disable_first = $disable_last = '';
    708         if ( $current == 1 ) {
    709             $disable_first = ' disabled';
    710         }
    711         if ( $current == $total_pages ) {
    712             $disable_last = ' disabled';
    713         }
    714         $page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    715             'first-page' . $disable_first,
    716             esc_url( remove_query_arg( 'paged', $current_url ) ),
    717             __( 'First page' ),
    718             '&laquo;'
    719         );
    720 
    721         $page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    722             'prev-page' . $disable_first,
    723             esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
    724             __( 'Previous page' ),
    725             '&lsaquo;'
    726         );
     707        $disable_first = $disable_last = $disable_prev = $disable_next = false;
     708
     709        if ( $current == 1 ) {
     710            $disable_first = true;
     711            $disable_prev = true;
     712        }
     713        if ( $current == 2 ) {
     714            $disable_first = true;
     715        }
     716        if ( $current == $total_pages ) {
     717            $disable_last = true;
     718            $disable_next = true;
     719        }
     720        if ( $current == $total_pages - 1 ) {
     721            $disable_last = true;
     722        }
     723
     724        if ( $disable_first ) {
     725            $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&laquo;</span>';
     726        } else {
     727            $page_links[] = sprintf( "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     728                esc_url( remove_query_arg( 'paged', $current_url ) ),
     729                __( 'First page' ),
     730                '&laquo;'
     731            );
     732        }
     733
     734        if ( $disable_prev ) {
     735            $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&lsaquo;</span>';
     736        } else {
     737            $page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     738                esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
     739                __( 'Previous page' ),
     740                '&lsaquo;'
     741            );
     742        }
    727743
    728744        if ( 'bottom' == $which ) {
    729745            $html_current_page  = $current;
    730             $total_pages_before = '<span id="table-paging" class="paging-input">';
     746            $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
    731747        } else {
    732748            $html_current_page = sprintf( "%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' />",
     
    739755        $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
    740756
    741         $page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    742             'next-page' . $disable_last,
    743             esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
    744             __( 'Next page' ),
    745             '&rsaquo;'
    746         );
    747 
    748         $page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
    749             'last-page' . $disable_last,
    750             esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
    751             __( 'Last page' ),
    752             '&raquo;'
    753         );
     757        if ( $disable_next ) {
     758            $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&rsaquo;</span>';
     759        } else {
     760            $page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     761                esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
     762                __( 'Next page' ),
     763                '&rsaquo;'
     764            );
     765        }
     766
     767        if ( $disable_last ) {
     768            $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&raquo;</span>';
     769        } else {
     770            $page_links[] = sprintf( "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
     771                esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
     772                __( 'Last page' ),
     773                '&raquo;'
     774            );
     775        }
    754776
    755777        $pagination_links_class = 'pagination-links';
Note: See TracChangeset for help on using the changeset viewer.