Ticket #37563: 37563.10.diff
File 37563.10.diff, 5.6 KB (added by , 9 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 /* … … 1709 1712 } else if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 1710 1713 $message = $( 'tr[data-plugin="' + job.data.plugin + '"]' ).find( '.update-message' ); 1711 1714 } else if ( 'plugin-install' === pagenow || 'plugin-install-network' === pagenow ) { 1712 $message = $( '.updat e-now.updating-message' );1715 $message = $( '.updating-message' ); 1713 1716 } else { 1714 1717 $message = $updatingMessage; 1715 1718 } 1716 1719 1717 if ( $message ) {1720 if ( $message && $message.hasClass( 'updating-message' ) ) { 1718 1721 originalText = $message.data( 'originaltext' ); 1719 1722 1720 1723 if ( 'undefined' === typeof originalText ) { … … 1724 1727 $message 1725 1728 .removeClass( 'updating-message' ) 1726 1729 .html( originalText ); 1730 1731 if ( 'update-plugin' === job.action ) { 1732 $message.attr( 'aria-label', wp.updates.l10n.updateNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1733 } else if ( 'install-plugin' === job.action ) { 1734 $message.attr( 'aria-label', wp.updates.l10n.installNowLabel.replace( '%s', $message.data( 'name' ) ) ); 1735 } 1727 1736 } 1728 1737 1729 1738 wp.a11y.speak( wp.updates.l10n.updateCancel, 'polite' ); … … 1999 2008 2000 2009 // Find all the checkboxes which have been checked. 2001 2010 itemsSelected.each( function( index, element ) { 2002 var $checkbox 2011 var $checkbox = $( element ), 2003 2012 $itemRow = $checkbox.parents( 'tr' ); 2004 2013 2005 // Un-check the box.2006 $checkbox.prop( 'checked', false );2007 2008 2014 // Only add update-able items to the update queue. 2009 2015 if ( 'update-selected' === bulkAction && ( ! $itemRow.hasClass( 'update' ) || $itemRow.find( 'notice-error' ).length ) ) { 2016 2017 // Un-check the box. 2018 $checkbox.prop( 'checked', false ); 2010 2019 return; 2011 2020 } 2012 2021 … … 2022 2031 2023 2032 // Display bulk notification for updates of any kind. 2024 2033 $document.on( 'wp-plugin-update-success wp-plugin-update-error wp-theme-update-success wp-theme-update-error', function( event, response ) { 2025 var $bulkActionNotice, itemName; 2034 var $itemRow = $( '[data-slug="' + response.slug + '"]' ), 2035 $bulkActionNotice, itemName; 2026 2036 2027 2037 if ( 'wp-' + response.update + '-update-success' === event.type ) { 2028 2038 success++; 2029 2039 } else { 2030 itemName = response.pluginName ? response.pluginName : $ ( '[data-slug="' + response.slug + '"]' ).find( '.column-primary strong' ).text();2040 itemName = response.pluginName ? response.pluginName : $itemRow.find( '.column-primary strong' ).text(); 2031 2041 2032 2042 error++; 2033 2043 errorMessages.push( itemName + ': ' + response.errorMessage ); 2034 2044 } 2035 2045 2046 $itemRow.find( 'input[name="checked[]"]:checked' ).prop( 'checked', false ); 2047 2036 2048 wp.updates.adminNotice = wp.template( 'wp-bulk-updates-admin-notice' ); 2037 2049 2038 2050 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' ), … … 634 636 'beforeunload' => __( 'Updates may not complete if you navigate away from this page.' ), 635 637 'installNow' => __( 'Install Now' ), 636 638 /* translators: %s: Plugin name */ 637 'installNowLabel' => __( 'Install %s ' ),639 'installNowLabel' => __( 'Install %s now' ), 638 640 'installing' => __( 'Installing...' ), 639 641 'installed' => __( 'Installed!' ), 640 642 'installFailedShort' => __( 'Install Failed!' ), -
tests/qunit/fixtures/updates.js
9 9 'updated': 'Updated!', 10 10 'update': 'Update', 11 11 'updateNow': 'Update Now', 12 'updateNowLabel': 'Update %s 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': 'Install %s now', 22 24 'installing': 'Installing...', 23 25 'installed': 'Installed!', 24 26 'installFailedShort': 'Install Failed!',