Ticket #24716: 24716.8.diff
File 24716.8.diff, 5.8 KB (added by , 10 years ago) |
---|
-
src/wp-includes/css/media-views.css
909 909 border-radius: 0; 910 910 } 911 911 912 .attachment .data-field { 913 white-space: nowrap; 914 text-overflow: ellipsis; 915 overflow: hidden; 916 display: block; 917 line-height: 19px; 918 height: 19px; 919 text-align: left; 920 } 921 912 922 /** 913 923 * Attachments Browser 914 924 */ … … 924 934 height: 50px; 925 935 } 926 936 937 .attachments-browser.hide-sidebar .media-toolbar { 938 right: 0; 939 } 940 927 941 .attachments-browser .media-toolbar-primary > .media-button, 928 942 .attachments-browser .media-toolbar-primary > .media-button-group, 929 943 .attachments-browser .media-toolbar-secondary > .media-button, … … 942 956 outline: none; 943 957 } 944 958 959 .attachment .edit-media { 960 -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; 961 opacity: 0; 962 position: absolute; 963 top: 25%; 964 right: 25%; 965 left: 25%; 966 background: #222; 967 background: rgba(0,0,0,0.7); 968 color: #fff; 969 font-size: 15px; 970 text-shadow: 0 1px 0 rgba(0,0,0,0.6); 971 -webkit-font-smoothing: antialiased; 972 font-weight: 600; 973 padding: 10px 0; 974 text-align: center; 975 -webkit-border-radius: 3px; 976 border-radius: 3px; 977 -webkit-transition: opacity 0.1s ease-in-out; 978 transition: opacity 0.1s ease-in-out; 979 } 980 981 .attachment:hover .edit-media { 982 -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; 983 opacity: 1; 984 } 985 986 .attachments-browser.hide-sidebar .attachments { 987 right: 0; 988 } 989 945 990 .attachments-browser .instructions { 946 991 display: inline-block; 947 992 margin-top: 16px; -
src/wp-includes/js/media-views.js
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', 'mime' ] ), 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 } 5622 5632 5623 5633 this.collection.on( 'add remove reset', this.updateContent, this ); 5624 5634 }, … … 5732 5742 this.removeContent(); 5733 5743 5734 5744 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, 5745 controller: this.controller, 5746 collection: this.collection, 5747 selection: this.options.selection, 5748 model: this.model, 5749 sortable: this.options.sortable, 5750 showAttachmentFields: this.options.showAttachmentFields, 5740 5751 5741 5752 // The single `Attachment` view to be used in the `Attachments` view. 5742 5753 AttachmentView: this.options.AttachmentView -
src/wp-includes/media-template.php
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 <# } #> … … 283 283 <# } #> {{ maybeReadOnly }} /> 284 284 <# } #> 285 285 <# } #> 286 <# if ( _.contains( data.controller.options.mode, 'grid' ) ) { #> 287 <# _.each( data.showAttachmentFields, function( field ) { #> 288 <div class="data-field data-{{ field }}"> 289 <# if ( 'uploadedTo' === field ) { #> 290 291 <# if ( data[field] ) { #> 292 <?php _e( 'Uploaded To:' ) ?> 293 <# } else { #> 294 <?php _e( 'Unattached' ) ?> 295 <# } #> 296 297 <# } #> 298 <# if ( data[field] ) { #> 299 {{ data[field] }} 300 <# } #> 301 </div> 302 <# }); #> 303 <# } #> 304 286 305 </script> 287 306 288 307 <script type="text/html" id="tmpl-attachment-details">