diff --git a/src/wp-includes/css/media-views.css b/src/wp-includes/css/media-views.css
index c768479..8398789 100644
a
|
b
|
|
924 | 924 | height: 50px; |
925 | 925 | } |
926 | 926 | |
| 927 | .attachments-browser.hide-sidebar .media-toolbar { |
| 928 | right: 0; |
| 929 | } |
| 930 | |
927 | 931 | .attachments-browser .media-toolbar-primary > .media-button, |
928 | 932 | .attachments-browser .media-toolbar-primary > .media-button-group, |
929 | 933 | .attachments-browser .media-toolbar-secondary > .media-button, |
… |
… |
|
942 | 946 | outline: none; |
943 | 947 | } |
944 | 948 | |
| 949 | .attachment .edit-media { |
| 950 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; |
| 951 | opacity: 0; |
| 952 | position: absolute; |
| 953 | top: 35%; |
| 954 | right: 25%; |
| 955 | left: 25%; |
| 956 | background: #222; |
| 957 | background: rgba(0,0,0,0.7); |
| 958 | color: #fff; |
| 959 | font-size: 15px; |
| 960 | text-shadow: 0 1px 0 rgba(0,0,0,0.6); |
| 961 | -webkit-font-smoothing: antialiased; |
| 962 | font-weight: 600; |
| 963 | padding: 15px 12px; |
| 964 | text-align: center; |
| 965 | -webkit-border-radius: 3px; |
| 966 | border-radius: 3px; |
| 967 | -webkit-transition: opacity 0.1s ease-in-out; |
| 968 | transition: opacity 0.1s ease-in-out; |
| 969 | } |
| 970 | |
| 971 | .attachment:hover .edit-media { |
| 972 | -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; |
| 973 | opacity: 1; |
| 974 | } |
| 975 | |
| 976 | .attachments-browser.hide-sidebar .attachments { |
| 977 | right: 0; |
| 978 | } |
| 979 | |
945 | 980 | .attachments-browser .instructions { |
946 | 981 | display: inline-block; |
947 | 982 | margin-top: 16px; |
diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
index f0f70e9..b406ef4 100644
a
|
b
|
|
1758 | 1758 | _.defaults( this.options, { |
1759 | 1759 | title: '', |
1760 | 1760 | modal: true, |
1761 | | uploader: true |
| 1761 | uploader: true, |
| 1762 | mode: ['select'] |
1762 | 1763 | }); |
1763 | 1764 | |
1764 | 1765 | // Ensure core UI is enabled. |
… |
… |
|
1981 | 1982 | library: {}, |
1982 | 1983 | multiple: false, |
1983 | 1984 | state: 'library', |
1984 | | uploader: true |
| 1985 | uploader: true, |
| 1986 | mode: [ 'grid', 'edit' ] |
1985 | 1987 | }); |
1986 | 1988 | |
1987 | 1989 | // Ensure core and media grid view UI is enabled. |
… |
… |
|
2088 | 2090 | display: state.get('displaySettings'), |
2089 | 2091 | dragInfo: state.get('dragInfo'), |
2090 | 2092 | bulkEdit: true, |
| 2093 | sidebar: false, |
2091 | 2094 | |
2092 | 2095 | suggestedWidth: state.get('suggestedWidth'), |
2093 | 2096 | suggestedHeight: state.get('suggestedHeight'), |
… |
… |
|
4711 | 4714 | compat: false, |
4712 | 4715 | alt: '', |
4713 | 4716 | description: '' |
4714 | | }); |
| 4717 | }, this.options ); |
4715 | 4718 | |
4716 | 4719 | options.buttons = this.buttons; |
4717 | 4720 | options.describe = this.controller.state().get('describe'); |
… |
… |
|
4772 | 4775 | method = 'toggle'; |
4773 | 4776 | } |
4774 | 4777 | |
| 4778 | if ( this.controller ) |
4775 | 4779 | this.toggleSelection({ |
4776 | 4780 | method: method |
4777 | 4781 | }); |
… |
… |
|
5296 | 5300 | */ |
5297 | 5301 | createAttachmentView: function( attachment ) { |
5298 | 5302 | var view = new this.options.AttachmentView({ |
5299 | | controller: this.controller, |
5300 | | model: attachment, |
5301 | | collection: this.collection, |
5302 | | selection: this.options.selection |
| 5303 | controller: this.controller, |
| 5304 | model: attachment, |
| 5305 | collection: this.collection, |
| 5306 | selection: this.options.selection, |
| 5307 | showAttachmentFields: this.options.showAttachmentFields |
5303 | 5308 | }); |
5304 | 5309 | |
5305 | 5310 | return this._viewsByCid[ attachment.cid ] = view; |
… |
… |
|
5612 | 5617 | filters: false, |
5613 | 5618 | search: true, |
5614 | 5619 | display: false, |
5615 | | |
| 5620 | sidebar: true, |
| 5621 | showAttachmentFields: getUserSetting( 'showAttachmentFields', [ 'title', 'uploadedTo', 'dateFormatted', 'filetype' ] ), |
5616 | 5622 | AttachmentView: media.view.Attachment.Library |
5617 | 5623 | }); |
5618 | 5624 | |
5619 | 5625 | this.createToolbar(); |
5620 | 5626 | this.updateContent(); |
5621 | | this.createSidebar(); |
| 5627 | if ( this.options.sidebar ) { |
| 5628 | this.createSidebar(); |
| 5629 | } else { |
| 5630 | this.$el.addClass( 'hide-sidebar' ); |
| 5631 | } |
| 5632 | |
5622 | 5633 | |
5623 | 5634 | this.collection.on( 'add remove reset', this.updateContent, this ); |
5624 | 5635 | }, |
… |
… |
|
5732 | 5743 | this.removeContent(); |
5733 | 5744 | |
5734 | 5745 | this.attachments = new media.view.Attachments({ |
5735 | | controller: this.controller, |
5736 | | collection: this.collection, |
5737 | | selection: this.options.selection, |
5738 | | model: this.model, |
5739 | | sortable: this.options.sortable, |
| 5746 | controller: this.controller, |
| 5747 | collection: this.collection, |
| 5748 | selection: this.options.selection, |
| 5749 | model: this.model, |
| 5750 | sortable: this.options.sortable, |
| 5751 | showAttachmentFields: this.options.showAttachmentFields, |
5740 | 5752 | |
5741 | 5753 | // The single `Attachment` view to be used in the `Attachments` view. |
5742 | 5754 | AttachmentView: this.options.AttachmentView |
diff --git a/src/wp-includes/media-template.php b/src/wp-includes/media-template.php
index 2c0ff80..de4b6eb 100644
a
|
b
|
function wp_print_media_templates() { |
257 | 257 | <div>{{ data.filename }}</div> |
258 | 258 | </div> |
259 | 259 | <# } #> |
260 | | |
| 260 | <span class="edit-media">Edit Media</span> |
261 | 261 | <# if ( data.buttons.close ) { #> |
262 | 262 | <a class="close media-modal-icon" href="#" title="<?php esc_attr_e('Remove'); ?>"></a> |
263 | 263 | <# } #> |
… |
… |
function wp_print_media_templates() { |
283 | 283 | <# } #> {{ maybeReadOnly }} /> |
284 | 284 | <# } #> |
285 | 285 | <# } #> |
| 286 | <# if ( _.contains( data.controller.options.mode, 'grid' ) ) { #> |
| 287 | <# _.each( data.showAttachmentFields, function( field ) { #> |
| 288 | <div>{{ data[field] }}</div> |
| 289 | <# }); #> |
| 290 | <# } #> |
| 291 | |
286 | 292 | </script> |
287 | 293 | |
288 | 294 | <script type="text/html" id="tmpl-attachment-details"> |