Ticket #31608: 31608.6.diff
| File 31608.6.diff, 14.3 KB (added by , 11 years ago) |
|---|
-
src/wp-admin/css/forms.css
864 864 margin: 25px; 865 865 } 866 866 867 .request-filesystem-credentials- dialog-contentinput[type="text"],868 .request-filesystem-credentials- dialog-contentinput[type="password"] {869 width: 85%;867 .request-filesystem-credentials-form input[type="text"], 868 .request-filesystem-credentials-form input[type="password"] { 869 display: block; 870 870 } 871 871 872 .request-filesystem-credentials-dialog input[type="text"], 873 .request-filesystem-credentials-dialog input[type="password"] { 874 width: 100%; 875 } 876 877 .request-filesystem-credentials-form .field-title { 878 font-weight: 600; 879 } 880 881 .request-filesystem-credentials-dialog label[for="hostname"], 882 .request-filesystem-credentials-dialog label[for="public_key"], 883 .request-filesystem-credentials-dialog label[for="private_key"] { 884 display: block; 885 margin-bottom: 1em; 886 } 887 888 .request-filesystem-credentials-dialog .ftp-username, 889 .request-filesystem-credentials-dialog .ftp-password { 890 float: left; 891 width: 48%; 892 } 893 894 .request-filesystem-credentials-dialog .ftp-password { 895 margin-left: 4%; 896 } 897 898 .request-filesystem-credentials-dialog .request-filesystem-credentials-action-buttons { 899 text-align: right; 900 } 901 902 .request-filesystem-credentials-dialog label[for="ftp"] { 903 margin-right: 10px; 904 } 905 906 #request-filesystem-credentials-dialog .button:not(:last-child) { 907 margin-right: 10px; 908 } 909 910 #request-filesystem-credentials-form .cancel-button { 911 display: none; 912 } 913 914 #request-filesystem-credentials-dialog .cancel-button { 915 display: inline; 916 } 917 918 872 919 /* =Media Queries 873 920 -------------------------------------------------------------- */ 874 921 … … 1098 1145 max-width: 400px; 1099 1146 width: auto; 1100 1147 } 1148 1101 1149 } 1102 1150 1151 @media only screen and (max-height: 480px) { 1152 /* Request Credentials */ 1153 .request-filesystem-credentials-dialog .notification-dialog{ 1154 width: 100%; 1155 height: 100%; 1156 position: fixed; 1157 top: 0; 1158 margin: 0; 1159 left: 0; 1160 overflow-y: auto; 1161 } 1162 } 1163 1103 1164 /* Smartphone */ 1104 1165 @media screen and (max-width: 600px) { 1105 1166 /* Color Picker Options */ -
src/wp-admin/includes/file.php
1111 1111 --> 1112 1112 </script> 1113 1113 <form action="<?php echo esc_url( $form_post ) ?>" method="post"> 1114 <div >1115 <h3 ><?php _e('Connection Information') ?></h3>1116 <p ><?php1114 <div id="request-filesystem-credentials-form" class="request-filesystem-credentials-form"> 1115 <h3 id="request-filesystem-credentials-title"><?php _e( 'Connection Information' ) ?></h3> 1116 <p id="request-filesystem-credentials-desc"><?php 1117 1117 $label_user = __('Username'); 1118 1118 $label_pass = __('Password'); 1119 1119 _e('To perform the requested action, WordPress needs to access your web server.'); … … 1132 1132 } 1133 1133 _e('If you do not remember your credentials, you should contact your web host.'); 1134 1134 ?></p> 1135 < table class="form-table">1136 <tr>1137 <th scope="row"><label for="hostname"><?php _e('Hostname') ?></label></th>1138 < td><input name="hostname" type="text" id="hostname" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php disabled( defined('FTP_HOST') ); ?> size="40" /></td>1139 < /tr>1140 1141 <tr>1142 <th scope="row"><label for="username"><?php echo $label_user; ?></label></th>1143 <td><input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php disabled( defined('FTP_USER') ); ?> size="40" /></td>1144 </ tr>1145 1146 <tr>1147 <th scope="row"><label for="password"><?php echo $label_pass; ?></label></th>1148 <td><div><input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> size="40" /></div>1149 <div><em><?php if ( ! defined('FTP_PASS') ) _e( 'This password will not be stored on the server.' ); ?></em></div></td>1150 </tr>1151 1135 <label for="hostname"> 1136 <span class="field-title"><?php _e( 'Hostname' ) ?></span> 1137 <input name="hostname" type="text" id="hostname" aria-describedby="request-filesystem-credentials-desc" class="code" placeholder="<?php esc_attr_e( __( 'example: www.mysite.com' ) ) ?>" value="<?php echo esc_attr($hostname); if ( !empty($port) ) echo ":$port"; ?>"<?php disabled( defined('FTP_HOST') ); ?> /> 1138 </label> 1139 <div class="ftp-username"> 1140 <label for="username"> 1141 <span class="field-title"><?php echo $label_user; ?></span> 1142 <input name="username" type="text" id="username" value="<?php echo esc_attr($username) ?>"<?php disabled( defined('FTP_USER') ); ?> /> 1143 </label> 1144 </div> 1145 <div class="ftp-password"> 1146 <label for="password"> 1147 <span class="field-title"><?php echo $label_pass; ?></span> 1148 <input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> /> 1149 <em><?php if ( ! defined('FTP_PASS') ) _e( 'This password will not be stored on the server.' ); ?></em> 1150 </label> 1151 </div> 1152 1152 <?php if ( isset($types['ssh']) ) : ?> 1153 < tr id="ssh_keys" style="<?php if ( 'ssh' != $connection_type ) echo 'display:none' ?>">1154 < th scope="row"><?php _e('Authentication Keys') ?>1155 <div class="key-labels textright">1156 <label for="public_key"><?php _e('Public Key:') ?></label ><br/>1157 < label for="private_key"><?php _e('Private Key:') ?></label>1158 < /div></th>1159 <td><br /><input name="public_key" type="text" id="public_key" value="<?php echo esc_attr($public_key) ?>"<?php disabled( defined('FTP_PUBKEY') ); ?> size="40" />1160 < br /><input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> size="40"/>1161 < div><?php _e('Enter the location on the server where the keys are located. If a passphrase is needed, enter that in the password field above.') ?></div></td>1162 < /tr>1153 <h4><?php _e('Authentication Keys') ?></h4> 1154 <label for="public_key"> 1155 <span class="field-title"><?php _e('Public Key:') ?></span> 1156 <input name="public_key" type="text" id="public_key" aria-describedby="auth-keys-desc" value="<?php echo esc_attr($public_key) ?>"<?php disabled( defined('FTP_PUBKEY') ); ?> /> 1157 </label> 1158 <label for="private_key"> 1159 <span class="field-title"><?php _e('Private Key:') ?></span> 1160 <input name="private_key" type="text" id="private_key" value="<?php echo esc_attr($private_key) ?>"<?php disabled( defined('FTP_PRIKEY') ); ?> /> 1161 </label> 1162 <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> 1163 1163 <?php endif; ?> 1164 1165 <tr> 1166 <th scope="row"><?php _e('Connection Type') ?></th> 1167 <td> 1164 <h4><?php _e('Connection Type') ?></h4> 1168 1165 <fieldset><legend class="screen-reader-text"><span><?php _e('Connection Type') ?></span></legend> 1169 1166 <?php 1170 1167 $disabled = disabled( (defined('FTP_SSL') && FTP_SSL) || (defined('FTP_SSH') && FTP_SSH), true, false ); … … 1175 1172 </label> 1176 1173 <?php endforeach; ?> 1177 1174 </fieldset> 1178 </td>1179 </tr>1180 </table>1181 1182 1175 <?php 1183 1176 foreach ( (array) $extra_fields as $field ) { 1184 1177 if ( isset( $_POST[ $field ] ) ) 1185 1178 echo '<input type="hidden" name="' . esc_attr( $field ) . '" value="' . esc_attr( wp_unslash( $_POST[ $field ] ) ) . '" />'; 1186 1179 } 1187 submit_button( __( 'Proceed' ), 'button', 'upgrade' );1188 1180 ?> 1181 <p class="request-filesystem-credentials-action-buttons"> 1182 <button class="button cancel-button" data-js-action="close" type="button"><?php _e( 'Cancel' ); ?></button> 1183 <?php submit_button( __( 'Proceed' ), 'button', 'upgrade', false ); ?> 1184 </p> 1189 1185 </div> 1190 1186 </form> 1191 1187 <?php … … 1209 1205 ?> 1210 1206 <div id="request-filesystem-credentials-dialog" class="notification-dialog-wrap request-filesystem-credentials-dialog"> 1211 1207 <div class="notification-dialog-background"></div> 1212 <div class="notification-dialog" >1208 <div class="notification-dialog" role="dialog" aria-labelledby="request-filesystem-credentials-title" tabindex="0"> 1213 1209 <div class="request-filesystem-credentials-dialog-content"> 1214 1210 <?php request_filesystem_credentials( site_url() ); ?> 1215 1211 <div> -
src/wp-admin/js/updates.js
79 79 wp.updates.updateQueue = []; 80 80 81 81 /** 82 * Store a jQuery reference to return focus to when exiting the request credentials modal. 83 * 84 * @since 4.2.0 85 * 86 * @var jQuery object 87 */ 88 wp.updates.$elToReturnFocusToFromCredentialsModal = null; 89 90 /** 82 91 * Decrement update counts throughout the various menus. 83 92 * 84 93 * @since 3.9.0 … … 144 153 } 145 154 146 155 $message.addClass( 'updating-message' ); 156 $message.data( 'originaltext', $message.html() ); 147 157 $message.text( wp.updates.l10n.updating ); 148 158 wp.a11y.speak( wp.updates.l10n.updatingMsg ); 149 159 … … 247 257 * @since 4.2.0 248 258 */ 249 259 wp.updates.showErrorInCredentialsForm = function( message ) { 250 var $ notificationDialog= $( '.notification-dialog' );260 var $modal = $( '.notification-dialog' ); 251 261 252 // Remove any existing error 253 $ notificationDialog.find( '.error' ).remove();262 // Remove any existing error. 263 $modal.find( '.error' ).remove(); 254 264 255 $ notificationDialog.find( 'h3' ).after( '<div class="error">' + message + '</div>' );265 $modal.find( 'h3' ).after( '<div class="error">' + message + '</div>' ); 256 266 }; 257 267 258 268 /** … … 302 312 303 313 304 314 /** 305 * Request the users filesystem credentials if we don't have them already 315 * Request the users filesystem credentials if we don't have them already. 306 316 * 307 317 * @since 4.2.0 308 318 */ 309 wp.updates.requestFilesystemCredentials = function( ) {319 wp.updates.requestFilesystemCredentials = function( event ) { 310 320 if ( wp.updates.updateDoneSuccessfully === false ) { 321 /* 322 * For the plugin install screen, return the focus to the install button 323 * after exiting the credentials request modal. 324 */ 325 if ( adminpage === 'plugin-install-php' ) { 326 wp.updates.$elToReturnFocusToFromCredentialsModal = $( event.target ); 327 } 328 311 329 wp.updates.updateLock = true; 312 $( 'body' ).addClass( 'modal-open' ); 313 $( '#request-filesystem-credentials-dialog' ).show();330 331 wp.updates.requestForCredentialsModalOpen(); 314 332 } 315 333 }; 316 334 335 /** 336 * Keydown handler for the request for credentials modal. 337 * 338 * Close the modal when the escape key is pressed. 339 * Constrain keyboard navigation to inside the modal. 340 * 341 * @since 4.2.0 342 */ 343 wp.updates.keydown = function( event ) { 344 if ( 27 === event.keyCode ) { 345 wp.updates.requestForCredentialsModalCancel(); 346 } else if ( 9 === event.keyCode ) { 347 // #upgrade button must always be the last focusable element in the dialog. 348 if ( event.target.id === 'upgrade' && ! event.shiftKey ) { 349 $( '#hostname' ).focus(); 350 event.preventDefault(); 351 } else if ( event.target.id === 'hostname' && event.shiftKey ) { 352 $( '#upgrade' ).focus(); 353 event.preventDefault(); 354 } 355 } 356 }; 357 358 /** 359 * Open the request for credentials modal. 360 * 361 * @since 4.2.0 362 */ 363 wp.updates.requestForCredentialsModalOpen = function() { 364 var $modal = $( '#request-filesystem-credentials-dialog' ); 365 $( 'body' ).addClass( 'modal-open' ); 366 $modal.show(); 367 368 $modal.find( '#hostname' ).focus(); 369 $modal.keydown( wp.updates.keydown ); 370 }; 371 372 /** 373 * Close the request for credentials modal. 374 * 375 * @since 4.2.0 376 */ 377 wp.updates.requestForCredentialsModalClose = function() { 378 $( '#request-filesystem-credentials-dialog' ).hide(); 379 $( 'body' ).removeClass( 'modal-open' ); 380 wp.updates.$elToReturnFocusToFromCredentialsModal.focus(); 381 }; 382 383 wp.updates.requestForCredentialsModalCancel = function() { 384 var slug = wp.updates.updateQueue[0].data.slug; 385 386 wp.updates.requestForCredentialsModalClose(); 387 if ( 'plugins' === pagenow || 'plugins-network' === pagenow ) { 388 $message = $( '[data-slug="' + slug + '"]' ).next().find( '.update-message' ); 389 } else if ( 'plugin-install' === pagenow ) { 390 $message = $( '.plugin-card-' + slug ).find( '.update-now' ); 391 } 392 $message.removeClass( 'updating-message' ); 393 $message.html( $message.data( 'originaltext' ) ); 394 wp.a11y.speak( wp.updates.l10n.updateCancel ); 395 } 396 317 397 $( document ).ready( function() { 318 398 /* 319 399 * Check whether a user needs to submit filesystem credentials based on whether … … 333 413 wp.updates.filesystemCredentials.ssh.publicKey = $('#public_key').val(); 334 414 wp.updates.filesystemCredentials.ssh.privateKey = $('#private_key').val(); 335 415 336 $( '#request-filesystem-credentials-dialog' ).hide(); 337 $( 'body' ).removeClass( 'modal-open' ); 416 wp.updates.requestForCredentialsModalClose(); 338 417 339 418 // Unlock and invoke the queue. 340 419 wp.updates.updateLock = false; … … 343 422 return false; 344 423 }); 345 424 425 // Close the request credentials modal when 426 $( '#request-filesystem-credentials-dialog [data-js-action="close"], .notification-dialog-background' ).on( 'click', function() { 427 wp.updates.requestForCredentialsModalCancel(); 428 }); 429 346 430 // Click handler for plugin updates in List Table view. 347 431 $( '.plugin-update-tr .update-link' ).on( 'click', function( e ) { 348 432 e.preventDefault(); 349 433 if ( wp.updates.shouldRequestFilesystemCredentials && ! wp.updates.updateLock ) { 350 wp.updates.requestFilesystemCredentials( );434 wp.updates.requestFilesystemCredentials( e ); 351 435 } 352 var $row = $( e.target ).parents( '.plugin-update-tr' ); 353 wp.updates.updatePlugin( $row.data( 'plugin' ), $row.data( 'slug' ) ); 436 var updateRow = $( e.target ).parents( '.plugin-update-tr' ); 437 // Return the user to the input box of the plugin's table row after closing the modal. 438 wp.updates.$elToReturnFocusToFromCredentialsModal = $( '#' + updateRow.data( 'slug' ) ).find( '.check-column input' ); 439 wp.updates.updatePlugin( updateRow.data( 'plugin' ), updateRow.data( 'slug' ) ); 354 440 } ); 355 441 356 442 $( '#bulk-action-form' ).on( 'submit', function( e ) { -
src/wp-includes/script-loader.php
533 533 'installingMsg' => __( 'Installing... please wait.' ), 534 534 'updatedMsg' => __( 'Update completed successfully.' ), 535 535 'installedMsg' => __( 'Installation completed successfully.' ), 536 'updateCancel' => __( 'Update canceled' ), 536 537 ) 537 538 ) ); 538 539