Making WordPress.org


Ignore:
Timestamp:
03/19/2015 10:36:17 PM (10 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Enable expand/collapse functionality for syntax-highlighted code in handbooks.

  • Enqueue function-reference.js on handbook pages as well
  • Wrap handbook syntax-highlighted code in similar markup the JS expects as used on coderef pages
  • Modify JS to handle multiple expandable code blocks on a page
  • Change styling for expand/collapse links since for handbooks only one link will be present in that section

Fixes #959.

File:
1 edited

Legend:

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

    r1198 r1429  
    6666    public static function scripts_and_styles() {
    6767        if ( is_singular() ) {
    68             if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() ) {
     68            if ( '0' != get_comments_number() || \DevHub\post_type_has_source_code() || Devhub_Handbooks::is_handbook_post_type() ) {
    6969                wp_enqueue_script( 'wporg-developer-function-reference', get_template_directory_uri() . '/js/function-reference.js', array( 'jquery', 'syntaxhighlighter-core', 'syntaxhighlighter-brush-php' ), '20150126', true );
    7070                wp_enqueue_style( 'syntaxhighlighter-core' );
Note: See TracChangeset for help on using the changeset viewer.