Changeset 29077
- Timestamp:
- 07/10/2014 08:59:12 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/common.css
r29075 r29077 1026 1026 margin: 0 20px -1px 0px; 1027 1027 position: relative; 1028 z-index: 10; 1028 1029 background-color: #fff; 1029 1030 border: 1px solid #ddd; … … 1048 1049 position: relative; 1049 1050 top: 0; 1051 z-index: 10; 1050 1052 } 1051 1053 -
trunk/src/wp-admin/includes/screen.php
r28500 r29077 1020 1020 <div id="screen-options-wrap" class="hidden" tabindex="-1" aria-label="<?php esc_attr_e('Screen Options Tab'); ?>"> 1021 1021 <form id="adv-settings" action="" method="post"> 1022 <?php if ( isset( $wp_meta_boxes[ $this->id ] ) || $this->get_option( 'per_page' ) || ( $columns && empty( $columns['_title'] ) ) ) : ?> 1022 <?php if ( 1023 isset( $wp_meta_boxes[ $this->id ] ) 1024 || $this->get_option( 'per_page' ) 1025 || $this->get_option( 'media_grid_title' ) 1026 || ( $columns && empty( $columns['_title'] ) ) 1027 ) : ?> 1023 1028 <h5><?php _e( 'Show on screen' ); ?></h5> 1024 1029 <?php … … 1072 1077 <br class="clear" /> 1073 1078 </div> 1079 <?php elseif ( $this->get_option( 'media_grid_title' ) ): ?> 1080 <div class="metabox-prefs media-grid-prefs"> 1081 <?php foreach ( $this->_options as $column => $args ) { 1082 $id = "$column-hide"; 1083 echo '<label for="' . $id . '">'; 1084 $saved = str_replace( 'media_grid_', '', $column ); 1085 echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $saved, $hidden ), true, false ) . ' />'; 1086 echo $args['label'] . "</label>\n"; 1087 } ?> 1088 <br class="clear" /> 1089 </div> 1074 1090 <?php endif; 1075 1091 -
trunk/src/wp-admin/js/common.js
r29049 r29077 29 29 saveManageColumnsState : function() { 30 30 var hidden = this.hidden(); 31 if ( $( '#media_grid_title-hide' ).length ) { 32 hidden = []; 33 $( '.hide-column-tog', '.media-grid-prefs' ).each( function() { 34 var $el, field = this.value.replace( 'media_grid_', '' ); 35 $el = $( '.data-' + field ); 36 if ( ! this.checked ) { 37 hidden.push( field ); 38 $el.removeClass( 'data-visible' ).addClass( 'data-hidden' ); 39 } else { 40 $el.removeClass( 'data-hidden' ).addClass( 'data-visible' ); 41 } 42 } ); 43 hidden = hidden.join( ',' ); 44 } 31 45 $.post(ajaxurl, { 32 46 action: 'hidden-columns', -
trunk/src/wp-admin/upload.php
r29057 r29077 26 26 wp_enqueue_script( 'media' ); 27 27 wp_localize_script( 'media-grid', 'mediaGridSettings', array( 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ) ) ); 28 29 add_screen_option( 'media_grid_title', array( 'label' => __( 'Name' ) ) ); 30 add_screen_option( 'media_grid_uploadedTo', array( 'label' => __( 'Uploaded To' ) ) ); 31 add_screen_option( 'media_grid_dateFormatted', array( 'label' => __( 'Date' ) ) ); 32 add_screen_option( 'media_grid_mime', array( 'label' => __( 'Mime-type' ) ) ); 28 33 29 34 require_once( ABSPATH . 'wp-admin/admin-header.php' ); -
trunk/src/wp-includes/css/media-views.css
r29067 r29077 2576 2576 */ 2577 2577 .media-grid-view { 2578 z-index: 1; 2578 2579 position: fixed; 2579 2580 bottom: 0; -
trunk/src/wp-includes/js/media-grid.js
r29076 r29077 598 598 }); 599 599 600 media.view.GridFieldOptions = media.View.extend({601 className: 'media-grid-field-options',602 template: media.template( 'media-grid-field-options' ),603 604 events: {605 'change input': 'toggleFields'606 },607 608 toggleFields: function(e) {609 var $el = $( e.currentTarget ), fields, setting;610 setting = $el.data( 'setting' );611 fields = $( '.data-' + setting, '.data-fields' );612 if ( $el.is( ':checked' ) ) {613 fields.show();614 deleteUserSetting( 'hidegrid' + setting );615 } else {616 fields.hide();617 setUserSetting( 'hidegrid' + setting, 1 );618 }619 620 if ( $( ':checked', this.$el ).length ) {621 fields.parent().show();622 } else {623 fields.parent().hide();624 }625 }626 });627 628 600 media.view.BulkSelectionToggleButton = media.view.Button.extend({ 629 601 initialize: function() { -
trunk/src/wp-includes/js/media-views.js
r29067 r29077 5229 5229 model: attachment, 5230 5230 collection: this.collection, 5231 selection: this.options.selection, 5232 showAttachmentFields: this.options.showAttachmentFields 5231 selection: this.options.selection 5233 5232 }); 5234 5233 … … 5545 5544 display: false, 5546 5545 sidebar: true, 5547 showAttachmentFields: getUserSetting( 'showAttachmentFields', [ 'title', 'uploadedTo', 'dateFormatted', 'mime' ] ),5548 5546 AttachmentView: media.view.Attachment.Library 5549 5547 }); … … 5609 5607 controller: this.controller, 5610 5608 priority: -69 5611 }).render() );5612 5613 this.toolbar.set( 'gridFieldOptions', new media.view.GridFieldOptions({5614 controller: this.controller,5615 priority: -505616 5609 }).render() ); 5617 5610 } … … 5706 5699 model: this.model, 5707 5700 sortable: this.options.sortable, 5708 showAttachmentFields: this.options.showAttachmentFields,5709 5701 5710 5702 // The single `Attachment` view to be used in the `Attachments` view. -
trunk/src/wp-includes/media-template.php
r29065 r29077 230 230 </script> 231 231 232 <script type="text/html" id="tmpl-media-grid-field-options">233 <label class="setting">234 <span><?php _e( 'Name' ); ?></span>235 <input type="checkbox" data-setting="title" {{ '' === getUserSetting( 'hidegridtitle' ) && 'checked' }} />236 </label>237 <label class="setting">238 <span><?php _e( 'Uploaded to' ); ?></span>239 <input type="checkbox" data-setting="uploadedTo" {{ '' === getUserSetting( 'hidegriduploadedTo' ) && 'checked' }} />240 </label>241 <label class="setting">242 <span><?php _e( 'Date' ); ?></span>243 <input type="checkbox" data-setting="dateFormatted" {{ '' === getUserSetting( 'hidegriddateFormatted' ) && 'checked' }} />244 </label>245 <label class="setting">246 <span><?php _e( 'Mime-type' ); ?></span>247 <input type="checkbox" data-setting="mime" {{ '' === getUserSetting( 'hidegridmime' ) && 'checked' }} />248 </label>249 </script>250 251 232 <script type="text/html" id="tmpl-uploader-status"> 252 233 <h3><?php _e( 'Uploading' ); ?></h3> … … 438 419 if ( _.contains( data.controller.options.mode, 'grid' ) ) { #> 439 420 <div class="data-fields"> 440 < # _.each( data.showAttachmentFields, function( field ) {441 var className = 'data-field data-hidden';442 if ( '' === getUserSetting( 'hidegrid' + field ) ) {443 className = 'data-field data-visible';444 }445 #>446 <div class=" {{ className }} data-{{ field }}"><#447 if ( 'uploadedTo' === field) {448 if ( data[ field] ) {421 <?php 422 $hidden = get_hidden_columns( get_current_screen() ); 423 $fields = array( 'title', 'uploadedTo', 'dateFormatted', 'mime' ); 424 foreach ( $fields as $field ): 425 $class_name = in_array( $field, $hidden ) ? 'data-field data-hidden' : 'data-field data-visible'; 426 ?> 427 <div class="<?php echo $class_name ?> data-<?php echo $field ?>"><# 428 if ( 'uploadedTo' === '<?php echo $field ?>' ) { 429 if ( data[ '<?php echo $field ?>' ] ) { 449 430 #><?php _e( 'Uploaded To: ' ) ?><a href="{{ data.uploadedToLink }}">{{ data.uploadedToTitle }}</a><# 450 431 } else { 451 432 #><?php _e( 'Unattached' ) ?><# 452 433 } 453 } else if ( 'title' === field && ! data[ field] ) {434 } else if ( 'title' === '<?php echo $field ?>' && ! data[ '<?php echo $field ?>' ] ) { 454 435 #><?php _e( '(No title)' ) ?><# 455 } else if ( data[ field] ) {456 #>{{ data[ field] }}<#436 } else if ( data[ '<?php echo $field ?>' ] ) { 437 #>{{ data[ '<?php echo $field ?>' ] }}<# 457 438 } 458 439 #></div> 459 < # }); #>440 <?php endforeach ?> 460 441 </div> 461 442 <# } #>
Note: See TracChangeset
for help on using the changeset viewer.