Ticket #47146: 47146.diff
| File 47146.diff, 4.7 KB (added by , 7 years ago) |
|---|
-
src/js/media/models/attachments.js
293 293 this.reset( [], { silent: true } ); 294 294 this.observe( attachments ); 295 295 296 // For the search results. 297 this.trigger( 'attachments:mirror:done', this ); 296 298 return this; 297 299 }, 298 300 /** … … 332 334 if ( this === attachments.mirroring ) { 333 335 deferred.resolveWith( this ); 334 336 } 337 338 // For the search results. 339 attachments.trigger( 'attachments:more:done', this ); 335 340 }); 336 341 337 342 return deferred.promise(); -
src/js/media/models/query.js
287 287 query = _.find( queries, function( query ) { 288 288 return _.isEqual( query.args, args ); 289 289 }); 290 // window.console.log( 'models query search cached', query ); 290 291 } else { 291 292 queries = []; 292 293 } … … 298 299 args: args 299 300 } ) ); 300 301 queries.push( query ); 302 // window.console.log( 'models query search request', query ); 301 303 } 302 304 303 305 return query; -
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 attachments query. 88 this.collection.on( 'attachments:more:done', this.queryDone, this ); 89 // Cached attachments query. 90 this.collection.on( 'attachments:mirror:done', this.queryDone, this ); 86 91 }, 87 92 93 queryDone: function() { 94 var count; 95 96 if ( this.collection.mirroring.args.s ) { 97 count = this.collection.length; 98 window.console.log( 'browser queryDone', this.collection ); 99 window.console.log( 'search results: ' + count ); 100 101 if ( 0 === count ) { 102 wp.a11y.speak( l10n.noMediaTryNewSearch ); 103 return; 104 } 105 106 wp.a11y.speak( l10n.mediaFound.replace( '%d', count ) ); 107 } 108 }, 109 88 110 editSelection: function( modal ) { 89 111 // When editing a selection, move focus to the "Return to library" button. 90 112 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 /** … … 40 39 } else { 41 40 this.model.unset('search'); 42 41 } 43 }, 300 )42 }, 500 ) 44 43 }); 45 44 46 45 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 );