Making WordPress.org

Changeset 1453


Ignore:
Timestamp:
03/26/2015 12:43:29 AM (10 years ago)
Author:
obenland
Message:

WP.org Themes: Don't create a /preview/ URL for previews.

The default has always been wp-themes.com. Let's keep it that way and handle
the integrated preview in JS only.

Also provides a better fix for #901. If themes are advanced in preview, the
modal keeps up with that now.

Fixes #895.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    r1452 r1453  
    512512            this.setNavButtonsState();
    513513
    514             // Hide previous/next navigation if there is only one theme
    515             if ( this.model.collection.length === 1 ) {
    516                 preview.$el.addClass( 'no-navigation' );
    517             } else {
    518                 preview.$el.removeClass( 'no-navigation' );
    519             }
    520 
    521514            if ( themes.data.settings.isMobile ) {
    522515                preview.$el.addClass( 'wp-full-overlay collapsed' );
     
    531524            // for `theme:next` and `theme:previous` events.
    532525            this.listenTo( preview, 'theme:next', function() {
     526                this.trigger( 'theme:next' );
     527
    533528                // Keep local track of current theme model.
    534529                current = self.model;
     
    556551            })
    557552            .listenTo( preview, 'theme:previous', function() {
     553                this.trigger( 'theme:previous' );
     554
    558555                // Keep track of current theme model.
    559556                current = self.model;
     
    813810            this.$el.html( this.html( data ) );
    814811
    815             themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) + '/preview' ) );
     812            themes.router.navigate( themes.router.baseUrl( themes.router.themePath + this.model.get( 'id' ) ) );
    816813
    817814            this.$el.fadeIn( 200, function() {
     
    10731070            // Sanity check which also serves as a boundary test
    10741071            if ( nextModel !== undefined ) {
    1075 
    1076                 // We have a new theme...
    1077                 // Close the overlay
    1078                 this.overlay.closeOverlay();
    1079 
    10801072                // Trigger a route update for the current model
    10811073                self.theme.trigger( 'theme:expand', nextModel.cid );
    1082 
    10831074            }
    10841075        },
     
    10971088
    10981089            if ( previousModel !== undefined ) {
    1099 
    1100                 // We have a new theme...
    1101                 // Close the overlay
    1102                 this.overlay.closeOverlay();
    1103 
    11041090                // Trigger a route update for the current model
    11051091                self.theme.trigger( 'theme:expand', previousModel.cid );
    1106 
    11071092            }
    11081093        }
     
    14611446            'search/:query/' : 'search',
    14621447            'author/:author/': 'author',
    1463             ':slug/preview/' : 'preview',
    14641448            ':slug/'         : 'preview',
    14651449            ''               : 'sort'
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme-preview.php

    r1374 r1453  
    1212                <span class="theme-by"><?php printf( __( 'By %s' ), '{{ data.author.display_name }}' ); ?></span>
    1313
    14                 <img class="theme-screenshot" src="{{ data.screenshot_url }}" alt="" />
     14                <img class="theme-screenshot" src="{{ data.screenshot_url }}?w=520&strip=all" alt="" />
    1515
    1616                <div class="theme-details">
Note: See TracChangeset for help on using the changeset viewer.