Make WordPress Core

Ticket #51476: 51476-update-single-bulk.patch

File 51476-update-single-bulk.patch, 3.2 KB (added by ravipatel, 4 years ago)

Added New code for a single & bulk action : Update

  • src/js/_enqueues/wp/updates.js

     
    440440         */
    441441        wp.updates.updatePlugin = function( args ) {
    442442                var $updateRow, $card, $message, message;
    443 
     443                var $adminBarUpdates  = $( '#wp-admin-bar-updates' );
     444               
    444445                args = _.extend( {
    445446                        success: wp.updates.updatePluginSuccess,
    446447                        error: wp.updates.updatePluginError
     
    447448                }, args );
    448449
    449450                if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
    450                         $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
     451                        $updateRow = $( 'tr[data-plugin="' + args.plugin + '"]' );
    451452                        $message   = $updateRow.find( '.update-message' ).removeClass( 'notice-error' ).addClass( 'updating-message notice-warning' ).find( 'p' );
    452453                        message    = sprintf(
    453454                                /* translators: %s: Plugin name and version. */
     
    471472                        $message.data( 'originaltext', $message.html() );
    472473                }
    473474
     475                $adminBarUpdates.addClass( 'updating-message' );
     476               
    474477                $message
    475478                        .attr( 'aria-label', message )
    476479                        .text( __( 'Updating...' ) );
     
    496499         */
    497500        wp.updates.updatePluginSuccess = function( response ) {
    498501                var $pluginRow, $updateMessage, newText;
    499 
     502                var $adminBarUpdates  = $( '#wp-admin-bar-updates' );
     503               
    500504                if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) {
    501505                        $pluginRow     = $( 'tr[data-plugin="' + response.plugin + '"]' )
    502506                                .removeClass( 'update' )
     
    509513                        newText = $pluginRow.find( '.plugin-version-author-uri' ).html().replace( response.oldVersion, response.newVersion );
    510514                        $pluginRow.find( '.plugin-version-author-uri' ).html( newText );
    511515
     516                        $adminBarUpdates.removeClass( 'updating-message' );
     517                       
    512518                        // Clear the "time to next auto-update" text.
    513519                        $pluginRow.find( '.auto-update-time' ).empty();
    514520                } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
     
    550556         */
    551557        wp.updates.updatePluginError = function( response ) {
    552558                var $card, $message, errorMessage;
     559                var $adminBarUpdates  = $( '#wp-admin-bar-updates' );
    553560
    554561                if ( ! wp.updates.isValidResponse( response, 'update' ) ) {
    555562                        return;
     
    572579                                $message = $( 'tr[data-slug="' + response.slug + '"]' ).find( '.update-message' );
    573580                        }
    574581                        $message.removeClass( 'updating-message notice-warning' ).addClass( 'notice-error' ).find( 'p' ).html( errorMessage );
    575 
     582                        $adminBarUpdates.removeClass( 'updating-message' );
     583                       
    576584                        if ( response.pluginName ) {
    577585                                $message.find( 'p' )
    578586                                        .attr(
  • src/wp-includes/css/admin-bar.css

     
    588588        top: 2px;
    589589}
    590590
     591#wpadminbar #wp-admin-bar-updates.updating-message .ab-icon:before {
     592        display: inline-block;
     593        animation: rotation 2s infinite linear;
     594}
     595
    591596/**
    592597 * Search
    593598 */