Ticket #3572: 3572.8.patch
File 3572.8.patch, 49.1 KB (added by , 7 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments-edit.php
1 <?php namespace DevHub; 2 /** 3 * The Template for editing user contributed notes. 4 * 5 * This template is used if the current user can edit a note. 6 * The global post data is set with the pre_get_posts action. 7 * 8 * @package wporg-developer 9 */ 10 11 get_header(); 12 13 $comment_id = get_query_var( 'feedback_id' ); 14 $comment = get_comment( $comment_id ); 15 $post = get_queried_object(); 16 $post_id = get_queried_object_id(); 17 18 if ( ! ( $comment && $post && $post_id ) ) { 19 // Bail if the comment or global post data is not found. 20 include get_404_template(); 21 return; 22 } 23 24 $is_parent = $comment->comment_parent ? true : false; 25 $parent = $is_parent ? get_comment( $comment->comment_parent ) : false; 26 $post_url = get_permalink( $post_id ); 27 $post_title = single_post_title( '', false ); 28 $post_types = get_parsed_post_types( 'labels' ); 29 $type_single = get_post_type_object( $post->post_type )->labels->singular_name; 30 $type_url = get_post_type_archive_link( $post->post_type ); 31 $type_label = $post_types[ $post->post_type ]; 32 $ref_url = get_site_section_url(); 33 $ref_link = "<a href='{$ref_url}'>Reference</a>"; 34 $post_link = "<a href='{$post_url}'>{$post_title}</a>"; 35 $note_link = "<a href='{$post_url}#comment-{$comment_id}'>note {$comment_id}</a>"; 36 $type_link = "<a href='{$type_url}'>{$type_label}</a>"; 37 38 $parent_link = ''; 39 $parent_author = ''; 40 if ( $is_parent && isset( $parent->comment_ID ) ) { 41 $parent_author = get_note_author_link( $parent ); 42 $parent_label = sprintf( __('note %d', 'wporg'), $parent->comment_ID ); 43 $parent_link = "<a href='{$post_url}#comment-{$parent->comment_ID}'>{$parent_label}</a>"; 44 } 45 46 add_filter( 'breadcrumb_trail_items', function($items) use ( $ref_link, $type_link, $post_link, $note_link ) { 47 $items[] = $ref_link; 48 $items[] = $type_link; 49 $items[] = $post_link; 50 $items[] = $note_link; 51 $items[] = __('Edit', 'wporg'); 52 return $items; 53 } ); 54 ?> 55 56 <div id="content-area" <?php body_class( 'code-reference' ); ?>> 57 58 <?php breadcrumb_trail( array( 'show_title' => false ) ); ?> 59 60 <main id="main" class="site-main" role="main"> 61 62 <h1><?php printf( __( 'Edit Note %d', 'wporg' ), $comment_id ); ?></h1> 63 64 <p> 65 <?php if ( $is_parent ) : ?> 66 <?php 67 /* translators: 1: comment title, 2: comment author name, 3: reference type (function, class, method, hook), 4: post title */ 68 printf( __( 'This is a feedback note to %1$s by %2$s for the %3$s %4$s.', 'wporg' ), $parent_link, $parent_author, strtolower( $type_single ), $post_link ); 69 ?> 70 <?php else : ?> 71 <?php 72 /* translators: 1: reference type (function, class, method, hook), 2: post title */ 73 printf( __( 'This is a note for the %1$s %2$s.', 'wporg' ), strtolower( $type_single ), $post_link ); ?> 74 <?php endif; ?> 75 76 <?php echo ' ' . __( "You can edit this note as long as it's in moderation.", 'wporg' ); ?> 77 </p> 78 <?php 79 if ( \DevHub\can_user_edit_note( $comment_id ) ) { 80 81 if ( $is_parent ) { 82 echo \DevHub_User_Submitted_Content::wp_editor_feedback( $comment, 'show', true ); 83 } else { 84 $args = \DevHub_User_Submitted_Content::comment_form_args( $comment, 'edit'); 85 comment_form( $args ); 86 } 87 } 88 ?> 89 90 </main><!-- #main --> 91 </div><!-- #primary --> 92 <?php get_footer(); ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php
45 45 } else { 46 46 $ordered_comments = wporg_developer_get_ordered_notes(); 47 47 if ( $ordered_comments ) { 48 $feedback_editor = array_filter( wp_list_pluck( $ordered_comments, 'show_editor') );48 $feedback_editor = array_filter( wp_list_pluck( $ordered_comments, 'show_editor' ) ); 49 49 wporg_developer_list_notes( $ordered_comments, array( 'avatar_size' => 32 ) ); 50 50 } 51 51 } … … 64 64 65 65 <?php if ( \DevHub\is_parsed_post_type() && DevHub\can_user_post_note( true, get_the_ID() ) ) : ?> 66 66 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> 67 <p id="add-user-note"><a href="<?php echo user_trailingslashit( get_permalink() ) . '#respond'; ?>"><?php _e( 'Have a note or feedback to contribute?', 'wporg' ); ?></a></p> 69 68 70 69 <?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 ) ) { 70 /* Display the comment form if the feedback form is not already displayed. 71 * If the feedback form is displayed Javascript is disabled. 72 * To display the comment form again users have to click the add-user-note link above. 73 */ 74 if ( empty( $feedback_editor ) && class_exists( 'DevHub_User_Submitted_Content' ) ) { 75 $args = \DevHub_User_Submitted_Content::comment_form_args(); 129 76 comment_form( $args ); 130 77 } 131 78 ?> -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/functions.php
56 56 require __DIR__ . '/inc/user-content-voting.php'; 57 57 58 58 /** 59 * Editing for user-submitted content. 60 */ 61 require __DIR__ . '/inc/user-content-edit.php'; 62 63 /** 59 64 * CLI commands custom post type and importer. 60 65 */ 61 66 require __DIR__ . '/inc/cli.php'; -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
202 202 // Feedback links to log in, add feedback or show feedback. 203 203 echo "<footer class='feedback-links' >\n"; 204 204 if ( $can_user_post_note ) { 205 echo "EEE";206 205 $feedback_link = trailingslashit( get_permalink() ) . "?replytocom={$comment_id}#feedback-editor-{$comment_id}"; 207 206 $display = ''; 208 207 $aria = ''; … … 243 242 $approved = ( 0 < (int) $comment->comment_approved ) ? true : false; 244 243 $is_parent = ( 0 === (int) $comment->comment_parent ) ? true : false; 245 244 $is_voting = class_exists( 'DevHub_User_Contributed_Notes_Voting' ); 245 $is_edit = class_exists( 'DevHub_User_Content_Edit' ); 246 246 $count = $is_voting ? (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ) : 0; 247 247 $curr_user_note = $is_voting ? (bool) DevHub_User_Contributed_Notes_Voting::is_current_user_note( $comment->comment_ID ) : false; 248 $edited_note_id = $is_edit ? DevHub_User_Content_Edit::get_edited_note() : 0; 249 $is_edited_note = $edited_note_id && ( (int) $comment->comment_ID === $edited_note_id ); 250 $note_author = \DevHub\get_note_author_link( $comment ); 251 $can_edit_note = \DevHub\can_user_edit_note( $comment->comment_ID ); 252 $has_edit_cap = current_user_can( 'edit_comment', $comment->comment_ID ); 248 253 249 // C lasses254 // CSS Classes 250 255 $comment_class = array(); 251 256 252 257 if ( -1 > $count ) { … … 261 266 $comment_class[] = 'user-note-moderated'; 262 267 } 263 268 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>";277 }278 279 269 $date = sprintf( _x( '%1$s ago', '%1$s = human-readable time difference', 'wporg' ), 280 270 human_time_diff( get_comment_time( 'U' ), 281 271 current_time( 'timestamp' ) ) … … 300 290 echo get_avatar( $comment, $args['avatar_size'] ); 301 291 } 302 292 303 printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $ comment_author_link) );293 printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $note_author ) ); 304 294 ?> 305 295 306 296 </span> 307 297 — 308 <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>">298 <a class="comment-date" href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> 309 299 <time datetime="<?php comment_time( 'c' ); ?>"> 310 300 <?php echo $date; ?> 311 301 </time> 312 302 </a> 313 303 <?php edit_comment_link( __( 'Edit', 'wporg' ), '<span class="edit-link">— ', '</span>' ); ?> 304 <?php if ( ! $has_edit_cap && $can_edit_note ) : ?> 305 — <span class="comment-author-edit-link"> 306 <a class="comment-edit-link" href="<?php echo site_url( "/reference/comment/edit/{$comment->comment_ID}" ); ?>"><?php _e( 'Edit', 'wporg' ); ?></a> 307 </span> 308 <?php endif; ?> 309 <?php if ( $can_edit_note && $is_edited_note ) : ?> 310 — <span class="comment-edited"> 311 <?php _e( 'edited', 'wporg' ); ?> 312 </span> 313 <?php endif; ?> 314 314 <?php if ( ! $approved ) : ?> 315 315 — <span class="comment-awaiting-moderation"><?php _e( 'awaiting moderation', 'wporg' ); ?></span> 316 316 <?php endif; ?> … … 325 325 comment_text(); 326 326 } else { 327 327 $text = get_comment_text() . ' — '; 328 $text .= sprintf( __( 'By %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $ comment_author_link) ) . ' — ';329 $text .= ' <a href="'. esc_url( get_comment_link( $comment->comment_ID ) ) . '">';328 $text .= sprintf( __( 'By %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $note_author ) ) . ' — '; 329 $text .= ' <a class="comment-date" href="'. esc_url( get_comment_link( $comment->comment_ID ) ) . '">'; 330 330 $text .= '<time datetime="' . get_comment_time( 'c' ) . '">' . $date . '</time></a>'; 331 331 332 if ( current_user_can( 'edit_comment', $comment->comment_ID )) {332 if ( $has_edit_cap ) { 333 333 $text .= ' — <a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) .'">'; 334 334 $text .= __( 'Edit', 'wporg' ) . '</a>'; 335 } elseif ( $can_edit_note ) { 336 $text .= ' — <a class="comment-edit-link" href="' . site_url( "/reference/comment/edit/{$comment->comment_ID}" ) . '">'; 337 $text .= __( 'Edit', 'wporg' ) . '</a>'; 335 338 } 336 339 340 if( $can_edit_note && $is_edited_note ) { 341 $text .= ' — <span class="comment-edited">' . __( 'edited', 'wporg' ) . '</span>'; 342 } 343 337 344 if ( ! $approved ) { 338 345 $text .= ' — <span class="comment-awaiting-moderation">' . __( 'awaiting moderation', 'wporg' ) . '</span>'; 339 346 } … … 1397 1404 } 1398 1405 1399 1406 /** 1407 * Indicates if the current user can edit a user contibuted note. 1408 * 1409 * A user can edit a note if the note is from a parsed post type, and 1410 * the note is from the current user and it's not yet approved. 1411 * Or if the user has the 'edit_comment' capability. 1412 * 1413 * @param integer $note_id Note ID. 1414 * @return bool True if the current user can edit the note. 1415 */ 1416 function can_user_edit_note( $note_id = 0 ) { 1417 $user = get_current_user_id(); 1418 $note = get_comment( $note_id ); 1419 if ( ! $user || ! $note ) { 1420 return false; 1421 } 1422 1423 $post_id = isset( $note->comment_post_ID ) ? (int) $note->comment_post_ID : 0; 1424 $is_note_author = isset( $note->user_id ) && ( (int) $note->user_id === $user ); 1425 $is_approved = isset( $note->comment_approved ) && ( 0 < (int) $note->comment_approved ); 1426 $can_edit_notes = isset( $note->comment_ID ) && current_user_can( 'edit_comment', $note->comment_ID ); 1427 $is_parsed_type = is_parsed_post_type( get_post_type( $post_id ) ); 1428 1429 if ( $is_parsed_type && ( $can_edit_notes || ( $is_note_author && ! $is_approved ) ) ) { 1430 return true; 1431 } 1432 1433 return false; 1434 } 1435 1436 /** 1437 * Get the note author link to the profiles.wordpress.org author's URL. 1438 * 1439 * @param WP_Comment|int $comment Comment object or comment ID. 1440 * @return string The HTML link to the profiles.wordpress.org author's URL. 1441 */ 1442 function get_note_author_link( $comment ) { 1443 return get_note_author( $comment, true ); 1444 } 1445 1446 /** 1447 * Get the note author nicename. 1448 * 1449 * @param WP_Comment|int $comment Comment object or comment ID. 1450 * @param bool $link. Whether to return a link to the author's profiles. Default false. 1451 * @return string The comment author name or HTML link. 1452 */ 1453 function get_note_author( $comment, $link = false ) { 1454 $comment = get_comment( $comment ); 1455 $user_id = isset( $comment->user_id ) ? $comment->user_id : 0; 1456 $commenter = get_user_by( 'id', $comment->user_id ); 1457 $author = ''; 1458 1459 if ( $user_id && isset( $commenter->user_nicename ) ) { 1460 $url = 'https://profiles.wordpress.org/' . sanitize_key( $commenter->user_nicename ) . '/'; 1461 $author = get_the_author_meta( 'display_name', $comment->user_id ); 1462 } else { 1463 $url = isset( $comment->comment_author_url ) ? $comment->comment_author_url : ''; 1464 $author = isset( $comment->comment_author ) ? $comment->comment_author : ''; 1465 } 1466 1467 if ( $link && ( $url && $author ) ) { 1468 $author = "<a href='$url' rel='external nofollow' class='url'>$author</a>"; 1469 } 1470 1471 return $author; 1472 } 1473 1474 /** 1400 1475 * Gets the summary. 1401 1476 * 1402 1477 * The summary (aka short description) is stored in the 'post_excerpt' field. -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content-edit.php
1 <?php 2 /** 3 * Code Reference edit user submitted content (comments, notes, etc). 4 * 5 * Allows users to edit top level and child comments. 6 * 7 * @package wporg-developer 8 */ 9 10 /** 11 * Class to handle editing user submitted content. 12 */ 13 class DevHub_User_Content_Edit { 14 15 private static $updated_note = 0; 16 17 /** 18 * Initializer 19 */ 20 public static function init() { 21 add_action( 'init', array( __CLASS__, 'do_init' ) ); 22 } 23 24 /** 25 * Handles adding hooks to enable editing comments. 26 * Adds rewrite rules for editing comments in the front end. 27 */ 28 public static function do_init() { 29 // Add the edit comment rewrite rule 30 add_rewrite_rule( 'reference/comment/edit/([0-9]{1,})/?$', 'index.php?feedback_id=$matches[1]', 'top' ); 31 32 // Add feedback_id query var for editing. 33 add_filter( 'query_vars', array( __CLASS__, 'comment_query_var' ) ); 34 35 // Redirect to home page if the edit request is invalid. 36 add_action( 'template_redirect', array( __CLASS__, 'redirect_invalid_edit_request' ) ); 37 38 // Include the comment edit template. 39 add_filter( 'template_include', array( __CLASS__, 'template_include' ) ); 40 41 // Set the post_type and post for an edit request. 42 add_action( 'pre_get_posts', array( __CLASS__, 'pre_get_posts' ) ); 43 44 // Update the comment. 45 add_action( 'wp', array( __CLASS__, 'update_comment' ) ); 46 } 47 48 /** 49 * Get the note ID that was edited. 50 * 51 * @return int Note ID that was edited or 0. 52 */ 53 public static function get_edited_note() { 54 return self::$updated_note ? (int) self::$updated_note : 0; 55 } 56 57 /** 58 * Add feedback_id to the public query vars. 59 * 60 * @param array $query_vars Array with public query vars. 61 * @return array Public query vars. 62 */ 63 public static function comment_query_var( $query_vars ) { 64 $query_vars[] = 'feedback_id'; 65 return $query_vars; 66 } 67 68 /** 69 * Update a comment after editing. 70 */ 71 public static function update_comment() { 72 self::$updated_note = 0; 73 74 if ( ! is_single() || ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) ) { 75 return; 76 } 77 78 $comment_data = wp_unslash( $_POST ); 79 80 $defaults = array( 81 'edit_contributed_note', 82 '_wpnonce', 83 'comment_ID', 84 'comment', 85 'comment_parent', 86 'comment_post_ID' 87 ); 88 89 foreach ( $defaults as $value ) { 90 if ( ! isset( $comment_data[ $value ] ) ) { 91 // Return if any of the $_POST keys are missing. 92 return; 93 } 94 } 95 96 $comment = trim( (string) $comment_data['comment'] ); 97 if ( ! $comment ) { 98 // Bail and provide a way back to the edit form if a comment is empty. 99 $msg = __( '<strong>ERROR</strong>: please type a comment.', 'wporg' ); 100 $args = array( 'response' => 200, 'back_link' => true ); 101 wp_die( '<p>' . $msg . '</p>', __( 'Comment Submission Failure', 'wporg' ), $args ); 102 } 103 104 $post_id = absint( $comment_data['comment_post_ID'] ); 105 $comment_id = absint( $comment_data['comment_ID'] ); 106 $can_user_edit = DevHub\can_user_edit_note( $comment_id ); 107 $action = 'update-note_' . $comment_id; 108 $is_nonce = wp_verify_nonce( $comment_data['_wpnonce'], $action ); 109 $is_post_type = $post_id && is_singular( get_post_type( $post_id ) ); 110 $is_id = $post_id && ( $post_id === get_the_ID() ); 111 112 if ( $is_id && $is_post_type && $is_nonce && $can_user_edit ) { 113 self::$updated_note = $comment_id; 114 $comment = trim( (string) $comment_data['comment'] ); 115 $comment_data['comment_content'] = $comment; 116 wp_update_comment( $comment_data ); 117 } 118 } 119 120 /** 121 * Redirects to the home page if the edit request is invalid for the current user. 122 * 123 * Redirects if the comment doesn't exist. 124 * Redirects if the comment is not for a parsed post type. 125 * Redirects if the current user is not the comment author. 126 * Redirects if a comment is already approved. 127 * 128 * Doesn't redirect for users with the edit_comment capability. 129 */ 130 public static function redirect_invalid_edit_request() { 131 $comment_id = absint( get_query_var( 'feedback_id' ) ); 132 if ( ! $comment_id ) { 133 // Not a query for editing a note. 134 return; 135 } 136 137 if ( ! DevHub\can_user_edit_note( $comment_id ) ) { 138 wp_redirect( home_url() ); 139 exit(); 140 } 141 } 142 143 /** 144 * Use the 'comments-edit.php' template for editing comments. 145 * 146 * The current user has already been verified in the template_redirect action. 147 * 148 * @param string $template Template to include. 149 * @return string Template to include. 150 */ 151 public static function template_include( $template ) { 152 $comment = get_query_var( 'feedback_id' ); 153 if ( ! $comment ) { 154 // Not a query for editing a note. 155 return $template; 156 } 157 158 $comment_template = get_query_template( "comments-edit" ); 159 if ( $comment_template ) { 160 $template = $comment_template; 161 } 162 return $template; 163 } 164 165 /** 166 * Sets the post and post type for an edit request. 167 * 168 * Trows a 404 if the current user can't edit the requested note. 169 * 170 * @param WP_Query $query The WP_Query instance (passed by reference) 171 */ 172 public static function pre_get_posts( $query ) { 173 $comment_id = $query->get( 'feedback_id' ); 174 175 if ( is_admin() || ! ( $query->is_main_query() && $comment_id ) ) { 176 // Not a query for editing a note. 177 return; 178 } 179 180 if ( DevHub\can_user_edit_note( $comment_id ) ) { 181 $comment = get_comment( $comment_id ); 182 if ( isset( $comment->comment_post_ID ) ) { 183 $query->is_singular = true; 184 $query->is_single = true; 185 $query->set( 'post_type', get_post_type( $comment->comment_post_ID ) ); 186 $query->set( 'p', $comment->comment_post_ID ); 187 188 return; 189 } 190 } 191 192 // Set 404 if a user can't edit a note. 193 $query->set_404(); 194 } 195 196 } // DevHub_User_Content_Edit 197 198 DevHub_User_Content_Edit::init(); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php
50 50 remove_filter( 'comment_text', 'capital_P_dangit', 31 ); 51 51 52 52 // Enable shortcodes for comments 53 add_filter( 'comment_text', 'do_shortcode' );53 add_filter( 'comment_text', 'do_shortcode' ); 54 54 55 55 // Customize allowed tags 56 56 add_filter( 'wp_kses_allowed_html', array( __CLASS__, 'wp_kses_allowed_html' ), 10, 2 ); … … 67 67 // Allowed HTML for an edited child comment (There is no decent hook to filter child comments only) 68 68 add_action( 'edit_comment', array( __CLASS__, 'comment_edit_allowed_html' ) ); 69 69 70 // Adds hidden fields for editing to a comment form 71 add_filter( 'comment_form_submit_field', array( __CLASS__, 'add_hidden_fields' ), 10, 2 ); 70 72 } 71 73 72 74 /** … … 167 169 wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'jquery', 'quicktags' ), '20180323', true ); 168 170 wp_enqueue_script( 'wporg-developer-user-notes-feedback', get_template_directory_uri() . '/js/user-notes-feedback.js', array( 'jquery', 'quicktags' ), '20180323', true ); 169 171 wp_localize_script( 'wporg-developer-user-notes-feedback', 'wporg_note_feedback', array( 170 'show' => __( 'Show Feedback', 'wporg' ),171 'hide' => __( 'Hide Feedback', 'wporg' ),172 ) );172 'show' => __( 'Show Feedback', 'wporg' ), 173 'hide' => __( 'Hide Feedback', 'wporg' ), 174 ) ); 173 175 } 174 176 } 175 177 … … 176 178 /** 177 179 * Sets the default language for SyntaxHighlighter shortcode. 178 180 * 179 * @param 181 * @param array $atts Shortcode attributes. 180 182 * @return array 181 183 */ 182 184 public static function syntaxhighlighter_shortcodeatts( $atts ) { … … 187 189 /** 188 190 * Subverts capital_P_dangit for SyntaxHighlighter shortcode. 189 191 * 190 * @param 192 * @param string $code 191 193 * @return string 192 194 */ 193 195 public static function syntaxhighlighter_precode( $code ) { … … 195 197 } 196 198 197 199 /** 200 * Add hidden fields to the comment form if the context is 'edit' 201 * 202 * @param string $submit_field HTML string with the submit button fields. 203 * @param array $args Arguments for the comment form. 204 * @return HTML string with the submit button fields. 205 */ 206 public static function add_hidden_fields( $submit_field, $args ) { 207 $context = isset( $args['context'] ) ? $args['context'] : ''; 208 $comment = isset( $args['comment_edit'] ) ? $args['comment_edit'] : false; 209 if ( ! ( $comment && ( 'edit' === $context ) ) ) { 210 return $submit_field; 211 } 212 213 $comment_id = isset( $comment->comment_ID ) ? $comment->comment_ID : 0; 214 215 return $submit_field . self::get_edit_fields( $comment_id, $instance = 0 ); 216 } 217 218 /** 219 * Get the comment form arguments by context. 220 * 221 * @param WP_Comment|false $comment Comment object or false. Default false. 222 * @param string $context Context of arguments. Accepts 'edit' or empty string. 223 * @return array Array with comment form arguments. 224 */ 225 public static function comment_form_args( $comment = false, $context = '' ) { 226 $label = _x( 'Add Note or Feedback', 'noun', 'wporg' ); 227 if ( 'edit' === $context ) { 228 $label = _x( 'Edit Note', 'noun', 'wporg' ); 229 } 230 231 $args = array( 232 'logged_in_as' => '<p class="logged-in-as">' 233 . sprintf( 234 /* translators: 1: user profile link, 2: accessibility text, 3: user name, 4: logout URL */ 235 __( '<a href="%1$s" aria-label="%2$s">Logged in as %3$s</a>. <a href="%4$s">Log out?</a>' ), 236 'https://profiles.wordpress.org/' . esc_attr( wp_get_current_user()->user_nicename ), 237 /* translators: %s: user name */ 238 esc_attr( sprintf( __( 'Logged in as %s. Edit your profile.' ), $user_identity ) ), 239 $user_identity, 240 wp_logout_url( apply_filters( 'the_permalink', get_permalink() ) ) 241 ) 242 . '</p><p><ul><li>' 243 . __( 'Notes should supplement code reference entries, for example examples, tips, explanations, use-cases, and best practices.', 'wporg' ) 244 . '</li><li>' 245 . __( 'Feedback can be to report errors or omissions with the documentation on this page. Such feedback will not be publicly posted.', 'wporg' ) 246 . '</li><li>' 247 /* translators: 1: php button, 2: js button, 3: inline code button */ 248 . sprintf( 249 __( 'You can enter text and code. Use the %1$s, %2$s, or %3$s buttons to wrap code snippets.', 'wporg' ), 250 '<span class="text-button">php</span>', 251 '<span class="text-button">js</span>', 252 '<span class="text-button">' . __( 'inline code', 'wporg' ) . '</span>' 253 ) 254 . '</li></ul></p>', 255 'comment_notes_after' => '<p>' . __( 'Submission Notes:', 'wporg' ) . '</p>' . self::get_editor_rules(), 256 'label_submit' => $label, 257 'cancel_reply_link' => '', 258 'must_log_in' => '<p>' . sprintf( 259 __( 'You must <a href="%s">log in</a> before being able to contribute a note or feedback.', 'wporg' ), 260 'https://login.wordpress.org/?redirect_to=' . urlencode( get_comments_link() ) 261 ) . '</p>', 262 'title_reply' => '', //'Add Example' 263 'title_reply_to' => '', 264 ); 265 266 if ( class_exists( 'DevHub_Note_Preview' ) ) { 267 $args['comment_notes_after'] = DevHub_Note_Preview::comment_preview() . $args['comment_notes_after']; 268 $args['class_form'] = "comment-form tab-container"; 269 } 270 271 $args['comment_field'] = self::wp_editor_comments( $label, $comment ); 272 $args['context'] = $context; 273 $args['comment_edit'] = $comment; 274 275 if ( $comment && ( 'edit' === $context ) ) { 276 $comment_id = isset( $comment->comment_ID ) ? $comment->comment_ID : 0; 277 $post_id = isset( $comment->comment_post_ID ) ? $comment->comment_post_ID : 0; 278 279 $args['action'] = get_permalink( $post_id ) . '#comment-' . $comment_id; 280 } 281 282 return $args; 283 } 284 285 /** 198 286 * Capture an {@see wp_editor()} instance as the 'User Contributed Notes' comment form. 199 287 * 200 288 * Uses output buffering to capture the editor instance for use with the {@see comments_form()}. 201 289 * 290 * @param string $label Label used for the editor. 291 * @param WP_Comment|false $comment Comment object or false. Default false. 202 292 * @return string HTML output for the wp_editor-ized comment form. 203 293 */ 204 public static function wp_editor_comments() { 294 public static function wp_editor_comments( $label, $comment = false ) { 295 $content = isset( $comment->comment_content ) ? trim( $comment->comment_content ) : ''; 296 297 // wp_kses() converts htmlspecialchars in source code. 298 $content = $content ? htmlspecialchars_decode( $content ) : ''; 299 205 300 ob_start(); 206 echo '<h3><label for="comment">' . _x( 'Add Note or Feedback', 'noun', 'wporg' ). '</label></h3>';301 echo '<h3><label for="comment">' . $label . '</label></h3>'; 207 302 208 303 if ( class_exists( 'DevHub_Note_Preview' ) ) { 209 echo '<ul class="tablist" style="display:none;">';304 echo "<ul class='tablist' style='display: none;'>"; 210 305 echo '<li><a href="#comment-form-comment">' . __( 'Write', 'wporg' ) . '</a></li>'; 211 306 echo '<li><a href="#comment-preview">' . __( 'Preview', 'wporg' ) . '</a></li></ul>'; 212 307 } 213 308 214 $style = '<style type="text/css">';215 ob_start();216 include get_stylesheet_directory() . '/stylesheets/editor-style.css';217 $style .= ob_get_clean();218 $style .=' </style>';219 220 309 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 ) );310 wp_editor( $content, 'comment', array( 311 'media_buttons' => false, 312 'editor_css' => self::get_editor_style(), 313 'textarea_name' => 'comment', 314 'textarea_rows' => 8, 315 'quicktags' => array( 316 'buttons' => 'strong,em,ul,ol,li' 317 ), 318 'teeny' => true, 319 'tinymce' => false, 320 ) ); 232 321 echo '</div>'; 233 322 return ob_get_clean(); 234 323 } … … 238 327 * 239 328 * Uses output buffering to capture the editor instance. 240 329 * 330 * @param WP_Comment|false $comment Comment object or false. Default false. 331 * @param string $display Display the editor. Default 'show'. 332 * @param bool $edit True if the editor used for editing a note. Default false. 241 333 * @return string HTML output for the wp_editor-ized feedback form. 242 334 */ 243 public static function wp_editor_feedback( $comment, $display = 'show', $ content = '') {335 public static function wp_editor_feedback( $comment, $display = 'show', $edit = false ) { 244 336 245 337 if ( ! ( isset( $comment->comment_ID ) && absint( $comment->comment_ID ) ) ) { 246 338 return ''; … … 251 343 static $instance = 0; 252 344 $instance++; 253 345 254 $display = ( 'hide' === $display ) ? ' style="display: none;"' : ''; 255 $title = __( 'Add feedback to this note', 'wporg' ); 256 $form_type = ''; 257 $button_text = __( 'Add Feedback', 'wporg' ); 346 $display = ( 'hide' === $display ) ? ' style="display: none;"' : ''; 347 $parent = $comment_id; 348 $action = site_url( '/wp-comments-post.php' ); 349 $content = ''; 350 $title = __( 'Add feedback to this note', 'wporg' ); 351 $form_type = ''; 352 $button_text = __( 'Add Feedback', 'wporg' ); 353 $post_id = isset( $comment->comment_post_ID ) ? $comment->comment_post_ID : get_the_ID(); 354 $note_link = ''; 258 355 259 if ( $content ) { 356 if ( $edit ) { 357 $content = isset( $comment->comment_content ) ? $comment->comment_content : ''; 260 358 $title = __( 'Edit feedback', 'wporg' ); 261 359 $form_type = '-edit'; 262 $button_text = __( 'Edit Feedback', 'wporg' ); 360 $button_text = __( 'Edit Note', 'wporg' ); 361 $action = get_permalink( $post_id ) . '#comment-' . $comment_id; 362 363 $parent = isset( $comment->comment_parent ) ? $comment->comment_parent : 0; 364 $parent_url = get_permalink( $post_id ) . '#comment-' . $parent; 365 $parent_author = \DevHub\get_note_author( $parent ); 366 $parent_note = sprintf( __( 'note %d', 'wporg' ), $parent ); 367 368 /* translators: 1: note, 2: note author name */ 369 $note_link = sprintf( __( '%1$s by %2$s', 'wporg' ), "<a href='{$parent_url}'>{$parent_note}</a>", $parent_author ); 263 370 } 264 371 265 372 $allowed_tags = ''; … … 269 376 270 377 ob_start(); 271 378 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"; 379 if ( ! $edit ) { 380 echo "<p class='feedback-editor-title'>{$title}</p>\n"; 381 } 274 382 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 ) ); 383 echo "<form id='feedback-form-{$instance}{$form_type}' class='feedback-form' method='post' action='{$action}' name='feedback-form-{$instance}'>\n"; 384 echo self::get_editor_rules( 'feedback', $note_link ); 385 wp_editor( $content, 'feedback-' . $instance, array( 386 'media_buttons' => false, 387 'textarea_name' => 'comment', 388 'textarea_rows' => 3, 389 'quicktags' => array( 390 'buttons' => 'strong,em' 391 ), 392 'editor_css' => self::get_editor_style(), 393 'teeny' => true, 394 'tinymce' => false, 395 ) ); 285 396 286 397 echo '<p><strong>' . __( 'Note', 'wporg' ) . '</strong>: ' . __( 'No newlines allowed', 'wporg' ) . '. '; 287 398 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"; 399 echo "<p><input id='submit-{$instance}' class='submit' type='submit' value='{$button_text}' name='submit-{$instance}'>\n"; 400 echo "<input type='hidden' name='comment_post_ID' value='{$post_id}' id='comment_post_ID-{$instance}' />\n"; 401 echo "<input type='hidden' name='comment_parent' id='comment_parent-{$instance}' value='{$parent}' />\n"; 402 403 if ( $edit ) { 404 echo self::get_edit_fields( $comment_id, $instance ); 405 } 406 291 407 echo "</p>\n</form>\n</div><!-- #feedback-editor-{$comment_id} -->\n"; 292 408 return ob_get_clean(); 293 409 } 294 410 411 /** 412 * Get the rules list for the comment form. 413 * 414 * @param string $context Accepts 'feedback' or empty sring 415 * @return string Editor rules. 416 */ 417 function get_editor_rules( $context = '', $note_link = '' ) { 418 $license_rule = sprintf( 419 /* translators: 1: GFDL link */ 420 __( '<strong>NOTE:</strong> All contributions are licensed under %s and are moderated before appearing on the site.', 'wporg' ), 421 '<a href="https://gnu.org/licenses/fdl.html">GFDL</a>' 422 ); 423 424 if ( 'feedback' === $context ) { 425 $feedback_rule = __( 'Use this form to report errors or to add additional information to this note.', 'wporg' ); 426 if ( $note_link ) { 427 $feedback_rule = sprintf( __( 'Use this form to report errors or to add additional information to %s.', 'wporg' ), $note_link ); 428 } 429 430 return '<ul><li>' 431 . __( 'Feedback is part of the documentation.', 'wporg' ) . ' ' 432 . $feedback_rule 433 . '</li><li>' 434 . __( 'This form is not for support requests, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' ) 435 . '</li><li class="user-notes-are-gpl">' 436 . $license_rule 437 . '</li></ul>'; 438 } 439 440 return '<ul><li>' 441 . __( 'This form is not for support requests, discussions, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' ) 442 . '</li><li>' 443 . __( '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' ) 444 . '</li><li class="user-notes-are-gpl">' 445 . $license_rule 446 . '</li></ul>'; 447 } 448 449 /** 450 * Get the editor styles. 451 * 452 * @return string Editor styles. 453 */ 454 function get_editor_style() { 455 $style = '<style type="text/css">'; 456 ob_start(); 457 include get_stylesheet_directory() . '/stylesheets/editor-style.css'; 458 $style .= ob_get_clean(); 459 $style .= ' </style>'; 460 return $style; 461 } 462 463 /** 464 * Get the hidden input fields HTML used when editing. 465 * 466 * @param int $comment_id Comment ID. 467 * @param integer $instance Comment form instance number used in HTML id's. 468 * @return string Hidden input fields HTML. 469 */ 470 function get_edit_fields( $comment_id, $instance = 0 ) { 471 $fields = "<input type='hidden' name='comment_ID' id='comment_ID-{$instance}' value='{$comment_id}' />\n"; 472 $fields .= "<input type='hidden' name='edit_contributed_note' id='edit_note_feedback-{$instance}' value='1' />\n"; 473 $fields .= wp_nonce_field( 'update-note_' . $comment_id, '_wpnonce', true, false ); 474 475 return $fields; 476 } 477 295 478 } // DevHub_User_Submitted_Content 296 479 297 480 DevHub_User_Submitted_Content::init(); -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-feedback.js
4 4 return; 5 5 } 6 6 7 var wpAdminBar = 0; 7 8 var options = wporg_note_feedback; 8 var wpAdminBar = $('#page.admin-bar').length ? 32 : 0;9 9 var feedbackToggle = $( '<a class="feedback-toggle" href="#">' + options.show + '</a>' ); 10 10 var hash = window.location.hash; 11 11 … … 78 78 79 79 // Show hidden child comments if the fragment identifier is a comment ID (e.g. #comment-63). 80 80 $( document ).ready( function() { 81 81 wpAdminBar = $('#wpadminbar').length ? 32 : 0 82 82 var childComments = $( '.comment' ).find( 'ul.children' ); 83 83 84 if ( ! ( hash.length && childComments.length ) ) {84 if ( ! ( hash.length && childComments.length ) ) { 85 85 return; 86 86 } 87 87 88 var hashComment = childComments.find( hash ).first(); 89 if ( hashComment.length ) { 90 // Child comment exists. 88 var hashComment = childComments.find( hash + '.depth-2' ).first(); 89 if ( ! hashComment.length ) { 90 return; 91 } 92 // Child comment exists. 91 93 92 93 94 95 96 94 var parent = hashComment.closest( '.comment.depth-1' ); 95 if ( parent.find( '.feedback' ).hasClass( 'hide-if-js' ) ) { 96 // Show child comments. 97 parent.find( '.feedback-toggle' ).first().trigger( 'click' ); 98 } 97 99 98 // Scroll to the child comment.99 100 101 102 103 } 100 // Scroll to child comment and adjust for admin bar 101 var pos = hashComment.offset(); 102 $( 'html,body' ).animate( { 103 scrollTop: pos.top - wpAdminBar 104 }, 1 ); 105 104 106 } ); 105 107 106 108 // Show/Hide feedback toggle link. -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-preview.js
20 20 text = ''; 21 21 processing = false; 22 22 23 // Show tabs with Javascript. 24 $( '#commentform .tablist').show(); 25 23 26 if ( textarea.length && preview.length && tabs.length ) { 24 27 25 28 // Append spinner to preview tab -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js
5 5 6 6 ( function( $ ) { 7 7 8 var commentForm = $( '.comment-form textarea' ); 8 var commentForm = $( '.comment-form textarea' ); 9 var hash = window.location.hash; 10 var wpAdminBar = 0; 9 11 10 if ( !commentForm.length ) { 11 return; 12 // Check if the fragment identifier is a comment ID (e.g. #comment-63) 13 if ( ! hash.match( /#comment\-[0-9]+$/ ) ) { 14 hash = ''; 12 15 } 13 16 17 // Scroll to top level comments 18 $( document ).ready( function() { 19 wpAdminBar = $( '#wpadminbar' ).length ? 32 : 0; 20 if( ! wpAdminBar || ! hash ) { 21 return; 22 } 23 24 var hashComment = $('#comments').find( hash + '.depth-1' ).first(); 25 if( ! hashComment.length ) { 26 return; 27 } 28 29 // Scroll to top level comment and adjust for admin bar. 30 var pos = hashComment.offset(); 31 $( 'html,body' ).animate( { 32 scrollTop: pos.top - wpAdminBar 33 }, 1 ); 34 } ); 35 36 // Scroll to comment if comment date link is clicked 37 $( '#comments' ).on( 'click', '.comment-date', function( e ) { 38 e.preventDefault(); 39 40 // Scroll to comment and adjust for admin bar 41 // Add 16px for child comments 42 var pos = $( this ).offset(); 43 $( 'html,body' ).animate( { 44 scrollTop: pos.top - wpAdminBar - 16 45 }, 1 ); 46 } ); 47 14 48 function showCommentForm() { 49 $( '#add-user-note' ).hide(); 15 50 $( '#respond' ).show(); 16 $( '#add-user-note' ).hide();17 51 18 var wpAdminBar = $( '#page.admin-bar' ).length ? 32 : 0;19 52 var target = $( '#commentform #add-note-or-feedback' ); 20 53 if ( target.length ) { 21 54 var pos = target.offset(); … … 28 61 } 29 62 } 30 63 31 $( '#respond, #add-user-note' ).toggle(); 64 if ( ! commentForm.length ) { 65 return; 66 } 67 68 if( $('#add-user-note').length ) { 69 // Hide by default if #add-user-note exists 70 $( '#respond' ).hide(); 71 } 72 32 73 $( '#add-user-note, .table-of-contents a[href="#add-note-or-feedback"]' ).click( function( e ) { 33 74 e.preventDefault(); 34 75 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
1137 1137 opacity: 1; 1138 1138 } 1139 1139 1140 .comment-awaiting-moderation { 1140 .comment-awaiting-moderation, 1141 .comment-edited { 1141 1142 background-color: #fff8e5; 1142 1143 padding: .2em .5em; 1144 margin-right: .5em; 1143 1145 border-radius: 3px; 1144 1146 border: 1px solid #ffb900; 1145 1147 } 1146 1148 1147 .depth-2 .comment-awaiting-moderation { 1149 .depth-2 .comment-awaiting-moderation, 1150 .depth-2 .comment-edited { 1148 1151 display: inline-block; 1149 1152 margin: 2px 0; 1150 1153 } … … 1170 1173 .comment-list li.depth-1, 1171 1174 #comment-preview { 1172 1175 border: 1px solid #dfdfdf; 1173 border-radius: 2px; 1176 border-radius: 2px; 1177 width: 100%; 1174 1178 } 1175 1179 1176 1180 // Feedback … … 1362 1366 padding: 0 5px; 1363 1367 } 1364 1368 1365 .comment-form ul {1369 .comment-form ul, .feedback-form ul { 1366 1370 margin-left: 1.5em; 1367 1371 } 1372 1373 .feedback-form ul li { 1374 margin: 0; 1375 overflow: visible; 1376 } 1368 1377 } 1369 1378 1370 1379 &.single-post { -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
1514 1514 opacity: 1; 1515 1515 } 1516 1516 1517 .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 { 1517 .devhub-wrap .single-wp-parser-function .comment-awaiting-moderation, 1518 .devhub-wrap .single-wp-parser-function .comment-edited, .devhub-wrap .single-wp-parser-method .comment-awaiting-moderation, 1519 .devhub-wrap .single-wp-parser-method .comment-edited, .devhub-wrap .single-wp-parser-hook .comment-awaiting-moderation, 1520 .devhub-wrap .single-wp-parser-hook .comment-edited, .devhub-wrap .single-wp-parser-class .comment-awaiting-moderation, 1521 .devhub-wrap .single-wp-parser-class .comment-edited { 1518 1522 background-color: #fff8e5; 1519 1523 padding: .2em .5em; 1524 margin-right: .5em; 1520 1525 border-radius: 3px; 1521 1526 border: 1px solid #ffb900; 1522 1527 } 1523 1528 1524 .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 { 1529 .devhub-wrap .single-wp-parser-function .depth-2 .comment-awaiting-moderation, 1530 .devhub-wrap .single-wp-parser-function .depth-2 .comment-edited, .devhub-wrap .single-wp-parser-method .depth-2 .comment-awaiting-moderation, 1531 .devhub-wrap .single-wp-parser-method .depth-2 .comment-edited, .devhub-wrap .single-wp-parser-hook .depth-2 .comment-awaiting-moderation, 1532 .devhub-wrap .single-wp-parser-hook .depth-2 .comment-edited, .devhub-wrap .single-wp-parser-class .depth-2 .comment-awaiting-moderation, 1533 .devhub-wrap .single-wp-parser-class .depth-2 .comment-edited { 1525 1534 display: inline-block; 1526 1535 margin: 2px 0; 1527 1536 } … … 1561 1570 .devhub-wrap .single-wp-parser-class #comment-preview { 1562 1571 border: 1px solid #dfdfdf; 1563 1572 border-radius: 2px; 1573 width: 100%; 1564 1574 } 1565 1575 1566 1576 .devhub-wrap .single-wp-parser-function .comment-list li.depth-2, .devhub-wrap .single-wp-parser-method .comment-list li.depth-2, .devhub-wrap .single-wp-parser-hook .comment-list li.depth-2, .devhub-wrap .single-wp-parser-class .comment-list li.depth-2 { … … 1735 1745 padding: 0 5px; 1736 1746 } 1737 1747 1738 .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 {1748 .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 { 1739 1749 margin-left: 1.5em; 1740 1750 } 1741 1751 1752 .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 { 1753 margin: 0; 1754 overflow: visible; 1755 } 1756 1742 1757 .devhub-wrap.single-post .comment-list, 1743 1758 .devhub-wrap.single-post .comment-list ol { 1744 1759 list-style: none;