WordPress.org

Make WordPress Core

Changeset 29125


Ignore:
Timestamp:
07/12/2014 10:07:16 PM (7 years ago)
Author:
ocean90
Message:

Improvements to the plugin information modal:

  • Whitespace/braces cleanup for [29040].
  • Reduce width of modal to 792px, which is the default banner size.
  • Reduce banner height when screen height is smaller than 500px.
  • Remove inline CSS.
  • Re-use tab var in JS.
  • Encode ampersands in links.

props avryl, michalzuber, ocean90.
see #27440.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/common.css

    r29077 r29125  
    18361836}
    18371837
    1838 @media only screen and (max-width: 800px) {
    1839     #plugin-information-title.with-banner {
    1840         height: 100px;
    1841         bottom: 100px;
    1842     }
    1843 }
    1844 
    18451838#plugin-information-title h2 {
    18461839    font-family: "Helvetica Neue", sans-serif;
     
    18691862}
    18701863
    1871 @media only screen and (max-width: 800px) {
    1872     #plugin-information-title.with-banner h2 {
    1873         top: 12px;
    1874         font-size: 20px;
    1875         line-height: 40px;
    1876     }
    1877 }
    1878 
    18791864#plugin-information-title div.vignette {
    18801865    display: none;
     
    18921877}
    18931878
    1894 @media only screen and (max-width: 800px) {
    1895     #plugin-information-title.with-banner div.vignette {
    1896         height: 65px;
    1897         bottom: 65px;
    1898         width: 800%;
    1899     }
    1900 }
    1901 
    19021879#plugin-information-tabs {
    19031880    padding: 0 16px;
     
    19111888
    19121889#plugin-information-tabs.with-banner {
    1913     top: 215px;
     1890    top: 214px;
    19141891    background: rgba( 255, 255, 255, 0.85 );
    1915 }
    1916 
    1917 @media only screen and (max-width: 800px) {
    1918     #plugin-information-tabs.with-banner {
    1919         top: 65px;
    1920     }
    19211892}
    19221893
     
    19241895    position: relative;
    19251896    float: left;
    1926     padding: 8px 10px 9px;
     1897    padding: 9px 10px;
    19271898    margin: 0;
    19281899    height: 18px;
     
    19351906
    19361907#plugin-information-tabs a.current {
    1937     margin: -1px -1px 0;
     1908    margin: 0 -1px 0;
    19381909    background: #fff;
    19391910    border: 1px solid #ddd;
    19401911    border-bottom: none;
     1912    padding-top: 8px;
    19411913    color: #333;
     1914}
     1915
     1916#plugin-information-tabs.with-banner a.current {
     1917    border-top: none;
     1918    padding-top: 9px;
    19421919}
    19431920
     
    19521929    border-bottom: 1px solid #ddd;
    19531930    position: absolute;
    1954     top: 90px;
     1931    top: 91px;
    19551932    right: 0;
    19561933    bottom: 58px;
    19571934    left: 0;
     1935    overflow: auto;
    19581936}
    19591937
    19601938#plugin-information-content.with-banner {
    1961     top:249px;
    1962 }
    1963 
    1964 @media only screen and (max-width: 800px) {
    1965     #plugin-information-content.with-banner {
    1966         top:99px;
    1967     }
     1939    border-top: none;
     1940    top: 250px;
    19681941}
    19691942
     
    20251998}
    20261999
     2000#plugin-information .counter-container {
     2001    margin: 3px 0;
     2002}
     2003
    20272004#plugin-information .counter-label {
    20282005    float: left;
     
    21192096}
    21202097
    2121 @media screen and ( max-width: 782px ) {
    2122     #plugin-information-content {
    2123         overflow: auto;
    2124         bottom: 58px;
     2098@media screen and ( max-width: 771px ), screen and ( max-height: 500px ) {
     2099    #plugin-information-title.with-banner {
     2100        height: 100px;
     2101        bottom: 100px;
     2102    }
     2103
     2104    #plugin-information-title.with-banner h2 {
     2105        top: 12px;
     2106        font-size: 20px;
     2107        line-height: 40px;
     2108    }
     2109
     2110    #plugin-information-title.with-banner div.vignette {
     2111        height: 65px;
     2112        bottom: 65px;
     2113        width: 800%;
     2114    }
     2115
     2116    #plugin-information-tabs.with-banner {
     2117        top: 63px;
     2118    }
     2119
     2120    #plugin-information-content.with-banner {
     2121        top: 99px;
     2122    }
     2123}
     2124
     2125@media screen and ( max-width: 771px ) {
     2126    #plugin-information-tabs {
     2127        padding: 0;
    21252128    }
    21262129
  • trunk/src/wp-admin/includes/plugin-install.php

    r29123 r29125  
    312312    global $tab;
    313313
    314     $api = plugins_api( 'plugin_information', array( 'slug' => wp_unslash( $_REQUEST['plugin'] ), 'is_ssl' => is_ssl(), 'fields' => array( 'banners' => true, 'reviews' => true ) ) );
    315 
    316     if ( is_wp_error( $api ) )
     314    $api = plugins_api( 'plugin_information', array(
     315        'slug' => wp_unslash( $_REQUEST['plugin'] ),
     316        'is_ssl' => is_ssl(),
     317        'fields' => array( 'banners' => true, 'reviews' => true )
     318    ) );
     319
     320    if ( is_wp_error( $api ) ) {
    317321        wp_die( $api );
     322    }
    318323
    319324    $plugins_allowedtags = array(
     
    327332
    328333    $plugins_section_titles = array(
    329         'description'  => _x('Description',  'Plugin installer section title'),
    330         'installation' => _x('Installation', 'Plugin installer section title'),
    331         'faq'          => _x('FAQ',          'Plugin installer section title'),
    332         'screenshots'  => _x('Screenshots',  'Plugin installer section title'),
    333         'changelog'    => _x('Changelog',    'Plugin installer section title'),
    334         'reviews'      => _x('Reviews',      'Plugin installer section title'),
    335         'other_notes'  => _x('Other Notes',  'Plugin installer section title')
     334        'description'  => _x( 'Description',  'Plugin installer section title' ),
     335        'installation' => _x( 'Installation', 'Plugin installer section title' ),
     336        'faq'          => _x( 'FAQ',          'Plugin installer section title' ),
     337        'screenshots'  => _x( 'Screenshots',  'Plugin installer section title' ),
     338        'changelog'    => _x( 'Changelog',    'Plugin installer section title' ),
     339        'reviews'      => _x( 'Reviews',      'Plugin installer section title' ),
     340        'other_notes'  => _x( 'Other Notes',  'Plugin installer section title' )
    336341    );
    337342
    338     //Sanitize HTML
    339     foreach ( (array)$api->sections as $section_name => $content ) {
    340         $api->sections[$section_name] = wp_kses($content, $plugins_allowedtags);
     343    // Sanitize HTML
     344    foreach ( (array) $api->sections as $section_name => $content ) {
     345        $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags );
    341346    }
    342347
    343348    foreach ( array( 'version', 'author', 'requires', 'tested', 'homepage', 'downloaded', 'slug' ) as $key ) {
    344         if ( isset( $api->$key ) )
     349        if ( isset( $api->$key ) ) {
    345350            $api->$key = wp_kses( $api->$key, $plugins_allowedtags );
     351        }
    346352    }
    347353
    348354    $_tab = esc_attr( $tab );
    349355
    350     $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; //Default to the Description tab, Do not translate, API returns English.
     356    $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English.
    351357    if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {
    352358        $section_titles = array_keys( (array) $api->sections );
     
    354360    }
    355361
    356     iframe_header( __('Plugin Install') );
     362    iframe_header( __( 'Plugin Install' ) );
    357363
    358364    $_with_banner = '';
    359365
    360     if ( !empty( $api->banners ) && ( !empty( $api->banners['low'] ) || !empty( $api->banners['high'] ) ) ) {
     366    if ( ! empty( $api->banners ) && ( ! empty( $api->banners['low'] ) || ! empty( $api->banners['high'] ) ) ) {
    361367        $_with_banner = 'with-banner';
    362         $low  = ( !empty( $api->banners['low'] ) ) ? $api->banners['low'] : $api->banners['high'];
    363         $high = ( !empty( $api->banners['high'] ) ) ? $api->banners['high'] : $api->banners['low'];
     368        $low  = empty( $api->banners['low'] ) ? $api->banners['high'] : $api->banners['low'];
     369        $high = empty( $api->banners['high'] ) ? $api->banners['low'] : $api->banners['high'];
    364370        ?>
    365371        <style type="text/css">
    366372            #plugin-information-title.with-banner {
    367                 background-image: url(<?php echo $low ?>);
     373                background-image: url( <?php echo esc_url( $low ); ?> );
    368374            }
    369             @media only screen and (-webkit-min-device-pixel-ratio: 1.5) {
     375            @media only screen and ( -webkit-min-device-pixel-ratio: 1.5 ) {
    370376                #plugin-information-title.with-banner {
    371                     background-image: url(<?php echo $high ?>});
     377                    background-image: url( <?php echo esc_url( $high ); ?> );
    372378                }
    373379            }
     
    379385    echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n";
    380386
    381     foreach ( (array)$api->sections as $section_name => $content ) {
    382         if ( 'reviews' == $section_name && ( empty( $api->ratings ) || 0 == array_sum( (array) $api->ratings ) ) )
     387    foreach ( (array) $api->sections as $section_name => $content ) {
     388        if ( 'reviews' === $section_name && ( empty( $api->ratings ) || 0 === array_sum( (array) $api->ratings ) ) ) {
    383389            continue;
    384 
    385         if ( isset( $plugins_section_titles[ $section_name ] ) )
     390        }
     391
     392        if ( isset( $plugins_section_titles[ $section_name ] ) ) {
    386393            $title = $plugins_section_titles[ $section_name ];
    387         else
     394        } else {
    388395            $title = ucwords( str_replace( '_', ' ', $section_name ) );
    389 
    390         $class = ( $section_name == $section ) ? ' class="current"' : '';
     396        }
     397
     398        $class = ( $section_name === $section ) ? ' class="current"' : '';
    391399        $href = add_query_arg( array('tab' => $tab, 'section' => $section_name) );
    392400        $href = esc_url( $href );
     
    401409    <div class="fyi">
    402410        <ul>
    403 <?php if ( ! empty( $api->version ) ) : ?>
    404             <li><strong><?php _e('Version:') ?></strong> <?php echo $api->version ?></li>
    405 <?php endif; if ( ! empty( $api->author ) ) : ?>
    406             <li><strong><?php _e('Author:') ?></strong> <?php echo links_add_target($api->author, '_blank') ?></li>
    407 <?php endif; if ( ! empty( $api->last_updated ) ) : ?>
    408             <li><strong><?php _e('Last Updated:') ?></strong> <span title="<?php echo $api->last_updated ?>"><?php
    409                             printf( __('%s ago'), human_time_diff(strtotime($api->last_updated)) ) ?></span></li>
    410 <?php endif; if ( ! empty( $api->requires ) ) : ?>
    411             <li><strong><?php _e('Requires WordPress Version:') ?></strong> <?php printf(__('%s or higher'), $api->requires) ?></li>
    412 <?php endif; if ( ! empty( $api->tested ) ) : ?>
    413             <li><strong><?php _e('Compatible up to:') ?></strong> <?php echo $api->tested ?></li>
    414 <?php endif; if ( ! empty( $api->downloaded ) ) : ?>
    415             <li><strong><?php _e('Downloaded:') ?></strong> <?php printf(_n('%s time', '%s times', $api->downloaded), number_format_i18n($api->downloaded)) ?></li>
    416 <?php endif; if ( ! empty( $api->slug ) && empty( $api->external ) ) : ?>
    417             <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug ?>/"><?php _e('WordPress.org Plugin Page &#187;') ?></a></li>
    418 <?php endif; if ( ! empty( $api->homepage ) ) : ?>
    419             <li><a target="_blank" href="<?php echo $api->homepage ?>"><?php _e('Plugin Homepage &#187;') ?></a></li>
    420 <?php endif;if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) : ?>
    421             <li><a target="_blank" href="<?php echo $api->donate_link ?>"><?php _e('Donate to this plugin &#187;') ?></a></li>
    422 <?php endif; ?>
     411        <?php if ( ! empty( $api->version ) ) { ?>
     412            <li><strong><?php _e( 'Version:' ); ?></strong> <?php echo $api->version; ?></li>
     413        <?php } if ( ! empty( $api->author ) ) { ?>
     414            <li><strong><?php _e( 'Author:' ); ?></strong> <?php echo links_add_target( $api->author, '_blank' ); ?></li>
     415        <?php } if ( ! empty( $api->last_updated ) ) { ?>
     416            <li><strong><?php _e( 'Last Updated:' ); ?></strong> <span title="<?php echo $api->last_updated; ?>">
     417                <?php printf( __( '%s ago' ), human_time_diff( strtotime( $api->last_updated ) ) ); ?>
     418            </span></li>
     419        <?php } if ( ! empty( $api->requires ) ) { ?>
     420            <li><strong><?php _e( 'Requires WordPress Version:' ); ?></strong> <?php printf( __( '%s or higher' ), $api->requires ); ?></li>
     421        <?php } if ( ! empty( $api->tested ) ) { ?>
     422            <li><strong><?php _e( 'Compatible up to:' ); ?></strong> <?php echo $api->tested; ?></li>
     423        <?php } if ( ! empty( $api->downloaded ) ) { ?>
     424            <li><strong><?php _e( 'Downloaded:' ); ?></strong> <?php printf( _n( '%s time', '%s times', $api->downloaded ), number_format_i18n( $api->downloaded ) ); ?></li>
     425        <?php } if ( ! empty( $api->slug ) && empty( $api->external ) ) { ?>
     426            <li><a target="_blank" href="https://wordpress.org/plugins/<?php echo $api->slug; ?>/"><?php _e( 'WordPress.org Plugin Page &#187;' ); ?></a></li>
     427        <?php } if ( ! empty( $api->homepage ) ) { ?>
     428            <li><a target="_blank" href="<?php echo esc_url( $api->homepage ); ?>"><?php _e( 'Plugin Homepage &#187;' ); ?></a></li>
     429        <?php } if ( ! empty( $api->donate_link ) && empty( $api->contributors ) ) { ?>
     430            <li><a target="_blank" href="<?php echo $api->donate_link ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a></li>
     431        <?php } ?>
    423432        </ul>
    424         <?php if ( ! empty( $api->rating ) ) : ?>
    425         <h3><?php _e('Average Rating') ?></h3>
     433        <?php if ( ! empty( $api->rating ) ) { ?>
     434        <h3><?php _e( 'Average Rating' ); ?></h3>
    426435        <?php wp_star_rating( array( 'rating' => $api->rating, 'type' => 'percent', 'number' => $api->num_ratings ) ); ?>
    427         <small><?php printf( _n('(based on %s rating)', '(based on %s ratings)', $api->num_ratings), number_format_i18n($api->num_ratings) ); ?></small>
    428         <?php endif; ?>
    429         <?php
     436        <small><?php printf( _n( '(based on %s rating)', '(based on %s ratings)', $api->num_ratings ), number_format_i18n( $api->num_ratings ) ); ?></small>
     437        <?php }
     438
    430439        if ( ! empty( $api->ratings ) && array_sum( (array) $api->ratings ) > 0 ) {
    431             foreach( $api->ratings as $key=>$ratecount ) {
     440            foreach( $api->ratings as $key => $ratecount ) {
    432441                // avoid div-by-zero
    433442                $_rating = $api->num_ratings ? ( $ratecount / $api->num_ratings ) : 0;
    434443                ?>
    435444                <div class="counter-container">
    436                     <a href="./plugin-install.php?tab=plugin-information&plugin=<?php echo $api->slug; ?>&section=reviews"
    437                        title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key ), $key ) ); ?>" -->
    438                         <span class="counter-label" style="float:left; margin-right:5px;"><?php echo $key; ?> stars</span>
    439                         <span class="counter-back" style="height:17px;width:92px;background-color:#ececec;float:left;">
    440                             <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;height:17px;background-color:#fddb5a;float:left;"></span>
     445                    <a href="<?php echo esc_url( self_admin_url( 'plugin-install.php?tab=plugin-information&amp;plugin=' . $api->slug . '&amp;section=reviews' ) ); ?>"
     446                       title="<?php echo esc_attr( sprintf( _n( 'Click to see reviews that provided a rating of %d star', 'Click to see reviews that provided a rating of %d stars', $key ), $key ) ); ?>">
     447                        <span class="counter-label"><?php echo $key; ?> stars</span>
     448                        <span class="counter-back">
     449                            <span class="counter-bar" style="width: <?php echo 92 * $_rating; ?>px;"></span>
    441450                        </span>
    442451                    </a>
    443                     <span class="counter-count" style="margin-left:5px;"><?php echo $ratecount; ?></span>
     452                    <span class="counter-count"><?php echo $ratecount; ?></span>
    444453                </div>
    445             <?php
     454                <?php
    446455            }
    447456        }
    448         if ( ! empty( $api->contributors ) ) : ?>
    449             <h3><?php _e('Contributors') ?></h3>
     457        if ( ! empty( $api->contributors ) ) { ?>
     458            <h3><?php _e( 'Contributors' ); ?></h3>
    450459            <ul class="contributors">
    451460                <?php
    452461                foreach ( (array) $api->contributors as $contrib_username => $contrib_profile ) {
    453                     if ( empty( $contrib_username ) && empty( $contrib_profile ) )
     462                    if ( empty( $contrib_username ) && empty( $contrib_profile ) ) {
    454463                        continue;
    455                     if ( empty( $contrib_username ) )
     464                    }
     465                    if ( empty( $contrib_username ) ) {
    456466                        $contrib_username = preg_replace( '/^.+\/(.+)\/?$/', '\1', $contrib_profile );
     467                    }
    457468                    $contrib_username = sanitize_user( $contrib_username );
    458                     if ( empty( $contrib_profile ) )
    459                         echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</li>";
    460                     else
    461                         echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&s=36' width='18' height='18' />{$contrib_username}</a></li>";
     469                    if ( empty( $contrib_profile ) ) {
     470                        echo "<li><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</li>";
     471                    } else {
     472                        echo "<li><a href='{$contrib_profile}' target='_blank'><img src='https://wordpress.org/grav-redirect.php?user={$contrib_username}&amp;s=36' width='18' height='18' />{$contrib_username}</a></li>";
     473                    }
    462474                }
    463475                ?>
    464476            </ul>
    465             <?php if ( ! empty( $api->donate_link ) ) : ?>
    466                 <a target="_blank" href="<?php echo $api->donate_link ?>"><?php _e('Donate to this plugin &#187;') ?></a>
    467             <?php endif; ?>
    468         <?php endif; ?>
     477            <?php if ( ! empty( $api->donate_link ) ) { ?>
     478                <a target="_blank" href="<?php echo esc_url( $api->donate_link ); ?>"><?php _e( 'Donate to this plugin &#187;' ); ?></a>
     479            <?php } ?>
     480        <?php } ?>
    469481    </div>
    470482    <div id="section-holder" class="wrap">
    471483    <?php
    472         if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) )
     484        if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) {
    473485            echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>';
    474 
    475         else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) )
     486        } else if ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) {
    476487            echo '<div class="updated"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
    477 
    478         foreach ( (array)$api->sections as $section_name => $content ) {
    479 
     488        }
     489
     490        foreach ( (array) $api->sections as $section_name => $content ) {
    480491            $content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' );
    481492            $content = links_add_target( $content, '_blank' );
     
    483494            $san_section = esc_attr( $section_name );
    484495
    485             $display = ( $section_name == $section ) ? 'block' : 'none';
     496            $display = ( $section_name === $section ) ? 'block' : 'none';
    486497
    487498            echo "\t<div id='section-{$san_section}' class='section' style='display: {$display};'>\n";
     
    492503    echo "</div>\n";
    493504    echo "<div id='$tab-footer'>\n";
    494     if ( ! empty( $api->download_link ) && ( current_user_can('install_plugins') || current_user_can('update_plugins') ) ) {
    495         $status = install_plugin_install_status($api);
     505    if ( ! empty( $api->download_link ) && ( current_user_can( 'install_plugins' ) || current_user_can( 'update_plugins' ) ) ) {
     506        $status = install_plugin_install_status( $api );
    496507        switch ( $status['status'] ) {
    497508            case 'install':
    498                 if ( $status['url'] )
    499                     echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Now') . '</a>';
     509                if ( $status['url'] ) {
     510                    echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Now' ) . '</a>';
     511                }
    500512                break;
    501513            case 'update_available':
    502                 if ( $status['url'] )
    503                     echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __('Install Update Now') .'</a>';
     514                if ( $status['url'] ) {
     515                    echo '<a class="button button-primary right" href="' . $status['url'] . '" target="_parent">' . __( 'Install Update Now' ) .'</a>';
     516                }
    504517                break;
    505518            case 'newer_installed':
    506                 echo '<a class="button button-primary right disabled">' . sprintf(__('Newer Version (%s) Installed'), $status['version']) . '</a>';
     519                echo '<a class="button button-primary right disabled">' . sprintf( __( 'Newer Version (%s) Installed'), $status['version'] ) . '</a>';
    507520                break;
    508521            case 'latest_installed':
    509                 echo '<a class="button button-primary right disabled">' . __('Latest Version Installed') . '</a>';
     522                echo '<a class="button button-primary right disabled">' . __( 'Latest Version Installed' ) . '</a>';
    510523                break;
    511524        }
  • trunk/src/wp-admin/js/plugin-install.js

    r29040 r29125  
    77        var tbWindow = $( '#TB_window' ),
    88            width = $( window ).width(),
    9             H = $( window ).height() - ( ( 850 < width ) ? 60 : 20 ),
    10             W = ( 850 < width ) ? 830 : width - 20;
     9            H = $( window ).height() - ( ( 792 < width ) ? 60 : 20 ),
     10            W = ( 792 < width ) ? 772 : width - 20;
    1111
    1212        if ( tbWindow.size() ) {
     
    1818            if ( typeof document.body.style.maxWidth !== 'undefined' ) {
    1919                tbWindow.css({
    20                     'top': ( ( 850 < width ) ? 30 : 10 ) + 'px',
     20                    'top': ( ( 792 < width ) ? 30 : 10 ) + 'px',
    2121                    'margin-top': '0'
    2222                });
     
    4747    });
    4848
    49     /* Plugin install related JS*/
     49    /* Plugin install related JS */
    5050    $( '#plugin-information-tabs a' ).click( function( event ) {
    5151        var tab = $( this ).attr( 'name' );
    5252        event.preventDefault();
    53         //Flip the tab
     53
     54        // Flip the tab
    5455        $( '#plugin-information-tabs a.current' ).removeClass( 'current' );
    5556        $( this ).addClass( 'current' );
    56         //Only show the fyi box in the description section, on smaller screen, where it's otherwise always displayed at the top.
    57         if ( 'description' != $( this ).attr( 'name' ) && $( 'body').width() < 830 )
    58             $( '#plugin-information-content div.fyi' ).hide();
    59         else
    60             $( '#plugin-information-content div.fyi' ).show();
    61         //Flip the content.
    62         $( '#section-holder div.section' ).hide(); //Hide 'em all
     57
     58        // Only show the fyi box in the description section, on smaller screen, where it's otherwise always displayed at the top.
     59        if ( 'description' !== tab && $( window ).width() < 772 ) {
     60            $( '#plugin-information-content' ).find( '.fyi' ).hide();
     61        } else {
     62            $( '#plugin-information-content' ).find( '.fyi' ).show();
     63        }
     64
     65        // Flip the content.
     66        $( '#section-holder div.section' ).hide(); // Hide 'em all.
    6367        $( '#section-' + tab ).show();
    6468    });
Note: See TracChangeset for help on using the changeset viewer.