Ticket #15530: 15530.3.diff
| File 15530.3.diff, 2.7 KB (added by , 15 years ago) |
|---|
-
wp-admin/admin-ajax.php
222 222 $total = $comment_count->$status; 223 223 // else use the decremented value from above 224 224 225 $page_links = paginate_links( array(226 'base' => add_query_arg( 'apage', '%#%', $url ),227 'format' => '',228 'prev_text' => __('«'),229 'next_text' => __('»'),230 'total' => ceil($total / $per_page),231 'current' => $page232 ) );233 225 $x = new WP_Ajax_Response( array( 234 226 'what' => 'comment', 235 227 'id' => $comment_id, // here for completeness - not used 236 228 'supplemental' => array( 237 'pageLinks' => $page_links, 229 'total_items_i18n' => sprintf( _n( '1 item', '%s items', $total ), number_format_i18n( $total ) ), 230 'total_pages_i18n' => number_format_i18n( ceil( $total / $per_page ) ), 238 231 'total' => $total, 239 232 'time' => $time 240 233 ) -
wp-admin/js/edit-comments.dev.js
4 4 setCommentsList = function() { 5 5 var totalInput, perPageInput, pageInput, lastConfidentTime = 0, dimAfter, delBefore, updateTotalCount, delAfter; 6 6 7 totalInput = $(' .tablenavinput[name="_total"]', '#comments-form');8 perPageInput = $(' .tablenavinput[name="_per_page"]', '#comments-form');9 pageInput = $(' .tablenavinput[name="_page"]', '#comments-form');7 totalInput = $('input[name="_total"]', '#comments-form'); 8 perPageInput = $('input[name="_per_page"]', '#comments-form'); 9 pageInput = $('input[name="_page"]', '#comments-form'); 10 10 11 11 dimAfter = function( r, settings ) { 12 12 var c = $('#' + settings.element); … … 190 190 total = total - spam - trash; 191 191 if ( total < 0 ) 192 192 total = 0; 193 193 console.log( r ); 194 194 if ( ( 'object' == typeof r ) && lastConfidentTime < settings.parsed.responses[0].supplemental.time ) { 195 pageLinks = settings.parsed.responses[0].supplemental.pageLinks|| '';196 if ( $.trim( pageLinks ) )197 $('.tablenav-pages').find( '.page-numbers' ).remove().end().append( $( pageLinks ) );198 else199 $('.t ablenav-pages').find( '.page-numbers' ).remove();200 195 total_items_i18n = settings.parsed.responses[0].supplemental.total_items_i18n || ''; 196 console.log( total_items_i18n ); 197 if ( total_items_i18n ) { 198 $('.displaying-num').text( total_items_i18n ); 199 $('.total-pages').text( settings.parsed.responses[0].supplemental.total_pages_i18n ); 200 } 201 201 updateTotalCount( total, settings.parsed.responses[0].supplemental.time, true ); 202 202 } else { 203 203 updateTotalCount( total, r, false );