]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/js/updates.js
WordPress 4.2.3
[autoinstalls/wordpress.git] / wp-admin / js / updates.js
index 6574a3cc846aba157f10d9981939a880b8cc2359..2ddfc85dabe7c96c38243e499f97ce2d60a314b1 100644 (file)
@@ -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;