Make WordPress Core

Ticket #15580: spinner-search.diff

File spinner-search.diff, 3.6 KB (added by scribu, 14 years ago)
  • wp-includes/script-loader.php

     
    307307                $scripts->add( 'list-table', "/wp-admin/js/list-table$suffix.js", array( 'jquery-query', 'jquery-serialize-object' ), '20101215' );
    308308                $scripts->add_data( 'list-table', 'group', 1 );
    309309                $scripts->localize( 'list-table', 'listTableL10n', array(
    310                         'loading' => __('Loading...'),
    311310                        'error' => __('An error has occurred while loading the items.'),
    312311                        'search' => __('Search results for “%s”'),
    313312                        'l10n_print_after' => 'try{convertEntities(listTableL10n);}catch(e){};'
  • wp-admin/includes/class-wp-list-table.php

     
    199199        <input type="text" id="<?php echo $input_id ?>" name="s" value="<?php _admin_search_query(); ?>" />
    200200        <?php submit_button( $text, 'button', 'submit', false ); ?>
    201201</p>
     202<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading" id="list-ajax-loading" alt="" />
    202203<?php
    203204        }
    204205
     
    232233
    233234                echo "<ul class='subsubsub'>\n";
    234235                foreach ( $views as $class => $view ) {
    235                          $views[ $class ] = "\t<li class='$class'>$view";
     236                        $views[ $class ] = "\t<li class='$class'>$view";
    236237                }
    237238                echo implode( " |</li>\n", $views ) . "</li>\n";
    238239                echo "</ul>";
  • wp-admin/js/list-table.dev.js

     
    1414                this.set_total_pages();
    1515
    1616                this.$tbody = $('#the-list, #the-comment-list');
    17 
    18                 this.$overlay = $('<div id="loading-items">')
    19                         .html(listTableL10n.loading)
    20                         .hide()
    21                         .prependTo($('body'));
    2217        },
    2318
    2419        // paging
     
    5348                if ( !different )
    5449                        return false;
    5550
    56                 this.show_overlay();
     51                this.start_loading();
    5752
    5853                if ( reset_paging )
    5954                        $.query.SET('paged', 1);
     
    9691                if ( 'object' != typeof response ) {
    9792                        this.handle_error();
    9893                } else {
    99                         this.hide_overlay();
     94                        this.stop_loading();
    10095
    10196                        this.$tbody.html(response.rows);
    10297
     
    119114        },
    120115
    121116        handle_error: function() {
    122                 this.hide_overlay();
     117                this.stop_loading();
    123118
    124119                $('h2').after('<div class="error ajax below-h2"><p>' + listTableL10n.error + '</p></div>');
    125120        },
    126121
    127         show_overlay: function() {
     122        start_loading: function() {
    128123                this.loading = true;
    129124
    130125                $('.error.ajax').remove();
    131126
    132                 this.$overlay
    133                         .css({
    134                                 width: this.$tbody.width() + 'px',
    135                                 height: this.$tbody.height() - 20 + 'px'
    136                         })
    137                         .css(this.$tbody.offset())
    138                         .show();
     127                $('#list-ajax-loading').css('visibility', 'visible');
    139128        },
    140129
    141         hide_overlay: function() {
     130        stop_loading: function() {
    142131                this.loading = false;
    143                 this.$overlay.hide();
     132
     133                $('#list-ajax-loading').css('visibility', 'hidden');
    144134        }
    145135}
    146136
  • wp-admin/css/wp-admin.dev.css

     
    41924192}
    41934193* html #template div {margin-right: 0;}
    41944194#save {width: 15em;}
    4195 #loading-items {
    4196         position: absolute;
    4197         z-index: 9999;
    4198         padding: 10px 0;
    4199         background-color: #fff;
    4200         font-weight: bold;
    4201         text-align: center;
    4202         opacity: 0.5;
     4195#list-ajax-loading {
     4196        float: right;
     4197        margin-right: 5px;
     4198        margin-top: -1px;
    42034199}
    42044200#howto {
    42054201        font-size: 11px;