X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7f1521bf193b382565eb753043c161f4cb3fcda7..refs/tags/wordpress-4.2.3:/wp-admin/js/updates.js diff --git a/wp-admin/js/updates.js b/wp-admin/js/updates.js index 6574a3cc..2ddfc85d 100644 --- a/wp-admin/js/updates.js +++ b/wp-admin/js/updates.js @@ -250,7 +250,7 @@ window.wp = window.wp || {}; wp.updates.updateError = function( response ) { var $message, name; wp.updates.updateDoneSuccessfully = false; - if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' ) { + if ( response.errorCode && response.errorCode == 'unable_to_connect_to_filesystem' && wp.updates.shouldRequestFilesystemCredentials ) { wp.updates.credentialError( response, 'update-plugin' ); return; } @@ -263,10 +263,18 @@ window.wp = window.wp || {}; $message.attr( 'aria-label', wp.updates.l10n.updateFailedLabel.replace( '%s', name ) ); } $message.removeClass( 'updating-message' ); - $message.text( wp.updates.l10n.updateFailed ); + $message.html( wp.updates.l10n.updateFailed + ': ' + response.error ); wp.a11y.speak( wp.updates.l10n.updateFailed ); + /* + * The lock can be released since this failure was + * after the credentials form. + */ + wp.updates.updateLock = false; + $(document).trigger( 'wp-plugin-update-error', response ); + + wp.updates.queueChecker(); }; /** @@ -467,6 +475,11 @@ window.wp = window.wp || {}; wp.updates.requestForCredentialsModalCancel(); }); + // Hide SSH fields when not selected + $( '#request-filesystem-credentials-dialog input[name="connection_type"]' ).on( 'change', function() { + $( this ).parents( 'form' ).find( '#private_key, #public_key' ).parents( 'label' ).toggle( ( 'ssh' == $( this ).val() ) ); + }).change(); + // Click handler for plugin updates in List Table view. $( '.plugin-update-tr' ).on( 'click', '.update-link', function( e ) { e.preventDefault(); @@ -490,7 +503,6 @@ window.wp = window.wp || {}; wp.updates.updatePlugin( $button.data( 'plugin' ), $button.data( 'slug' ) ); } ); - // $( '#plugin_update_from_iframe' ).on( 'click' , function( e ) { var target, data;