Ticket #16262: markjaquith.16262.issue09.river.3.diff
File markjaquith.16262.issue09.river.3.diff, 4.8 KB (added by , 10 years ago) |
---|
-
wp-includes/script-loader.php
299 299 $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' ); 300 300 $scripts->add_data( 'admin-custom-fields', 'group', 1 ); 301 301 302 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags' ), '20110121' );302 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags', 'jquery-query'), '20110121' ); 303 303 $scripts->add_data( 'admin-comments', 'group', 1 ); 304 304 $scripts->localize( 'admin-comments', 'adminCommentsL10n', array( 305 305 'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']), -
wp-admin/includes/class-wp-list-table.php
81 81 $args = wp_parse_args( $args, array( 82 82 'plural' => '', 83 83 'singular' => '', 84 'ajax' => true84 'ajax' => false 85 85 ) ); 86 86 87 87 $screen = get_current_screen(); … … 93 93 94 94 $this->_args = $args; 95 95 96 //if ( $args['ajax'] ) {97 //wp_enqueue_script( 'list-table' );98 //add_action( 'admin_footer', array( &$this, '_js_vars' ) );99 //}96 if ( $args['ajax'] ) { 97 // wp_enqueue_script( 'list-table' ); 98 add_action( 'admin_footer', array( &$this, '_js_vars' ) ); 99 } 100 100 } 101 101 102 102 /** -
wp-admin/includes/class-wp-comments-list-table.php
32 32 parent::WP_List_Table( array( 33 33 'plural' => 'comments', 34 34 'singular' => 'comment', 35 'ajax' => true, 35 36 ) ); 36 37 } 37 38 … … 267 268 function display() { 268 269 extract( $this->_args ); 269 270 270 //wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );271 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 271 272 272 273 $this->display_tablenav( 'top' ); 273 274 … … 538 539 function display( $output_empty = false ) { 539 540 extract( $this->_args ); 540 541 541 //wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' );542 wp_nonce_field( "fetch-list-" . get_class( $this ), '_ajax_fetch_list_nonce' ); 542 543 ?> 543 544 <table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;"> 544 545 <tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>> -
wp-admin/js/edit-comments.dev.js
211 211 212 212 theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() ); 213 213 214 //refillTheExtraList();214 refillTheExtraList(); 215 215 }; 216 216 217 /* var refillTheExtraList = function(ev) { 218 var args = $.query.get(), total_pages = listTable.get_total_pages(), per_page = $('input[name=_per_page]', '#comments-form').val(); 219 217 var refillTheExtraList = function(ev) { 218 // var args = $.query.get(), total_pages = listTable.get_total_pages(), per_page = $('input[name=_per_page]', '#comments-form').val(), r; 219 var args = $.query.get(), total_pages = $('.total-pages').text(), per_page = $('input[name=_per_page]', '#comments-form').val(), r; 220 221 if (! args.paged) 222 args.paged = 1; 223 220 224 if (args.paged > total_pages) { 221 225 return; 222 226 } … … 226 230 args.number = Math.min(8, per_page); // see WP_Comments_List_Table::prepare_items() @ class-wp-comments-list-table.php 227 231 } else { 228 232 args.number = 1; 229 args.offset = per_page - 1; // fetch only the last item of the next page233 args.offset = Math.min(8, per_page) - 1; // fetch only the next item on the extra list 230 234 } 231 235 232 236 args.no_placeholder = true; 233 237 234 238 args.paged ++; 239 240 args = $.extend(args, { 241 'action': 'fetch-list', 242 'list_args': list_args, 243 '_ajax_fetch_list_nonce': $('#_ajax_fetch_list_nonce').val() 244 }); 235 245 236 listTable.fetch_list(args, function(response) { 237 theExtraList.get(0).wpList.add( response.rows ); 246 $.ajax({ 247 url: ajaxurl, 248 global: false, 249 dataType: 'json', 250 data: args, 251 success: function(response) { 252 theExtraList.get(0).wpList.add( response.rows ); 253 } 238 254 }); 239 }; */255 }; 240 256 241 257 theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } ); 242 258 theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )