Make WordPress Core

Ticket #43058: 43058-3.patch

File 43058-3.patch, 3.8 KB (added by Mahesh901122, 8 years ago)

Handle UI & Accessibility.

  • wp-admin/css/common-rtl.css

     
    30453045        box-sizing: border-box;
    30463046}
    30473047
     3048#plugin-files-search,
     3049#theme-files-search {
     3050        width: 100%;
     3051}
     3052
    30483053#templateside > h2 {
    30493054        padding-top: 6px;
    30503055        padding-bottom: 7px;
  • wp-admin/css/common.css

     
    30453045        box-sizing: border-box;
    30463046}
    30473047
     3048#plugin-files-search,
     3049#theme-files-search {
     3050        width: 100%;
     3051}
     3052
    30483053#templateside > h2 {
    30493054        padding-top: 6px;
    30503055        padding-bottom: 7px;
  • wp-admin/js/theme-plugin-editor.js

     
    7373                        }
    7474                        return undefined;
    7575                } );
     76
     77                var inputEvent;
     78
     79                /*
     80                 * Use feature detection to determine whether inputs should use
     81                 * the `keyup` or `input` event. Input is preferred but lacks support
     82                 * in legacy browsers. See changeset 34078, see also ticket #26600#comment:59
     83                 */
     84                if ( 'oninput' in document.createElement( 'input' ) ) {
     85                        inputEvent = 'input';
     86                } else {
     87                        inputEvent = 'keyup';
     88                }
     89
     90                $( document ).on( inputEvent, '#plugin-files-search, #theme-files-search', component._searchFile);
    7691        };
    7792
    7893        /**
     94         * Search file.
     95         *
     96         * @since 4.9.2
     97         * @returns {void}
     98         */
     99        component._searchFile = function() {
     100                var parent              = $('#templateside'),
     101                        directories     = parent.find('ul ul li'),
     102                        files           = parent.find('ul ul li a'),
     103                        search_term     = $(this).val();
     104
     105                if( search_term.length ) {
     106
     107                        // Expand all directories for search file.
     108                        // Hide Directories. Because, Below we show those directories
     109                        // which have search term in the file name.
     110                        directories.attr('aria-expanded', true).hide();
     111
     112                        // Search file and ONLY show these directories which "contain" the file name.
     113                        var rex = new RegExp( search_term, 'i');
     114                files.filter(function () {
     115                                var file_name = $.trim( $(this).text() ) || '';
     116                        return rex.test( file_name );
     117                }).parents('li').show();
     118
     119                } else {
     120       
     121                        // Collapse & show all directories.
     122                        directories.attr('aria-expanded', false).show();
     123                }
     124        };
     125
     126        /**
    79127         * Set up and display the warning modal.
    80128         *
    81129         * @since 4.9.0
  • wp-admin/plugin-editor.php

     
    239239
    240240<div id="templateside">
    241241        <h2 id="plugin-files-label"><?php _e( 'Plugin Files' ); ?></h2>
     242        <label for="plugin-files-search" class="screen-reader-text"><?php esc_html_e( 'Search file..' ); ?></label>
     243        <input id="plugin-files-search" name="plugin-files-search" type="search" placeholder="<?php esc_html_e( 'Search file..' ); ?>">
    242244
    243245        <?php
    244246        $plugin_editable_files = array();
  • wp-admin/theme-editor.php

     
    243243?>
    244244<div id="templateside">
    245245        <h2 id="theme-files-label"><?php _e( 'Theme Files' ); ?></h2>
     246        <label for="theme-files-search" class="screen-reader-text"><?php esc_html_e( 'Search file..' ); ?></label>
     247        <input id="theme-files-search" name="theme-files-search" type="search" placeholder="<?php esc_html_e( 'Search file..' ); ?>">
     248
    246249        <ul role="tree" aria-labelledby="theme-files-label">
    247250                <?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?>
    248251                        <li class="howto">