Ticket #47146: 47146.2.diff
| File 47146.2.diff, 4.3 KB (added by , 6 years ago) |
|---|
-
src/js/media/models/attachments.js
293 293 this.reset( [], { silent: true } ); 294 294 this.observe( attachments ); 295 295 296 // Used for the search results. 297 this.trigger( 'attachments:received', this ); 296 298 return this; 297 299 }, 298 300 /** … … 332 334 if ( this === attachments.mirroring ) { 333 335 deferred.resolveWith( this ); 334 336 } 337 338 // Used for the search results. 339 attachments.trigger( 'attachments:received', this ); 335 340 }); 336 341 337 342 return deferred.promise(); -
src/js/media/views/attachments/browser.js
83 83 } 84 84 85 85 this.collection.on( 'add remove reset', this.updateContent, this ); 86 87 // Non-cached and cached attachments query completed. 88 this.collection.on( 'attachments:received', this.announceSearchResults, this ); 86 89 }, 87 90 91 announceSearchResults: function() { 92 var count; 93 94 if ( this.collection.mirroring.args.s ) { 95 count = this.collection.length; 96 97 if ( 0 === count ) { 98 wp.a11y.speak( l10n.noMediaTryNewSearch ); 99 return; 100 } 101 102 wp.a11y.speak( l10n.mediaFound.replace( '%d', count ) ); 103 } 104 }, 105 88 106 editSelection: function( modal ) { 89 107 // When editing a selection, move focus to the "Return to library" button. 90 108 modal.$( '.media-button-backToLibrary' ).focus(); -
src/js/media/views/search.js
22 22 }, 23 23 24 24 events: { 25 'input': 'search', 26 'keyup': 'search' 25 'input': 'search' 27 26 }, 28 27 29 28 /** … … 35 34 }, 36 35 37 36 search: _.debounce( function( event ) { 38 if ( event.target.value ) { 39 this.model.set( 'search', event.target.value ); 37 var searchTerm = event.target.value.trim(); 38 39 // Trigger the search only after 2 ASCII characters. 40 if ( searchTerm && searchTerm.length > 1 ) { 41 this.model.set( 'search', searchTerm ); 40 42 } else { 41 this.model.unset( 'search');43 this.model.unset( 'search' ); 42 44 } 43 }, 300 )45 }, 500 ) 44 46 }); 45 47 46 48 module.exports = Search; -
src/wp-includes/media.php
3812 3812 'filterByType' => __( 'Filter by type' ), 3813 3813 'searchMediaLabel' => __( 'Search Media' ), 3814 3814 'searchMediaPlaceholder' => __( 'Search media items...' ), // placeholder (no ellipsis) 3815 'noMedia' => __( 'No media files found.' ), 3815 'noMedia' => __( 'No media items found.' ), 3816 'mediaFound' => __( 'Number of media items found: %d' ), 3817 'noMediaTryNewSearch' => __( 'No media items found. Try a different search.' ), 3816 3818 3817 3819 // Library Details 3818 3820 'attachmentDetails' => __( 'Attachment Details' ), -
src/wp-includes/script-loader.php
1507 1507 1508 1508 // To enqueue media-views or media-editor, call wp_enqueue_media(). 1509 1509 // Both rely on numerous settings, styles, and templates to operate correctly. 1510 $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request' ), false, 1 );1510 $scripts->add( 'media-views', "/wp-includes/js/media-views$suffix.js", array( 'utils', 'media-models', 'wp-plupload', 'jquery-ui-sortable', 'wp-mediaelement', 'wp-api-request', 'wp-a11y' ), false, 1 ); 1511 1511 $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 ); 1512 1512 $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 ); 1513 1513 $scripts->add( 'mce-view', "/wp-includes/js/mce-view$suffix.js", array( 'shortcode', 'jquery', 'media-views', 'media-audiovideo' ), false, 1 );