Ticket #37563: 37563.7.diff
File 37563.7.diff, 5.1 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/updates.js
523 523 $message = $( '[data-slug="' + args.slug + '"]' ); 524 524 } 525 525 526 $message.text( wp.updates.l10n.installing ); 526 if ( $message.html() !== wp.updates.l10n.installing ) { 527 $message.data( 'originaltext', $message.html() ); 528 } 527 529 528 530 $message 529 531 .addClass( 'updating-message' ) 530 .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) ); 532 .attr( 'aria-label', wp.updates.l10n.pluginInstallingLabel.replace( '%s', $message.data( 'name' ) ) ) 533 .text( wp.updates.l10n.installing ); 531 534 532 535 wp.a11y.speak( wp.updates.l10n.installingMsg, 'polite' ); 533 536 … … 1505 1508 // Restore callbacks. 1506 1509 response = wp.updates._addCallbacks( response, action ); 1507 1510 1508 wp.updates.queue. push( {1511 wp.updates.queue.unshift( { 1509 1512 action: action, 1510 1513 1511 1514 /* … … 1703 1706 } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 1704 1707 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1705 1708 } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 1706 $message = $( '.updat e-now.updating-message' );1709 $message = $( '.updating-message' ); 1707 1710 } else { 1708 1711 $message = $updatingMessage; 1709 1712 } 1710 1713 1711 if ( $message ) {1714 if ( $message && $message.hasClass( 'updating-message' ) ) { 1712 1715 originalText = $message.data( 'originaltext' ); 1713 1716 1714 1717 if ( 'undefined' === typeof originalText ) { … … 1718 1721 $message 1719 1722 .removeClass( 'updating-message' ) 1720 1723 .html( originalText ); 1724 1725 if ( 'update-plugin' === job.action ) { 1726 $message.attr( 'aria-label', wp.updates.l10n.updateNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1727 } else if ( 'install-plugin' === job.action ) { 1728 $message.attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1729 } 1721 1730 } 1722 1731 1723 1732 wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); … … 1993 2002 1994 2003 // Find all the checkboxes which have been checked. 1995 2004 itemsSelected.each( function( index, element ) { 1996 var $checkbox 2005 var $checkbox = $( element ), 1997 2006 $itemRow = $checkbox.parents( 'tr' ); 1998 2007 1999 // Un-check the box.2000 $checkbox.prop( 'checked', false );2001 2002 2008 // Only add update-able items to the update queue. 2003 2009 if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) { 2010 2011 // Un-check the box. 2012 $checkbox.prop( 'checked', false ); 2004 2013 return; 2005 2014 } 2006 2015 … … 2016 2025 2017 2026 // Display bulk notification for updates of any kind. 2018 2027 $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) { 2019 var $bulkActionNotice, itemName; 2028 var $itemRow = $( '[data-slug="' + response.slug + '"]' ), 2029 $bulkActionNotice, itemName; 2020 2030 2021 2031 if ( 'wp-' + response.update + '-update-success' === event.type ) { 2022 2032 success++; 2023 2033 } else { 2024 itemName = response.pluginName ? response.pluginName : $ ( '[data-slug="' + response.slug + '"]' ).find( '.theme-title strong' ).text();2034 itemName = response.pluginName ? response.pluginName : $itemRow.find( '.theme-title strong' ).text(); 2025 2035 2026 2036 error++; 2027 2037 errorMessages.push( itemName + ': ' + response.errorMessage ); 2028 2038 } 2029 2039 2040 $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false ); 2041 2030 2042 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' ); 2031 2043 2032 2044 wp.updates.addAdminNotice( { -
src/wp-includes/script-loader.php
616 616 'updated' => __( 'Updated!' ), 617 617 'update' => __( 'Update' ), 618 618 'updateNow' => __( 'Update Now' ), 619 /* translators: %s: Plugin name and version */ 620 'updateNowLabel' => __( 'Update %s now' ), 619 621 'updateFailedShort' => __( 'Update Failed!' ), 620 622 /* translators: %s: Error string for a failed update */ 621 623 'updateFailed' => __( 'Update Failed: %s' ), -
tests/qunit/fixtures/updates.js
9 9 'updated': 'Updated!', 10 10 'update': 'Update', 11 11 'updateNow': 'Update Now', 12 'updateNowLabel': 'Update Now', 12 13 'updateFailedShort': 'Update Failed!', 13 14 'updateFailed': 'Update Failed: %s', 14 15 'updatingLabel': 'Updating %s...', … … 19 20 'updateCancel': 'Update canceled.', 20 21 'beforeunload': 'Updates may not complete if you navigate away from this page.', 21 22 'installNow': 'Install Now', 23 'installNowLabel': 'Update %s now', 22 24 'installing': 'Installing...', 23 25 'installed': 'Installed!', 24 26 'installFailedShort': 'Install Failed!',