Changeset 37467
- Timestamp:
- 05/19/2016 10:58:55 PM (10 years ago)
- Location:
- trunk/src/wp-admin
- Files:
-
- 3 edited
-
css/forms.css (modified) (2 diffs)
-
includes/file.php (modified) (3 diffs)
-
js/updates.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/forms.css
r37458 r37467 971 971 972 972 .request-filesystem-credentials-dialog .notification-dialog { 973 top: 1 5%;973 top: 10%; 974 974 max-height: 85%; 975 975 } … … 1027 1027 .request-filesystem-credentials-dialog label[for="ftp"] { 1028 1028 margin-right: 10px; 1029 } 1030 1031 .request-filesystem-credentials-dialog #auth-keys-desc { 1032 margin-bottom: 0; 1029 1033 } 1030 1034 -
trunk/src/wp-admin/includes/file.php
r37421 r37467 1167 1167 1168 1168 ?> 1169 <script type="text/javascript">1170 <!--1171 jQuery(function($){1172 jQuery("#ssh").click(function () {1173 jQuery("#ssh_keys").show();1174 });1175 jQuery("#ftp, #ftps").click(function () {1176 jQuery("#ssh_keys").hide();1177 });1178 jQuery('#request-filesystem-credentials-form input[value=""]:first').focus();1179 });1180 -->1181 </script>1182 1169 <form action="<?php echo esc_url( $form_post ) ?>" method="post"> 1183 1170 <div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form"> … … 1226 1213 </label> 1227 1214 </div> 1228 <?php if ( isset($types['ssh']) ) : ?>1229 1215 <fieldset> 1216 <legend><?php _e( 'Connection Type' ); ?></legend> 1217 <?php 1218 $disabled = disabled( ( defined( 'FTP_SSL' ) && FTP_SSL ) || ( defined( 'FTP_SSH' ) && FTP_SSH ), true, false ); 1219 foreach ( $types as $name => $text ) : ?> 1220 <label for="<?php echo esc_attr( $name ) ?>"> 1221 <input type="radio" name="connection_type" id="<?php echo esc_attr( $name ) ?>" value="<?php echo esc_attr( $name ) ?>"<?php checked( $name, $connection_type ); echo $disabled; ?> /> 1222 <?php echo $text; ?> 1223 </label> 1224 <?php 1225 endforeach; 1226 ?> 1227 </fieldset> 1228 <?php 1229 if ( isset( $types['ssh'] ) ) { 1230 $hidden_class = ''; 1231 if ( 'ssh' != $connection_type || empty( $connection_type ) ) { 1232 $hidden_class = ' class="hidden"'; 1233 } 1234 ?> 1235 <fieldset id="ssh-keys"<?php echo $hidden_class; ?>"> 1230 1236 <legend><?php _e( 'Authentication Keys' ); ?></legend> 1231 1237 <label for="public_key"> … … 1237 1243 <input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> /> 1238 1244 </label> 1239 </fieldset> 1240 <span id="auth-keys-desc"><?php _e('Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.') ?></span> 1241 <?php endif; ?> 1242 <fieldset> 1243 <legend><?php _e( 'Connection Type' ); ?></legend> 1244 <?php 1245 $disabled = disabled( (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH), true, false ); 1246 foreach ( $types as $name => $text ) : ?> 1247 <label for="<?php echo esc_attr($name) ?>"> 1248 <input type="radio" name="connection_type" id="<?php echo esc_attr($name) ?>" value="<?php echo esc_attr($name) ?>"<?php checked($name, $connection_type); echo $disabled; ?> /> 1249 <?php echo $text ?> 1250 </label> 1251 <?php endforeach; ?> 1245 <p id="auth-keys-desc"><?php _e( 'Enter the location on the server where the public and private keys are located. If a passphrase is needed, enter that in the password field above.' ) ?></p> 1252 1246 </fieldset> 1253 1247 <?php 1248 } 1249 1254 1250 foreach ( (array) $extra_fields as $field ) { 1255 1251 if ( isset( $_POST[ $field ] ) ) -
trunk/src/wp-admin/js/updates.js
r36558 r37467 472 472 473 473 $( document ).ready( function() { 474 // Set initial focus on the first empty form field. 475 $( '#request-filesystem-credentials-form input[value=""]:first' ).focus(); 476 474 477 /* 475 478 * Check whether a user needs to submit filesystem credentials based on whether … … 504 507 }); 505 508 506 // Hide SSH fields when not selected 507 $( '#request-filesystem-credentials- dialoginput[name="connection_type"]' ).on( 'change', function() {508 $( this ).parents( 'form' ).find( '#private_key, #public_key' ).parents( 'label' ).toggle( ( 'ssh'== $( this ).val() ) );509 }) .change();509 // Hide SSH fields when not selected. 510 $( '#request-filesystem-credentials-form input[name="connection_type"]' ).on( 'change', function() { 511 $( '#ssh-keys' ).toggleClass( 'hidden', ( 'ssh' !== $( this ).val() ) ); 512 }); 510 513 511 514 // Click handler for plugin updates in List Table view.
Note: See TracChangeset
for help on using the changeset viewer.