WordPress.org

Make WordPress Core

Ticket #21347: 21347.patch

File 21347.patch, 4.1 KB (added by azaozz, 6 years ago)
  • wp-admin/js/common.dev.js

     
    321321
    322322        // tab in textareas
    323323        $('#newcontent').bind('keydown.wpevent_InsertTab', function(e) {
    324                 if ( e.keyCode != 9 )
    325                         return true;
     324                var el = e.target, selStart, selEnd, val, scroll, sel;;
    326325
    327                 var el = e.target, selStart = el.selectionStart, selEnd = el.selectionEnd, val = el.value, scroll, sel;
     326                if ( e.keyCode == 27 ) { // escape key
     327                        $(el).data('tab-out', true);
     328                        return;
     329                }
    328330
     331                if ( e.keyCode != 9 || e.ctrlKey || e.altKey || e.shiftKey ) // tab key
     332                        return;
     333
     334                if ( $(el).data('tab-out') ) {
     335                        $(el).data('tab-out', false);
     336                        return;
     337                }
     338
     339                selStart = el.selectionStart;
     340                selEnd = el.selectionEnd;
     341                val = el.value;
     342
    329343                try {
    330344                        this.lastKey = 9; // not a standard DOM property, lastKey is to help stop Opera tab event. See blur handler below.
    331345                } catch(err) {}
  • wp-admin/plugin-editor.php

     
    226226</div>
    227227<form name="template" id="template" action="plugin-editor.php" method="post">
    228228        <?php wp_nonce_field('edit-plugin_' . $file) ?>
    229                 <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
     229                <div><textarea cols="70" rows="25" name="newcontent" id="newcontent" aria-describedby="newcontent-description" tabindex="1"><?php echo $content ?></textarea>
     230                <span id="newcontent-description" class="screen-reader-text"><?php _e('Content of the edited file. The Tab key enters a tab character, to move below this area, press the Esc key followed by the Tab key. Shift + Tab works as expected.'); ?></span>
    230231                <input type="hidden" name="action" value="update" />
    231232                <input type="hidden" name="file" value="<?php echo esc_attr($file) ?>" />
    232233                <input type="hidden" name="plugin" value="<?php echo esc_attr($plugin) ?>" />
     
    256257<br class="clear" />
    257258</div>
    258259<script type="text/javascript">
    259 /* <![CDATA[ */
    260260jQuery(document).ready(function($){
    261261        $('#template').submit(function(){ $('#scrollto').val( $('#newcontent').scrollTop() ); });
    262262        $('#newcontent').scrollTop( $('#scrollto').val() );
    263263});
    264 /* ]]> */
    265264</script>
    266265<?php
    267266        break;
  • wp-admin/theme-editor.php

     
    198198else : ?>
    199199        <form name="template" id="template" action="theme-editor.php" method="post">
    200200        <?php wp_nonce_field( 'edit-theme_' . $file . $stylesheet ); ?>
    201                  <div><textarea cols="70" rows="30" name="newcontent" id="newcontent" tabindex="1"><?php echo $content ?></textarea>
    202                  <input type="hidden" name="action" value="update" />
    203                  <input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" />
    204                  <input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" />
    205                  <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
    206                  </div>
     201                <div><textarea cols="70" rows="30" name="newcontent" id="newcontent" aria-describedby="newcontent-description" tabindex="1"><?php echo $content ?></textarea>
     202                <span id="newcontent-description" class="screen-reader-text"><?php _e('Content of the edited file. The Tab key enters a tab character, to move below this area, press the Esc key followed by the Tab key. Shift + Tab works as expected.'); ?></span>
     203                <input type="hidden" name="action" value="update" />
     204                <input type="hidden" name="file" value="<?php echo esc_attr( $relative_file ); ?>" />
     205                <input type="hidden" name="theme" value="<?php echo esc_attr( $theme->get_stylesheet() ); ?>" />
     206                <input type="hidden" name="scrollto" id="scrollto" value="<?php echo $scrollto; ?>" />
     207                </div>
    207208        <?php if ( ! empty( $functions ) ) : ?>
    208209                <div id="documentation" class="hide-if-no-js">
    209210                <label for="docs-list"><?php _e('Documentation:') ?></label>