Make WordPress Core

Ticket #15580: spinner-search.2.diff

File spinner-search.2.diff, 3.8 KB (added by scribu, 14 years ago)

add bottom spinner

  • 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 list-ajax-loading" alt="" />
    202203<?php
    203204        }
    204205
     
    730731                <div class="alignleft actions">
    731732                        <?php $this->bulk_actions( $which ); ?>
    732733                </div>
    733 
    734         <?php
     734<?php
    735735                $this->extra_tablenav( $which );
    736736                $this->pagination( $which );
    737         ?>
    738737
     738if ( 'bottom' == $which ) {
     739?>
     740<img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" class="ajax-loading list-ajax-loading" alt="" />
     741<?php } ?>
     742
    739743                <br class="clear" />
    740744        </div>
    741745<?php
  • 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

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