Ticket #37603: 37603.4.diff
File 37603.4.diff, 3.1 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/updates.js
713 713 * decorated with an abort() method. 714 714 */ 715 715 wp.updates.deletePlugin = function( args ) { 716 var $ message = $( '[data-plugin="' + args.plugin + '"]' ).find( '.update-message p' );716 var $link = $( '[data-plugin="' + args.plugin + '"]' ).find( '.row-actions a.delete' ); 717 717 718 718 args = _.extend( { 719 719 success: wp.updates.deletePluginSuccess, 720 720 error: wp.updates.deletePluginError 721 721 }, args ); 722 722 723 if ( $message.html() !== wp.updates.l10n.updating ) { 724 $message.data( 'originaltext', $message.html() ); 723 if ( $link.html() !== wp.updates.l10n.deleting ) { 724 $link 725 .data( 'originaltext', $link.html() ) 726 .text( wp.updates.l10n.deleting ) 725 727 } 726 728 727 729 wp.a11y.speak( wp.updates.l10n.deleting, 'polite' ); … … 1165 1167 * decorated with an abort() method. 1166 1168 */ 1167 1169 wp.updates.deleteTheme = function( args ) { 1168 var $button = $( '.theme-actions .delete-theme' );1170 var $button; 1169 1171 1172 if ( 'themes' === pagenow ) { 1173 $button = $( '.theme-actions .delete-theme' ) 1174 } else if ( 'themes-network' === pagenow ) { 1175 $button = $( '[data-slug="' + args.slug + '"]' ).find( '.row-actions a.delete' ); 1176 } 1177 1170 1178 args = _.extend( { 1171 1179 success: wp.updates.deleteThemeSuccess, 1172 1180 error: wp.updates.deleteThemeError 1173 1181 }, args ); 1174 1182 1175 1183 if ( $button.html() !== wp.updates.l10n.deleting ) { 1176 $button.data( 'originaltext', $button.html() ); 1184 $button 1185 .data( 'originaltext', $button.html() ) 1186 .text( wp.updates.l10n.deleting ); 1177 1187 } 1178 1188 1179 $button.text( wp.updates.l10n.deleting );1180 1189 wp.a11y.speak( wp.updates.l10n.deleting, 'polite' ); 1181 1190 1182 1191 // Remove previous error messages, if any. … … 1707 1716 if ( 'import' === pagenow ) { 1708 1717 $updatingMessage.removeClass( 'updating-message' ); 1709 1718 } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 1710 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1719 if ( 'update-plugin' === job.action ) { 1720 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1721 } else if ( 'delete-plugin' === job.action ) { 1722 $message = $( '[data-plugin="' + job.data.plugin + '"]' ).find( '.row-actions a.delete' ); 1723 } 1711 1724 } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 1712 1725 $message = $( '.update-now.updating-message' ); 1726 } else if ( 'themes' === pagenow || 'themes-network' === pagenow ) { 1727 if ( 'update-theme' === job.action ) { 1728 $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.update-message' ); 1729 } else if ( 'delete-theme' === job.action && 'themes-network' === pagenow ) { 1730 $message = $( '[data-slug="' + job.data.slug + '"]' ).find( '.row-actions a.delete' ); 1731 } else if ( 'delete-theme' === job.action && 'themes' === pagenow ) { 1732 $message = $( '.theme-actions .delete-theme' ); 1733 } 1713 1734 } else { 1714 1735 $message = $updatingMessage; 1715 1736 }