Ticket #15503: garyc40-15503-rev2.patch
File garyc40-15503-rev2.patch, 7.9 KB (added by , 14 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 681a7a0..11647b2 100644
body.press-this .stuffbox:hover .handlediv, 1399 1399 color: #555; 1400 1400 } 1401 1401 1402 .tablenav .tablenav-pages a {1402 .tablenav .tablenav-pages a, .tablenav .tablenav-pages span.disabled { 1403 1403 border-color: #D1E5EE; 1404 1404 background: #eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px; 1405 1405 } 1406 1406 1407 .tablenav .tablenav-pages span.disabled { 1408 color:#ccc; 1409 } 1410 1407 1411 .tablenav .tablenav-pages a:hover { 1408 1412 color: #d54e21; 1409 1413 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 73242a6..199542c 100644
fieldset.inline-edit-col-right .inline-edit-col { 1394 1394 color: #555; 1395 1395 } 1396 1396 1397 .tablenav .tablenav-pages a {1397 .tablenav .tablenav-pages a, .tablenav .tablenav-pages span.disabled { 1398 1398 border-color: #e3e3e3; 1399 1399 background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px; 1400 1400 } 1401 1401 1402 .tablenav .tablenav-pages span.disabled { 1403 color: #ccc; 1404 } 1405 1402 1406 .tablenav .tablenav-pages a:hover { 1403 1407 color: #d54e21; 1404 1408 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 07836e4..0d558d5 100644
th.asc:hover span.sorting-indicator { 1441 1441 1442 1442 /* Bulk Actions */ 1443 1443 1444 .tablenav-pages a {1444 .tablenav-pages a, .tablenav-pages span.disabled { 1445 1445 border-bottom-style: solid; 1446 1446 border-bottom-width: 2px; 1447 1447 font-weight: bold; … … th.asc:hover span.sorting-indicator { 1481 1481 } 1482 1482 1483 1483 .tablenav .tablenav-pages a, 1484 .tablenav-pages span.current { 1484 .tablenav-pages span.current, 1485 .tablenav-pages span.disabled { 1485 1486 text-decoration: none; 1486 1487 border: none; 1487 1488 padding: 3px 6px; … … th.asc:hover span.sorting-indicator { 1491 1492 -khtml-border-radius: 5px; 1492 1493 -webkit-border-radius: 5px; 1493 1494 border-radius: 5px; 1495 font-weight:bold; 1494 1496 } 1495 1497 1496 1498 .tablenav .displaying-num { -
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 a8aaa8f..ddb39e5 100644
class WP_List_Table { 479 479 $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; 480 480 481 481 $page_links = array(); 482 483 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 484 'first-page', 485 esc_attr__( 'Go to the first page' ), 486 esc_url( remove_query_arg( 'paged', $current_url ) ), 487 '«' 488 ); 489 490 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 491 'prev-page', 492 esc_attr__( 'Go to the previous page' ), 493 esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ), 494 '‹' 495 ); 482 483 if ( $current == 1 ) { 484 $page_links[] = sprintf( "<span class='%s'>%s</span>", 485 'first-page disabled', 486 '««' 487 ); 488 $page_links[] = sprintf( "<span class='%s'>%s</span>", 489 'prev-page disabled', 490 '«' 491 ); 492 } else { 493 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 494 'first-page', 495 esc_attr__( 'Go to the first page' ), 496 esc_url( remove_query_arg( 'paged', $current_url ) ), 497 '««' 498 ); 499 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 500 'prev-page', 501 esc_attr__( 'Go to the previous page' ), 502 esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ), 503 '«' 504 ); 505 } 496 506 497 507 $html_current_page = sprintf( "<input class='current-page' title='%s' type='text' name='%s' value='%s' size='%d' />", 498 508 esc_attr__( 'Current page' ), … … class WP_List_Table { 503 513 $html_total_pages = sprintf( "<span class='total-pages'>%s</span>", number_format_i18n( $total_pages ) ); 504 514 $page_links[] = '<span class="paging-input">' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . '</span>'; 505 515 506 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 507 'next-page', 508 esc_attr__( 'Go to the next page' ), 509 esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ), 510 '›' 511 ); 516 if ( $current == $total_pages ) { 517 $page_links[] = sprintf( "<span class='%s'>%s</span>", 518 'next-page disabled', 519 '»' 520 ); 512 521 513 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 514 'last-page', 515 esc_attr__( 'Go to the last page' ), 516 esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), 517 '»' 518 ); 522 $page_links[] = sprintf( "<span class='%s'>%s</span>", 523 'last-page disabled', 524 '»»' 525 ); 526 } else { 527 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 528 'next-page', 529 esc_attr__( 'Go to the next page' ), 530 esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ), 531 '»' 532 ); 533 534 $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>", 535 'last-page', 536 esc_attr__( 'Go to the last page' ), 537 esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), 538 '»»' 539 ); 540 } 519 541 520 542 $output .= "\n" . join( "\n", $page_links ); 521 543 -
wp-admin/js/list-table.dev.js
diff --git wp-admin/js/list-table.dev.js wp-admin/js/list-table.dev.js index e92f453..2a41ae8 100644
window.listTable = { 18 18 19 19 // paging 20 20 set_total_pages: function(num) { 21 var last_page_url = $('.last-page').attr('href'); 22 23 if ( last_page_url ) 24 this.total_pages = num || $.query.load( last_page_url ).get('paged'); 21 this.total_pages = num || $('span.total-pages').eq(0).text(); 25 22 }, 26 23 27 24 get_total_pages: function() { … … listTable.init(); 143 140 144 141 // Ajaxify various UI elements 145 142 146 function change_page(paged, $el) { 143 var spanify = function(selectors) { 144 $('.tablenav-pages a'). 145 filter(selectors). 146 each(function(){ 147 var $this = $(this), span = $('<span />'); 148 span. 149 addClass($this.attr('class') + ' disabled'). 150 text($this.text()); 151 $this.replaceWith(span); 152 }); 153 }; 154 155 var linkify = function() { 156 $('.tablenav-pages span.disabled').each(function(){ 157 var $this = $(this), a = $('<a />'); 158 a. 159 addClass($this.attr('class')). 160 removeClass('disabled'). 161 text($this.text()); 162 163 $this.replaceWith(a); 164 }); 165 } 166 167 var updatePageLinks = function(paged) { 168 $('.tablenav-pages a').each(function(){ 169 var a = $(this), href = '#'; 170 171 switch (a.attr('class')) { 172 case 'first-page': 173 href = $.query.set('paged', 1).toString(); 174 break; 175 case 'prev-page': 176 href = $.query.set('paged', paged - 1).toString(); 177 break; 178 case 'next-page': 179 href = $.query.set('paged', paged + 1).toString(); 180 break; 181 case 'last-page': 182 href = $.query.set('paged', listTable.get_total_pages()).toString(); 183 break; 184 } 185 186 a.attr('href', href); 187 }); 188 }; 189 190 function change_page(paged, $el) { 147 191 if ( paged < 1 ) 148 192 paged = 1; 149 193 … … listTable.init(); 154 198 listTable.update_rows({'paged': paged}, false, function() { 155 199 if ( $el.parents('.tablenav.bottom').length ) 156 200 scrollTo(0, 0); 201 202 // convert disabled buttons to links 203 linkify(); 204 205 // disable pagination links in case of first or last page 206 if ( paged == 1 ) { 207 spanify('.prev-page, .first-page'); 208 } else if ( paged == listTable.get_total_pages() ) { 209 spanify('.next-page, .last-page'); 210 } 211 212 // update href attribute of pagination links 213 updatePageLinks(paged); 157 214 158 215 $(listTable).trigger('changePage'); 159 216 }); 160 217 } 161 218 162 219 // pagination 163 $('.tablenav-pages a'). click(function() {220 $('.tablenav-pages a').live('click', function() { 164 221 var $el = $(this), 165 222 paged = $.query.GET('paged'); 166 223