Make WordPress Core

Ticket #22839: 22839.5.diff

File 22839.5.diff, 12.9 KB (added by valendesigns, 8 years ago)
  • src/wp-admin/css/common.css

    diff --git src/wp-admin/css/common.css src/wp-admin/css/common.css
    index 6a1e9d7..0ccc758 100644
    h2 .nav-tab { 
    19311931        margin: 2px 5px 0;
    19321932}
    19331933
     1934.spinner.is-active {
     1935        display: inline-block !important;
     1936}
     1937
    19341938#template div {
    19351939        margin-right: 190px;
    19361940}
  • src/wp-admin/js/dashboard.js

    diff --git src/wp-admin/js/dashboard.js src/wp-admin/js/dashboard.js
    index f5e37e6..22385ee 100644
    jQuery(document).ready( function($) { 
    6868                $( '#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]' ).prop( 'disabled' , false );
    6969
    7070                t = $('#quick-press').submit( function() {
    71                         $('#dashboard_quick_press #publishing-action .spinner').show();
     71                        $('#dashboard_quick_press #publishing-action .spinner').addClass( 'is-active' );
    7272                        $('#quick-press .submit input[type="submit"], #quick-press .submit input[type="reset"]').prop('disabled', true);
    7373
    7474                        $.post( t.attr( 'action' ), t.serializeArray(), function( data ) {
  • src/wp-admin/js/edit-comments.js

    diff --git src/wp-admin/js/edit-comments.js src/wp-admin/js/edit-comments.js
    index 72b81e2..05419c5 100644
    commentReply = { 
    352352                $('#replycontent').css('height', '').val('');
    353353                $('#edithead input').val('');
    354354                $('.error', replyrow).empty().hide();
    355                 $('.spinner', replyrow).hide();
     355                $( '.spinner', replyrow ).removeClass( 'is-active' );
    356356
    357357                this.cid = '';
    358358        },
    commentReply = { 
    442442                var post = {};
    443443
    444444                $('#replysubmit .error').hide();
    445                 $('#replysubmit .spinner').show();
     445                $( '#replysubmit .spinner' ).addClass( 'is-active' );
    446446
    447447                $('#replyrow input').not(':button').each(function() {
    448448                        var t = $(this);
    commentReply = { 
    525525        error : function(r) {
    526526                var er = r.statusText;
    527527
    528                 $('#replysubmit .spinner').hide();
     528                $( '#replysubmit .spinner' ).removeClass( 'is-active' );
    529529
    530530                if ( r.responseText )
    531531                        er = r.responseText.replace( /<.[^<>]*?>/g, '' );
  • src/wp-admin/js/image-edit.js

    diff --git src/wp-admin/js/image-edit.js src/wp-admin/js/image-edit.js
    index 7bf2928..0abf6ef 100644
    var imageEdit = window.imageEdit = { 
    306306                        btn = $('#imgedit-open-btn-' + postid), spin = btn.siblings('.spinner');
    307307
    308308                btn.prop('disabled', true);
    309                 spin.show();
     309                spin.addClass( 'is-active' );
    310310
    311311                data = {
    312312                        'action': 'image-editor',
    var imageEdit = window.imageEdit = { 
    324324                        head.fadeOut('fast', function(){
    325325                                elem.fadeIn('fast');
    326326                                btn.removeAttr('disabled');
    327                                 spin.hide();
     327                                spin.removeClass( 'is-active' );
    328328                        });
    329329                });
    330330
  • src/wp-admin/js/inline-edit-post.js

    diff --git src/wp-admin/js/inline-edit-post.js src/wp-admin/js/inline-edit-post.js
    index 1249904..a1a9c02 100644
    inlineEditPost = { 
    250250                        id = this.getId(id);
    251251                }
    252252
    253                 $('table.widefat .spinner').show();
     253                $( 'table.widefat .spinner' ).addClass( 'is-active' );
    254254
    255255                params = {
    256256                        action: 'inline-save',
    inlineEditPost = { 
    266266                // make ajax request
    267267                $.post( ajaxurl, params,
    268268                        function(r) {
    269                                 $('table.widefat .spinner').hide();
     269                                $( 'table.widefat .spinner' ).removeClass( 'is-active' );
    270270
    271271                                if (r) {
    272272                                        if ( -1 !== r.indexOf( '<tr' ) ) {
    inlineEditPost = { 
    289289                var id = $('table.widefat tr.inline-editor').attr('id');
    290290
    291291                if ( id ) {
    292                         $('table.widefat .spinner').hide();
     292                        $( 'table.widefat .spinner' ).removeClass( 'is-active' );
    293293
    294294                        if ( 'bulk-edit' === id ) {
    295295                                $('table.widefat #bulk-edit').removeClass('inline-editor').hide().siblings('tr.hidden').remove();
  • src/wp-admin/js/inline-edit-tax.js

    diff --git src/wp-admin/js/inline-edit-tax.js src/wp-admin/js/inline-edit-tax.js
    index a996f24..e174646 100644
    inlineEditTax = { 
    8181                        id = this.getId(id);
    8282                }
    8383
    84                 $('table.widefat .spinner').show();
     84                $( 'table.widefat .spinner' ).addClass( 'is-active' );
    8585
    8686                params = {
    8787                        action: 'inline-save-tax',
    inlineEditTax = { 
    9797                $.post( ajaxurl, params,
    9898                        function(r) {
    9999                                var row, new_id, option_value;
    100                                 $('table.widefat .spinner').hide();
     100                                $( 'table.widefat .spinner' ).removeClass( 'is-active' );
    101101
    102102                                if (r) {
    103103                                        if ( -1 !== r.indexOf( '<tr' ) ) {
    inlineEditTax = { 
    133133                var id = $('table.widefat tr.inline-editor').attr('id');
    134134
    135135                if ( id ) {
    136                         $('table.widefat .spinner').hide();
     136                        $( 'table.widefat .spinner' ).removeClass( 'is-active' );
    137137                        $('#'+id).siblings('tr.hidden').addBack().remove();
    138138                        id = id.substr( id.lastIndexOf('-') + 1 );
    139139                        $(this.what+id).show();
  • src/wp-admin/js/media.js

    diff --git src/wp-admin/js/media.js src/wp-admin/js/media.js
    index 59c1f1a..f0c2175 100644
    var findPosts; 
    5151                                },
    5252                                spinner = $( '.find-box-search .spinner' );
    5353
    54                         spinner.show();
     54                        spinner.addClass( 'is-active' );
    5555
    5656                        $.ajax( ajaxurl, {
    5757                                type: 'POST',
    5858                                data: post,
    5959                                dataType: 'json'
    6060                        }).always( function() {
    61                                 spinner.hide();
     61                                spinner.removeClass( 'is-active' );
    6262                        }).done( function( x ) {
    6363                                if ( ! x.success ) {
    6464                                        $( '#find-posts-response' ).text( attachMediaBoxL10n.error );
  • src/wp-admin/js/nav-menu.js

    diff --git src/wp-admin/js/nav-menu.js src/wp-admin/js/nav-menu.js
    index bf59c6f..9f8916a 100644
    var wpNavMenu; 
    177177                                                        return false;
    178178
    179179                                                // Show the ajax spinner
    180                                                 t.find('.spinner').show();
     180                                                t.find( '.spinner' ).addClass( 'is-active' );
    181181
    182182                                                // Retrieve menu item data
    183183                                                $(checkboxes).each(function(){
    var wpNavMenu; 
    194194                                                api.addItemToMenu(menuItems, processMethod, function(){
    195195                                                        // Deselect the items and hide the ajax spinner
    196196                                                        checkboxes.removeAttr('checked');
    197                                                         t.find('.spinner').hide();
     197                                                        t.find( '.spinner' ).removeClass( 'is-active' );
    198198                                                });
    199199                                        });
    200200                                },
    var wpNavMenu; 
    862862                                loc.find('select').each(function() {
    863863                                        params[this.name] = $(this).val();
    864864                                });
    865                                 loc.find('.spinner').show();
     865                                loc.find( '.spinner' ).addClass( 'is-active' );
    866866                                $.post( ajaxurl, params, function() {
    867                                         loc.find('.spinner').hide();
     867                                        loc.find( '.spinner' ).removeClass( 'is-active' );
    868868                                });
    869869                                return false;
    870870                        });
    var wpNavMenu; 
    906906                                'type': input.attr('name')
    907907                        };
    908908
    909                         $('.spinner', panel).show();
     909                        $( '.spinner', panel ).addClass( 'is-active' );
    910910
    911911                        $.post( ajaxurl, params, function(menuMarkup) {
    912912                                api.processQuickSearchQueryResponse(menuMarkup, params, panel);
    var wpNavMenu; 
    923923                                return false;
    924924
    925925                        // Show the ajax spinner
    926                         $('.customlinkdiv .spinner').show();
     926                        $( '.customlinkdiv .spinner' ).addClass( 'is-active' );
    927927                        this.addLinkToMenu( url, label, processMethod, function() {
    928928                                // Remove the ajax spinner
    929                                 $('.customlinkdiv .spinner').hide();
     929                                $( '.customlinkdiv .spinner' ).removeClass( 'is-active' );
    930930                                // Set custom link form back to defaults
    931931                                $('#custom-menu-item-name').val('').blur();
    932932                                $('#custom-menu-item-url').val('http://');
    var wpNavMenu; 
    11741174
    11751175                        if( ! $items.length ) {
    11761176                                $('.categorychecklist', panel).html( '<li><p>' + navMenuL10n.noResultsFound + '</p></li>' );
    1177                                 $('.spinner', panel).hide();
     1177                                $( '.spinner', panel ).removeClass( 'is-active' );
    11781178                                return;
    11791179                        }
    11801180
    var wpNavMenu; 
    12011201                        });
    12021202
    12031203                        $('.categorychecklist', panel).html( $items );
    1204                         $('.spinner', panel).hide();
     1204                        $( '.spinner', panel ).removeClass( 'is-active' );
    12051205                },
    12061206
    12071207                removeMenuItem : function(el) {
  • src/wp-admin/js/post.js

    diff --git src/wp-admin/js/post.js src/wp-admin/js/post.js
    index 32c5f9c..8dfdf37 100644
    commentsBox = { 
    2020
    2121                this.st += num;
    2222                this.total = total;
    23                 $('#commentsdiv .spinner').show();
     23                $( '#commentsdiv .spinner' ).addClass( 'is-active' );
    2424
    2525                data = {
    2626                        'action' : 'get-comments',
    commentsBox = { 
    3535                        function(r) {
    3636                                r = wpAjax.parseAjaxResponse(r);
    3737                                $('#commentsdiv .widefat').show();
    38                                 $('#commentsdiv .spinner').hide();
     38                                $( '#commentsdiv .spinner' ).removeClass( 'is-active' );
    3939
    4040                                if ( 'object' == typeof r && r.responses[0] ) {
    4141                                        $('#the-comment-list').append( r.responses[0].data );
    jQuery(document).ready( function($) { 
    272272                        $submitButtons.addClass( 'disabled' );
    273273
    274274                        if ( $button.attr('id') === 'publish' ) {
    275                                 $submitpost.find('#major-publishing-actions .spinner').show();
     275                                $submitpost.find( '#major-publishing-actions .spinner' ).addClass( 'is-active' );
    276276                        } else {
    277                                 $submitpost.find('#minor-publishing .spinner').show();
     277                                $submitpost.find( '#minor-publishing .spinner' ).addClass( 'is-active' );
    278278                        }
    279279                });
    280280        });
    jQuery(document).ready( function($) { 
    676676                                        wp.autosave.enableButtons();
    677677                                }
    678678
    679                                 $('#publishing-action .spinner').hide();
     679                                $( '#publishing-action .spinner' ).removeClass( 'is-active' );
    680680                        }
    681681                });
    682682
  • src/wp-admin/js/widgets.js

    diff --git src/wp-admin/js/widgets.js src/wp-admin/js/widgets.js
    index a149a29..43e6f8c 100644
    wpWidgets = { 
    321321                };
    322322
    323323                if ( sidebarId ) {
    324                         $( '#' + sidebarId ).find('.spinner:first').css('display', 'inline-block');
     324                        $( '#' + sidebarId ).find( '.spinner:first' ).addClass( 'is-active' );
    325325                }
    326326
    327327                $('div.widgets-sortables').each( function() {
    wpWidgets = { 
    331331                });
    332332
    333333                $.post( ajaxurl, data, function() {
    334                         $('.spinner').hide();
     334                        $( '.spinner' ).removedClass( 'is-active' );
    335335                });
    336336        },
    337337
    wpWidgets = { 
    340340                        data = widget.find('form').serialize(), a;
    341341
    342342                widget = $(widget);
    343                 $('.spinner', widget).show();
     343                $( '.spinner', widget ).addClass( 'is-active' );
    344344
    345345                a = {
    346346                        action: 'save-widget',
    wpWidgets = { 
    377377                                        widget.remove();
    378378                                }
    379379                        } else {
    380                                 $('.spinner').hide();
     380                                $( '.spinner' ).removeClass( 'is-active' );
    381381                                if ( r && r.length > 2 ) {
    382382                                        $( 'div.widget-content', widget ).html( r );
    383383                                        wpWidgets.appendTitle( widget );
  • src/wp-admin/js/wp-fullscreen.js

    diff --git src/wp-admin/js/wp-fullscreen.js src/wp-admin/js/wp-fullscreen.js
    index 2431738..cb8c8e0 100644
     
    267267                        $saveMessage = $('#wp-fullscreen-save .wp-fullscreen-saved-message'),
    268268                        $errorMessage = $('#wp-fullscreen-save .wp-fullscreen-error-message');
    269269
    270                 $spinner.show();
     270                $spinner.addClass( 'is-active' );
    271271                $errorMessage.hide();
    272272                $saveMessage.hide();
    273273                $hidden.val('wp-fullscreen-save-post');
     
    282282                        data: $('form#post').serialize(),
    283283                        dataType: 'json'
    284284                }).done( function( response ) {
    285                         $spinner.hide();
     285                        $spinner.removeClass( 'is-active' );
    286286
    287287                        if ( response && response.success ) {
    288288                                $saveMessage.show();
     
    298298                                $errorMessage.show();
    299299                        }
    300300                }).fail( function() {
    301                         $spinner.hide();
     301                        $spinner.removeClass( 'is-active' );
    302302                        $errorMessage.show();
    303303                });
    304304
  • src/wp-admin/options-general.php

    diff --git src/wp-admin/options-general.php src/wp-admin/options-general.php
    index 960c4f0..c1256df 100644
    function options_general_add_js() { 
    6060                });
    6161                $("input[name='date_format_custom'], input[name='time_format_custom']").change( function() {
    6262                        var format = $(this);
    63                         format.siblings('.spinner').css('display', 'inline-block'); // show(); can't be used here
     63                        format.siblings( '.spinner' ).addClass( 'is-active' );
    6464                        $.post(ajaxurl, {
    6565                                        action: 'date_format_custom' == format.attr('name') ? 'date_format' : 'time_format',
    6666                                        date : format.val()
    67                                 }, function(d) { format.siblings('.spinner').hide(); format.siblings('.example').text(d); } );
     67                                }, function(d) { format.siblings( '.spinner' ).removeClass( 'is-active' ); format.siblings('.example').text(d); } );
    6868                });
    6969
    7070                var languageSelect = $( '#WPLANG' );
  • src/wp-includes/js/wplink.js

    diff --git src/wp-includes/js/wplink.js src/wp-includes/js/wplink.js
    index 7aa0f70..14361a2 100644
    var wpLink; 
    405405                                        return;
    406406
    407407                                wpLink.lastSearch = search;
    408                                 waiting = t.parent().find('.spinner').show();
     408                                waiting = t.parent().find( '.spinner' ).addClass( 'is-active' );
    409409
    410410                                rivers.search.change( search );
    411411                                rivers.search.ajax( function() {
    412                                         waiting.hide();
     412                                        waiting.removeClass( 'is-active' );
    413413                                });
    414414                        } else {
    415415                                rivers.search.hide();
    var wpLink; 
    645645                                if ( ! self.query.ready() || newBottom < self.contentHeight.height() - wpLink.riverBottomThreshold )
    646646                                        return;
    647647
    648                                 self.waiting.show();
     648                                self.waiting.addClass( 'is-active' );
    649649                                el.scrollTop( newTop + self.waiting.outerHeight() );
    650650
    651651                                self.ajax( function() {
    652                                         self.waiting.hide();
     652                                        self.waiting.removeClass( 'is-active' );
    653653                                });
    654654                        }, wpLink.timeToTriggerRiver );
    655655                }