Ticket #43058: 43058.2.patch
| File 43058.2.patch, 2.2 KB (added by , 8 years ago) |
|---|
-
wp-admin/js/theme-plugin-editor.js
73 73 } 74 74 return undefined; 75 75 } ); 76 77 $( document ).on( 'keyup', '#plugin-files-search, #theme-files-search', component._searchFile ); 76 78 }; 77 79 78 80 /** 81 * Search file. 82 * 83 * @since 4.9.2 84 * @returns {void} 85 */ 86 component._searchFile = function() { 87 var parent = $( '#templateside' ); 88 var directories = parent.find( 'ul ul li' ); 89 var files = parent.find( 'ul ul li a' ); 90 91 // Expand all directories. 92 directories.attr( 'aria-expanded', true ); 93 94 // Hide Directories. Becuase, Below we show those directories 95 // which have search term in the file name. 96 directories.hide(); 97 98 // Search file and ONLY show these directories which "contain" the file name. 99 var rex = new RegExp( $( this ).val(), 'i' ); 100 files.filter( function() { 101 var file_name = $.trim( $( this ).text() ) || ''; 102 return rex.test( file_name ); 103 } ).parents( 'li' ).show(); 104 }; 105 106 /** 79 107 * Set up and display the warning modal. 80 108 * 81 109 * @since 4.9.0 -
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 <input id="plugin-files-search" type="text" placeholder="<?php _e( 'Search file..' ); ?>"> 242 243 243 244 <?php 244 245 $plugin_editable_files = array(); -
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 <input id="theme-files-search" type="text" placeholder="<?php _e( 'Search file..' ); ?>"> 246 247 <ul role="tree" aria-labelledby="theme-files-label"> 247 248 <?php if ( ( $has_templates || $theme->parent() ) && $theme->parent() ) : ?> 248 249 <li class="howto">