Making WordPress.org


Ignore:
Timestamp:
08/24/2016 08:22:35 PM (7 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Implement a tabbed interface for writing and previewing user contributed notes.

Also wraps form header in 'h3' tag so it appears in table of contents.

Props keesiemeijer.
See #1905.

File:
1 edited

Legend:

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

    r3790 r3852  
    9090            }
    9191
    92             wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'quicktags', 'wporg-developer-preview' ), '20160809', true );
     92            wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'quicktags' ), '20160809', true );
    9393            if ( get_option( 'thread_comments' ) ) {
    9494                wp_enqueue_script( 'comment-reply' );
     
    127127    public static function wp_editor_comments() {
    128128        ob_start();
    129         echo '<p class="comment-form-comment"><label for="comment">' . _x( 'Add Note or Feedback', 'noun', 'wporg' ) . '</label>';
     129        echo '<h3><label for="comment">' . _x( 'Add Note or Feedback', 'noun', 'wporg' ) . '</label></h3>';
     130
     131        if ( class_exists( 'DevHub_Note_Preview' ) ) {
     132            echo '<ul class="tablist" style="display:none;">';
     133            echo '<li><a href="#comment-form-comment">' . __( 'Write', 'wporg' ) . '</a></li>';
     134            echo '<li><a href="#comment-preview">' . __( 'Preview', 'wporg' ) . '</a></li></ul>';
     135        }
     136
     137        $style = '<style type="text/css">';
     138        ob_start();
     139        include get_stylesheet_directory() . '/stylesheets/editor-style.css';
     140        $style .= ob_get_clean();
     141        $style .=' </style>';
     142
     143        echo '<div class="comment-form-comment tab-section" id="comment-form-comment">';
    130144        wp_editor( '', 'comment', array(
    131145            'media_buttons' => false,
     146            'editor_css'    => $style,
    132147            'textarea_name' => 'comment',
    133148            'textarea_rows' => 8,
     
    138153            'tinymce'       => false,
    139154        ) );
    140         echo '</p>';
     155        echo '</div>';
    141156        return ob_get_clean();
    142157    }
Note: See TracChangeset for help on using the changeset viewer.