-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Media library 23562 #10832
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
joedolson
wants to merge
7
commits into
WordPress:trunk
Choose a base branch
from
joedolson:media-library-23562
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+101
−54
Open
Media library 23562 #10832
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
38a8306
Make labels visible for filters
joedolson 55977d7
Make image accessible name visible in media library
joedolson e2af1f0
Make styles match filename on non-images & ignore media with filenames
joedolson d4e68a7
Make max-height tall enough for two lines of text
joedolson 35747d2
Styling for grid view on media screen
joedolson 1910544
Adjust in list view
joedolson dac051d
Revert "Adjust in list view"
joedolson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -193,35 +193,46 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro | |
| priority: -100, | ||
| text: l10n.filterAttachments, | ||
| level: 'h2', | ||
| className: 'media-attachments-filter-heading' | ||
| className: 'media-attachments-filter-heading screen-reader-text' | ||
| }).render() ); | ||
| } | ||
|
|
||
| if ( showFilterByType ) { | ||
| // "Filters" is a <select>, a visually hidden label element needs to be rendered before. | ||
| this.toolbar.set( 'filtersLabel', new wp.media.view.Label({ | ||
| var filtersLabel = new wp.media.view.Label({ | ||
| value: l10n.filterByType, | ||
| attributes: { | ||
| 'for': 'media-attachment-filters' | ||
| }, | ||
| priority: -80 | ||
| }).render() ); | ||
| }); | ||
|
|
||
| if ( 'uploaded' === this.options.filters ) { | ||
| this.toolbar.set( 'filters', new wp.media.view.AttachmentFilters.Uploaded({ | ||
| Filters = new wp.media.view.AttachmentFilters.Uploaded({ | ||
| controller: this.controller, | ||
| model: this.collection.props, | ||
| priority: -80 | ||
| }).render() ); | ||
| }); | ||
| } else { | ||
| Filters = new wp.media.view.AttachmentFilters.All({ | ||
| controller: this.controller, | ||
| model: this.collection.props, | ||
| priority: -80 | ||
| }); | ||
|
|
||
| this.toolbar.set( 'filters', Filters.render() ); | ||
| } | ||
|
|
||
| var filterContainer = wp.media.View.extend({ | ||
| tagname: 'div', | ||
| className: 'media-filter-container type-filter', | ||
|
|
||
| initialize: function() { | ||
| this.views.add( [ filtersLabel, Filters ] ); | ||
| } | ||
| }); | ||
|
|
||
| this.toolbar.set( 'filters', new filterContainer({ | ||
| controller: this.controller, | ||
| model: this.controller.props, | ||
| priority: -80 | ||
|
Comment on lines
+232
to
+234
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation? |
||
| }) ).render(); | ||
| } | ||
|
|
||
| /* | ||
|
|
@@ -241,18 +252,31 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro | |
| }).render() ); | ||
|
|
||
| // DateFilter is a <select>, a visually hidden label element needs to be rendered before. | ||
| this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ | ||
| var dateFilterLabel = new wp.media.view.Label({ | ||
| value: l10n.filterByDate, | ||
| attributes: { | ||
| 'for': 'media-attachment-date-filters' | ||
| }, | ||
| priority: -75 | ||
| }).render() ); | ||
| this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ | ||
| }); | ||
| var dateFilter = new wp.media.view.DateFilter({ | ||
| controller: this.controller, | ||
| model: this.collection.props, | ||
| priority: -75 | ||
| }).render() ); | ||
| }); | ||
|
|
||
| var dateFilterContainer = wp.media.View.extend({ | ||
| tagname: 'div', | ||
| className: 'media-filter-container date-filter', | ||
|
|
||
| initialize: function() { | ||
| this.views.add( [ dateFilterLabel, dateFilter ] ); | ||
| } | ||
| }); | ||
|
|
||
| this.toolbar.set( 'dateFilters', new dateFilterContainer({ | ||
| controller: this.controller, | ||
| model: this.collection.props, | ||
| priority: -75 | ||
| }) ).render(); | ||
|
|
||
| // BulkSelection is a <div> with subviews, including screen reader text. | ||
| this.toolbar.set( 'selectModeToggleButton', new wp.media.view.SelectModeToggleButton({ | ||
|
|
@@ -363,18 +387,31 @@ AttachmentsBrowser = View.extend(/** @lends wp.media.view.AttachmentsBrowser.pro | |
|
|
||
| } else if ( this.options.date ) { | ||
| // DateFilter is a <select>, a visually hidden label element needs to be rendered before. | ||
| this.toolbar.set( 'dateFilterLabel', new wp.media.view.Label({ | ||
| var dateFilterLabel = new wp.media.view.Label({ | ||
| value: l10n.filterByDate, | ||
| attributes: { | ||
| 'for': 'media-attachment-date-filters' | ||
| }, | ||
| priority: -75 | ||
| }).render() ); | ||
| this.toolbar.set( 'dateFilter', new wp.media.view.DateFilter({ | ||
| }); | ||
| var dateFilter = new wp.media.view.DateFilter({ | ||
| controller: this.controller, | ||
| model: this.collection.props, | ||
| priority: -75 | ||
| }).render() ); | ||
| }); | ||
|
|
||
| var dateFilterContainer = wp.media.View.extend({ | ||
| tagname: 'div', | ||
| className: 'media-filter-container date-filter', | ||
|
|
||
| initialize: function() { | ||
| this.views.add( [ dateFilterLabel, dateFilter ] ); | ||
| } | ||
| }); | ||
|
|
||
| this.toolbar.set( 'dateFilters', new dateFilterContainer({ | ||
| controller: this.controller, | ||
| model: this.collection.props, | ||
| priority: -75 | ||
| }) ).render(); | ||
| } | ||
|
|
||
| if ( this.options.search ) { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the new class
type-filteradded here?