Making WordPress.org


Ignore:
Timestamp:
06/06/2014 09:51:08 PM (11 years ago)
Author:
coffee2code
Message:

Code Reference: Improve linking related to source code display. See #176

  • Remove 'View source code:' label and links
  • Add 'View source' link that links downpage to Source section
  • Remove ellipsis from link text
  • Add ability to collapse expanded source code
  • Move link to core.trac for function to be under source code display as 'View on Trac'
  • Fix to display link to trac for hooks and classes
File:
1 edited

Legend:

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

    r686 r687  
    3131            <p>
    3232                <strong><?php _e( 'Source file:', 'wporg' ); ?></strong>
    33                 <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a><br />
    34                 <strong><?php _e( 'View source code:', 'wporg' ); ?></strong>
    35                 <?php if ( post_type_has_source_code() ) { ?>
    36                 <a href="#source-code"><?php _e( 'below', 'wporg' ); ?></a> or
    37                 <?php } ?>
    38                 <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'on the WP Trac code browser&hellip;', 'wporg' ); ?></a>
     33                <a href="<?php echo get_source_file_archive_link( $source_file ); ?>"><?php echo esc_html( $source_file ); ?></a>
    3934            </p>
     35            <?php if ( post_type_has_source_code() ) { ?>
     36            <p>
     37                <a href="#source-code"><?php _e( 'View source', 'wporg' ); ?></a>
     38            </p>
     39            <?php } else { ?>
     40            <p>
     41                <a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a>
     42            </p>
     43            <?php } ?>
    4044        </section>
    4145    <?php endif; ?>
     
    131135                <pre class="brush: php; toolbar: false;"><?php echo esc_html( get_source_code() ); ?></pre>
    132136            </div>
    133             <p><a href="#" class="show-complete-source"><?php _e( 'View full source code&hellip;', 'wporg' ); ?></a></p>
     137            <p class="source-code-links">
     138                <span>
     139                    <a href="#" class="show-complete-source"><?php _e( 'Expand full source code', 'wporg' ); ?></a>
     140                    <a href="#" class="less-complete-source"><?php _e( 'Collapse full source code', 'wporg' ); ?></a>
     141                </span>
     142                <span><a href="<?php echo get_source_file_link(); ?>"><?php _e( 'View on Trac', 'wporg' ); ?></a></span>
     143            </p>
    134144        </section>
    135145    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.