Changeset 29625
- Timestamp:
- 08/26/2014 03:57:20 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/list-tables.css
r29603 r29625 596 596 } 597 597 598 .wp-filter .actions { 599 display: inline-block; 600 vertical-align: middle; 601 } 602 598 603 .tablenav .delete { 599 604 margin-right: 20px; … … 618 623 } 619 624 620 .view-switch {625 tablenav .view-switch { 621 626 float: right; 622 627 margin: 5px 16px 0 8px; 628 } 629 630 .wp-filter .view-switch { 631 display: inline-block; 632 vertical-align: middle; 633 padding: 14px 0; 634 margin: 0 20px 0 0; 623 635 } 624 636 … … 680 692 .screen-per-page { 681 693 width: 4em; 694 } 695 696 #posts-filter .wp-filter { 697 margin-bottom: 0; 682 698 } 683 699 … … 1438 1454 } 1439 1455 1440 .tablenav.top .actions, .view-switch { 1456 .tablenav.top .actions, 1457 .tablenav .view-switch { 1441 1458 display: none; 1442 1459 } -
trunk/src/wp-admin/css/media.css
r29623 r29625 514 514 } 515 515 516 .media-frame.mode-grid .media-toolbar select {517 margin-top: 1px;518 font-size: inherit;519 }520 521 .media-frame.mode-grid .attachments-browser .bulk-select {522 display: inline-block;523 margin: 0 10px 0 0;524 }525 526 516 .media-frame.mode-grid .attachments, 527 517 .media-frame.mode-select .attachments { … … 531 521 .media-frame.mode-select .attachments-browser.fixed .attachments { 532 522 position: relative; 533 top: 80px; /* prevent jumping up when the toolbar becomes fixed */534 padding-bottom: 80px; /* offset for above so the bottom doesn't get cut off */523 top: 94px; /* prevent jumping up when the toolbar becomes fixed */ 524 padding-bottom: 94px; /* offset for above so the bottom doesn't get cut off */ 535 525 } 536 526 … … 573 563 } 574 564 575 /** 576 * Copied styles from the Add theme toolbar. 577 * 578 * This should be OOCSS'd so both use a shared selector. 579 */ 580 .media-frame.mode-grid .attachments-browser .media-toolbar { 581 background: #fff; 582 -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); 583 box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); 584 -webkit-box-sizing: border-box; 585 -moz-box-sizing: border-box; 586 box-sizing: border-box; 587 color: #555; 565 .media-frame.mode-grid .media-toolbar { 566 margin: 15px 0; 567 height: auto; 568 } 569 570 .media-frame.mode-grid .media-toolbar select { 571 margin: 0 10px 0 0; 572 font-size: 14px; 573 } 574 575 .media-frame.mode-grid .media-toolbar-secondary > .media-button { 576 margin-top: 10px; 577 margin-bottom: 10px; 578 } 579 580 .media-frame.mode-grid .attachments-browser .bulk-select { 588 581 display: inline-block; 589 font-size: 13px; 590 margin: 20px 0; 591 padding: 0 20px; 592 position: relative; 593 width: 100%; 594 height: auto; 595 border: none; 582 margin: 0 10px 0 0; 583 } 584 585 .media-frame.mode-grid .search { 586 margin-top: 0; 587 } 588 589 .media-frame.mode-grid .spinner { 590 margin-top: 15px; 591 } 592 593 .attachments-browser .media-toolbar-secondary > .select-mode-toggle-button { 594 margin-right: 10px; 596 595 } 597 596 … … 602 601 right: 20px; 603 602 margin-top: 0; 604 }605 606 .media-frame.mode-grid input[type="search"] {607 margin: 1px;608 padding: 3px 5px;609 position: absolute;610 right: 10px;611 top: 9px;612 font-size: 16px;613 font-weight: 300;614 line-height: 1.5;615 width: 280px;616 }617 618 .media-frame.mode-grid .view-switch {619 display: inline-block;620 float: none;621 vertical-align: middle;622 padding: 15px 0;623 margin: 0 20px 0 0;624 }625 626 .media-frame.mode-grid select {627 margin: 0 10px 0 0;628 }629 630 .media-frame.mode-grid .spinner {631 margin-top: 15px;632 }633 634 .attachments-browser .media-toolbar-secondary > .select-mode-toggle-button {635 margin-right: 10px;636 603 } 637 604 … … 1160 1127 1161 1128 @media only screen and (max-width: 1120px) { 1162 .media-frame.mode-grid .attachments-browser .media-toolbar-primary,1163 1129 .media-frame.mode-grid .attachments-browser .media-toolbar-secondary { 1164 1130 float: none; 1165 }1166 1167 .media-frame.mode-grid input[type="search"] {1168 margin: 20px 0;1169 position: static;1170 width: 100%;1171 max-width: 280px;1172 1131 } 1173 1132 } -
trunk/src/wp-admin/includes/class-wp-media-list-table.php
r29550 r29625 21 21 */ 22 22 public function __construct( $args = array() ) { 23 $this->detached = isset( $_REQUEST['detached'] );23 $this->detached = ( isset( $_REQUEST['attachment-filter'] ) && 'detached' === $_REQUEST['attachment-filter'] ); 24 24 25 25 parent::__construct( array( … … 61 61 $num_posts[$type] = ( isset( $num_posts[$type] ) ) ? $num_posts[$type] + $_num_posts[$real] : $_num_posts[$real]; 62 62 63 $ class = ( empty($_GET['post_mime_type']) && !$this->detached && !isset($_GET['status']) ) ? ' class="current"' : '';64 $type_links['all'] = "< a href='upload.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</a>';63 $selected = empty( $_GET['attachment-filter'] ) ? ' selected="selected"' : ''; 64 $type_links['all'] = "<option value=''$selected>" . sprintf( _nx( 'All (%s)', 'All (%s)', $_total_posts, 'uploaded files' ), number_format_i18n( $_total_posts ) ) . '</option>'; 65 65 foreach ( $post_mime_types as $mime_type => $label ) { 66 66 $class = ''; … … 69 69 continue; 70 70 71 if ( !empty($_GET['post_mime_type']) && wp_match_mime_types($mime_type, $_GET['post_mime_type']) ) 72 $class = ' class="current"'; 71 $selected = ''; 72 if ( !empty( $_GET['attachment-filter'] ) && strpos( $_GET['attachment-filter'], 'post_mime_type:' ) === 0 && wp_match_mime_types( $mime_type, str_replace( 'post_mime_type:', '', $_GET['attachment-filter'] ) ) ) 73 $selected = ' selected="selected"'; 73 74 if ( !empty( $num_posts[$mime_type] ) ) 74 $type_links[$mime_type] = '< a href="upload.php?post_mime_type=' . urlencode( $mime_type ) . '"' . $class . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</a>';75 } 76 $type_links['detached'] = '< a href="upload.php?detached=1"' . ( $this->detached ? ' class="current"' : '' ) . '>' . sprintf( _nx( 'Unattached <span class="count">(%s)</span>', 'Unattached <span class="count">(%s)</span>', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</a>';75 $type_links[$mime_type] = '<option value="post_mime_type:' . urlencode( $mime_type ) . '"' . $selected . '>' . sprintf( translate_nooped_plural( $label[2], $num_posts[$mime_type] ), number_format_i18n( $num_posts[$mime_type] )) . '</option>'; 76 } 77 $type_links['detached'] = '<option value="detached"' . ( $this->detached ? ' selected="selected"' : '' ) . '>' . sprintf( _nx( 'Unattached (%s)', 'Unattached (%s)', $total_orphans, 'detached files' ), number_format_i18n( $total_orphans ) ) . '</option>'; 77 78 78 79 if ( !empty($_num_posts['trash']) ) 79 $type_links['trash'] = '< a href="upload.php?status=trash"' . ( (isset($_GET['status']) && $_GET['status'] == 'trash' ) ? ' class="current"' : '') . '>' . sprintf( _nx( 'Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</a>';80 $type_links['trash'] = '<option value="trash"' . ( (isset($_GET['attachment-filter']) && $_GET['attachment-filter'] == 'trash' ) ? ' selected="selected"' : '') . '>' . sprintf( _nx( 'Trash (%s)', 'Trash (%s)', $_num_posts['trash'], 'uploaded files' ), number_format_i18n( $_num_posts['trash'] ) ) . '</option>'; 80 81 81 82 return $type_links; … … 92 93 93 94 protected function extra_tablenav( $which ) { 94 ?> 95 <div class="alignleft actions"> 96 <?php 97 if ( 'top' == $which && !is_singular() && !$this->detached && !$this->is_trash ) { 95 if ( 'bar' !== $which ) { 96 return; 97 } 98 ?> 99 <div class="actions"> 100 <?php 101 if ( ! is_singular() && ! $this->is_trash ) { 98 102 $this->months_dropdown( 'attachment' ); 99 103 … … 132 136 133 137 parent::pagination( $which ); 134 135 $this->view_switcher( $mode );136 138 } 137 139 … … 166 168 </div> 167 169 <?php 170 } 171 172 /** 173 * Override parent views so we can use the filter bar display. 174 */ 175 public function views() { 176 global $mode; 177 178 $views = $this->get_views(); 179 ?> 180 <div class="wp-filter"> 181 <?php $this->view_switcher( $mode ); ?> 182 183 <select class="attachment-filters" name="attachment-filter"> 184 <?php 185 if ( ! empty( $views ) ) { 186 foreach ( $views as $class => $view ) { 187 echo "\t$view\n"; 188 } 189 } 190 ?> 191 </select> 192 193 <?php 194 $this->extra_tablenav( 'bar' ); 195 196 /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */ 197 $views = apply_filters( "views_{$this->screen->id}", '' ); 198 199 // Back compat for pre-4.0 view links. 200 if ( ! empty( $views ) ) { 201 echo '<ul class="filter-links">'; 202 foreach ( $views as $class => $view ) { 203 echo "<li class='$class'>$view</li>"; 204 } 205 echo '</ul>'; 206 } 207 ?> 208 209 <div class="search-form"> 210 <label for="media-search-input" class="screen-reader-text"><?php esc_html_e( 'Search Media' ); ?></label> 211 <input type="search" placeholder="Search" id="media-search-input" class="search" name="s" value="<?php _admin_search_query(); ?>"></div> 212 </div> 213 <?php 168 214 } 169 215 -
trunk/src/wp-admin/includes/post.php
r29206 r29625 1033 1033 1034 1034 $q['post_status'] = isset( $q['status'] ) && 'trash' == $q['status'] ? 'trash' : $states; 1035 $q['post_status'] = isset( $q['attachment-filter'] ) && 'trash' == $q['attachment-filter'] ? 'trash' : $states; 1036 1035 1037 $media_per_page = (int) get_user_option( 'upload_per_page' ); 1036 1038 if ( empty( $media_per_page ) || $media_per_page < 1 ) … … 1052 1054 unset($q['post_mime_type']); 1053 1055 1054 if ( isset($q['detached']) ) 1056 foreach( array_keys( $post_mime_types ) as $type ) { 1057 if ( isset( $q['attachment-filter'] ) && "post_mime_type:$type" == $q['attachment-filter'] ) { 1058 $q['post_mime_type'] = $type; 1059 break; 1060 } 1061 } 1062 1063 if ( isset( $q['detached'] ) || ( isset( $q['attachment-filter'] ) && 'detached' == $q['attachment-filter'] ) ) { 1055 1064 $q['post_parent'] = 0; 1065 } 1056 1066 1057 1067 wp( $q ); -
trunk/src/wp-admin/upload.php
r29550 r29625 266 266 <?php } ?> 267 267 268 <form id="posts-filter" action="" method="get"> 269 268 270 <?php $wp_list_table->views(); ?> 269 270 <form id="posts-filter" action="" method="get">271 272 <?php $wp_list_table->search_box( __( 'Search Media' ), 'media' ); ?>273 271 274 272 <?php $wp_list_table->display(); ?> -
trunk/src/wp-includes/js/media-grid.js
r29600 r29625 180 180 $toolbar = $browser.find('.media-toolbar'); 181 181 182 if ( $browser.offset().top < this.$window.scrollTop() + this.$adminBar.height() ) { 182 // Offset doesn't appear to take top margin into account, hence +16 183 if ( ( $browser.offset().top + 16 ) < this.$window.scrollTop() + this.$adminBar.height() ) { 183 184 $browser.addClass( 'fixed' ); 184 185 $toolbar.css('width', $browser.width() + 'px'); -
trunk/src/wp-includes/js/media-views.js
r29623 r29625 3912 3912 media.view.Toolbar = media.View.extend({ 3913 3913 tagName: 'div', 3914 className: 'media-toolbar ',3914 className: 'media-toolbar wp-filter', 3915 3915 3916 3916 initialize: function() { … … 3924 3924 this.primary = new media.view.PriorityList(); 3925 3925 this.secondary = new media.view.PriorityList(); 3926 this.primary.$el.addClass('media-toolbar-primary ');3926 this.primary.$el.addClass('media-toolbar-primary search-form'); 3927 3927 this.secondary.$el.addClass('media-toolbar-secondary'); 3928 3928
Note: See TracChangeset
for help on using the changeset viewer.