Changeset 31982
- Timestamp:
- 04/02/2015 05:30:13 AM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-plugin-install-list-table.php
r31862 r31982 403 403 if ( $status['url'] ) { 404 404 /* translators: 1: Plugin name and version. */ 405 $action_links[] = '<a class="install-now button" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '" >' . __( 'Install Now' ) . '</a>';405 $action_links[] = '<a class="install-now button" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Install %s now' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Install Now' ) . '</a>'; 406 406 } 407 407 … … 410 410 if ( $status['url'] ) { 411 411 /* translators: 1: Plugin name and version */ 412 $action_links[] = '<a class="update-now button" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '" >' . __( 'Update Now' ) . '</a>';412 $action_links[] = '<a class="update-now button" data-plugin="' . esc_attr( $status['file'] ) . '" data-slug="' . esc_attr( $plugin['slug'] ) . '" href="' . esc_url( $status['url'] ) . '" aria-label="' . esc_attr( sprintf( __( 'Update %s now' ), $name ) ) . '" data-name="' . esc_attr( $name ) . '">' . __( 'Update Now' ) . '</a>'; 413 413 } 414 414 -
trunk/src/wp-admin/js/updates.js
r31969 r31982 34 34 * Filesystem credentials to be packaged along with the request. 35 35 * 36 * @since 36 * @since 4.2.0 37 37 * 38 38 * @var object … … 97 97 wp.updates.decrementCount = function( upgradeType ) { 98 98 var count, 99 100 101 102 99 pluginCount, 100 $adminBarUpdateCount = $( '#wp-admin-bar-updates .ab-label' ), 101 $dashboardNavMenuUpdateCount = $( 'a[href="update-core.php"] .update-plugins' ), 102 $pluginsMenuItem = $( '#menu-plugins' ); 103 103 104 104 … … 146 146 */ 147 147 wp.updates.updatePlugin = function( plugin, slug ) { 148 var $message ;148 var $message, name; 149 149 if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 150 150 $message = $( '[data-slug="' + slug + '"]' ).next().find( '.update-message' ); 151 151 } else if ( 'plugin-install' === pagenow ) { 152 152 $message = $( '.plugin-card-' + slug ).find( '.update-now' ); 153 name = $message.data( 'name' ); 154 $message.attr( 'aria-label', wp.updates.l10n.updatingLabel.replace( '%s', name ) ); 153 155 } 154 156 … … 199 201 */ 200 202 wp.updates.updateSuccess = function( response ) { 201 var $updateMessage ;203 var $updateMessage, name, $pluginRow, newText; 202 204 if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 203 var$pluginRow = $( '[data-slug="' + response.slug + '"]' ).first();205 $pluginRow = $( '[data-slug="' + response.slug + '"]' ).first(); 204 206 $updateMessage = $pluginRow.next().find( '.update-message' ); 205 207 $pluginRow.addClass( 'updated' ).removeClass( 'update' ); 206 208 207 209 // Update the version number in the row. 208 varnewText = $pluginRow.find('.plugin-version-author-uri').html().replace( response.oldVersion, response.newVersion );210 newText = $pluginRow.find('.plugin-version-author-uri').html().replace( response.oldVersion, response.newVersion ); 209 211 $pluginRow.find('.plugin-version-author-uri').html( newText ); 210 212 … … 214 216 $updateMessage = $( '.plugin-card-' + response.slug ).find( '.update-now' ); 215 217 $updateMessage.addClass( 'button-disabled' ); 218 name = $updateMessage.data( 'name' ); 219 $updateMessage.attr( 'aria-label', wp.updates.l10n.updatedLabel.replace( '%s', name ) ); 216 220 } 217 221 … … 241 245 */ 242 246 wp.updates.updateError = function( response ) { 243 var $message ;247 var $message, name; 244 248 wp.updates.updateDoneSuccessfully = false; 245 249 if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' ) { … … 251 255 } else if ( 'plugin-install' === pagenow ) { 252 256 $message = $( '.plugin-card-' + response.slug ).find( '.update-now' ); 257 258 name = $message.data( 'name' ); 259 $message.attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', name ) ); 253 260 } 254 261 $message.removeClass( 'updating-message' ); -
trunk/src/wp-includes/script-loader.php
r31973 r31982 526 526 'ajax_nonce' => wp_create_nonce( 'updates' ), 527 527 'l10n' => array( 528 'updating' => __( 'Updating...' ), 529 'updated' => __( 'Updated!' ), 530 'updateFailed' => __( 'Update failed.' ), 531 'updatingMsg' => __( 'Updating... please wait.' ), 532 'updatedMsg' => __( 'Update completed successfully.' ), 533 'updateCancel' => __( 'Update canceled' ), 528 'updating' => __( 'Updating...' ), 529 'updated' => __( 'Updated!' ), 530 'updateFailed' => __( 'Update Failed' ), 531 /* translators: Plugin Name */ 532 'updatingLabel' => __( 'Updating %s...' ), 533 /* translators: Plugin Name */ 534 'updatedLabel' => __( '%s updated!' ), 535 /* translators: Plugin Name */ 536 'updateFailedLabel' => __( '%s update failed' ), 537 'updatingMsg' => __( 'Updating... please wait.' ), 538 'updatedMsg' => __( 'Update completed successfully.' ), 539 'updateCancel' => __( 'Update canceled.' ), 534 540 ) 535 541 ) );
Note: See TracChangeset
for help on using the changeset viewer.