Ticket #38086: 38086.diff
File 38086.diff, 10.5 KB (added by , 9 years ago) |
---|
-
src/wp-admin/css/common.css
1045 1045 display: inline-block; 1046 1046 } 1047 1047 1048 .wp-filter .drawer-toggle { 1049 display: inline-block; 1050 margin: 0 10px; 1051 padding: 4px 6px; 1048 .wp-filter .button.drawer-toggle { 1049 margin: 10px 9px 0; 1050 padding: 0 10px 0 6px; 1051 border-color: transparent; 1052 background-color: transparent; 1052 1053 color: #666; 1053 cursor: pointer; 1054 vertical-align: baseline; 1055 -webkit-box-shadow: none; 1056 box-shadow: none; 1054 1057 } 1055 1058 1056 1059 .wp-filter .drawer-toggle:before { 1057 display: inline-block;1058 vertical-align: top;1059 1060 content: "\f111"; 1060 1061 margin: 0 5px 0 0; 1061 width: 16px;1062 height: 16px;1063 1062 color: #72777c; 1064 -webkit-transition: color .1s ease-in 0; 1065 transition: color .1s ease-in 0; 1066 font-family: dashicons; 1067 font-size: 16px; 1068 line-height: 1; 1069 text-align: center; 1070 text-decoration: inherit; 1071 font-weight: 400; 1072 font-style: normal; 1063 font: normal 16px/1 dashicons; 1064 vertical-align: text-bottom; 1073 1065 -webkit-font-smoothing: antialiased; 1066 -moz-osx-font-smoothing: grayscale; 1074 1067 } 1075 1068 1076 .wp-filter .drawer-toggle:hover, 1077 .wp-filter .drawer-toggle:hover:before { 1069 .wp-filter .button.drawer-toggle:hover, 1070 .wp-filter .drawer-toggle:hover:before, 1071 .wp-filter .button.drawer-toggle:focus, 1072 .wp-filter .drawer-toggle:focus:before { 1073 background-color: transparent; 1078 1074 color: #00a0d2; 1079 1075 } 1080 1076 1077 .wp-filter .button.drawer-toggle:hover, 1078 .wp-filter .button.drawer-toggle:focus:active { 1079 border-color: transparent; 1080 } 1081 1082 .wp-filter .button.drawer-toggle:focus { 1083 border-color: #5b9dd9; 1084 } 1085 1086 .wp-filter .button.drawer-toggle:active { 1087 background: transparent; 1088 -webkit-box-shadow: none; 1089 box-shadow: none; 1090 -webkit-transform: none; 1091 -ms-transform: none; 1092 transform: none; 1093 } 1094 1081 1095 .wp-filter .drawer-toggle.current:before { 1082 1096 color: #fff; 1083 1097 } … … 1092 1106 width: 100%; 1093 1107 } 1094 1108 1095 .show-favorites-form . wp-filter .favorites-form {1109 .show-favorites-form .favorites-form { 1096 1110 display: block; 1097 1111 } 1098 1112 … … 1110 1124 width: 100%; 1111 1125 } 1112 1126 1113 .show-filters .wp-filter .drawer-toggle:hover,1114 .show-filters .wp-filter .drawer-toggle:focus {1115 background: rgb(46, 162, 204);1116 }1117 1118 1127 .show-filters .filter-links a.current { 1119 1128 border-bottom: none; 1120 1129 } 1121 1130 1122 .show-filters .wp-filter . drawer-toggle {1131 .show-filters .wp-filter .button.drawer-toggle { 1123 1132 -webkit-border-radius: 2px; 1124 1133 border-radius: 2px; 1125 border: none;1126 1134 background: #72777c; 1127 1135 color: #fff; 1128 1136 } 1129 1137 1138 .show-filters .wp-filter .drawer-toggle:hover, 1139 .show-filters .wp-filter .drawer-toggle:focus { 1140 background: rgb(46, 162, 204); 1141 } 1142 1130 1143 .show-filters .wp-filter .drawer-toggle:before { 1131 1144 color: #fff; 1132 1145 } … … 1170 1183 } 1171 1184 1172 1185 .filter-drawer .buttons { 1186 clear: both; 1173 1187 margin-bottom: 20px; 1174 1188 } 1175 1189 1190 .filter-drawer .filter-group + .buttons { 1191 margin-bottom: 0; 1192 padding-top: 20px; 1193 } 1194 1176 1195 .filter-drawer .buttons .button span { 1177 1196 display: inline-block; 1178 1197 opacity: 0.8; … … 1185 1204 margin-left: 10px; 1186 1205 } 1187 1206 1207 .wp-filter .button-link.edit-filters { 1208 color: #0073aa; 1209 text-decoration: underline; 1210 padding: 0 5px; 1211 line-height: 28px; 1212 } 1213 1214 .wp-filter .button-link.edit-filters:hover { 1215 color: #00a0d2; 1216 } 1217 1218 .wp-filter .button-link.edit-filters:focus { 1219 color: #124964; 1220 } 1221 1188 1222 .filtered-by { 1189 1223 display: none; 1190 1224 margin: 0; … … 1226 1260 padding: 20px; 1227 1261 } 1228 1262 1263 .show-filters .favorites-form, 1229 1264 .show-filters .content-filterable, 1230 1265 .show-filters.filters-applied.loading-content .content-filterable, 1231 1266 .loading-content .content-filterable, … … 3721 3756 .filter-drawer .filter-group-feature label { 3722 3757 line-height: 25px; 3723 3758 } 3759 3760 .wp-filter .button.drawer-toggle { 3761 font-size: 13px; 3762 line-height: 26px; 3763 height: 28px; 3764 } 3724 3765 } 3725 3766 3726 3767 /* Smartphone */ -
src/wp-admin/js/theme.js
1523 1523 1524 1524 $( '.filter-links li > a.current' ).removeClass( 'current' ); 1525 1525 $( 'body' ).removeClass( 'show-filters filters-applied show-favorites-form' ); 1526 $( '.drawer-toggle' ).attr( 'aria-expanded', 'false' ); 1526 1527 1527 1528 // Get the themes by sending Ajax POST request to api.wordpress.org/themes 1528 1529 // or searching the local cache … … 1545 1546 'click .filter-drawer .apply-filters': 'applyFilters', 1546 1547 'click .filter-group [type="checkbox"]': 'addFilter', 1547 1548 'click .filter-drawer .clear-filters': 'clearFilters', 1548 'click . filtered-by': 'backToFilters',1549 'click .edit-filters': 'backToFilters', 1549 1550 'click .favorites-form-submit' : 'saveUsername', 1550 1551 'keyup #wporg-username-input': 'saveUsername' 1551 1552 }, … … 1621 1622 event.preventDefault(); 1622 1623 1623 1624 $( 'body' ).removeClass( 'filters-applied show-filters' ); 1625 $( '.drawer-toggle' ).attr( 'aria-expanded', 'false' ); 1624 1626 1625 1627 // Bail if this is already active 1626 1628 if ( $el.hasClass( this.activeClass ) ) { … … 1640 1642 $( '[data-sort="' + sort + '"]' ).addClass( this.activeClass ); 1641 1643 1642 1644 if ( 'favorites' === sort ) { 1643 $ 1645 $( 'body' ).addClass( 'show-favorites-form' ); 1644 1646 } else { 1645 $ 1647 $( 'body' ).removeClass( 'show-favorites-form' ); 1646 1648 } 1647 1649 1648 1650 this.browse( sort ); … … 1692 1694 event.preventDefault(); 1693 1695 } 1694 1696 1697 if ( ! tags ) { 1698 wp.a11y.speak( l10n.selectFeatureFilter ); 1699 return; 1700 } 1701 1695 1702 $( 'body' ).addClass( 'filters-applied' ); 1696 1703 $( '.filter-links li > a.current' ).removeClass( 'current' ); 1697 1704 filteringBy.empty(); … … 1782 1789 1783 1790 // Toggle the full filters navigation 1784 1791 moreFilters: function( event ) { 1792 var $body = $( 'body' ), 1793 $toggleButton = $( '.drawer-toggle' ); 1794 1785 1795 event.preventDefault(); 1786 1796 1787 if ( $ ( 'body' ).hasClass( 'filters-applied' ) ) {1797 if ( $body.hasClass( 'filters-applied' ) ) { 1788 1798 return this.backToFilters(); 1789 1799 } 1790 1800 1791 // If the filters section is opened and filters are checked1792 // run the relevant query collapsing to filtered-by state1793 if ( $( 'body' ).hasClass( 'show-filters' ) && this.filtersChecked() ) {1794 return this.addFilter();1795 }1796 1797 1801 this.clearSearch(); 1798 1802 1799 1803 themes.router.navigate( themes.router.baseUrl( '' ) ); 1800 $( 'body' ).toggleClass( 'show-filters' ); 1804 // Toggle the feature filters view. 1805 $body.toggleClass( 'show-filters' ); 1806 // Toggle the `aria-expanded` button attribute. 1807 $toggleButton.attr( 'aria-expanded', $body.hasClass( 'show-filters' ) ); 1801 1808 }, 1802 1809 1803 1810 // Clears all the checked filters -
src/wp-admin/theme-install.php
37 37 wp_localize_script( 'theme', '_wpThemeSettings', array( 38 38 'themes' => false, 39 39 'settings' => array( 40 'isInstall' 41 'canInstall' 42 'installURI' 43 'adminUrl' 40 'isInstall' => true, 41 'canInstall' => current_user_can( 'install_themes' ), 42 'installURI' => current_user_can( 'install_themes' ) ? self_admin_url( 'theme-install.php' ) : null, 43 'adminUrl' => parse_url( self_admin_url(), PHP_URL_PATH ) 44 44 ), 45 45 'l10n' => array( 46 'addNew' => __( 'Add New Theme' ), 47 'search' => __( 'Search Themes' ), 48 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis) 49 'upload' => __( 'Upload Theme' ), 50 'back' => __( 'Back' ), 51 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), 52 'themesFound' => __( 'Number of Themes found: %d' ), 53 'noThemesFound' => __( 'No themes found. Try a different search.' ), 54 'collapseSidebar' => __( 'Collapse Sidebar' ), 55 'expandSidebar' => __( 'Expand Sidebar' ), 46 'addNew' => __( 'Add New Theme' ), 47 'search' => __( 'Search Themes' ), 48 'searchPlaceholder' => __( 'Search themes...' ), // placeholder (no ellipsis) 49 'upload' => __( 'Upload Theme' ), 50 'back' => __( 'Back' ), 51 'error' => __( 'An unexpected error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the <a href="https://wordpress.org/support/">support forums</a>.' ), 52 'themesFound' => __( 'Number of Themes found: %d' ), 53 'noThemesFound' => __( 'No themes found. Try a different search.' ), 54 'collapseSidebar' => __( 'Collapse Sidebar' ), 55 'expandSidebar' => __( 'Expand Sidebar' ), 56 /* translators: hidden accessibility text */ 57 'selectFeatureFilter' => __( 'Select one or more Theme features to filter by' ), 56 58 ), 57 59 'installedThemes' => array_keys( $installed_themes ), 58 60 ) ); … … 152 154 <li><a href="#" data-sort="favorites"><?php _ex( 'Favorites', 'themes' ); ?></a></li> 153 155 </ul> 154 156 155 < a class="drawer-toggle" href="#"><?php _e( 'Feature Filter' ); ?></a>157 <button type="button" class="button drawer-toggle" aria-expanded="false"><?php _e( 'Feature Filter' ); ?></button> 156 158 157 159 <div class="search-form"></div> 158 160 … … 178 180 179 181 <div class="filter-drawer"> 180 182 <div class="buttons"> 181 < a class="apply-filters button button-secondary" href="#"><?php _e( 'Apply Filters' ); ?><span></span></a>182 < a class="clear-filters button button-secondary" href="#"><?php _e( 'Clear' ); ?></a>183 <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button> 184 <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> 183 185 </div> 184 186 <?php 185 187 $feature_list = get_theme_feature_list(); … … 197 199 echo '</fieldset>'; 198 200 } 199 201 ?> 202 <div class="buttons"> 203 <button type="button" class="apply-filters button"><?php _e( 'Apply Filters' ); ?><span></span></button> 204 <button type="button" class="clear-filters button" aria-label="<?php esc_attr_e( 'Clear current filters' ); ?>"><?php _e( 'Clear' ); ?></button> 205 </div> 200 206 <div class="filtered-by"> 201 207 <span><?php _e( 'Filtering by:' ); ?></span> 202 208 <div class="tags"></div> 203 < a href="#"><?php _e( 'Edit' ); ?></a>209 <button type="button" class="button-link edit-filters"><?php _e( 'Edit Filters' ); ?></button> 204 210 </div> 205 211 </div> 206 212 </div>