diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 5060fff082..2895932525 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -923,6 +923,314 @@ th.action-links { text-align: right; } +/* Filter bar */ + +.wp-title-count { + display: inline; + position: relative; + top: -3px; + margin-left: 5px; + margin-right: 20px; + padding: 4px 10px; + -webkit-border-radius: 30px; + border-radius: 30px; + background: #777; + color: #fff; + font-size: 14px; + font-weight: 600; +} + +.wp-filter { + display: inline-block; + position: relative; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + margin: 12px 0 25px; + padding: 0 20px; + width: 100%; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); + box-shadow: 0 1px 1px rgba(0,0,0,0.04); + border: 1px solid #e5e5e5; + background: #fff; + color: #555; + font-size: 13px; +} + +.wp-filter a { + text-decoration: none; +} + +.wp-filter-count { + display: inline-block; + vertical-align: middle; + min-width: 4em; +} + +.wp-filter-count .count { + display: inline-block; + position: relative; + top: -1px; + padding: 4px 10px; + -webkit-border-radius: 30px; + border-radius: 30px; + background: #777; + color: #fff; + font-size: 14px; + font-weight: 600; +} + +.wp-filter-links { + display: inline-block; + margin: 0; +} + +.wp-filter-links li { + display: inline-block; + margin: 0; +} + +.wp-filter-link { + display: inline-block; + margin: 0 10px; + padding: 15px 0; + border-bottom: 4px solid #fff; + color: #666; + cursor: pointer; +} + +.wp-filter-links .current { + border-bottom: 4px solid #666; + color: #222; +} + +.wp-filter-search { + position: absolute; + top: 9px; + right: 10px; + left: auto; + padding: 3px 5px; + width: 280px; + font-size: 16px; + font-weight: 300; + line-height: 1.5; +} + +.wp-filter-drawer-toggle { + display: inline-block; + margin: 0 10px; + padding: 4px 6px; + color: #666; + cursor: pointer; +} + +.wp-filter-drawer-toggle:before { + display: inline-block; + vertical-align: top; + content: "\f111"; + margin: 0 5px 0 0; + width: 16px; + height: 16px; + color: #777; + -webkit-transition: color .1s ease-in 0; + transition: color .1s ease-in 0; + font-family: "dashicons"; + font-size: 16px; + line-height: 1; + text-align: center; + text-decoration: inherit; + font-weight: normal; + font-style: normal; + -webkit-font-smoothing: antialiased; +} + +.wp-filter-drawer-toggle:hover { + color: #777; +} + +.wp-filter-drawer-toggle.current:before { + color: #fff; +} + +.wp-filter-drawer { + display: none; + margin: 0 -20px; + padding: 20px; + border-top: 1px solid #eee; + background: #fafafa; +} + +body.show-filter-drawer .wp-filter-drawer { + display: block; + overflow: hidden; +} + +body.show-filter-drawer .wp-filter-drawer-toggle:hover, +body.show-filter-drawer .wp-filter-drawer-toggle:focus { + background: rgb(46, 162, 204); +} + +body.show-filter-drawer .wp-filter-link.current { + border-bottom: none; +} + +body.show-filter-drawer .wp-filter-drawer-toggle { + -webkit-border-radius: 2px; + border-radius: 2px; + border: none; + background: #777; + color: #fff; +} + +body.show-filter-drawer .wp-filter-drawer-toggle:before { + color: #fff; +} + +.wp-filter-group { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + float: left; + margin: 0 1% 0 0; + padding: 10px; + width: 19%; + background: #fff; + border: 1px solid #e5e5e5; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); + box-shadow: 0 1px 1px rgba(0,0,0,0.04); +} + +.wp-filter-group-wide { + width: 38%; +} + +.wp-filter-group-title { + position: relative; + margin: 0; +} + +.wp-filter-drawer ol { + margin: 20px 0 0; + list-style-type: none; + font-size: 12px; +} + +.wp-filter-drawer li { + display: inline-block; + vertical-align: top; + margin: 5px 0; + padding-right: 25px; + width: 160px; + list-style-type: none; +} + +.wp-filter-drawer-buttons { + margin-bottom: 20px; +} + +.wp-filter .wp-filter-drawer-buttons .button span { + display: inline-block; + opacity: 0.8; + font-size: 12px; + text-indent: 10px; +} + +.wp-filter .button.clear-filters { + display: none; + margin: 0 0 20px 10px; +} + +.wp-filter-by { + display: none; + margin: 0; +} + +.wp-filter-by > span { + font-weight: 600; +} + +.wp-filter-by a { + margin-left: 10px; +} + +.wp-filter-by .tags { + display: inline; +} + +.wp-filter-by .tag { + margin: 0 5px; + padding: 4px 8px; + border: 1px solid #e5e5e5; + -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); + box-shadow: 0 1px 1px rgba(0,0,0,0.04); + background: #fff; + font-size: 11px; +} + +body.filters-applied .wp-filter-group, +body.filters-applied .wp-filter-drawer a.button, +body.filters-applied .wp-filter-drawer br { + display: none !important; +} + +body.filters-applied .wp-filter-by { + display: block; +} + +body.filters-applied .wp-filter-drawer { + padding: 20px; +} + +body.show-filter-drawer .wp-filter-content, +body.show-filter-drawer.filters-applied.loading-content .wp-filter-content { + display: none; +} + +body.show-filter-drawer.filters-applied .wp-filter-content { + display: block; +} + +.loading-content .wp-filter-content, +.error .wp-filter-content { + display: none; +} + +.loading-content .spinner { + display: block; + margin: 40px auto 0; + float: none; +} + +@media only screen and (max-width: 1120px) { + .wp-filter-search { + position: static; + margin: 20px 0; + width: 100%; + } + + .wp-filter-drawer { + border-bottom: 1px solid #eee; + } + + .wp-filter-group { + margin-bottom: 0; + margin-top: 5px; + width: 100%; + } + + .wp-filter-group li { + margin: 10px 0; + } +} + +@media only screen and (max-width: 782px) { + .wp-filter-group, + .wp-filter-group li { + width: 100%; + } + +} + /*------------------------------------------------------------------------------ 4.0 - Notifications diff --git a/src/wp-admin/css/themes.css b/src/wp-admin/css/themes.css index 3a2773da4d..2add665641 100644 --- a/src/wp-admin/css/themes.css +++ b/src/wp-admin/css/themes.css @@ -25,23 +25,16 @@ margin-left: 20px; } -.themes-php .wrap .theme-count, -.theme-navigation .theme-count { - color: #fff; - -webkit-border-radius: 30px; - border-radius: 30px; - background: #777; - font-size: 14px; - padding: 4px 10px; - font-weight: 600; - margin-left: 5px; - margin-right: 20px; +/* Search form */ +.themes-php .wp-filter-search { position: relative; - top: -3px; -} - -.theme-navigation a { - text-decoration:none; + top: -2px; + left: 20px; + margin: 0; + width: 280px; + font-size: 16px; + font-weight: 300; + line-height: 1.5; } /* Position admin messages */ @@ -401,19 +394,6 @@ z-index: 2; } -/* - * The search form - */ -.themes-php .theme-search { - position: relative; - top: -2px; - left: 20px; - font-size: 16px; - font-weight: 300; - line-height: 1.5; - width: 280px; -} - /** * Theme Overlay * Shown when clicking a theme @@ -1025,7 +1005,7 @@ body.folded .theme-overlay .theme-wrap { width: 100%; } - .themes-php .theme-search { + .themes-php .wp-filter-search { float: none; clear: both; left: 0; @@ -1088,21 +1068,6 @@ body.folded .theme-overlay .theme-wrap { display: none !important; } -.theme-navigation { - background: #fff; - -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); - box-shadow: 0 1px 1px 0 rgba(0,0,0,.1); - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - color: #555; - display: inline-block; - font-size: 13px; - margin: 20px 0 30px; - padding: 0 20px; - position: relative; - width: 100%; -} .theme-install-php a.upload, .theme-install-php a.browse-themes { cursor: pointer; @@ -1119,7 +1084,7 @@ body.folded .theme-overlay .theme-wrap { -moz-box-sizing: border-box; box-sizing: border-box; display: none; - margin: 0px 0 0; + margin: 0; padding: 0; width: 100%; overflow: hidden; @@ -1144,191 +1109,11 @@ body.show-upload-theme .upload-theme { padding: 40px 0 0; text-align: center; } -body.show-upload-theme .upload-theme + .theme-navigation, -body.show-upload-theme .upload-theme + .theme-navigation + .theme-browser { +body.show-upload-theme .upload-theme + .wp-filter, +body.show-upload-theme .upload-theme + .wp-filter + .theme-browser { display: none; } -.theme-navigation .theme-count { - margin-left: 0; - position: absolute; - top: 12px; -} -.theme-count + .theme-section { - margin-left: 60px; -} -.theme-section, -.theme-filter { - border-bottom: 4px solid #fff; - color: #666; - cursor: pointer; - display: inline-block; - margin: 0 10px; - padding: 15px 0; -} -.theme-section.current, -.theme-filter.current { - border-bottom: 4px solid #666; - color: #222; -} -.theme-top-filters { - display: inline-block; -} -.theme-navigation .more-filters { - color: #666; - cursor: pointer; - display: inline-block; - margin: 0 10px; - padding: 4px 6px; -} -body.more-filters-opened .more-filters { - background: #777; - -webkit-border-radius: 2px; - border-radius: 2px; - border: none; - color: #fff; -} -body.more-filters-opened .more-filters:before { - color: #fff; -} - -body.more-filters-opened .more-filters:hover, -body.more-filters-opened .more-filters:focus { - background: rgb(46, 162, 204); -} - -.theme-install-php .theme-search { - position: absolute; - right: 10px; - top: 9px; - font-size: 16px; - font-weight: 300; - line-height: 1.5; - width: 280px; -} -.more-filters:before { - color: #777; - text-align: center; - margin: 0 5px 0 0; - content: "\f111"; - display: inline-block; - width: 16px; - height: 16px; - -webkit-font-smoothing: antialiased; - font-size: 16px; - line-height: 1; - font-family: "dashicons"; - text-decoration: inherit; - font-weight: normal; - font-style: normal; - vertical-align: top; - -webkit-transition: color .1s ease-in 0; - transition: color .1s ease-in 0; - text-align: center; -} -.more-filters.current:before { - color: #fff; -} -.more-filters-container { - display: none; - padding: 20px; - border-top: 1px solid #eee; - margin: 0 -20px; - background: #fafafa; -} -body.more-filters-opened .more-filters-container { - display: block; - overflow: hidden; -} -body.more-filters-opened .theme-section.current { - border-bottom: none; -} -body.more-filters-opened .theme-browser, -body.more-filters-opened.filters-applied.loading-themes .theme-browser { - display: none; -} -body.more-filters-opened.filters-applied .theme-browser { - display: block; -} -.more-filters-container .filters-group { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; - float: left; - width: 19%; - background: #fff; - margin: 0 1% 0 0; - border: 1px solid #e5e5e5; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); - box-shadow: 0 1px 1px rgba(0,0,0,0.04); - padding: 10px; -} -.more-filters-container .wide-filters-group { - width: 38%; -} -.more-filters-container .feature-name { - margin: 0; - position: relative; -} -.more-filters-container ol { - list-style-type: none; - margin: 20px 0 0; - font-size: 12px; -} -.more-filters-container li { - display: inline-block; - vertical-align: top; - list-style-type: none; - margin: 5px 0; - padding-right: 25px; - width: 160px; -} -.theme-navigation .more-filters-container .apply-filters { - margin: 0 0 20px; -} -.theme-navigation .more-filters-container .clear-filters { - display: none; - margin: 0 0 20px 10px; -} -.more-filters-container .apply-filters span { - display: inline-block; - font-size: 12px; - text-indent: 10px; - opacity: 0.8; -} -.more-filters-container .filtering-by { - display: none; - margin: 0; -} -.more-filters-container .filtering-by > span { - font-weight: 600; -} -.more-filters-container .filtering-by .tags { - display: inline; -} -.more-filters-container .filtering-by .tag { - background: #fff; - border: 1px solid #e5e5e5; - -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.04); - box-shadow: 0 1px 1px rgba(0,0,0,0.04); - font-size: 11px; - margin: 0 5px; - padding: 4px 8px; -} -.more-filters-container .filtering-by a { - margin-left: 10px; -} -body.filters-applied .more-filters-container .filters-group, -body.filters-applied .more-filters-container a.button, -body.filters-applied .more-filters-container br { - display: none !important; -} -body.filters-applied .more-filters-container .filtering-by { - display: block; -} -body.filters-applied .more-filters-container { - padding: 20px; -} p.no-themes { color: #999; font-size: 18px; @@ -1345,20 +1130,11 @@ body.show-upload-theme p.no-themes { display: none !important; } - .theme-install-php .add-new-theme { display: none !important; } @media only screen and (max-width: 1120px) { - .theme-install-php .theme-search { - margin: 20px 0; - position: static; - width: 100%; - } - .more-filters-container { - border-bottom: 1px solid #eee; - } .upload-theme .wp-upload-form { margin: 20px 0; max-width: 100%; @@ -1368,23 +1144,6 @@ body.show-upload-theme p.no-themes { padding: 20px 0 0; text-align: left; } - .more-filters-container .filters-group { - margin-bottom: 0; - margin-top: 5px; - width: 100%; - } - .more-filters-container .filters-group li { - margin: 10px 0; - } -} - -@media only screen and (max-width: 782px) { - .more-filters-container .filters-group { - width: 100%; - } - .more-filters-container .filters-group li { - width: 100%; - } } .rating { @@ -1448,15 +1207,6 @@ body.show-upload-theme p.no-themes { line-height: 20px; color: #999; } -.loading-themes .theme-browser, -.error .theme-browser { - display: none; -} -.loading-themes .spinner { - display: block; - margin: 40px auto 0; - float: none; -} /*------------------------------------------------------------------------------ 16.3 - Custom Header Screen diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index c13f917b57..2236498a29 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -105,7 +105,7 @@ themes.view.Appearance = wp.Backbone.View.extend({ // Render and append after screen title view.render(); this.searchContainer - .append( $.parseHTML( '' ) ) + .append( $.parseHTML( '' ) ) .append( view.el ); }, @@ -342,7 +342,7 @@ themes.Collection = Backbone.Collection.extend({ beforeSend: function() { if ( ! paginated ) { // Spin it - $( 'body' ).addClass( 'loading-themes' ).removeClass( 'no-results' ); + $( 'body' ).addClass( 'loading-content' ).removeClass( 'no-results' ); } } }); @@ -1080,8 +1080,8 @@ themes.view.Themes = wp.Backbone.View.extend({ themes.view.Search = wp.Backbone.View.extend({ tagName: 'input', - className: 'theme-search', - id: 'theme-search-input', + className: 'wp-filter-search', + id: 'wp-filter-search-input', searching: false, attributes: { @@ -1168,11 +1168,11 @@ themes.Router = Backbone.Router.extend({ }, search: function( query ) { - $( '.theme-search' ).val( query ); + $( '.wp-filter-search' ).val( query ); }, themes: function() { - $( '.theme-search' ).val( '' ); + $( '.wp-filter-search' ).val( '' ); }, navigate: function() { @@ -1229,7 +1229,7 @@ themes.Run = { // Handles search route event themes.router.on( 'route:search', function() { - $( '.theme-search' ).trigger( 'keyup' ); + $( '.wp-filter-search' ).trigger( 'keyup' ); }); this.extraRoutes(); @@ -1288,8 +1288,8 @@ themes.view.InstallerSearch = themes.view.Search.extend({ request.tag = [ value.slice( 4 ) ]; } - $( '.theme-section.current' ).removeClass( 'current' ); - $( 'body' ).removeClass( 'more-filters-opened filters-applied' ); + $( '.wp-filter-link.current' ).removeClass( 'current' ); + $( 'body' ).removeClass( 'show-filter-drawer filters-applied' ); // Get the themes by sending Ajax POST request to api.wordpress.org/themes // or searching the local cache @@ -1306,14 +1306,14 @@ themes.view.Installer = themes.view.Appearance.extend({ // Register events for sorting and filters in theme-navigation events: { - 'click .theme-section': 'onSort', + 'click .wp-filter-link': 'onSort', 'click .theme-filter': 'onFilter', - 'click .more-filters': 'moreFilters', - 'click .apply-filters': 'applyFilters', - 'click [type="checkbox"]': 'addFilter', - 'click .clear-filters': 'clearFilters', - 'click .feature-name': 'filterSection', - 'click .filtering-by a': 'backToFilters' + 'click .wp-filter-drawer-toggle': 'moreFilters', + 'click .wp-filter-drawer .apply-filters': 'applyFilters', + 'click .wp-filter-group [type="checkbox"]': 'addFilter', + 'click .wp-filter-drawer .clear-filters': 'clearFilters', + 'click .wp-filter-group-title': 'filterSection', + 'click .wp-filter-by a': 'backToFilters' }, // Initial render method @@ -1343,12 +1343,12 @@ themes.view.Installer = themes.view.Appearance.extend({ }); this.listenTo( this.collection, 'query:success', function() { - $( 'body' ).removeClass( 'loading-themes' ); + $( 'body' ).removeClass( 'loading-content' ); $( '.theme-browser' ).find( 'div.error' ).remove(); }); this.listenTo( this.collection, 'query:fail', function() { - $( 'body' ).removeClass( 'loading-themes' ); + $( 'body' ).removeClass( 'loading-content' ); $( '.theme-browser' ).find( 'div.error' ).remove(); $( '.theme-browser' ).find( 'div.themes' ).before( '
' + l10n.error + '