Make WordPress Core

Ticket #61331: r58081-revert.diff

File r58081-revert.diff, 4.8 KB (added by hellofromTonya, 13 months ago)

Clean revert diff of r58081

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

     
    11051105         *
    11061106         * @since 6.5.0
    11071107         *
    1108          * @param {Object} response            Response from the server.
    1109          * @param {string} response.slug       Slug of the activated plugin.
    1110          * @param {string} response.pluginName Name of the activated plugin.
    1111          * @param {string} response.plugin     The plugin file, relative to the plugins directory.
     1108         * @param {Object} response             Response from the server.
     1109         * @param {string} response.slug        Slug of the activated plugin.
     1110         * @param {string} response.pluginName  Name of the activated plugin.
     1111         * @param {string} response.plugin      The plugin file, relative to the plugins directory.
    11121112         */
    11131113        wp.updates.activatePluginSuccess = function( response ) {
    11141114                var $message = $( '.plugin-card-' + response.slug + ', #plugin-information-footer' ).find( '.activating-message' ),
    1115                         isInModal = 'plugin-information-footer' === $message.parent().attr( 'id' ),
    11161115                        buttonText = _x( 'Activated!', 'plugin' ),
    11171116                        ariaLabel = sprintf(
    11181117                                /* translators: %s: The plugin name. */
    11191118                                '%s activated successfully.',
    11201119                                response.pluginName
    1121                         ),
    1122                         noticeData = {
    1123                                 id: 'plugin-activated-successfully',
    1124                                 className: 'notice-success',
    1125                                 message: sprintf(
    1126                                         /* translators: %s: The refresh link's attributes. */
    1127                                         __( 'Plugin activated. Some changes may not occur until you refresh the page. <a %s>Refresh Now</a>' ),
    1128                                         'href="#" class="button button-secondary refresh-page"'
    1129                                 ),
    1130                                 slug: response.slug
    1131                         },
    1132                         noticeTarget;
     1120                        );
    11331121
    1134                 wp.a11y.speak( __( 'Activation completed successfully. Some changes may not occur until you refresh the page.' ) );
     1122                wp.a11y.speak( __( 'Activation completed successfully.' ) );
    11351123                $document.trigger( 'wp-plugin-activate-success', response );
    11361124
    11371125                $message
     
    11401128                        .attr( 'aria-label', ariaLabel )
    11411129                        .text( buttonText );
    11421130
    1143                 if ( isInModal ) {
     1131                if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
    11441132                        wp.updates.setCardButtonStatus(
    11451133                                {
    11461134                                        status: 'activated-plugin',
     
    11511139                                        ariaLabel: ariaLabel
    11521140                                }
    11531141                        );
    1154 
    1155                         // Add a notice to the modal's footer.
    1156                         $message.replaceWith( wp.updates.adminNotice( noticeData ) );
    1157 
    1158                         // Send notice information back to the parent screen.
    1159                         noticeTarget = window.parent === window ? null : window.parent;
    1160                         $.support.postMessage = !! window.postMessage;
    1161                         if ( false !== $.support.postMessage && null !== noticeTarget && -1 === window.parent.location.pathname.indexOf( 'index.php' ) ) {
    1162                                 noticeTarget.postMessage(
    1163                                         JSON.stringify( noticeData ),
    1164                                         window.location.origin
    1165                                 );
    1166                         }
    1167                 } else {
    1168                         // Add a notice to the top of the screen.
    1169                         wp.updates.addAdminNotice( noticeData );
    11701142                }
    11711143
    11721144                setTimeout( function() {
    1173                         if ( isInModal ) {
     1145                        $message.removeClass( 'activated-message' )
     1146                        .text( _x( 'Active', 'plugin' ) );
     1147
     1148                        if ( 'plugin-information-footer' === $message.parent().attr( 'id' ) ) {
    11741149                                wp.updates.setCardButtonStatus(
    11751150                                        {
    11761151                                                status: 'plugin-active',
     
    11841159                                                )
    11851160                                        }
    11861161                                );
    1187                         } else {
    1188                                 $message.removeClass( 'activated-message' ).text( _x( 'Active', 'plugin' ) );
    11891162                        }
    11901163                }, 1000 );
    11911164        };
     
    32563229                                return;
    32573230                        }
    32583231
    3259                         if ( 'undefined' !== typeof message.id && 'plugin-activated-successfully' === message.id ) {
    3260                                 wp.updates.addAdminNotice( message );
    3261                                 return;
    3262                         }
    3263 
    32643232                        if (
    32653233                                'undefined' !== typeof message.status &&
    32663234                                'undefined' !== typeof message.slug &&
     
    34933461                                } );
    34943462                        }
    34953463                );
    3496 
    3497                 /**
    3498                  * Click handler for page refresh link.
    3499                  *
    3500                  * @since 6.5.3
    3501                  *
    3502                  * @param {Event} event Event interface.
    3503                  */
    3504                 $document.on( 'click', '.refresh-page', function( event ) {
    3505                         event.preventDefault();
    3506 
    3507                         if ( window.parent === window ) {
    3508                                 window.location.reload();
    3509                         } else {
    3510                                 window.parent.location.reload();
    3511                         }
    3512                 } );
    35133464        } );
    35143465})( jQuery, window.wp, window._wpUpdatesSettings );
  • src/wp-admin/css/common.css

     
    15191519    margin-top: -5px;
    15201520}
    15211521
    1522 #plugin-information-footer #plugin-activated-successfully {
    1523         margin-bottom: 0;
    1524 }
    1525 
    1526 #plugin-information-footer #plugin-activated-successfully p {
    1527         display: flex;
    1528         gap: 1em;
    1529         align-items: center;
    1530         justify-content: space-between;
    1531         margin: 0;
    1532 }
    1533 
    1534 #plugin-information-footer #plugin-activated-successfully .refresh-page {
    1535         flex-grow: 0;
    1536         line-height: 2.15384615;
    1537         min-height: 0;
    1538         margin-bottom: 0;
    1539 }
    1540 
    15411522.update-message p:before,
    15421523.updating-message p:before,
    15431524.updated-message p:before,