Making WordPress.org

Changeset 7754


Ignore:
Timestamp:
10/19/2018 10:56:22 PM (6 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Allow users to edit their own submitted notes that are still in moderation.

Props keesiemeijer.
Fixes #3572.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
Files:
2 added
9 edited

Legend:

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

    r6910 r7754  
    4646                    $ordered_comments = wporg_developer_get_ordered_notes();
    4747                    if ( $ordered_comments ) {
    48                         $feedback_editor = array_filter(  wp_list_pluck( $ordered_comments, 'show_editor') );
    4948                        wporg_developer_list_notes( $ordered_comments, array( 'avatar_size' => 32 ) );
    5049                    }
     
    6564    <?php if ( \DevHub\is_parsed_post_type() && DevHub\can_user_post_note( true, get_the_ID() ) ) : ?>
    6665
    67         <?php $add_note_style = empty( $feedback_editor ) ? 'display:none;' : ''; ?>
    68         <p id="add-user-note" style="<?php echo $add_note_style; ?>"><a href="<?php echo user_trailingslashit( get_permalink() ) . '#respond'; ?>"><?php _e( 'Have a note or feedback to contribute?', 'wporg' ); ?></a></p>
     66        <?php if ( is_user_logged_in() ) : ?>
     67            <?php
     68                /* Hide the add user note link by default.
     69                 * It will be displayed by Javascript.
     70                 * If Javascript is disabled the comment form is displayed and the link stays hidden.
     71                 */
     72            ?>
     73            <p id="add-user-note" style="display: none;"><a href="<?php echo user_trailingslashit( get_permalink() ) . '#respond'; ?>"><?php _e( 'Have a note or feedback to contribute?', 'wporg' ); ?></a></p>
     74        <?php endif; ?>
    6975
    7076        <?php
    71         $args = array(
    72             'logged_in_as'        => '<p class="logged-in-as">'
    73                 . sprintf(
    74                     /* translators: 1: user profile link, 2: accessibility text, 3: user name, 4: logout URL */
    75                     __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
    76                     'https://profiles.wordpress.org/' . esc_attr( wp_get_current_user()->user_nicename ),
    77                     /* translators: %s: user name */
    78                     esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ),
    79                     $user_identity,
    80                     wp_logout_url( apply_filters( 'the_permalink', get_permalink() ) )
    81                 )
    82                 . '</p><p><ul><li>'
    83                 . __( 'Notes should supplement code reference entries, for example examples, tips, explanations, use-cases, and best practices.', 'wporg' )
    84                 . '</li><li>'
    85                 . __( 'Feedback can be to report errors or omissions with the documentation on this page. Such feedback will not be publicly posted.', 'wporg' )
    86                 . '</li><li>'
    87                 /* translators: 1: php button, 2: js button, 3: inline code button */
    88                 . sprintf(
    89                     __( 'You can enter text and code. Use the %1$s, %2$s, or %3$s buttons to wrap code snippets.', 'wporg' ),
    90                     '<span class="text-button">php</span>',
    91                     '<span class="text-button">js</span>',
    92                     '<span class="text-button">' . __( 'inline code', 'wporg' ) . '</span>'
    93                 )
    94                 . '</li></ul></p>',
    95             'comment_notes_after' => '<p>'
    96                 . __( 'Submission Notes:', 'wporg' )
    97                 . '<ul><li>'
    98                 . __( 'This form is not for support requests, discussions, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' )
    99                 . '</li><li>'
    100                 . __( 'In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key. In some cases the Esc key will need to be pressed twice before the Tab key will allow you to continue.', 'wporg' )
    101                 . '</li><li class="user-notes-are-gpl">'
    102                 . sprintf(
    103                     /* translators: 1: GFDL link */
    104                     __( '<strong>NOTE:</strong> All contributions are licensed under %s and are moderated before appearing on the site.', 'wporg' ),
    105                     '<a href="https://gnu.org/licenses/fdl.html">GFDL</a>'
    106                 )
    107                 . '</li></ul></p>',
    108             'label_submit'        => __( 'Add Note or Feedback', 'wporg' ),
    109             'cancel_reply_link'   => '',
    110             'must_log_in'         => '<p>' . sprintf(
    111                 __( 'You must <a href="%s">log in</a> before being able to contribute a note or feedback.', 'wporg' ),
    112                 'https://login.wordpress.org/?redirect_to=' . urlencode( get_comments_link() )
    113             ) . '</p>',
    114             'title_reply'         => '', //'Add Example'
    115             'title_reply_to'      => '',
    116         );
    117 
    118         if ( class_exists( 'DevHub_Note_Preview' ) ) {
    119             $args['comment_notes_after'] = DevHub_Note_Preview::comment_preview() . $args['comment_notes_after'];
    120             $args['class_form']          = 'comment-form tab-container';
    121         }
    122 
    123         if ( class_exists( 'DevHub_User_Submitted_Content' ) ) {
    124             $args['comment_field'] = DevHub_User_Submitted_Content::wp_editor_comments();
    125         }
    126 
    127         // Insert comment form if feedback form is not already used.
    128         if ( empty( $feedback_editor ) ) {
     77        if ( class_exists( 'DevHub_User_Submitted_Content' ) )  {
     78            $args = \DevHub_User_Submitted_Content::comment_form_args();
    12979            comment_form( $args );
    13080        }
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php

    r7744 r7754  
    5555 */
    5656require __DIR__ . '/inc/user-content-voting.php';
     57
     58/**
     59 * Editing for user-submitted content.
     60 */
     61require __DIR__ . '/inc/user-content-edit.php';
    5762
    5863/**
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r7753 r7754  
    114114            // Check if the current page is a reply to a note.
    115115            $reply_id = 0;
    116             if ( isset( $_GET['replytocom'] ) && $_GET['replytocom'] ) {
     116            if ( isset( $_GET['replytocom'] ) && $_GET['replytocom'] ) {       
     117                /* Javascript uses preventDefault() when clicking links with '?replytocom={comment_ID}'
     118                 * We assume Javascript is disabled when visiting a page with this query var.
     119                 * There are no consequences if Javascript is enabled.
     120                 */
    117121                $reply_id = absint( $_GET['replytocom'] );
    118122            }
     
    143147                }
    144148
    145                 if ( ! $show_editor && ( $reply_id && ( $reply_id === (int) $comment->comment_ID ) ) ) {
    146                     // Show the editor when replying to this parent comment
     149                if ( ! $show_editor && ( $reply_id && ( $reply_id === (int) $comment->comment_ID ) ) ) {
     150                    /* The query var 'replytocom' is used and the value is the same as the current comment ID.
     151                     * We show the editor for the current comment because we assume Javascript is disabled.
     152                     * If Javascript is not disabled the editor is hidden (as normal) by the class 'hide-if-js'.
     153                     */
    147154                    $comments[ $key ]->show_editor = true;
    148155                    $show_editor = true;
     
    165172         */
    166173        function wporg_developer_list_notes( $comments, $args ) {
     174            $is_user_content    = class_exists( 'DevHub_User_Submitted_Content' );
    167175            $is_user_logged_in  = is_user_logged_in();
    168176            $can_user_post_note = DevHub\can_user_post_note( true, get_the_ID() );
    169             $user_content       = class_exists( 'DevHub_User_Submitted_Content' );
    170             $display_editor     = $is_user_logged_in && $can_user_post_note && $user_content;
     177            $is_user_verified   = $is_user_logged_in && $can_user_post_note;
     178       
     179            $args['updated_note'] = 0;
     180            if ( isset( $_GET['updated-note'] ) && $_GET['updated-note'] ) {
     181                $args['updated_note'] = absint( $_GET['updated-note'] );
     182            }
    171183
    172184            foreach ( $comments as $comment ) {
     
    177189                wporg_developer_user_note( $comment, $args, 1 );
    178190
    179                 // Show or hide feedback notes.
    180                 $class = $comment->show_editor ? '' : ' hide-if-js';
    181                 echo "<section id='feedback-{$comment_id}' class='feedback{$class}'>\n";
     191                /* Use hide-if-js class to hide the feedback section if Javascript is enabled.
     192                 * Users can display the section with Javascript.
     193                 */
     194                echo "<section id='feedback-{$comment_id}' class='feedback hide-if-js'>\n";
    182195
    183196                // Display child comments.
     
    193206
    194207                // Add a feedback form for logged in users.
    195                 if ( $display_editor ) {
    196                     // Show or hide the editor depending if we're replying to a note.
     208                if ( $is_user_content && $is_user_verified ) {
     209                    /* Show the feedback editor if we're replying to a note and Javascript is disabled.
     210                     * If Javascript is enabled the editor is hidden (as normal) by the 'hide-if-js' class.
     211                     */
    197212                    $display = $comment->show_editor ? 'show' : 'hide';
    198213                    echo DevHub_User_Submitted_Content::wp_editor_feedback( $comment, $display );
     
    203218                echo "<footer class='feedback-links' >\n";
    204219                if ( $can_user_post_note ) {
    205                     echo "EEE";
    206220                    $feedback_link = trailingslashit( get_permalink() ) . "?replytocom={$comment_id}#feedback-editor-{$comment_id}";
    207221                    $display       = '';
    208                     $aria          = '';
    209222                    if ( ! $is_user_logged_in ) {
    210223                        $class         = 'login';
     
    214227                        $class         ='add';
    215228                        $feedback_text = __( 'Add feedback to this note', 'wporg' );
    216                         $aria          = '';//" aria-expanded='false' aria_controls='feedback-editor-{$comment_id}' aria-label='" . esc_attr( $feedback_text ) . "'";
    217 
    218                         // Hide 'add feedback' link if editor is displayed.
    219                         $display = $display_editor && $comment->show_editor ? ' style="display:none"' : '';
     229
     230                        /* Hide the feedback link if the current user is logged in and the
     231                         * feedback editor is displayed (because Javascript is disabled).
     232                         * If Javascript is enabled the editor is hidden and the feedback link is displayed (as normal).
     233                         */
     234                        $display = $is_user_verified && $comment->show_editor ? ' style="display:none"' : '';
    220235                    }
    221                     echo '<a class="feedback-' . $class . '" href="' . esc_url( $feedback_link ) . '"' . $display . $aria .' rel="nofollow">' . $feedback_text . '</a>';
     236                    echo '<a role="button" class="feedback-' . $class . '" href="' . esc_url( $feedback_link ) . '"' . $display . ' rel="nofollow">' . $feedback_text . '</a>';
    222237                }
    223238
     
    241256            $GLOBALS['comment_depth'] = $depth;
    242257
     258            static $note_number = 0;
     259
    243260            $approved       = ( 0 < (int) $comment->comment_approved ) ? true : false;
    244261            $is_parent      = ( 0 === (int) $comment->comment_parent ) ? true : false;
     
    246263            $count          = $is_voting ? (int)  DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ) : 0;
    247264            $curr_user_note = $is_voting ? (bool) DevHub_User_Contributed_Notes_Voting::is_current_user_note( $comment->comment_ID ) : false;
    248 
    249             // Classes
     265            $edited_note_id = isset( $args['updated_note'] ) ? $args['updated_note'] : 0;
     266            $is_edited_note = ( $edited_note_id === (int) $comment->comment_ID );
     267            $note_author    = \DevHub\get_note_author_link( $comment );
     268            $can_edit_note  = \DevHub\can_user_edit_note( $comment->comment_ID );
     269            $has_edit_cap   = current_user_can( 'edit_comment', $comment->comment_ID );
     270
     271            // CSS Classes
    250272            $comment_class = array();
    251273
     
    260282            if ( ! $approved ) {
    261283                $comment_class[] = 'user-note-moderated';
    262             }
    263 
    264             // This would all be moot if core passed the $comment context for 'get_comment_author_link' filter.
    265             if ( $comment->user_id ) {
    266                 $commenter = get_user_by( 'id', $comment->user_id );
    267                 $url = 'https://profiles.wordpress.org/' . sanitize_key( $commenter->user_nicename ) . '/';
    268                 $author = get_the_author_meta( 'display_name', $comment->user_id );
    269             } else {
    270                 $url = $comment->comment_author_url;
    271                 $author = $comment->comment_author;
    272             }
    273 
    274             $comment_author_link = $author;
    275             if ( $url ) {
    276                 $comment_author_link = "<a href='$url' rel='external nofollow' class='url'>$author</a>";
    277284            }
    278285
     
    286293
    287294            <?php if ( $is_parent ) : ?>
    288                 <a href="#comment-content-<?php echo $comment->comment_ID; ?>" class="screen-reader-text"><?php _e( 'Skip to note content', 'wporg' ); ?></a>
     295                <a href="#comment-content-<?php echo $comment->comment_ID; ?>" class="screen-reader-text"><?php printf( __( 'Skip to note %d content', 'wporg' ), ++ $note_number ); ?></a>
    289296                <header class="comment-meta">
    290297
     
    301308                        }
    302309
    303                         printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) );
     310                        printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $note_author ) );
    304311                        ?>
    305312
    306313                        </span>
    307314                        &mdash;
    308                         <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
     315                        <a class="comment-date" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">
    309316                            <time datetime="<?php comment_time( 'c' ); ?>">
    310317                            <?php echo $date; ?>
    311318                            </time>
    312319                        </a>
     320
    313321                        <?php edit_comment_link( __( 'Edit', 'wporg' ), '<span class="edit-link">&mdash; ', '</span>' ); ?>
     322                        <?php if ( ! $has_edit_cap && $can_edit_note ) : ?>
     323                            &mdash; <span class="comment-author-edit-link">
     324                                <!-- Front end edit comment link -->
     325                                <a class="comment-edit-link" href="<?php echo site_url( "/reference/comment/edit/{$comment->comment_ID}" ); ?>"><?php _e( 'Edit', 'wporg' ); ?></a>
     326                            </span>
     327                        <?php endif; ?>
     328                        <?php if ( $can_edit_note && $is_edited_note ) : ?>
     329                            &mdash; <span class="comment-edited">
     330                            <?php _e( 'edited', 'wporg' ); ?>
     331                            </span>
     332                        <?php endif; ?>
    314333                        <?php if ( ! $approved ) : ?>
    315334                            &mdash; <span class="comment-awaiting-moderation"><?php _e( 'awaiting moderation', 'wporg' ); ?></span>
     
    326345                } else {
    327346                    $text = get_comment_text()  . ' &mdash; ';
    328                     $text .= sprintf( __( 'By %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) ) . ' &mdash; ';
    329                     $text .= ' <a href="'. esc_url( get_comment_link( $comment->comment_ID ) ) . '">';
     347                    $text .= sprintf( __( 'By %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $note_author ) ) . ' &mdash; ';
     348                    $text .= ' <a class="comment-date" href="'. esc_url( get_comment_link( $comment->comment_ID ) ) . '">';
    330349                    $text .= '<time datetime="' . get_comment_time( 'c' ) . '">' . $date . '</time></a>';
    331350
    332                     if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) {
     351                    if ( $has_edit_cap ) {
     352                        // WP admin edit comment link.
    333353                        $text .= ' &mdash; <a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) .'">';
    334354                        $text .= __( 'Edit', 'wporg' ) . '</a>';
     355                    } elseif ( $can_edit_note ) {
     356                        // Front end edit comment link.
     357                        $text .= ' &mdash; <a class="comment-edit-link" href="' . site_url( "/reference/comment/edit/{$comment->comment_ID}" ) . '">';
     358                        $text .= __( 'Edit', 'wporg' ) . '</a>';
     359                    }
     360
     361                    if ( $can_edit_note && $is_edited_note ) {
     362                        $text .= ' &mdash; <span class="comment-edited">' . __( 'edited', 'wporg' ) . '</span>';
    335363                    }
    336364
     
    14081436
    14091437    /**
     1438     * Indicates if the current user can edit a user contibuted note.
     1439     *
     1440     * A user can only edit their own notes if it's in moderation and
     1441     * if it's a note for a parsed post type.
     1442     *     
     1443     * Users with the 'edit_comment' capability can edit
     1444     * all notes from a parsed post type (regardless if it's in moderation).
     1445     *
     1446     * @param integer $note_id Note ID.
     1447     * @return bool True if the current user can edit notes.
     1448     */
     1449    function can_user_edit_note( $note_id = 0 ) {
     1450        $user = get_current_user_id();
     1451        $note = get_comment( $note_id );
     1452        if ( ! $user || ! $note ) {
     1453            return false;
     1454        }
     1455
     1456        $post_id        = isset( $note->comment_post_ID ) ? (int) $note->comment_post_ID : 0;
     1457        $is_note_author = isset( $note->user_id ) && ( (int) $note->user_id === $user );
     1458        $is_approved    = isset( $note->comment_approved ) && ( 0 < (int) $note->comment_approved );
     1459        $can_edit_notes = isset( $note->comment_ID ) && current_user_can( 'edit_comment', $note->comment_ID );
     1460        $is_parsed_type = is_parsed_post_type( get_post_type( $post_id ) );
     1461
     1462        if ( $is_parsed_type && ( $can_edit_notes || ( $is_note_author && ! $is_approved ) ) ) {
     1463            return true;
     1464        }
     1465
     1466        return false;
     1467    }
     1468
     1469    /**
     1470     * Get the note author link to the profiles.wordpress.org author's URL.
     1471     *
     1472     * @param WP_Comment|int $comment Comment object or comment ID.
     1473     * @return string The HTML link to the profiles.wordpress.org author's URL.
     1474     */
     1475    function get_note_author_link( $comment ) {
     1476        return get_note_author( $comment, true );
     1477    }
     1478
     1479    /**
     1480     * Get the note author nicename.
     1481     *
     1482     * @param WP_Comment|int $comment Comment object or comment ID.
     1483     * @param bool           $link. Whether to return a link to the author's profiles. Default false.
     1484     * @return string The comment author name or HTML link.
     1485     */
     1486    function get_note_author( $comment, $link = false ) {
     1487        $comment   = get_comment( $comment );
     1488        $user_id   = isset( $comment->user_id ) ? $comment->user_id : 0;
     1489        $commenter = get_user_by( 'id', $comment->user_id );
     1490        $author    = '';
     1491
     1492        if ( $user_id && isset( $commenter->user_nicename ) ) {
     1493            $url    = 'https://profiles.wordpress.org/' . sanitize_key( $commenter->user_nicename ) . '/';
     1494            $author = get_the_author_meta( 'display_name', $comment->user_id );
     1495        } else {
     1496            $url    = isset( $comment->comment_author_url ) ? $comment->comment_author_url : '';
     1497            $author = isset( $comment->comment_author ) ?  $comment->comment_author : '';
     1498        }
     1499
     1500        if ( $link && ( $url && $author ) ) {
     1501            $author = sprintf( '<a href="%s" rel="external nofollow" class="url">%s</a>', esc_url( $url ), $author );
     1502        }
     1503
     1504        return $author;
     1505    }
     1506
     1507    /**
    14101508     * Gets the summary.
    14111509     *
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php

    r7492 r7754  
    5151
    5252        // Enable shortcodes for comments
    53         add_filter( 'comment_text',                    'do_shortcode');
     53        add_filter( 'comment_text',                    'do_shortcode' );
    5454
    5555        // Customize allowed tags
     
    6868        add_action( 'edit_comment',                    array( __CLASS__, 'comment_edit_allowed_html' ) );
    6969
     70        // Adds hidden fields to a comment form for editing
     71        add_filter( 'comment_form_submit_field',       array( __CLASS__, 'add_hidden_fields' ), 10, 2 );
    7072    }
    7173
     
    149151
    150152        $allowed_protocols = array( 'http', 'https' );
    151 
    152         $comment_content = wp_kses( $comment_content, $allowed_html, $allowed_protocols );
    153         $commentdata['comment_content'] = preg_replace( '/\r?\n|\r/', '', $comment_content );
     153        $comment_content   = wp_kses( $comment_content, $allowed_html, $allowed_protocols );
     154
     155        // Replace newlines with a space.
     156        $commentdata['comment_content'] = preg_replace( '/\r?\n|\r/', ' ', $comment_content );
    154157
    155158        return $commentdata;
     
    168171            wp_enqueue_script( 'wporg-developer-user-notes-feedback', get_template_directory_uri() . '/js/user-notes-feedback.js', array( 'jquery', 'quicktags' ), '20180323', true );
    169172            wp_localize_script( 'wporg-developer-user-notes-feedback', 'wporg_note_feedback', array(
    170                 'show' => __( 'Show Feedback', 'wporg' ),
    171                 'hide' => __( 'Hide Feedback', 'wporg' ),
     173                'show'             => __( 'Show Feedback', 'wporg' ),
     174                'hide'             => __( 'Hide Feedback', 'wporg' ),
    172175            ) );
    173176        }
     
    177180     * Sets the default language for SyntaxHighlighter shortcode.
    178181     *
    179      * @param  array $atts Shortcode attributes.
     182     * @param array $atts Shortcode attributes.
    180183     * @return array
    181184     */
     
    188191     * Subverts capital_P_dangit for SyntaxHighlighter shortcode.
    189192     *
    190      * @param  string $code
     193     * @param string $code
    191194     * @return string
    192195     */
     
    196199
    197200    /**
     201     * Add hidden fields to the comment form if the context is 'edit'
     202     *
     203     * @param string $submit_field HTML string with the submit button fields.
     204     * @param array  $args         Arguments for the comment form.
     205     * @return HTML string with the submit button fields.
     206     */
     207    public static function add_hidden_fields( $submit_field, $args ) {
     208        $context = isset( $args['context'] ) ? $args['context'] : '';
     209        $comment = isset( $args['comment_edit'] ) ? $args['comment_edit'] : false;
     210        if ( ! ( $comment && ( 'edit' === $context ) ) ) {
     211            return $submit_field;
     212        }
     213
     214        $comment_id = isset( $comment->comment_ID ) ? $comment->comment_ID : 0;
     215
     216        return $submit_field . self::get_edit_fields( $comment_id, $instance = 0 );
     217    }
     218
     219    /**
     220     * Get the comment form arguments by context.
     221     *
     222     * @param WP_Comment|false $comment Comment object or false. Default false.
     223     * @param string           $context Context of arguments. Accepts 'edit' or empty string.
     224     * @return array Array with comment form arguments.
     225     */
     226    public static function comment_form_args( $comment = false, $context = '' ) {
     227        $label = _x( 'Add Note or Feedback', 'noun', 'wporg' );
     228        if ( 'edit' === $context ) {
     229            $label = _x( 'Edit Note', 'noun', 'wporg' );
     230        }
     231
     232        $user_identity = wp_get_current_user();
     233
     234        $args = array(
     235            'logged_in_as'        => '<p class="logged-in-as">'
     236            . sprintf(
     237                /* translators: 1: user profile link, 2: accessibility text, 3: user name, 4: logout URL */
     238                __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ),
     239                'https://profiles.wordpress.org/' . esc_attr( $user_identity->user_nicename ),
     240                /* translators: %s: user name */
     241                esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity->display_name ) ),
     242                $user_identity->display_name,
     243                wp_logout_url( apply_filters( 'the_permalink', get_permalink() ) )
     244            )
     245            . '</p><p><ul><li>'
     246            . __( 'Notes should supplement code reference entries, for example examples, tips, explanations, use-cases, and best practices.', 'wporg' )
     247            . '</li><li>'
     248            . __( 'Feedback can be to report errors or omissions with the documentation on this page. Such feedback will not be publicly posted.', 'wporg' )
     249            . '</li><li>'
     250            /* translators: 1: php button, 2: js button, 3: inline code button */
     251            . sprintf(
     252                __( 'You can enter text and code. Use the %1$s, %2$s, or %3$s buttons to wrap code snippets.', 'wporg' ),
     253                '<span class="text-button">php</span>',
     254                '<span class="text-button">js</span>',
     255                '<span class="text-button">' . __( 'inline code', 'wporg' ) . '</span>'
     256            )
     257            . '</li></ul></p>',
     258            'comment_notes_after' => '<p>' . __( 'Submission Notes:', 'wporg' ) . '</p>' . self::get_editor_rules(),
     259            'label_submit'        => $label,
     260            'cancel_reply_link'   => '',
     261            'must_log_in'         => '<p>' . sprintf(
     262                __( 'You must <a href="%s">log in</a> before being able to contribute a note or feedback.', 'wporg' ),
     263                'https://login.wordpress.org/?redirect_to=' . urlencode( get_comments_link() )
     264            ) . '</p>',
     265            'title_reply'         => '', //'Add Example'
     266            'title_reply_to'      => '',
     267        );
     268
     269        if ( class_exists( 'DevHub_Note_Preview' ) ) {
     270            $args['comment_notes_after'] = DevHub_Note_Preview::comment_preview() . $args['comment_notes_after'];
     271            $args['class_form']          = "comment-form tab-container";
     272        }
     273
     274        $args['comment_field'] = self::wp_editor_comments( $label, $comment );
     275
     276        // Args for adding hidden links after the comment form submit field.
     277        $args['context']      = $context;
     278        $args['comment_edit'] = $comment;
     279
     280        if ( $comment && ( 'edit' === $context ) ) {
     281            $comment_id = isset( $comment->comment_ID ) ? $comment->comment_ID : 0;
     282            $post_id    = isset( $comment->comment_post_ID ) ? $comment->comment_post_ID : 0;
     283
     284            $args['action'] = get_permalink( $post_id ) . '#comment-' . $comment_id;
     285        }
     286
     287        return $args;
     288    }
     289
     290    /**
    198291     * Capture an {@see wp_editor()} instance as the 'User Contributed Notes' comment form.
    199292     *
    200293     * Uses output buffering to capture the editor instance for use with the {@see comments_form()}.
    201294     *
     295     * @param string           $label   Label used for the editor.
     296     * @param WP_Comment|false $comment Comment object or false. Default false.
    202297     * @return string HTML output for the wp_editor-ized comment form.
    203298     */
    204     public static function wp_editor_comments() {
     299    public static function wp_editor_comments( $label, $comment = false ) {
     300        $content = isset( $comment->comment_content ) ? trim( $comment->comment_content ) : '';
     301
     302        // wp_kses() converts htmlspecialchars in source code.
     303        $content = $content ? htmlspecialchars_decode( $content ) : '';
     304
    205305        ob_start();
    206         echo '<h3><label for="comment">' . _x( 'Add Note or Feedback', 'noun', 'wporg' ) . '</label></h3>';
     306        echo '<h3><label for="comment">' . $label . '</label></h3>';
    207307
    208308        if ( class_exists( 'DevHub_Note_Preview' ) ) {
    209             echo '<ul class="tablist" style="display:none;">';
     309            echo "<ul class='tablist' style='display: none;'>";
    210310            echo '<li><a href="#comment-form-comment">' . __( 'Write', 'wporg' ) . '</a></li>';
    211311            echo '<li><a href="#comment-preview">' . __( 'Preview', 'wporg' ) . '</a></li></ul>';
    212312        }
    213313
     314        echo '<div class="comment-form-comment tab-section" id="comment-form-comment">';
     315        wp_editor( $content, 'comment', array(
     316                'media_buttons' => false,
     317                'editor_css'    => self::get_editor_style(),
     318                'textarea_name' => 'comment',
     319                'textarea_rows' => 8,
     320                'quicktags'     => array(
     321                    'buttons' => 'strong,em,ul,ol,li'
     322                ),
     323                'teeny'         => true,
     324                'tinymce'       => false,
     325            ) );
     326        echo '</div>';
     327        return ob_get_clean();
     328    }
     329
     330    /**
     331     * Capture an {@see wp_editor()} instance as the 'User Contributed Notes' feedback form.
     332     *
     333     * Uses output buffering to capture the editor instance.
     334     *
     335     * @param WP_Comment|false $comment Comment object or false. Default false.
     336     * @param string           $display Display the editor. Default 'show'.
     337     * @param bool             $edit    True if the editor used for editing a note. Default false.
     338     * @return string HTML output for the wp_editor-ized feedback form.
     339     */
     340    public static function wp_editor_feedback( $comment, $display = 'show', $edit = false ) {
     341
     342        if ( ! ( isset( $comment->comment_ID ) && absint( $comment->comment_ID ) ) ) {
     343            return '';
     344        }
     345
     346        $comment_id = absint( $comment->comment_ID );
     347
     348        static $instance = 0;
     349        $instance++;
     350
     351        $display       = ( 'hide' === $display ) ? ' style="display: none;"' : '';
     352        $parent        = $comment_id;
     353        $action        = site_url( '/wp-comments-post.php' );
     354        $title         = __( 'Add feedback to this note', 'wporg' );
     355        $button_text   = __( 'Add Feedback', 'wporg' );
     356        $post_id       = isset( $comment->comment_post_ID ) ? $comment->comment_post_ID : get_the_ID();
     357        $content       = '';
     358        $form_type     = '';
     359        $note_link     = '';
     360        $class         = '';
     361
     362        if ( $edit ) {
     363            $content       = isset( $comment->comment_content ) ? $comment->comment_content : '';
     364            $title         = __( 'Edit feedback', 'wporg' );
     365            $form_type     = '-edit';
     366            $button_text   = __( 'Edit Note', 'wporg' );
     367            $post_url      = get_permalink( $post_id );
     368            $action        = $post_url ? $post_url . '#comment-' . $comment_id : '';
     369            $parent        = isset( $comment->comment_parent ) ? $comment->comment_parent : 0;
     370            $parent_author = \DevHub\get_note_author( $parent );
     371            $class         = ' edit-feedback-editor';
     372
     373            if ( $parent && $post_url && $parent_author ) {
     374                $post_url  = $post_url . '#comment-' . $parent;
     375                $parent_note = sprintf( __( 'note %d', 'wporg' ), $parent );
     376
     377                /* translators: 1: note, 2: note author name */
     378                $note_link = sprintf( __( '%1$s by %2$s', 'wporg' ), "<a href='{$post_url}'>{$parent_note}</a>", $parent_author );
     379            }
     380        }
     381
     382        $allowed_tags = '';
     383        foreach ( array( '<strong>', '<em>', '<code>', '<a>' ) as $tag ) {
     384            $allowed_tags .= '<code>' . htmlentities( $tag ) . '</code>, ';
     385        }
     386
     387        ob_start();
     388        echo "<div id='feedback-editor-{$comment_id}' class='feedback-editor{$class}'{$display}>\n";
     389        if ( ! $edit ) {
     390            echo "<p class='feedback-editor-title'>{$title}</p>\n";
     391        }
     392
     393        echo "<form id='feedback-form-{$instance}{$form_type}' class='feedback-form' method='post' action='{$action}' name='feedback-form-{$instance}'>\n";
     394        echo self::get_editor_rules( 'feedback', $note_link );
     395        wp_editor( $content, 'feedback-' . $instance, array(
     396                'media_buttons' => false,
     397                'textarea_name' => 'comment',
     398                'textarea_rows' => 3,
     399                'quicktags'     => array(
     400                    'buttons' => 'strong,em'
     401                ),
     402                'editor_css'    => self::get_editor_style(),
     403                'teeny'         => true,
     404                'tinymce'       => false,
     405            ) );
     406
     407        echo '<p><strong>' . __( 'Note', 'wporg' ) . '</strong>: ' . __( 'No newlines allowed', 'wporg' ) . '. ';
     408        printf( __( 'Allowed tags: %s', 'wporg' ), trim( $allowed_tags, ', ' ) ) . "</p>\n";
     409        echo "<p><input id='submit-{$instance}' class='submit' type='submit' value='{$button_text}' name='submit-{$instance}'>\n";
     410        echo "<input type='hidden' name='comment_post_ID' value='{$post_id}' id='comment_post_ID-{$instance}' />\n";
     411        echo "<input type='hidden' name='comment_parent' id='comment_parent-{$instance}' value='{$parent}' />\n";
     412
     413        if ( $edit ) {
     414            echo self::get_edit_fields( $comment_id, $instance );
     415        }
     416
     417        echo "</p>\n</form>\n</div><!-- #feedback-editor-{$comment_id} -->\n";
     418        return ob_get_clean();
     419    }
     420
     421    /**
     422     * Get the rules list for the comment form.
     423     *
     424     * @param string $context   Accepts 'feedback' or empty sring.
     425     * @param string $note_link Link to parent note.
     426     * @return string Editor rules.
     427     */
     428    public static function get_editor_rules( $context = '', $note_link = '' ) {
     429        $license_rule = sprintf(
     430            /* translators: 1: GFDL link */
     431            __( '<strong>NOTE:</strong> All contributions are licensed under %s and are moderated before appearing on the site.', 'wporg' ),
     432            '<a href="https://gnu.org/licenses/fdl.html">GFDL</a>'
     433        );
     434
     435        if ( 'feedback' === $context ) {
     436            $feedback_rule = __( 'Use this form to report errors or to add additional information to this note.', 'wporg' );
     437            if ( $note_link ) {
     438                $feedback_rule = sprintf( __( 'Use this form to report errors or to add additional information to %s.', 'wporg' ), $note_link );
     439            }
     440
     441            return '<ul><li>'
     442                . __( 'Feedback is part of the documentation.', 'wporg' ) . ' '
     443                . $feedback_rule
     444                . '</li><li>'
     445                . __( 'This form is not for support requests, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' )
     446                . '</li><li class="user-notes-are-gpl">'
     447                . $license_rule
     448                . '</li></ul>';
     449        }
     450
     451        return '<ul><li>'
     452            . __( 'This form is not for support requests, discussions, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' )
     453            . '</li><li>'
     454            . __( 'In the editing area the Tab key enters a tab character. To move below this area by pressing Tab, press the Esc key followed by the Tab key. In some cases the Esc key will need to be pressed twice before the Tab key will allow you to continue.', 'wporg' )
     455            . '</li><li class="user-notes-are-gpl">'
     456            . $license_rule
     457            . '</li></ul>';
     458    }
     459
     460    /**
     461     * Get the editor styles.
     462     *
     463     * @return string Editor styles.
     464     */
     465    public static function get_editor_style() {
    214466        $style = '<style type="text/css">';
    215467        ob_start();
    216468        include get_stylesheet_directory() . '/stylesheets/editor-style.css';
    217469        $style .= ob_get_clean();
    218         $style .=' </style>';
    219 
    220         echo '<div class="comment-form-comment tab-section" id="comment-form-comment">';
    221         wp_editor( '', 'comment', array(
    222             'media_buttons' => false,
    223             'editor_css'    => $style,
    224             'textarea_name' => 'comment',
    225             'textarea_rows' => 8,
    226             'quicktags'     => array(
    227                 'buttons' => 'strong,em,ul,ol,li'
    228             ),
    229             'teeny'         => true,
    230             'tinymce'       => false,
    231         ) );
    232         echo '</div>';
    233         return ob_get_clean();
    234     }
    235 
    236     /**
    237      * Capture an {@see wp_editor()} instance as the 'User Contributed Notes' feedback form.
    238      *
    239      * Uses output buffering to capture the editor instance.
    240      *
    241      * @return string HTML output for the wp_editor-ized feedback form.
    242      */
    243     public static function wp_editor_feedback( $comment, $display = 'show', $content = '' ) {
    244 
    245         if ( ! ( isset( $comment->comment_ID ) && absint( $comment->comment_ID ) ) ) {
    246             return '';
    247         }
    248 
    249         $comment_id = absint( $comment->comment_ID );
    250 
    251         static $instance = 0;
    252         $instance++;
    253 
    254         $display     = ( 'hide' === $display ) ? ' style="display: none;"' : '';
    255         $title       = __( 'Add feedback to this note', 'wporg' );
    256         $form_type   = '';
    257         $button_text = __( 'Add Feedback', 'wporg' );
    258 
    259         if ( $content ) {
    260             $title       = __( 'Edit feedback', 'wporg' );
    261             $form_type   = '-edit';
    262             $button_text = __( 'Edit Feedback', 'wporg' );
    263         }
    264 
    265         $allowed_tags = '';
    266         foreach ( array( '<strong>', '<em>', '<code>', '<a>' ) as $tag ) {
    267             $allowed_tags .= '<code>' . htmlentities( $tag ) . '</code>, ';
    268         }
    269 
    270         ob_start();
    271         echo "<div id='feedback-editor-{$comment_id}' class='feedback-editor'{$display}>\n";
    272         echo "<p class='feedback-editor-title'>{$title}</p>\n";
    273         echo '<form id="feedback-form-' . $instance . $form_type . '" class="feedback-form" method="post" action="' . site_url( '/wp-comments-post.php' ) . '" name="feedback-form-' . $instance ."\">\n";
    274 
    275         wp_editor( '', 'feedback-' . $instance, array(
    276             'media_buttons' => false,
    277             'textarea_name' => 'comment',
    278             'textarea_rows' => 3,
    279             'quicktags'     => array(
    280                 'buttons' => 'strong,em'
    281             ),
    282             'teeny'         => true,
    283             'tinymce'       => false,
    284         ) );
    285 
    286         echo '<p><strong>' . __( 'Note', 'wporg' ) . '</strong>: ' . __( 'No newlines allowed', 'wporg' ) . '. ';
    287         printf( __( 'Allowed tags: %s', 'wporg' ), trim( $allowed_tags, ', ' ) ) . "</p>\n";
    288         echo "<p><input id='submit-{$instance}' class='submit' type='submit' value='Add Feedback' name='submit-{$instance}'>\n";
    289         echo "<input type='hidden' name='comment_post_ID' value='" . get_the_ID() . "' id='comment_post_ID-{$instance}' />\n";
    290         echo "<input type='hidden' name='comment_parent' id='comment_parent-{$instance}' value='{$comment_id}' />\n";
    291         echo "</p>\n</form>\n</div><!-- #feedback-editor-{$comment_id} -->\n";
    292         return ob_get_clean();
     470        $style .= ' </style>';
     471        return $style;
     472    }
     473
     474    /**
     475     * Get the hidden input fields HTML used for editing a note.
     476     *
     477     * @param int     $comment_id Comment ID.
     478     * @param integer $instance   Comment form instance number used in HTML id's.
     479     * @return string Hidden input fields HTML.
     480     */
     481    public static function get_edit_fields( $comment_id, $instance = 0 ) {
     482        $fields = "<input type='hidden' name='comment_ID' id='comment_ID-{$instance}' value='{$comment_id}' />\n";
     483        $fields .= "<input type='hidden' name='update_user_note' id='update_user_note-{$instance}' value='1' />\n";
     484        $fields .= wp_nonce_field( 'update_user_note_' . $comment_id, '_wpnonce', true, false );
     485
     486        return $fields;
    293487    }
    294488
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-feedback.js

    r6910 r7754  
    55    }
    66
     7    var wpAdminBar     = 0;
    78    var options        = wporg_note_feedback;
    8     var wpAdminBar     = $('#page.admin-bar').length ? 32 : 0;
    9     var feedbackToggle = $( '<a class="feedback-toggle" href="#">' + options.show + '</a>' );
    10     var hash           = window.location.hash;
     9    var feedbackToggle = $( '<a role="button" class="feedback-toggle" href="#">' + options.show + '</a>' );
     10    var commentID      = window.location.hash;
    1111
    1212    // Check if the fragment identifier is a comment ID (e.g. #comment-63)
    13     if ( !hash.match( /#comment\-[0-9]+$/ ) ) {
    14         hash = '';
     13    if ( !commentID.match( /#comment\-[0-9]+$/ ) ) {
     14        commentID = '';
    1515    }
    1616   
    1717    $( '.feedback-editor' ).each( function() {
    18 
    19         // Hide hidden editor with 'hide-if-js' class.
    20         if( 'none' === $(this).css('display') ) {
    21             $( this ).show().addClass( 'hide-if-js' );
    22         }
     18        // Hide feedback editors with hide-if-js class
     19        $( this ).not('.edit-feedback-editor').addClass( 'hide-if-js' );
     20        $( this ).removeAttr("style");
    2321
    2422        // Add quicktag 'inline code' button to editor.
     
    3836            var toggle = feedbackToggle.clone();
    3937
     38            var feedback_id = getCommentID( $(this) );
    4039            toggle.attr( {
    4140                'aria-expanded': 'false',
    42                 'aria-controls': 'feedback-' + getCommentID( $(this) )
     41                'aria-controls': 'feedback-' + feedback_id
    4342            } );
    4443
     
    4847            }
    4948
    50             feedbackLinks.find( '.feedback-add' ).show();
     49            // Display hidden add feedback link and add aria
     50            feedbackLinks.find( '.feedback-add' ).removeAttr("style").attr( {
     51                'aria-expanded': 'false',
     52                'aria-controls': 'feedback-editor-' + feedback_id
     53            } );
     54
    5155            feedbackLinks.append( toggle );
    5256        }
    5357
    5458        if ( feedbackLinks.length ) {
    55             // Move feedback links before feedback.
     59            // Move the feedback links before the feedback section.
    5660            var clonedElements = feedbackLinks.clone().children();
    5761            var feedbackLinksTop = $( '<div class="feedback-links"></div>' ).append( clonedElements );
    5862            $( this ).find( '.feedback' ).first().before( feedbackLinksTop );
     63
     64            // Hide the bottom feedback links.
    5965            feedbackLinks.addClass( 'bottom hide-if-js' );
    6066        }
     
    6874    // Removes added elements
    6975    function resetComment( el ) {
    70 
    7176        var children = el.find( 'ul.children' );
    7277        if ( !children.length ) {
     
    7984    // Show hidden child comments if the fragment identifier is a comment ID (e.g. #comment-63). 
    8085    $( document ).ready( function() {
    81 
     86        // Set wpAdminBar
     87        wpAdminBar = $('#wpadminbar').length ? 32 : 0;
    8288        var childComments = $( '.comment' ).find( 'ul.children' );
    8389
    84         if ( !( hash.length && childComments.length ) ) {
    85             return;
    86         }
    87 
    88         var hashComment = childComments.find( hash ).first();
    89         if ( hashComment.length ) {
    90             // Child comment exists.
    91 
    92             var parent = hashComment.closest( '.comment.depth-1' );
    93             if ( parent.find( '.feedback' ).hasClass( 'hide-if-js' ) ) {
    94                 // Show child comments.
    95                 parent.find( '.feedback-toggle' ).first().trigger( 'click' );
    96             }
    97 
    98             // Scroll to the child comment.
    99             var pos = hashComment.offset();
    100             $( 'html,body' ).animate( {
    101                 scrollTop: pos.top - wpAdminBar
    102             }, 1 );
    103         }
    104     } );
    105 
    106     // Show/Hide feedback toggle link.
     90        if ( ! ( commentID.length && childComments.length ) ) {
     91            return;
     92        }
     93
     94        var comment = childComments.find( commentID + '.depth-2' ).first();
     95        if ( ! comment.length ) {
     96            return;
     97        }
     98        // Child comment exists.
     99
     100        var parent = comment.closest( '.comment.depth-1' );
     101        if ( parent.find( '.feedback' ).hasClass( 'hide-if-js' ) ) {
     102            // Show child comments.
     103            parent.find( '.feedback-toggle' ).first().trigger( 'click' );
     104        }
     105
     106        // Scroll to child comment and adjust for admin bar
     107        var pos = comment.offset();
     108        $( 'html,body' ).animate( {
     109            scrollTop: pos.top - wpAdminBar
     110        }, 1 );
     111
     112    } );
     113
     114    // Click event for Show/Hide feedback toggle link.
    107115    $( document ).on( 'click', '.feedback-toggle', function( e ) {
    108116        e.preventDefault();
     
    131139            }, 1000 );
    132140
    133             // Add feedback links at the bottom if there are over 3 feedback notes.
     141            // Show feedback links at the bottom if there are over 3 feedback notes.
    134142            var children = parent.find( 'ul.children > li' );
    135143            if ( 3 < children.length ) {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-preview.js

    r3852 r7754  
    2020        text = '';
    2121        processing = false;
     22
     23        // Show tabs with Javascript.
     24        $( '#commentform .tablist').show();
    2225
    2326        if ( textarea.length && preview.length && tabs.length ) {
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js

    r6910 r7754  
    77
    88    var commentForm = $( '.comment-form textarea' );
     9    var add_user_note = $( '#add-user-note' ); 
     10    var commentID = window.location.hash;
     11    var wpAdminBar = 0;
    912
    10     if ( !commentForm.length ) {
    11         return;
     13    // Check if the fragment identifier is a comment ID (e.g. #comment-63)
     14    if ( ! commentID.match( /#comment\-[0-9]+$/ ) ) {
     15        commentID = '';
    1216    }
    1317
     18    // Actions for when the page is ready
     19    $( document ).ready( function() {
     20        // Set wpAdminBar
     21        wpAdminBar = $( '#wpadminbar' ).length ? 32 : 0;
     22
     23        // Display form and scroll to it
     24        if ( '#respond' === window.location.hash ) {
     25            showCommentForm();
     26        }
     27
     28        if( ! wpAdminBar || ! commentID ) {
     29            return;
     30        }
     31
     32        var comment = $('#comments').find( commentID + '.depth-1' ).first();
     33        if( ! comment.length  ) {
     34            return;
     35        }
     36
     37        // Scroll to top level comment and adjust for admin bar.
     38        var pos = comment.offset();
     39        $( 'html,body' ).animate( {
     40            scrollTop: pos.top - wpAdminBar
     41        }, 1 );
     42    } );
     43
     44    // Scroll to comment if comment date link is clicked
     45    $( '#comments' ).on( 'click', '.comment-date', function( e ) {
     46        // Scroll to comment and adjust for admin bar
     47        // Add 16px for child comments
     48        var pos = $( this ).offset();
     49        $( 'html,body' ).animate( {
     50            scrollTop: pos.top - wpAdminBar - 16
     51        }, 1 );
     52    } );
     53
    1454    function showCommentForm() {
     55        if( add_user_note.length ) {
     56            add_user_note.hide();
     57        }
     58
    1559        $( '#respond' ).show();
    16         $( '#add-user-note' ).hide();
    1760
    18         var wpAdminBar = $( '#page.admin-bar' ).length ? 32 : 0;
    19         var target     = $( '#commentform #add-note-or-feedback' );
     61        var target = $( '#commentform #add-note-or-feedback' );
    2062        if ( target.length ) {
    2163            var pos = target.offset();
     
    2971    }
    3072
    31     $( '#respond, #add-user-note' ).toggle();
     73    if ( ! commentForm.length ) {
     74        return;
     75    }
     76
     77    if( add_user_note.length ) {
     78        add_user_note.show();
     79
     80        // Hide by default if #add-user-note exists
     81        $( '#respond' ).hide();
     82    }
     83
    3284    $( '#add-user-note, .table-of-contents a[href="#add-note-or-feedback"]' ).click( function( e ) {
    3385        e.preventDefault();
    34 
    3586        showCommentForm();
    3687    } );
    37 
    38     if ( '#respond' === document.location.hash ) {
    39         showCommentForm();
    40     }
    4188
    4289    // Add php and js buttons to QuickTags.
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss

    r7752 r7754  
    12061206        }
    12071207
    1208         .comment-awaiting-moderation {
     1208        .comment-awaiting-moderation,
     1209        .comment-edited {
    12091210            background-color: #fff8e5;
    12101211            padding: .2em .5em;
     1212            margin-right: .5em;
    12111213            border-radius: 3px;
    12121214            border: 1px solid #ffb900;
    12131215        }
    12141216
    1215         .depth-2 .comment-awaiting-moderation {
     1217        .depth-2 .comment-awaiting-moderation,
     1218        .depth-2 .comment-edited {
    12161219            display: inline-block;
    12171220            margin: 2px 0;
     
    12391242        #comment-preview {
    12401243            border: 1px solid #dfdfdf;
    1241             border-radius: 2px;
     1244            border-radius: 2px;
     1245            width: 100%;
    12421246        }
    12431247
     
    14311435        }
    14321436
    1433         .comment-form ul {
     1437        .comment-form ul, .feedback-form ul {
    14341438            margin-left: 1.5em;
     1439        }
     1440
     1441        .feedback-form ul li {
     1442            margin: 0;
     1443            overflow: visible;
    14351444        }
    14361445    }
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css

    r7752 r7754  
    15881588}
    15891589
    1590 .devhub-wrap .single-wp-parser-function .comment-awaiting-moderation, .devhub-wrap .single-wp-parser-method .comment-awaiting-moderation, .devhub-wrap .single-wp-parser-hook .comment-awaiting-moderation, .devhub-wrap .single-wp-parser-class .comment-awaiting-moderation {
     1590.devhub-wrap .single-wp-parser-function .comment-awaiting-moderation,
     1591.devhub-wrap .single-wp-parser-function .comment-edited, .devhub-wrap .single-wp-parser-method .comment-awaiting-moderation,
     1592.devhub-wrap .single-wp-parser-method .comment-edited, .devhub-wrap .single-wp-parser-hook .comment-awaiting-moderation,
     1593.devhub-wrap .single-wp-parser-hook .comment-edited, .devhub-wrap .single-wp-parser-class .comment-awaiting-moderation,
     1594.devhub-wrap .single-wp-parser-class .comment-edited {
    15911595  background-color: #fff8e5;
    15921596  padding: .2em .5em;
     1597  margin-right: .5em;
    15931598  border-radius: 3px;
    15941599  border: 1px solid #ffb900;
    15951600}
    15961601
    1597 .devhub-wrap .single-wp-parser-function .depth-2 .comment-awaiting-moderation, .devhub-wrap .single-wp-parser-method .depth-2 .comment-awaiting-moderation, .devhub-wrap .single-wp-parser-hook .depth-2 .comment-awaiting-moderation, .devhub-wrap .single-wp-parser-class .depth-2 .comment-awaiting-moderation {
     1602.devhub-wrap .single-wp-parser-function .depth-2 .comment-awaiting-moderation,
     1603.devhub-wrap .single-wp-parser-function .depth-2 .comment-edited, .devhub-wrap .single-wp-parser-method .depth-2 .comment-awaiting-moderation,
     1604.devhub-wrap .single-wp-parser-method .depth-2 .comment-edited, .devhub-wrap .single-wp-parser-hook .depth-2 .comment-awaiting-moderation,
     1605.devhub-wrap .single-wp-parser-hook .depth-2 .comment-edited, .devhub-wrap .single-wp-parser-class .depth-2 .comment-awaiting-moderation,
     1606.devhub-wrap .single-wp-parser-class .depth-2 .comment-edited {
    15981607  display: inline-block;
    15991608  margin: 2px 0;
     
    16351644  border: 1px solid #dfdfdf;
    16361645  border-radius: 2px;
     1646  width: 100%;
    16371647}
    16381648
     
    18091819}
    18101820
    1811 .devhub-wrap .single-wp-parser-function .comment-form ul, .devhub-wrap .single-wp-parser-method .comment-form ul, .devhub-wrap .single-wp-parser-hook .comment-form ul, .devhub-wrap .single-wp-parser-class .comment-form ul {
     1821.devhub-wrap .single-wp-parser-function .comment-form ul, .devhub-wrap .single-wp-parser-function .feedback-form ul, .devhub-wrap .single-wp-parser-method .comment-form ul, .devhub-wrap .single-wp-parser-method .feedback-form ul, .devhub-wrap .single-wp-parser-hook .comment-form ul, .devhub-wrap .single-wp-parser-hook .feedback-form ul, .devhub-wrap .single-wp-parser-class .comment-form ul, .devhub-wrap .single-wp-parser-class .feedback-form ul {
    18121822  margin-left: 1.5em;
     1823}
     1824
     1825.devhub-wrap .single-wp-parser-function .feedback-form ul li, .devhub-wrap .single-wp-parser-method .feedback-form ul li, .devhub-wrap .single-wp-parser-hook .feedback-form ul li, .devhub-wrap .single-wp-parser-class .feedback-form ul li {
     1826  margin: 0;
     1827  overflow: visible;
    18131828}
    18141829
Note: See TracChangeset for help on using the changeset viewer.