Making WordPress.org

Changeset 1209


Ignore:
Timestamp:
01/30/2015 10:28:07 PM (8 years ago)
Author:
obenland
Message:

WP.org Themes: Designate More Info as a link to the theme.

This brings the view en par with its PHP implementation.
More importantly, it enables users to right-click the theme
to open it in a new tab.

See http://make.wordpress.org/meta/2015/01/23/theme-directory-mockups/
See #745.

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

    r1188 r1209  
    1919            'touchmove': 'preventExpand'
    2020        },
     21
     22        render: function() {
     23            var data = this.model.toJSON();
     24
     25            data.permalink = wp.themes.router.baseUrl( data.slug );
     26
     27            // Render themes using the html template
     28            this.$el.html( this.html( data ) ).attr({
     29                tabindex: 0,
     30                'aria-describedby' : data.id + '-action ' + data.id + '-name'
     31            });
     32        },
     33
     34        // Single theme overlay screen
     35        // It's shown when clicking a theme
     36        expand: function( event ) {
     37            var self = this;
     38
     39            event = event || window.event;
     40
     41            // 'enter' and 'space' keys expand the details view when a theme is :focused
     42            if ( event.type === 'keydown' && ( event.which !== 13 && event.which !== 32 ) ) {
     43                return;
     44            }
     45
     46            // Bail if the user scrolled on a touch device
     47            if ( this.touchDrag === true ) {
     48                return this.touchDrag = false;
     49            }
     50
     51            // Prevent the modal from showing when the user clicks
     52            // one of the direct action buttons
     53            if ( $( event.target ).is( '.theme-actions a' ) ) {
     54                return;
     55            }
     56
     57            // Set focused theme to current element
     58            themes.focusedTheme = this.$el;
     59
     60            this.trigger( 'theme:expand', self.model.cid );
     61            event.preventDefault();
     62        }
    2163    });
    2264
     
    4183            data.is_outdated = updated.setYear(updated.getYear() + 1902).valueOf() < new Date().valueOf();
    4284
    43             // Make tags clickable and seprated by a comma.
     85            // Make tags click-able and separated by a comma.
    4486            data.tags = _.map( data.tags, function( tag ) {
    45                 return '<a href="'+wp.themes.data.settings.adminUrl+'tag/'+tag+'/">'+tag+'</a>';
     87                return '<a href="' + wp.themes.router.baseUrl( 'tag/' + tag ) + '">' + tag + '</a>';
    4688            }).join( ', ' );
    4789
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php

    r1034 r1209  
    77    <div class="theme-screenshot blank"></div>
    88    <# } #>
    9     <span class="more-details "><?php _ex( 'More Info', 'theme' ); ?></span>
     9    <a class="more-details url" href="{{{ data.permalink }}}" rel="bookmark"><?php _ex( 'More Info', 'theme' ); ?></a>
    1010    <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">{{ data.author }}</span>' ); ?></div>
    1111    <h3 class="theme-name entry-title">{{ data.name }}</h3>
Note: See TracChangeset for help on using the changeset viewer.