Changeset 46239
- Timestamp:
- 09/23/2019 12:18:53 PM (5 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/js/media/models/attachments.js
r43309 r46239 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 }, … … 333 335 deferred.resolveWith( this ); 334 336 } 337 338 // Used for the search results. 339 attachments.trigger( 'attachments:received', this ); 335 340 }); 336 341 -
trunk/src/js/media/views/attachments/browser.js
r45701 r46239 84 84 85 85 this.collection.on( 'add remove reset', this.updateContent, this ); 86 }, 86 87 // The non-cached or cached attachments query has completed. 88 this.collection.on( 'attachments:received', this.announceSearchResults, this ); 89 }, 90 91 /** 92 * Updates the `wp.a11y.speak()` ARIA live region with a message to communicate 93 * the number of search results to screen reader users. This function is 94 * debounced because the collection updates multiple times. 95 * 96 * @since 5.3.0 97 * 98 * @returns {void} 99 */ 100 announceSearchResults: _.debounce( function() { 101 var count; 102 103 if ( this.collection.mirroring.args.s ) { 104 count = this.collection.length; 105 106 if ( 0 === count ) { 107 wp.a11y.speak( l10n.noMediaTryNewSearch ); 108 return; 109 } 110 111 if ( this.collection.hasMore() ) { 112 wp.a11y.speak( l10n.mediaFoundHasMoreResults.replace( '%d', count ) ); 113 return; 114 } 115 116 wp.a11y.speak( l10n.mediaFound.replace( '%d', count ) ); 117 } 118 }, 200 ), 87 119 88 120 editSelection: function( modal ) { -
trunk/src/js/media/views/focus-manager.js
r45867 r46239 72 72 * 73 73 * The reason why we use `aria-hidden` is that `aria-modal="true"` is buggy 74 * in Safari 11.1 and support is spotty in other browsers. In the future we 75 * should consider to remove this helper function and only use `aria-modal="true"`. 74 * in Safari 11.1 and support is spotty in other browsers. Also, `aria-modal="true"` 75 * prevents the `wp.a11y.speak()` ARIA live regions to work as they're outside 76 * of the modal dialog and get hidden from assistive technologies. 76 77 * 77 78 * @since 5.2.3 -
trunk/src/js/media/views/search.js
r43309 r46239 23 23 24 24 events: { 25 'input': 'search', 26 'keyup': 'search' 25 'input': 'search' 27 26 }, 28 27 … … 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 -
trunk/src/wp-includes/media-template.php
r46168 r46239 188 188 <?php // Template for the media modal. ?> 189 189 <script type="text/html" id="tmpl-media-modal"> 190 <div tabindex="0" class="<?php echo $class; ?>" role="dialog" aria- modal="true" aria-labelledby="media-frame-title">190 <div tabindex="0" class="<?php echo $class; ?>" role="dialog" aria-labelledby="media-frame-title"> 191 191 <# if ( data.hasCloseButton ) { #> 192 192 <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php _e( 'Close dialog' ); ?></span></span></button> -
trunk/src/wp-includes/media.php
r46164 r46239 3855 3855 'searchMediaLabel' => __( 'Search Media' ), 3856 3856 'searchMediaPlaceholder' => __( 'Search media items...' ), // placeholder (no ellipsis) 3857 'noMedia' => __( 'No media files found.' ), 3857 'mediaFound' => __( 'Number of media items found: %d' ), 3858 'mediaFoundHasMoreResults' => __( 'Number of media items displayed: %d. Scroll the page for more results.' ), 3859 'noMedia' => __( 'No media items found.' ), 3860 'noMediaTryNewSearch' => __( 'No media items found. Try a different search.' ), 3858 3861 3859 3862 // Library Details -
trunk/src/wp-includes/script-loader.php
r46189 r46239 1625 1625 // To enqueue media-views or media-editor, call wp_enqueue_media(). 1626 1626 // Both rely on numerous settings, styles, and templates to operate correctly. 1627 $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 );1627 $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 ); 1628 1628 $scripts->add( 'media-editor', "/wp-includes/js/media-editor$suffix.js", array( 'shortcode', 'media-views' ), false, 1 ); 1629 1629 $scripts->add( 'media-audiovideo', "/wp-includes/js/media-audiovideo$suffix.js", array( 'media-editor' ), false, 1 );
Note: See TracChangeset
for help on using the changeset viewer.