Ticket #43058: 43058.4.patch
File 43058.4.patch, 3.4 KB (added by , 6 years ago) |
---|
-
src/wp-admin/css/common.css
3053 3053 box-sizing: border-box; 3054 3054 } 3055 3055 3056 #plugin-files-search, 3057 #theme-files-search { 3058 width: 100%; 3059 } 3060 3056 3061 #templateside > h2 { 3057 3062 padding-top: 6px; 3058 3063 padding-bottom: 7px; -
src/wp-admin/js/theme-plugin-editor.js
73 73 } 74 74 return undefined; 75 75 } ); 76 77 /* 78 * Use feature detection to determine whether inputs should use 79 * the `keyup` or `input` event. Input is preferred but lacks support 80 * in legacy browsers. See changeset 34078, see also ticket #26600#comment:59 81 */ 82 83 var inputEvent; 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 ); 76 91 }; 77 92 78 93 /** 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 // Collapse & show all directories. 121 directories.attr( 'aria-expanded', false ).show(); 122 } 123 }; 124 125 /** 79 126 * Set up and display the warning modal. 80 127 * 81 128 * @since 4.9.0 -
src/wp-admin/plugin-editor.php
239 239 240 240 <div id="templateside"> 241 241 <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..' ); ?>"> 242 244 243 245 <?php 244 246 $plugin_editable_files = array(); -
src/wp-admin/theme-editor.php
243 243 ?> 244 244 <div id="templateside"> 245 245 <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 246 249 <ul role="tree" aria-labelledby="theme-files-label"> 247 250 <?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?> 248 251 <li class="howto">