Make WordPress Core

Ticket #16262: garyc40.16262.river.2.diff

File garyc40.16262.river.2.diff, 5.0 KB (added by garyc40, 12 years ago)

previous patch accidentally includes list-table.js

  • wp-admin/includes/class-wp-comments-list-table.php

    diff --git wp-admin/includes/class-wp-comments-list-table.php wp-admin/includes/class-wp-comments-list-table.php
    index 5864e3b..0c34b1d 100644
    class WP_Comments_List_Table extends WP_List_Table { 
    3232                parent::WP_List_Table( array(
    3333                        'plural' => 'comments',
    3434                        'singular' => 'comment',
     35                        'ajax' => true,
    3536                ) );
    3637        }
    3738
    class WP_Comments_List_Table extends WP_List_Table { 
    267268        function display() {
    268269                extract( $this->_args );
    269270
    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' );
    271272
    272273                $this->display_tablenav( 'top' );
    273274
    class WP_Post_Comments_List_Table extends WP_Comments_List_Table { 
    538539        function display( $output_empty = false ) {
    539540                extract( $this->_args );
    540541
    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' );
    542543?>
    543544<table class="<?php echo implode( ' ', $this->get_table_classes() ); ?>" cellspacing="0" style="display:none;">
    544545        <tbody id="the-comment-list"<?php if ( $singular ) echo " class='list:$singular'"; ?>>
  • 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 13a688c..90c29f2 100644
    class WP_List_Table { 
    8181                $args = wp_parse_args( $args, array(
    8282                        'plural' => '',
    8383                        'singular' => '',
    84                         'ajax' => true
     84                        'ajax' => false
    8585                ) );
    8686
    8787                $screen = get_current_screen();
    class WP_List_Table { 
    9393
    9494                $this->_args = $args;
    9595
    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                }
    100100        }
    101101
    102102        /**
  • wp-admin/js/edit-comments.dev.js

    diff --git wp-admin/js/edit-comments.dev.js wp-admin/js/edit-comments.dev.js
    index 5ca2fb6..d198508 100644
    setCommentsList = function() { 
    211211
    212212                theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
    213213
    214                 // refillTheExtraList();
     214                refillTheExtraList();
    215215        };
    216216
    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               
    220224                if (args.paged > total_pages) {
    221225                        return;
    222226                }
    setCommentsList = function() { 
    226230                        args.number = Math.min(8, per_page); // see WP_Comments_List_Table::prepare_items() @ class-wp-comments-list-table.php
    227231                } else {
    228232                        args.number = 1;
    229                         args.offset = per_page - 1; // fetch only the last item of the next page
     233                        args.offset = Math.min(8, per_page) - 1; // fetch only the next item on the extra list
    230234                }
    231235
    232236                args.no_placeholder = true;
    233237
    234238                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                });
    235245
    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                        }
    238254                });
    239         }; */
     255        };
    240256
    241257        theExtraList = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
    242258        theList = $('#the-comment-list').wpList( { alt: '', delBefore: delBefore, dimAfter: dimAfter, delAfter: delAfter, addColor: 'none' } )
  • wp-includes/script-loader.php

    diff --git wp-includes/script-loader.php wp-includes/script-loader.php
    index 6b97393..9abdf0f 100644
    function wp_default_scripts( &$scripts ) { 
    299299                $scripts->add( 'admin-custom-fields', "/wp-admin/js/custom-fields$suffix.js", array('wp-lists'), '20090106' );
    300300                $scripts->add_data( 'admin-custom-fields', 'group', 1 );
    301301
    302                 $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20110118' );
     302                $scripts->add( 'admin-comments', "/wp-admin/js/edit-comments$suffix.js", array('wp-lists', 'jquery-ui-resizable', 'quicktags', 'jquery-query'), '20110118' );
    303303                $scripts->add_data( 'admin-comments', 'group', 1 );
    304304                $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
    305305                        'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),