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

Props afercia.
Fixes #32253.

Built from https://develop.svn.wordpress.org/trunk@32948


git-svn-id: http://core.svn.wordpress.org/trunk@32919 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-06-25 20:32:26 +00:00
parent 7a264022e7
commit 7537240d37
6 changed files with 157 additions and 111 deletions

View File

@ -513,16 +513,24 @@ th.asc a:focus span.sorting-indicator {
} }
/* Bulk Actions */ /* Bulk Actions */
.tablenav-pages a { .tablenav-pages a,
.tablenav-pages-navspan {
font-weight: 600; font-weight: 600;
margin-left: 1px;
padding: 0 2px; padding: 0 2px;
} }
.tablenav-pages .current-page { .tablenav-pages .current-page {
padding-top: 0; margin: 0 0 0 2px;
padding-bottom: 5px;
font-size: 13px;
text-align: center; text-align: center;
} }
.tablenav-pages .next-page {
.tablenav .total-pages {
margin-left: 2px;
}
.tablenav #table-paging {
margin-right: 2px; margin-right: 2px;
} }
@ -544,12 +552,10 @@ th.asc a:focus span.sorting-indicator {
.tablenav .tablenav-pages { .tablenav .tablenav-pages {
float: left; float: left;
display: block; height: 28px;
margin-top: 3px;
cursor: default; cursor: default;
height: 30px;
color: #555; color: #555;
line-height: 2.5;
font-size: 12px;
} }
.tablenav .no-pages, .tablenav .no-pages,
@ -563,41 +569,43 @@ th.asc a:focus span.sorting-indicator {
padding: 3px 6px; padding: 3px 6px;
} }
.tablenav .tablenav-pages a { .tablenav .tablenav-pages a,
padding: 0 10px 3px; .tablenav-pages-navspan {
background: #eee;
background: rgba( 0, 0, 0, 0.05 );
display: inline-block; display: inline-block;
width: 7px;
border: 1px solid #d2d2d2;
padding: 3px 10px 7px;
background: #e4e4e4;
font-size: 16px; font-size: 16px;
line-height: 1;
font-weight: normal; font-weight: normal;
line-height: 1.3333; text-align: center;
}
.tablenav-pages-navspan {
height: 16px;
border-color: #e8e8e8;
background: #ebebeb;
color: #b4b4b4;
} }
.tablenav .tablenav-pages a:hover, .tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus { .tablenav .tablenav-pages a:focus {
border-color: #5b9dd9;
color: #fff; color: #fff;
background: #00a0d2; background: #00a0d2;
} -webkit-box-shadow: none;
box-shadow: none;
.tablenav .tablenav-pages a.disabled, outline: none; /* IE8 */
.tablenav .tablenav-pages a.disabled:hover,
.tablenav .tablenav-pages a.disabled:focus,
.tablenav .tablenav-pages a.disabled:active {
color: #a0a5aa;
background: #eee;
background: rgba( 0, 0, 0, 0.05 );
} }
.tablenav .displaying-num { .tablenav .displaying-num {
margin-left: 7px; margin-left: 7px;
color: #777;
font-size: 12px;
font-style: italic;
} }
.tablenav .one-page .displaying-num { .tablenav .one-page .displaying-num {
display: inline-block; display: inline-block;
margin-top: 2px; margin-top: 5px;
margin-left: 0; margin-left: 0;
} }
@ -637,8 +645,6 @@ classes exist in paginate_links() but not seen in list table output. */
float: left; float: left;
margin: 0 5px; margin: 0 5px;
padding-top: 3px; padding-top: 3px;
/* line-height in px same as .tablenav height */
line-height: 30px;
} }
.wp-filter .view-switch { .wp-filter .view-switch {
@ -658,6 +664,7 @@ classes exist in paginate_links() but not seen in list table output. */
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 24px; line-height: 24px;
text-decoration: none;
} }
.view-switch a:before { .view-switch a:before {
@ -1616,12 +1623,14 @@ div.action-links,
.tablenav.bottom .displaying-num { .tablenav.bottom .displaying-num {
position: absolute; position: absolute;
left: 0; left: 0;
top: 10px; top: 11px;
margin: 0;
font-size: 14px; font-size: 14px;
} }
.tablenav-pages { .tablenav .tablenav-pages {
width: 100%; width: 100%;
height: auto;
text-align: center; text-align: center;
margin: 0 0 25px; margin: 0 0 25px;
} }
@ -1639,20 +1648,23 @@ div.action-links,
height: 0; height: 0;
} }
.tablenav-pages .pagination-links .paging-input { .tablenav-pages .pagination-links {
font-size: 16px;
}
.tablenav-pages .pagination-links a,
.tablenav-pages-navspan {
padding: 9px 16px 12px;
font-size: 18px; font-size: 18px;
} }
.tablenav-pages .pagination-links a { .tablenav-pages-navspan {
padding: 8px 20px 11px; height: 18px;
display: inline;
font-size: 18px;
background: rgba(0, 0, 0, 0.05);
} }
.tablenav-pages .pagination-links .current-page { .tablenav-pages .pagination-links .current-page {
padding: 10px; padding: 8px 9px 9px;
font-size: 14px; font-size: 16px;
} }
/* WP List Table Adjustments: General */ /* WP List Table Adjustments: General */

View File

@ -513,16 +513,24 @@ th.asc a:focus span.sorting-indicator {
} }
/* Bulk Actions */ /* Bulk Actions */
.tablenav-pages a { .tablenav-pages a,
.tablenav-pages-navspan {
font-weight: 600; font-weight: 600;
margin-right: 1px;
padding: 0 2px; padding: 0 2px;
} }
.tablenav-pages .current-page { .tablenav-pages .current-page {
padding-top: 0; margin: 0 2px 0 0;
padding-bottom: 5px;
font-size: 13px;
text-align: center; text-align: center;
} }
.tablenav-pages .next-page {
.tablenav .total-pages {
margin-right: 2px;
}
.tablenav #table-paging {
margin-left: 2px; margin-left: 2px;
} }
@ -544,12 +552,10 @@ th.asc a:focus span.sorting-indicator {
.tablenav .tablenav-pages { .tablenav .tablenav-pages {
float: right; float: right;
display: block; height: 28px;
margin-top: 3px;
cursor: default; cursor: default;
height: 30px;
color: #555; color: #555;
line-height: 2.5;
font-size: 12px;
} }
.tablenav .no-pages, .tablenav .no-pages,
@ -563,41 +569,43 @@ th.asc a:focus span.sorting-indicator {
padding: 3px 6px; padding: 3px 6px;
} }
.tablenav .tablenav-pages a { .tablenav .tablenav-pages a,
padding: 0 10px 3px; .tablenav-pages-navspan {
background: #eee;
background: rgba( 0, 0, 0, 0.05 );
display: inline-block; display: inline-block;
width: 7px;
border: 1px solid #d2d2d2;
padding: 3px 10px 7px;
background: #e4e4e4;
font-size: 16px; font-size: 16px;
line-height: 1;
font-weight: normal; font-weight: normal;
line-height: 1.3333; text-align: center;
}
.tablenav-pages-navspan {
height: 16px;
border-color: #e8e8e8;
background: #ebebeb;
color: #b4b4b4;
} }
.tablenav .tablenav-pages a:hover, .tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus { .tablenav .tablenav-pages a:focus {
border-color: #5b9dd9;
color: #fff; color: #fff;
background: #00a0d2; background: #00a0d2;
} -webkit-box-shadow: none;
box-shadow: none;
.tablenav .tablenav-pages a.disabled, outline: none; /* IE8 */
.tablenav .tablenav-pages a.disabled:hover,
.tablenav .tablenav-pages a.disabled:focus,
.tablenav .tablenav-pages a.disabled:active {
color: #a0a5aa;
background: #eee;
background: rgba( 0, 0, 0, 0.05 );
} }
.tablenav .displaying-num { .tablenav .displaying-num {
margin-right: 7px; margin-right: 7px;
color: #777;
font-size: 12px;
font-style: italic;
} }
.tablenav .one-page .displaying-num { .tablenav .one-page .displaying-num {
display: inline-block; display: inline-block;
margin-top: 2px; margin-top: 5px;
margin-right: 0; margin-right: 0;
} }
@ -637,8 +645,6 @@ classes exist in paginate_links() but not seen in list table output. */
float: right; float: right;
margin: 0 5px; margin: 0 5px;
padding-top: 3px; padding-top: 3px;
/* line-height in px same as .tablenav height */
line-height: 30px;
} }
.wp-filter .view-switch { .wp-filter .view-switch {
@ -658,6 +664,7 @@ classes exist in paginate_links() but not seen in list table output. */
height: 28px; height: 28px;
text-align: center; text-align: center;
line-height: 24px; line-height: 24px;
text-decoration: none;
} }
.view-switch a:before { .view-switch a:before {
@ -1616,12 +1623,14 @@ div.action-links,
.tablenav.bottom .displaying-num { .tablenav.bottom .displaying-num {
position: absolute; position: absolute;
right: 0; right: 0;
top: 10px; top: 11px;
margin: 0;
font-size: 14px; font-size: 14px;
} }
.tablenav-pages { .tablenav .tablenav-pages {
width: 100%; width: 100%;
height: auto;
text-align: center; text-align: center;
margin: 0 0 25px; margin: 0 0 25px;
} }
@ -1639,20 +1648,23 @@ div.action-links,
height: 0; height: 0;
} }
.tablenav-pages .pagination-links .paging-input { .tablenav-pages .pagination-links {
font-size: 16px;
}
.tablenav-pages .pagination-links a,
.tablenav-pages-navspan {
padding: 9px 16px 12px;
font-size: 18px; font-size: 18px;
} }
.tablenav-pages .pagination-links a { .tablenav-pages-navspan {
padding: 8px 20px 11px; height: 18px;
display: inline;
font-size: 18px;
background: rgba(0, 0, 0, 0.05);
} }
.tablenav-pages .pagination-links .current-page { .tablenav-pages .pagination-links .current-page {
padding: 10px; padding: 8px 9px 9px;
font-size: 14px; font-size: 16px;
} }
/* WP List Table Adjustments: General */ /* WP List Table Adjustments: General */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -704,30 +704,46 @@ class WP_List_Table {
$total_pages_before = '<span class="paging-input">'; $total_pages_before = '<span class="paging-input">';
$total_pages_after = '</span>'; $total_pages_after = '</span>';
$disable_first = $disable_last = ''; $disable_first = $disable_last = $disable_prev = $disable_next = false;
if ( $current == 1 ) { if ( $current == 1 ) {
$disable_first = ' disabled'; $disable_first = true;
$disable_prev = true;
}
if ( $current == 2 ) {
$disable_first = true;
} }
if ( $current == $total_pages ) { if ( $current == $total_pages ) {
$disable_last = ' disabled'; $disable_last = true;
$disable_next = true;
} }
$page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>", if ( $current == $total_pages - 1 ) {
'first-page' . $disable_first, $disable_last = true;
}
if ( $disable_first ) {
$page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&laquo;</span>';
} else {
$page_links[] = sprintf( "<a class='first-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
esc_url( remove_query_arg( 'paged', $current_url ) ), esc_url( remove_query_arg( 'paged', $current_url ) ),
__( 'First page' ), __( 'First page' ),
'&laquo;' '&laquo;'
); );
}
$page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>", if ( $disable_prev ) {
'prev-page' . $disable_first, $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&lsaquo;</span>';
} else {
$page_links[] = sprintf( "<a class='prev-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ), esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
__( 'Previous page' ), __( 'Previous page' ),
'&lsaquo;' '&lsaquo;'
); );
}
if ( 'bottom' == $which ) { if ( 'bottom' == $which ) {
$html_current_page = $current; $html_current_page = $current;
$total_pages_before = '<span id="table-paging" class="paging-input">'; $total_pages_before = '<span class="screen-reader-text">' . __( 'Current Page' ) . '</span><span id="table-paging" class="paging-input">';
} else { } else {
$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' />", $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' />",
'<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>', '<label for="current-page-selector" class="screen-reader-text">' . __( 'Current Page' ) . '</label>',
@ -738,19 +754,25 @@ class WP_List_Table {
$html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) ); $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) );
$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after; $page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;
$page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>", if ( $disable_next ) {
'next-page' . $disable_last, $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&rsaquo;</span>';
} else {
$page_links[] = sprintf( "<a class='next-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ), esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
__( 'Next page' ), __( 'Next page' ),
'&rsaquo;' '&rsaquo;'
); );
}
$page_links[] = sprintf( "<a class='%s' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>", if ( $disable_last ) {
'last-page' . $disable_last, $page_links[] = '<span class="tablenav-pages-navspan" aria-hidden="true">&raquo;</span>';
} else {
$page_links[] = sprintf( "<a class='last-page' href='%s'><span class='screen-reader-text'>%s</span><span aria-hidden='true'>%s</span></a>",
esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
__( 'Last page' ), __( 'Last page' ),
'&raquo;' '&raquo;'
); );
}
$pagination_links_class = 'pagination-links'; $pagination_links_class = 'pagination-links';
if ( ! empty( $infinite_scroll ) ) { if ( ! empty( $infinite_scroll ) ) {

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-alpha-32947'; $wp_version = '4.3-alpha-32948';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.