Ticket #40453: 40453.diff
File 40453.diff, 2.7 KB (added by , 7 years ago) |
---|
-
src/wp-admin/includes/class-bulk-upgrader-skin.php
43 43 /* translators: 1: Title of an update */ 44 44 $this->upgrader->strings['skin_update_failed'] = __('The update of %1$s failed.'); 45 45 /* translators: 1: Title of an update */ 46 $this->upgrader->strings['skin_update_successful'] = __( '%1$s updated successfully.' ) . ' <a onclick="%2$s" href="#" class="hide-if-no-js"><span>' . __( 'Show Details' ) . '</span><span class="hidden">' . __( 'Hide Details' ) . '</span></a>';46 $this->upgrader->strings['skin_update_successful'] = __( '%1$s updated successfully.' ); 47 47 $this->upgrader->strings['skin_upgrade_end'] = __('All updates have been completed.'); 48 48 } 49 49 … … 148 148 echo '<script type="text/javascript">jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').show();</script>'; 149 149 } 150 150 if ( $this->result && ! is_wp_error( $this->result ) ) { 151 if ( ! $this->error ) 152 echo '<div class="updated"><p>' . sprintf($this->upgrader->strings['skin_update_successful'], $title, 'jQuery(\'#progress-' . esc_js($this->upgrader->update_current) . '\').toggle();jQuery(\'span\', this).toggle(); return false;') . '</p></div>'; 151 if ( ! $this->error ) { 152 echo '<div class="updated" data-update-details="progress-' . esc_attr( $this->upgrader->update_current ) . '">' . 153 '<p>' . sprintf( $this->upgrader->strings['skin_update_successful'], $title ) . 154 ' <button type="button" class="hide-if-no-js button-link update-details-toggle" aria-expanded="false">' . 155 '<span>' . __( 'Show details.' ) . '</span>' . 156 '</button></p></div>'; 157 } 158 153 159 echo '<script type="text/javascript">jQuery(\'.waiting-' . esc_js($this->upgrader->update_current) . '\').hide();</script>'; 154 160 } 155 161 -
src/wp-admin/js/common.js
978 978 979 979 // Set initial focus on a specific element. 980 980 $( '.wp-initial-focus' ).focus(); 981 982 // Toggle update details on update-core.php. 983 $body.on( 'click', '.update-details-toggle', function() { 984 var $updateNotice = $( this ).closest( '.updated' ), 985 $progressDiv = $( '#' + $updateNotice.data( 'update-details' ) ); 986 987 if ( ! $progressDiv.hasClass( 'update-details-moved' ) ) { 988 $progressDiv.insertAfter( $updateNotice ).addClass( 'update-details-moved' ); 989 } 990 991 $progressDiv.toggle(); 992 $( this ).attr( 'aria-expanded', $progressDiv.is( ':visible' ) ) 993 }) 981 994 }); 982 995 983 996 // Fire a custom jQuery event at the end of window resize