Ticket #15503: garyc40-15503.patch
File garyc40-15503.patch, 7.1 KB (added by , 15 years ago) |
---|
-
wp-admin/css/colors-classic.dev.css
diff --git wp-admin/css/colors-classic.dev.css wp-admin/css/colors-classic.dev.css index 0b8183c..d99a7d5 100644
fieldset.inline-edit-col-right .inline-edit-col { 1408 1408 color: #555; 1409 1409 } 1410 1410 1411 .tablenav .tablenav-pages a {1411 .tablenav .tablenav-pages a, .tablenav .tablenav-pages span.disabled { 1412 1412 border-color: #D1E5EE; 1413 1413 background: #eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px; 1414 1414 } 1415 1415 1416 .tablenav .tablenav-pages span.disabled { 1417 color:#ccc; 1418 } 1419 1416 1420 .tablenav .tablenav-pages a:hover { 1417 1421 color: #d54e21; 1418 1422 border-color: #d54321; -
wp-admin/css/colors-fresh.dev.css
diff --git wp-admin/css/colors-fresh.dev.css wp-admin/css/colors-fresh.dev.css index ede8f38..a325d37 100644
fieldset.inline-edit-col-right .inline-edit-col { 1405 1405 color: #555; 1406 1406 } 1407 1407 1408 .tablenav .tablenav-pages a {1408 .tablenav .tablenav-pages a, .tablenav .tablenav-pages span.disabled { 1409 1409 border-color: #e3e3e3; 1410 1410 background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px; 1411 1411 } 1412 1412 1413 .tablenav .tablenav-pages span.disabled { 1414 color: #ccc; 1415 } 1416 1413 1417 .tablenav .tablenav-pages a:hover { 1414 1418 color: #d54e21; 1415 1419 border-color: #d54321; -
wp-admin/css/wp-admin.dev.css
diff --git wp-admin/css/wp-admin.dev.css wp-admin/css/wp-admin.dev.css index 13694dd..3171b04 100644
th.asc:hover span.sorting-indicator { 1438 1438 } 1439 1439 1440 1440 .tablenav .tablenav-pages a, 1441 .tablenav-pages span.current { 1441 .tablenav-pages span.current, 1442 .tablenav-pages span.disabled { 1442 1443 text-decoration: none; 1443 1444 border: none; 1444 1445 padding: 3px 6px; -
wp-admin/includes/class-wp-list-table.php
diff --git wp-admin/includes/class-wp-list-table.php wp-admin/includes/class-wp-list-table.php index 024c7b6..8964e79 100644
class WP_List_Table { 481 481 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 482 482 483 483 $page_links = array(); 484 485 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 486 'first-page', 487 esc_attr__( 'Go to the first page' ), 488 esc_url( remove_query_arg( 'paged', $current_url ) ), 489 '««' 490 ); 491 492 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 493 'prev-page', 494 esc_attr__( 'Go to the previous page' ), 495 esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ), 496 '«' 497 ); 484 485 if ( $current == 1 ) { 486 $page_links[] = sprintf( "<span class='%s'>%s</span>", 487 'first-page disabled', 488 '««' 489 ); 490 $page_links[] = sprintf( "<span class='%s'>%s</span>", 491 'prev-page disabled', 492 '«' 493 ); 494 } else { 495 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 496 'first-page', 497 esc_attr__( 'Go to the first page' ), 498 esc_url( remove_query_arg( 'paged', $current_url ) ), 499 '««' 500 ); 501 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 502 'prev-page', 503 esc_attr__( 'Go to the previous page' ), 504 esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ), 505 '«' 506 ); 507 } 498 508 499 509 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />", 500 510 esc_attr__( 'Current page' ), … … class WP_List_Table { 505 515 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) ); 506 516 $page_links[] = sprintf( _x( '%s of %s', 'paging' ), $html_current_page, $html_total_pages ); 507 517 508 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 509 'next-page', 510 esc_attr__( 'Go to the next page' ), 511 esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ), 512 '»' 513 ); 518 if ( $current == $total_pages ) { 519 $page_links[] = sprintf( "<span class='%s'>%s</span>", 520 'next-page disabled', 521 '»' 522 ); 514 523 515 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 516 'last-page', 517 esc_attr__( 'Go to the last page' ), 518 esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), 519 '»»' 520 ); 524 $page_links[] = sprintf( "<span class='%s'>%s</span>", 525 'last-page disabled', 526 '»»' 527 ); 528 } else { 529 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 530 'next-page', 531 esc_attr__( 'Go to the next page' ), 532 esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ), 533 '»' 534 ); 535 536 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 537 'last-page', 538 esc_attr__( 'Go to the last page' ), 539 esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), 540 '»»' 541 ); 542 } 521 543 522 544 $output .= join( "\n", $page_links ); 523 545 -
wp-admin/js/list-table.dev.js
diff --git wp-admin/js/list-table.dev.js wp-admin/js/list-table.dev.js index d44e7a7..b87c404 100644
listTable.init(); 148 148 149 149 // Ajaxify various UI elements 150 150 151 function change_page(paged, $el) { 151 var spanify = function(selectors) { 152 $('.tablenav-pages a'). 153 filter(selectors). 154 each(function(){ 155 var $this = $(this), span = $('<span />'); 156 span. 157 addClass($this.attr('class') + ' disabled'). 158 text($this.text()); 159 $this.replaceWith(span); 160 }); 161 }; 162 163 var linkify = function() { 164 $('.tablenav-pages span.disabled').each(function(){ 165 var $this = $(this), a = $('<a />'); 166 a. 167 addClass($this.attr('class')). 168 removeClass('disabled'). 169 text($this.text()); 170 171 $this.replaceWith(a); 172 }); 173 } 174 175 var updatePageLinks = function(paged) { 176 $('.tablenav-pages a').each(function(){ 177 var a = $(this), href = '#'; 178 179 switch (a.attr('class')) { 180 case 'first-page': 181 href = $.query.set('paged', 1).toString(); 182 break; 183 case 'prev-page': 184 href = $.query.set('paged', paged - 1).toString(); 185 break; 186 case 'next-page': 187 href = $.query.set('paged', paged + 1).toString(); 188 break; 189 case 'last-page': 190 href = $.query.set('paged', listTable.get_total_pages()).toString(); 191 break; 192 } 193 194 a.attr('href', href); 195 }); 196 }; 197 198 function change_page(paged, $el) { 152 199 if ( paged < 1 ) 153 200 paged = 1; 154 201 … … listTable.init(); 158 205 listTable.update_rows({'paged': paged}, false, function() { 159 206 if ( $el.parents('.tablenav.bottom').length ) 160 207 scrollTo(0, 0); 208 209 // convert disabled buttons to links 210 linkify(); 211 212 // disable pagination links in case of first or last page 213 if ( paged == 1 ) { 214 spanify('.prev-page, .first-page'); 215 } else if ( paged == listTable.get_total_pages() ) { 216 spanify('.next-page, .last-page'); 217 } 218 219 // update href attribute of pagination links 220 updatePageLinks(paged); 161 221 162 222 $(listTable).trigger('changePage'); 163 223 }); 164 224 } 165 225 166 226 // pagination 167 $('.tablenav-pages a'). click(function() {227 $('.tablenav-pages a').live('click', function() { 168 228 var $el = $(this), 169 229 paged = $.query.GET('paged'); 170 230