diff --git a/src/wp-admin/css/forms.css b/src/wp-admin/css/forms.css index 5a3aa78508..3616af66ff 100644 --- a/src/wp-admin/css/forms.css +++ b/src/wp-admin/css/forms.css @@ -970,7 +970,7 @@ table.form-table td .updated p { } .request-filesystem-credentials-dialog .notification-dialog { - top: 15%; + top: 10%; max-height: 85%; } @@ -1028,6 +1028,10 @@ table.form-table td .updated p { margin-right: 10px; } +.request-filesystem-credentials-dialog #auth-keys-desc { + margin-bottom: 0; +} + #request-filesystem-credentials-dialog .button:not(:last-child) { margin-right: 10px; } diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 5abb4cfba5..9f47b013f3 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -1166,19 +1166,6 @@ function request_filesystem_credentials( $form_post, $type = '', $error = false, $types = apply_filters( 'fs_ftp_connection_types', $types, $credentials, $type, $error, $context ); ?> -
" . __( 'Connectio
-
+ + $text ) : ?> + + +
+ +
"> -
- - -
- - $text ) : ?> - - +

'; diff --git a/src/wp-admin/js/updates.js b/src/wp-admin/js/updates.js index 35ae6c7d9b..0173b6ef2f 100644 --- a/src/wp-admin/js/updates.js +++ b/src/wp-admin/js/updates.js @@ -471,6 +471,9 @@ window.wp = window.wp || {}; $( document ).ready( function() { + // Set initial focus on the first empty form field. + $( '#request-filesystem-credentials-form input[value=""]:first' ).focus(); + /* * Check whether a user needs to submit filesystem credentials based on whether * the form was output on the page server-side. @@ -503,10 +506,10 @@ 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(); + // Hide SSH fields when not selected. + $( '#request-filesystem-credentials-form input[name="connection_type"]' ).on( 'change', function() { + $( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) ); + }); // Click handler for plugin updates in List Table view. $( '.plugin-update-tr' ).on( 'click', '.update-link', function( e ) {