Ticket #38667: 38667.1.diff
File 38667.1.diff, 3.7 KB (added by , 8 years ago) |
---|
-
src/wp-admin/css/customize-controls.css
diff --git src/wp-admin/css/customize-controls.css src/wp-admin/css/customize-controls.css index 2841557..a057532 100644
p.customize-section-description { 1129 1129 margin-left: 10px; 1130 1130 margin-right: 10px; 1131 1131 } 1132 #customize-theme-controls #sub-accordion-section-custom_css textarea { 1133 tab-size: 4; 1134 } 1132 1135 1133 1136 #sub-accordion-section-custom_css .customize-control-notifications-container { 1134 1137 margin-bottom: 15px; -
src/wp-admin/js/customize-controls.js
diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js index 30e98ea..cb177c6 100644
5234 5234 }); 5235 5235 }); 5236 5236 5237 // Allow tabs to be entered in Custom CSS textarea. 5238 api.control( 'custom_css', function ( control ) { 5239 control.deferred.embedded.done( function allowTabs() { 5240 var $textarea = control.container.find( 'textarea' ), textarea = $textarea[0]; 5241 5242 $textarea.on( 'blur', function() { 5243 $textarea.data( 'next-tab-blurs', false ); 5244 } ); 5245 5246 $textarea.on( 'keydown', function onKeydown( event ) { 5247 var selectionStart, selectionEnd, value, scroll; 5248 5249 if ( 27 === event.keyCode ) { // Escape key. 5250 // When pressing Escape: Opera 12 and 27 blur form fields. 5251 event.preventDefault(); 5252 5253 if ( true !== $textarea.data( 'next-tab-blurs' ) ) { 5254 $textarea.data( 'next-tab-blurs', true ); 5255 event.stopPropagation(); // Prevent collapsing the section. 5256 } 5257 return; 5258 } 5259 5260 // Short-circuit if tab key is not being pressed or if a modifier key *is* being pressed. 5261 if ( 9 !== event.keyCode || event.ctrlKey || event.altKey || event.shiftKey ) { // Tab key. 5262 return; 5263 } 5264 5265 // Prevent capturing Tab characters if Esc was pressed. 5266 if ( $textarea.data( 'next-tab-blurs' ) ) { 5267 return; 5268 } 5269 5270 selectionStart = textarea.selectionStart; 5271 selectionEnd = textarea.selectionEnd; 5272 value = textarea.value; 5273 5274 if ( selectionStart >= 0 ) { 5275 scroll = $textarea.scrollTop; 5276 textarea.value = value.substring( 0, selectionStart ).concat( '\t', value.substring( selectionEnd ) ); 5277 $textarea.selectionStart = textarea.selectionEnd = selectionStart + 1; 5278 textarea.scrollTop = scroll; 5279 } 5280 5281 event.stopPropagation(); 5282 event.preventDefault(); 5283 } ); 5284 } ); 5285 } ); 5286 5237 5287 // Update the setting validities. 5238 5288 api.previewer.bind( 'selective-refresh-setting-validities', function handleSelectiveRefreshedSettingValidities( settingValidities ) { 5239 5289 api._handleSettingValidities( { -
src/wp-includes/class-wp-customize-manager.php
diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php index 3058138..1c00703 100644
final class WP_Customize_Manager { 3590 3590 'priority' => 200, 3591 3591 'description_hidden' => true, 3592 3592 'description' => sprintf( '%s<br /><a href="%s" class="external-link" target="_blank">%s<span class="screen-reader-text">%s</span></a>', 3593 __( 'CSS allows you to customize the appearance and layout of your site with code. Separate CSS is saved for each of your themes. ' ),3593 __( 'CSS allows you to customize the appearance and layout of your site with code. Separate CSS is saved for each of your themes. In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key. In some cases the Esc key will need to be pressed twice before the Tab key will allow you to continue.' ), 3594 3594 'https://codex.wordpress.org/Know_Your_Sources#CSS', 3595 3595 __( 'Learn more about CSS' ), 3596 3596 __( '(link opens in a new window)' )