Changeset 1375
- Timestamp:
- 03/04/2015 12:02:15 PM (8 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/functions.php
r1374 r1375 49 49 wp_localize_script( 'theme', '_wpThemeSettings', array( 50 50 'themes' => false, 51 'query' => wporg_themes_prepare_themes_for_js(), 51 52 'settings' => array( 52 53 'title' => __( 'WordPress › %s « Free WordPress Themes', 'wporg-themes' ), … … 110 111 } 111 112 add_filter( 'wp_title', 'wporg_themes_wp_title', 10, 2 ); 113 114 /** 115 * Bootstraps found themes for the frontend JS handler. 116 * 117 * @return array 118 */ 119 function wporg_themes_prepare_themes_for_js() { 120 global $wp_query; 121 122 include_once API_WPORGPATH . 'themes/info/1.0/class-themes-api.php'; 123 $api = new Themes_API( 'get_result' ); 124 $api->fields = array_merge( $api->fields, array( 125 'description' => true, 126 'sections' => false, 127 'tested' => true, 128 'requires' => true, 129 'rating' => true, 130 'ratings' => true, 131 'downloaded' => true, 132 'downloadlink' => true, 133 'last_updated' => true, 134 'homepage' => true, 135 'tags' => true, 136 'num_ratings' => true, 137 'parent' => true, 138 ) ); 139 140 $themes = array_map( array( $api, 'fill_theme' ), $wp_query->posts ); 141 $themes = array_map( 'wporg_themes_ajax_prepare_theme', $themes ); 142 143 $request = array(); 144 if ( get_query_var( 'browse' ) ) { 145 $request['browse'] = get_query_var( 'browse' ); 146 } else if ( $wp_query->is_tag() ) { 147 $request['tag'] = (array) explode( '+', get_query_var( 'tag' ) ); 148 } 149 else if ( $wp_query->is_search() ) { 150 $request['search'] = get_query_var( 's' ); 151 } 152 else if ( $wp_query->is_author() ) { 153 $request['author'] = get_user_by( 'id', get_query_var( 'author' ) )->user_nicename; 154 } 155 else if ( $wp_query->is_singular( 'repopackage' ) ) { 156 $request['theme'] = get_query_var( 'name' ); 157 } 158 159 return array( 160 'themes' => $themes, 161 'request' => $request, 162 'total' => $wp_query->found_posts, 163 ); 164 } 112 165 113 166 /** -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/index.php
r1274 r1375 63 63 64 64 <div class="theme-browser content-filterable"> 65 <div class="themes" style="display:none;">65 <div class="themes"> 66 66 <?php 67 67 while ( have_posts() ) : -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js
r1373 r1375 644 644 routes: { 645 645 'browse/:sort/' : 'sort', 646 'tags/:tag/' 646 'tags/:tag/' : 'tag', 647 647 'search/:query/' : 'search', 648 648 'author/:author/': 'author', … … 665 665 666 666 _.extend( wp.themes.RunInstaller, { 667 extraRoutes: function() {667 routes: function() { 668 668 var self = this, 669 request = {}; 670 671 // Open the modal when matching the route for a single themes. 669 request = {}; 670 671 // Bind to our global `wp.themes` object 672 // so that the router is available to sub-views 673 wp.themes.router = new wp.themes.InstallerRouter(); 674 675 // Handles `theme` route event 676 // Queries the API for the passed theme slug 672 677 wp.themes.router.on( 'route:preview', function( slug ) { 678 self.view.collection.queries.push( wp.themes.data.query ); 679 680 request.theme = slug; 681 self.view.collection.query( request ); 682 673 683 $( '.close-full-overlay' ).trigger( 'click' ); 674 this.listenToOnce( self.view.collection, 'query:success', function() { 675 self.view.view.expand( slug ); 676 }); 684 self.view.view.expand( slug ); 685 }); 686 687 // Handles sorting / browsing routes 688 // Also handles the root URL triggering a sort request 689 // for `featured`, the default view 690 wp.themes.router.on( 'route:sort', function( sort ) { 691 self.view.collection.queries.push( wp.themes.data.query ); 692 693 if ( ! sort ) { 694 sort = 'featured'; 695 } 696 self.view.sort( sort ); 697 self.view.trigger( 'theme:close' ); 698 }); 699 700 // The `search` route event. The router populates the input field. 701 wp.themes.router.on( 'route:search', function() { 702 self.view.collection.queries.push( wp.themes.data.query ); 703 704 $( '.wp-filter-search' ).focus().trigger( 'keyup' ); 677 705 }); 678 706 679 707 wp.themes.router.on( 'route:tag', function( tag ) { 708 self.view.collection.queries.push( wp.themes.data.query ); 709 680 710 _.each( tag.split( '+' ), function( tag ) { 681 711 $( '#filter-id-' + tag ).prop( 'checked', true ); … … 686 716 687 717 wp.themes.router.on( 'route:author', function( author ) { 718 self.view.collection.queries.push( wp.themes.data.query ); 719 688 720 request.author = author; 689 721 self.view.collection.query( request ); 690 722 wp.themes.utils.title( author ); 691 723 }); 724 725 this.extraRoutes(); 692 726 } 693 727 }); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/style.css
r1331 r1375 271 271 * Theme heading information 272 272 */ 273 .single.single-repopackage .themes .theme-wrap { 274 visibility: hidden; 275 } 273 276 .single .theme-wrap .current-label { 274 277 background: #333;
Note: See TracChangeset
for help on using the changeset viewer.