Make WordPress Core

Ticket #37669: 37669.diff

File 37669.diff, 3.5 KB (added by fgiannar, 5 years ago)
  • src/js/_enqueues/wp/updates.js

    diff --git src/js/_enqueues/wp/updates.js src/js/_enqueues/wp/updates.js
    index d7e0de1c39..2537b2e681 100644
     
    953953                        $notice = $notice.addClass( 'updating-message' ).find( 'p' );
    954954                }
    955955
    956                 if ( $notice.html() !== wp.updates.l10n.updating ) {
    957                         $notice.data( 'originaltext', $notice.html() );
    958                 }
     956                // #37669
     957                // Shiny Updates: Cancelling the filesystem credentials when updating within the
     958                // pop-up prevents updating again (without closing/opening) and leaves UI artefacts
     959                $notice.each( function( index, n ) {
     960                        $n = $(n);
     961                        if ( $n.html() !== wp.updates.l10n.updating ) {
     962                                $n.data( 'originaltext', $n.html() );
     963                        }
     964                } );
    959965
    960966                wp.a11y.speak( wp.updates.l10n.updatingMsg, 'polite' );
    961967                $notice.text( wp.updates.l10n.updating );
     
    18001806                                $message = $updatingMessage;
    18011807                        }
    18021808
    1803                         if ( $message && $message.hasClass( 'updating-message' ) ) {
    1804                                 originalText = $message.data( 'originaltext' );
     1809                        // #37669
     1810                        // Shiny Updates: Cancelling the filesystem credentials when updating within the
     1811                        // pop-up prevents updating again (without closing/opening) and leaves UI artefacts
     1812                        $message.each( function( index, msg ) {
     1813                                $msg = $(msg);
     1814                                if ( $msg.hasClass( 'updating-message' ) ) {
     1815                                        originalText = $msg.data( 'originaltext' );
    18051816
    1806                                 if ( 'undefined' === typeof originalText ) {
    1807                                         originalText = $( '<p>' ).html( $message.find( 'p' ).data( 'originaltext' ) );
    1808                                 }
     1817                                        if ( 'undefined' === typeof originalText ) {
     1818                                                originalText = $( '<p>' ).html( $msg.find( 'p' ).data( 'originaltext' ) );
     1819                                        }
    18091820
    1810                                 $message
    1811                                         .removeClass( 'updating-message' )
    1812                                         .html( originalText );
    1813 
    1814                                 if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
    1815                                         if ( 'update-plugin' === job.action ) {
    1816                                                 $message.attr( 'aria-label', wp.updates.l10n.pluginUpdateNowLabel.replace( '%s', $message.data( 'name' ) ) );
    1817                                         } else if ( 'install-plugin' === job.action ) {
    1818                                                 $message.attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', $message.data( 'name' ) ) );
     1821                                        $msg
     1822                                                .removeClass( 'updating-message' )
     1823                                                .html( originalText );
     1824
     1825                                        if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) {
     1826                                                if ( 'update-plugin' === job.action ) {
     1827                                                        $msg.attr( 'aria-label', wp.updates.l10n.pluginUpdateNowLabel.replace( '%s', $msg.data( 'name' ) ) );
     1828                                                } else if ( 'install-plugin' === job.action ) {
     1829                                                        $msg.attr( 'aria-label', wp.updates.l10n.pluginInstallNowLabel.replace( '%s', $msg.data( 'name' ) ) );
     1830                                                }
    18191831                                        }
    18201832                                }
    1821                         }
     1833                        } );
     1834
     1835                        wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
    18221836
    18231837                        wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' );
    18241838                } );
  • src/wp-admin/themes.php

    diff --git src/wp-admin/themes.php src/wp-admin/themes.php
    index 244f573ce6..65e7ab58f4 100644
    if ( ! is_multisite() && current_user_can( 'edit_themes' ) && $broken_themes ) { 
    564564                                </p>
    565565
    566566                                <# if ( data.hasUpdate ) { #>
    567                                 <div class="notice notice-warning notice-alt notice-large">
    568                                         <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
    569                                         {{{ data.update }}}
     567                                <div data-slug="{{ data.id }}">
     568                                        <div class="update-message notice notice-warning notice-alt notice-large">
     569                                                <h3 class="notice-title"><?php _e( 'Update Available' ); ?></h3>
     570                                                {{{ data.update }}}
     571                                        </div>
    570572                                </div>
    571573                                <# } #>
    572574                                <p class="theme-description">{{{ data.description }}}</p>