Making WordPress.org

Changeset 1265


Ignore:
Timestamp:
02/16/2015 11:10:16 PM (12 years ago)
Author:
obenland
Message:

WP.org Themes: Don't prevent opening themes in new tabs.

Wrapps the anchor around all child elements of .theme to allow users to
either right-click and choose to open the link in a new tab, or click the link
with a meta modifier key pressed (command/Ctrl).

Fixes #844.

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

Legend:

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

    r1239 r1265  
    44?>
    55<article id="post-<?php echo $theme->slug; ?>" class="theme hentry">
    6         <div class="theme-screenshot">
    7                 <img src="<?php echo esc_url( $theme->screenshot_url . '?w=572&strip=all' ); ?>" alt="">
    8         </div>
    9         <a class="more-details url" href="<?php echo esc_url( home_url( $theme->slug . '/' ) ); ?>" rel="bookmark"><?php _ex( 'More Info', 'theme' ); ?></a>
    10         <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></div>
    11         <h3 class="theme-name entry-title"><?php echo $theme->name; ?></h3>
     6        <a class="url" href="<?php echo esc_url( home_url( $theme->slug . '/' ) ); ?>" rel="bookmark" tabindex="-1">
     7                <div class="theme-screenshot">
     8                        <img src="<?php echo esc_url( $theme->screenshot_url . '?w=572&strip=all' ); ?>" alt="">
     9                </div>
     10                <span class="more-details"><?php _ex( 'More Info', 'theme' ); ?></span>
     11                <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">' . $theme->author . '</span>' ); ?></div>
     12                <h3 class="theme-name entry-title"><?php echo $theme->name; ?></h3>
    1213
    13         <div class="theme-actions">
    14                 <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
    15         </div>
     14                <div class="theme-actions">
     15                        <a class="button button-primary preview install-theme-preview" href="<?php echo esc_url( '//downloads.wordpress.org/theme/' . $theme->slug . '.' . $theme->version . '.zip' ); ?>"><?php esc_html_e( 'Download' ); ?></a>
     16                </div>
     17        </a>
    1618</article>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/js/theme.js

    r1257 r1265  
    154154
    155155                        event = event || window.event;
     156
     157                        // Don't handle click if command/Ctrl are pressed to open the link in a new tab.
     158                        if ( true === event.metaKey && 'click' === event.type ) {
     159                                return;
     160                        }
    156161
    157162                        // 'enter' and 'space' keys expand the details view when a theme is :focused
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-themes/view-templates/theme.php

    r1250 r1265  
    11<script id="tmpl-theme" type="text/template">
    2         <# if ( data.screenshot_url ) { #>
    3         <div class="theme-screenshot">
    4                 <img src="{{ data.screenshot_url }}?w=572&strip=all" alt="" />
    5         </div>
    6         <# } else { #>
    7         <div class="theme-screenshot blank"></div>
    8         <# } #>
    9         <a class="more-details url" href="{{{ data.permalink }}}" rel="bookmark" tabindex="-1"><?php _ex( 'More Info', 'theme' ); ?></a>
    10         <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">{{ data.author }}</span>' ); ?></div>
    11         <h3 class="theme-name entry-title">{{{ data.name }}}</h3>
     2        <a class="url" href="{{{ data.permalink }}}" rel="bookmark" tabindex="-1">
     3                <# if ( data.screenshot_url ) { #>
     4                <div class="theme-screenshot">
     5                        <img src="{{ data.screenshot_url }}?w=572&strip=all" alt="" />
     6                </div>
     7                <# } else { #>
     8                <div class="theme-screenshot blank"></div>
     9                <# } #>
     10                <span class="more-details"><?php _ex( 'More Info', 'theme' ); ?></span>
     11                <div class="theme-author"><?php printf( __( 'By %s' ), '<span class="author">{{ data.author }}</span>' ); ?></div>
     12                <h3 class="theme-name entry-title">{{{ data.name }}}</h3>
    1213
    13         <div class="theme-actions">
    14                 <a class="button button-primary preview install-theme-preview" href="//downloads.wordpress.org/theme/{{ data.slug }}.{{ data.version }}.zip"><?php esc_html_e( 'Download' ); ?></a>
    15         </div>
     14                <div class="theme-actions">
     15                        <a class="button button-primary preview install-theme-preview" href="//downloads.wordpress.org/theme/{{ data.slug }}.{{ data.version }}.zip"><?php esc_html_e( 'Download' ); ?></a>
     16                </div>
     17        </a>
    1618</script>
Note: See TracChangeset for help on using the changeset viewer.