Changeset 6910
- Timestamp:
- 03/23/2018 09:59:23 PM (6 years ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/comments.php
r5239 r6910 33 33 34 34 <ol class="comment-list"> 35 <?php 36 /* Loop through and list the comments. Tell wp_list_comments() 37 * to use wporg_developer_comment() to format the comments. 35 <?php 36 $feedback_editor = false; 37 38 /* Loop through and list the comments. Use wporg_developer_list_notes() to format the comments. 38 39 * If you want to override this in a child theme, then you can 39 * define wporg_developer_ comment() and that will be used instead.40 * See wporg_developer_ comment() in inc/template-tags.php for more.40 * define wporg_developer_list_notes() and that will be used instead. 41 * See wporg_developer_list_notes() in inc/template-tags.php for more. 41 42 */ 42 43 if ( is_singular( 'post' ) ) { … … 45 46 $ordered_comments = wporg_developer_get_ordered_notes(); 46 47 if ( $ordered_comments ) { 47 wp_list_comments( array( 'callback' => 'wporg_developer_user_note' ), $ordered_comments ); 48 $feedback_editor = array_filter( wp_list_pluck( $ordered_comments, 'show_editor') ); 49 wporg_developer_list_notes( $ordered_comments, array( 'avatar_size' => 32 ) ); 48 50 } 49 51 } … … 63 65 <?php if ( \DevHub\is_parsed_post_type() && DevHub\can_user_post_note( true, get_the_ID() ) ) : ?> 64 66 65 <p id="add-user-note" style="display:none;"><a href=""><?php _e( 'Have a note or feedback to contribute?', 'wporg' ); ?></a></p> 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 69 67 <?php comment_form( array( 68 'class_form' => 'comment-form tab-container', 69 'comment_field' => DevHub_User_Submitted_Content::wp_editor_comments(), 70 <?php 71 $args = array( 70 72 'logged_in_as' => '<p class="logged-in-as">' 71 73 . sprintf( … … 91 93 ) 92 94 . '</li></ul></p>', 93 'comment_notes_after' => DevHub_Note_Preview::comment_preview() 94 . '<p>' 95 . __( 'Submission Notes:', 'wporg' ) 95 'comment_notes_after' => '<p>' 96 . __( 'Submission Notes:', 'wporg' ) 96 97 . '<ul><li>' 97 98 . __( 'This form is not for support requests, discussions, spam, bug reports, complaints, or self-promotion. Entries of this nature will be deleted.', 'wporg' ) … … 106 107 . '</li></ul></p>', 107 108 'label_submit' => __( 'Add Note or Feedback', 'wporg' ), 109 'cancel_reply_link' => '', 108 110 'must_log_in' => '<p>' . sprintf( 109 111 __( 'You must <a href="%s">log in</a> before being able to contribute a note or feedback.', 'wporg' ), 110 'https:// wordpress.org/support/bb-login.php?redirect_to=' . urlencode( get_comments_link() )112 'https://login.wordpress.org/?redirect_to=' . urlencode( get_comments_link() ) 111 113 ) . '</p>', 112 'title_reply' => '', //'Add Example' 113 ) ); ?> 114 'title_reply' => '', //'Add Example' 115 'title_reply_to' => '', 116 ); 114 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 ) ) { 129 comment_form( $args ); 130 } 131 ?> 115 132 <?php endif; ?> 116 133 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php
r6512 r6910 77 77 * Get contibuted notes ordered by vote 78 78 * 79 * By default only top level comments are returned. 80 * If child notes are included use wp_list_comments() or a custom walker for display. 81 * unapproved notes for the current user are included. 79 * Only the parent notes are ordered by vote count. 80 * Child notes are added to to the parent note 'child_notes' property. 81 * Unapproved notes for the current user are included. 82 * Use `wporg_developer_list_notes()` to display the notes. 82 83 * 83 84 * @param integer $post_id Optional. Post id to get comments for … … 93 94 } 94 95 95 $order = array();96 96 $defaults = array( 97 97 'post__in' => array( $post_id ), … … 99 99 'status' => 'approve', 100 100 'include_unapproved' => array_filter( array( get_current_user_id() ) ), 101 'parent' => false,102 101 ); 103 102 … … 106 105 } 107 106 108 $args = wp_parse_args( $args, $defaults ); 109 107 $args = wp_parse_args( $args, $defaults ); 110 108 $comments = get_comments( $args ); 111 109 … … 114 112 } 115 113 114 // Check if the current page is a reply to a note. 115 $reply_id = 0; 116 if ( isset( $_GET['replytocom'] ) && $_GET['replytocom'] ) { 117 $reply_id = absint( $_GET['replytocom'] ); 118 } 119 120 $order = $children = array(); 121 $voting = class_exists( 'DevHub_User_Contributed_Notes_Voting' ); 122 123 // Remove child notes and add the vote count order for parent notes. 116 124 foreach ( $comments as $key => $comment ) { 117 $order[ $key ] = (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ); 125 if ( 0 === (int) $comment->comment_parent ) { 126 $vote_count = $voting ? (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ) : 0; 127 $order[ $key ] = $vote_count; 128 } else { 129 unset( $comments[ $key ] ); 130 $children[ $comment->comment_parent ][] = $comment; 131 } 132 } 133 134 $show_editor = false; 135 136 // Add children notes to their parents. 137 foreach ( $comments as $key => $comment ) { 138 $comments[ $key ]->child_notes = array(); 139 $comments[ $key ]->show_editor = false; 140 141 if ( array_key_exists( $comment->comment_ID, $children ) ) { 142 $comments[ $key ]->child_notes = array_reverse( $children[ $comment->comment_ID ] ); 143 } 144 145 if ( ! $show_editor && ( $reply_id && ( $reply_id === (int) $comment->comment_ID ) ) ) { 146 // Show the editor when replying to this parent comment 147 $comments[ $key ]->show_editor = true; 148 $show_editor = true; 149 } 118 150 } 119 151 … … 124 156 } 125 157 endif; 158 159 if ( ! function_exists( 'wporg_developer_list_notes' ) ) : 160 /** 161 * List user contributed notes. 162 * 163 * @param array $comments Array with comment objects. 164 * @param array $args Comment display arguments. 165 */ 166 function wporg_developer_list_notes( $comments, $args ) { 167 $is_user_logged_in = is_user_logged_in(); 168 $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; 171 172 foreach ( $comments as $comment ) { 173 174 $comment_id = $comment->comment_ID; 175 176 // Display parent comment. 177 wporg_developer_user_note( $comment, $args, 1 ); 178 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"; 182 183 // Display child comments. 184 if ( ! empty( $comment->child_notes ) ) { 185 186 echo "<h4 class='feedback-title'>Feedback</h4>\n"; 187 echo "<ul class='children'>\n"; 188 foreach ( $comment->child_notes as $child_note ) { 189 wporg_developer_user_note( $child_note, $args, 2, $comment->show_editor ); 190 } 191 echo "</ul>\n"; 192 } 193 194 // 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. 197 $display = $comment->show_editor ? 'show' : 'hide'; 198 echo DevHub_User_Submitted_Content::wp_editor_feedback( $comment, $display ); 199 } 200 echo "</section><!-- .feedback -->\n"; 201 202 // Feedback links to log in, add feedback or show feedback. 203 echo "<footer class='feedback-links' >\n"; 204 if ( $can_user_post_note ) { 205 echo "EEE"; 206 $feedback_link = trailingslashit( get_permalink() ) . "?replytocom={$comment_id}#feedback-editor-{$comment_id}"; 207 $display = ''; 208 $aria = ''; 209 if ( ! $is_user_logged_in ) { 210 $class = 'login'; 211 $feedback_text = __( 'Log in to add feedback', 'wporg' ); 212 $feedback_link = 'https://login.wordpress.org/?redirect_to=' . urlencode( $feedback_link ); 213 } else { 214 $class ='add'; 215 $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"' : ''; 220 } 221 echo '<a class="feedback-' . $class . '" href="' . esc_url( $feedback_link ) . '"' . $display . $aria .' rel="nofollow">' . $feedback_text . '</a>'; 222 } 223 224 // close parent list item 225 echo "</footer>\n</article><!-- .comment-body -->\n</li>\n"; 226 } 227 } 228 endif; 229 126 230 127 231 if ( ! function_exists( 'wporg_developer_user_note' ) ) : 128 232 /** 129 233 * Template for user contributed notes. 234 * 235 * @param object $comment Comment object. 236 * @param array $args Arguments. 237 * @param int $depth Nested comment depth. 130 238 */ 131 239 function wporg_developer_user_note( $comment, $args, $depth ) { 132 $GLOBALS['comment'] = $comment; 133 $count = (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ); 134 $curr_user_note = DevHub_User_Contributed_Notes_Voting::is_current_user_note( $comment->comment_ID ); 135 240 $GLOBALS['comment'] = $comment; 241 $GLOBALS['comment_depth'] = $depth; 242 243 $approved = ( 0 < (int) $comment->comment_approved ) ? true : false; 244 $is_parent = ( 0 === (int) $comment->comment_parent ) ? true : false; 245 $is_voting = class_exists( 'DevHub_User_Contributed_Notes_Voting' ); 246 $count = $is_voting ? (int) DevHub_User_Contributed_Notes_Voting::count_votes( $comment->comment_ID, 'difference' ) : 0; 247 $curr_user_note = $is_voting ? (bool) DevHub_User_Contributed_Notes_Voting::is_current_user_note( $comment->comment_ID ) : false; 248 249 // Classes 136 250 $comment_class = array(); 251 137 252 if ( -1 > $count ) { 138 253 $comment_class[] = 'bad-note'; 139 254 } 255 140 256 if ( $curr_user_note ) { 141 257 $comment_class[] = 'user-submitted-note'; 142 258 } 259 260 if ( ! $approved ) { 261 $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>"; 277 } 278 279 $date = sprintf( _x( '%1$s ago', '%1$s = human-readable time difference', 'wporg' ), 280 human_time_diff( get_comment_time( 'U' ), 281 current_time( 'timestamp' ) ) 282 ); 143 283 ?> 144 145 <li id="comment-<?php comment_ID(); ?>" <?php comment_class( implode( ' ', $comment_class ) ); ?>> 284 <li id="comment-<?php comment_ID(); ?>" data-comment-id="<?php echo $comment->comment_ID; ?>" <?php comment_class( implode( ' ', $comment_class ) ); ?>> 146 285 <article id="div-comment-<?php comment_ID(); ?>" class="comment-body"> 286 287 <?php if ( $is_parent ) : ?> 147 288 <a href="#comment-content-<?php echo $comment->comment_ID; ?>" class="screen-reader-text"><?php _e( 'Skip to note content', 'wporg' ); ?></a> 148 289 <header class="comment-meta"> 149 <?php DevHub_User_Contributed_Notes_Voting::show_voting(); ?> 290 291 <?php 292 if ( $is_voting ) { 293 DevHub_User_Contributed_Notes_Voting::show_voting(); 294 } 295 ?> 150 296 <div class="comment-author vcard"> 151 297 <span class="comment-author-attribution"> 152 <?php if ( 0 != $args['avatar_size'] ) {153 echo get_avatar( $comment, $args['avatar_size'] );154 } ?>155 156 298 <?php 157 // This would all be moot if core passed the $comment context for 'get_comment_author_link' filter 158 if ( $comment->user_id ) { 159 $commenter = get_user_by( 'id', $comment->user_id ); 160 $url = 'https://profiles.wordpress.org/' . esc_attr( $commenter->user_nicename ) . '/'; 161 $author = get_the_author_meta( 'display_name', $comment->user_id ); 162 } else { 163 $url = $comment->comment_author_url; 164 $author = $comment->comment_author; 165 } 166 167 $comment_author_link = ''; 168 if ( $url ) { 169 $comment_author_link = "<a href='$url' rel='external nofollow' class='url'>"; 170 } 171 $comment_author_link .= $author; 172 if ( $url ) { 173 $comment_author_link .= '</a>'; 174 } 175 176 printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) ); 299 if ( 0 != $args['avatar_size'] ) { 300 echo get_avatar( $comment, $args['avatar_size'] ); 301 } 302 303 printf( __( 'Contributed by %s', 'wporg' ), sprintf( '<cite class="fn">%s</cite>', $comment_author_link ) ); 177 304 ?> 178 305 … … 181 308 <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ); ?>"> 182 309 <time datetime="<?php comment_time( 'c' ); ?>"> 183 <?php 184 printf( _x( '%1$s ago', '%1$s = human-readable time difference', 'wporg' ), 185 human_time_diff( get_comment_time( 'U' ), 186 current_time( 'timestamp' ) ) 187 ); 188 ?> 310 <?php echo $date; ?> 189 311 </time> 190 312 </a> 191 313 <?php edit_comment_link( __( 'Edit', 'wporg' ), '<span class="edit-link">— ', '</span>' ); ?> 314 <?php if ( ! $approved ) : ?> 315 — <span class="comment-awaiting-moderation"><?php _e( 'awaiting moderation', 'wporg' ); ?></span> 316 <?php endif; ?> 192 317 </div> 193 318 </header> 194 319 <!-- .comment-metadata --> 320 <?php endif; ?> 195 321 196 322 <div class="comment-content" id="comment-content-<?php echo $comment->comment_ID; ?>"> 197 <?php comment_text(); ?>198 </div>199 <!-- .comment-content -->200 201 <?php if ( '0' == $comment->comment_approved ) : ?>202 <footer class="comment-footer">203 <p class="comment-awaiting-moderation"><?php _e( 'Your note is awaiting moderation.', 'wporg' ); ?></p>204 </footer>205 <!-- .comment-footer -->206 <?php endif; ?>207 208 323 <?php 209 comment_reply_link( array_merge( $args, array( 210 'add_below' => 'div-comment', 211 'depth' => $depth, 212 'max_depth' => $args['max_depth'], 213 'before' => '<div class="reply">', 214 'after' => '</div>', 215 ) ) ); 324 if ( $is_parent ) { 325 comment_text(); 326 } else { 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 ) ) . '">'; 330 $text .= '<time datetime="' . get_comment_time( 'c' ) . '">' . $date . '</time></a>'; 331 332 if ( current_user_can( 'edit_comment', $comment->comment_ID ) ) { 333 $text .= ' — <a class="comment-edit-link" href="' . get_edit_comment_link( $comment->comment_ID ) .'">'; 334 $text .= __( 'Edit', 'wporg' ) . '</a>'; 335 } 336 337 if ( ! $approved ) { 338 $text .= ' — <span class="comment-awaiting-moderation">' . __( 'awaiting moderation', 'wporg' ) . '</span>'; 339 } 340 341 echo apply_filters( 'comment_text', $text ); 342 } 216 343 ?> 217 </article><!-- .comment-body --> 218 <?php 344 </div><!-- .comment-content --> 345 346 <?php if ( ! $is_parent ) : ?> 347 </article> 348 </li> 349 <?php endif; ?> 350 <?php 219 351 } 220 352 endif; // ends check for wporg_developer_user_note() -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/user-content.php
r5243 r6910 41 41 add_filter( 'comment_reply_link', '__return_empty_string' ); 42 42 43 // Remove cancel reply link 44 add_filter( 'cancel_comment_reply_link', '__return_empty_string' ); 45 43 46 // Disable smilie conversion 44 47 remove_filter( 'comment_text', 'convert_smilies', 20 ); … … 58 61 // Tweak code contained in shortcode 59 62 add_filter( 'syntaxhighlighter_precode', array( __CLASS__, 'syntaxhighlighter_precode' ) ); 63 64 // Allowed HTML for a new child comment 65 add_filter( 'preprocess_comment', array( __CLASS__, 'comment_new_allowed_html' ) ); 66 67 // Allowed HTML for an edited child comment (There is no decent hook to filter child comments only) 68 add_action( 'edit_comment', array( __CLASS__, 'comment_edit_allowed_html' ) ); 60 69 61 70 } … … 80 89 81 90 /** 91 * Updates edited child comments with allowed HTML. 92 * 93 * Allowed html is <strong>, <em>, <code> and <a>. 94 * 95 * @param int $comment_ID Comment ID. 96 */ 97 public static function comment_edit_allowed_html( $comment_ID ) { 98 99 // Get the edited comment. 100 $comment = get_comment( $comment_ID, ARRAY_A ); 101 if ( ! $comment ) { 102 return; 103 } 104 105 if ( ( 0 === (int) $comment['comment_parent'] ) || empty( $comment['comment_content'] ) ) { 106 return; 107 } 108 109 $content = $comment['comment_content']; 110 $data = self::comment_new_allowed_html( $comment ); 111 112 if ( $data['comment_content'] !== $content ) { 113 $commentarr = array( 114 'comment_ID' => $data['comment_ID'], 115 'comment_content' => $data['comment_content'] 116 ); 117 118 // Update comment content. 119 wp_update_comment( $commentarr ); 120 } 121 } 122 123 /** 124 * Filter new child comments content with allowed HTML. 125 * 126 * Allowed html is <strong>, <em>, <code> and <a>. 127 * 128 * @param array $commentdata Array with comment data. 129 * @return array Array with filtered comment data. 130 */ 131 public static function comment_new_allowed_html( $commentdata ) { 132 $comment_parent = isset( $commentdata['comment_parent'] ) ? absint( $commentdata['comment_parent'] ) : 0; 133 $comment_content = isset( $commentdata['comment_content'] ) ? trim( $commentdata['comment_content'] ) : ''; 134 135 if ( ( $comment_parent === 0 ) || ! $comment_content ) { 136 return $commentdata; 137 } 138 139 $allowed_html = array( 140 'a' => array( 141 'href' => true, 142 'rel' => true, 143 'target' => true, 144 ), 145 'em' => array(), 146 'strong' => array(), 147 'code' => array(), 148 ); 149 150 $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 ); 154 155 return $commentdata; 156 } 157 158 /** 82 159 * Enqueues scripts and styles. 83 160 */ … … 88 165 wp_enqueue_style( 'syntaxhighlighter-theme-default' ); 89 166 90 wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'quicktags' ), '20170404', true ); 91 if ( get_option( 'thread_comments' ) ) { 92 wp_enqueue_script( 'comment-reply' ); 93 } 167 wp_enqueue_script( 'wporg-developer-user-notes', get_template_directory_uri() . '/js/user-notes.js', array( 'jquery', 'quicktags' ), '20170404', true ); 168 wp_enqueue_script( 'wporg-developer-user-notes-feedback', get_template_directory_uri() . '/js/user-notes-feedback.js', array( 'jquery', 'quicktags' ), '20170404eee', true ); 169 wp_localize_script( 'wporg-developer-user-notes-feedback', 'wporg_note_feedback', array( 170 'show' => __( 'Show Feedback', 'wporg' ), 171 'hide' => __( 'Hide Feedback', 'wporg' ), 172 ) ); 94 173 } 95 174 } … … 155 234 } 156 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(); 293 } 294 157 295 } // DevHub_User_Submitted_Content 158 296 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes.js
r5240 r6910 14 14 function showCommentForm() { 15 15 $( '#respond' ).show(); 16 $( '#add-user-note' ).hide();16 $( '#add-user-note' ).hide(); 17 17 18 var target = $( '#commentform' ); 18 var wpAdminBar = $( '#page.admin-bar' ).length ? 32 : 0; 19 var target = $( '#commentform #add-note-or-feedback' ); 19 20 if ( target.length ) { 20 21 var pos = target.offset(); 21 22 22 23 $( 'html,body' ).animate( { 23 scrollTop: pos.top 24 scrollTop: pos.top - wpAdminBar 24 25 }, 1000 ); 25 26 … … 40 41 41 42 // Add php and js buttons to QuickTags. 42 QTags.addButton( 'php', 'php', '[php]', '[/php]' );43 QTags.addButton( 'js', 'js', '[js]', '[/js]' );44 QTags.addButton( 'inline-code', 'inline code', '<code>', '</code>' );43 QTags.addButton( 'php', 'php', '[php]', '[/php]', '', '', '', 'comment' ); 44 QTags.addButton( 'js', 'js', '[js]', '[/js]', '', '', '', 'comment' ); 45 QTags.addButton( 'inline-code', 'inline code', '<code>', '</code>', '', '', '', 'comment' ); 45 46 46 47 // Override tab within user notes textarea to actually insert a tab character. -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/scss/main.scss
r6825 r6910 1138 1138 } 1139 1139 1140 .comment-awaiting-moderation { 1141 background-color: #fff8e5; 1142 padding: .2em .5em; 1143 border-radius: 3px; 1144 border: 1px solid #ffb900; 1145 } 1146 1147 .depth-2 .comment-awaiting-moderation { 1148 display: inline-block; 1149 margin: 2px 0; 1150 } 1151 1140 1152 .comment-list, 1141 1153 .comment-list ol { … … 1147 1159 .comment-list li, 1148 1160 #comment-preview { 1149 margin-top: 2.5rem;1161 margin-top: 3rem; 1150 1162 background: #fff; 1151 1163 overflow: auto; 1152 border: 1px solid #dfdfdf;1153 border-radius: 0 2px 2px 2px;1154 1164 1155 1165 article { 1156 1166 overflow: auto; 1157 1167 } 1168 } 1169 1170 .comment-list li.depth-1, 1171 #comment-preview { 1172 border: 1px solid #dfdfdf; 1173 border-radius: 2px; 1174 } 1175 1176 // Feedback 1177 .comment-list li.depth-2 { 1178 border-top: 1px solid #dfdfdf; 1179 padding: 0; 1180 margin: 0; 1181 1182 .comment-content { 1183 padding: .9em 0; 1184 } 1185 .comment-content p { 1186 margin-bottom: 0; 1187 font-size: .9em; 1188 } 1189 } 1190 1191 .comment ul.children { 1192 margin: 0 0 1.5em 0; 1193 border-bottom: 1px solid #dfdfdf; 1194 } 1195 1196 .feedback { 1197 width: 90%; 1198 float: right; 1199 margin-right: 1.5rem; 1200 } 1201 1202 .feedback-links { 1203 margin: 0 1.5rem 1em 1.5rem; 1204 font-size: 0.9em; 1205 clear: both; 1206 } 1207 1208 .feedback-editor-title, 1209 .feedback-title { 1210 font-size: 1.8rem; 1211 font-weight: 300; 1212 line-height: 2.2rem; 1213 margin-bottom: 1em; 1214 } 1215 1216 .feedback-toggle { 1217 margin: 0 0 0 1.5rem; 1218 display: inline-block; 1219 } 1220 1221 #wp-feedback-wrap { 1222 padding-bottom: 1em; 1158 1223 } 1159 1224 … … 1163 1228 border: 1px solid #ccc; 1164 1229 border-radius: 0 3px 3px 3px; 1165 clear: both;1230 clear: both; 1166 1231 } 1167 1232 … … 1224 1289 clear: both; 1225 1290 padding: 2rem 1.5rem .5rem; 1226 }1227 1228 .comment-footer {1229 margin: 0 1em;1230 padding: 0 0 1em 0;1231 position: relative;1232 overflow: auto;1233 1234 a {1235 float: right;1236 }1237 1238 p {1239 margin-bottom: 0;1240 }1241 1291 } 1242 1292 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/stylesheets/main.css
r6825 r6910 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 { 1518 background-color: #fff8e5; 1519 padding: .2em .5em; 1520 border-radius: 3px; 1521 border: 1px solid #ffb900; 1522 } 1523 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 { 1525 display: inline-block; 1526 margin: 2px 0; 1527 } 1528 1517 1529 .devhub-wrap .single-wp-parser-function .comment-list, 1518 1530 .devhub-wrap .single-wp-parser-function .comment-list ol, .devhub-wrap .single-wp-parser-method .comment-list, … … 1530 1542 .devhub-wrap .single-wp-parser-hook #comment-preview, .devhub-wrap .single-wp-parser-class .comment-list li, 1531 1543 .devhub-wrap .single-wp-parser-class #comment-preview { 1532 margin-top: 2.5rem;1544 margin-top: 3rem; 1533 1545 background: #fff; 1534 1546 overflow: auto; 1535 border: 1px solid #dfdfdf;1536 border-radius: 0 2px 2px 2px;1537 1547 } 1538 1548 … … 1543 1553 .devhub-wrap .single-wp-parser-class #comment-preview article { 1544 1554 overflow: auto; 1555 } 1556 1557 .devhub-wrap .single-wp-parser-function .comment-list li.depth-1, 1558 .devhub-wrap .single-wp-parser-function #comment-preview, .devhub-wrap .single-wp-parser-method .comment-list li.depth-1, 1559 .devhub-wrap .single-wp-parser-method #comment-preview, .devhub-wrap .single-wp-parser-hook .comment-list li.depth-1, 1560 .devhub-wrap .single-wp-parser-hook #comment-preview, .devhub-wrap .single-wp-parser-class .comment-list li.depth-1, 1561 .devhub-wrap .single-wp-parser-class #comment-preview { 1562 border: 1px solid #dfdfdf; 1563 border-radius: 2px; 1564 } 1565 1566 .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 { 1567 border-top: 1px solid #dfdfdf; 1568 padding: 0; 1569 margin: 0; 1570 } 1571 1572 .devhub-wrap .single-wp-parser-function .comment-list li.depth-2 .comment-content, .devhub-wrap .single-wp-parser-method .comment-list li.depth-2 .comment-content, .devhub-wrap .single-wp-parser-hook .comment-list li.depth-2 .comment-content, .devhub-wrap .single-wp-parser-class .comment-list li.depth-2 .comment-content { 1573 padding: .9em 0; 1574 } 1575 1576 .devhub-wrap .single-wp-parser-function .comment-list li.depth-2 .comment-content p, .devhub-wrap .single-wp-parser-method .comment-list li.depth-2 .comment-content p, .devhub-wrap .single-wp-parser-hook .comment-list li.depth-2 .comment-content p, .devhub-wrap .single-wp-parser-class .comment-list li.depth-2 .comment-content p { 1577 margin-bottom: 0; 1578 font-size: .9em; 1579 } 1580 1581 .devhub-wrap .single-wp-parser-function .comment ul.children, .devhub-wrap .single-wp-parser-method .comment ul.children, .devhub-wrap .single-wp-parser-hook .comment ul.children, .devhub-wrap .single-wp-parser-class .comment ul.children { 1582 margin: 0 0 1.5em 0; 1583 border-bottom: 1px solid #dfdfdf; 1584 } 1585 1586 .devhub-wrap .single-wp-parser-function .feedback, .devhub-wrap .single-wp-parser-method .feedback, .devhub-wrap .single-wp-parser-hook .feedback, .devhub-wrap .single-wp-parser-class .feedback { 1587 width: 90%; 1588 float: right; 1589 margin-right: 1.5rem; 1590 } 1591 1592 .devhub-wrap .single-wp-parser-function .feedback-links, .devhub-wrap .single-wp-parser-method .feedback-links, .devhub-wrap .single-wp-parser-hook .feedback-links, .devhub-wrap .single-wp-parser-class .feedback-links { 1593 margin: 0 1.5rem 1em 1.5rem; 1594 font-size: 0.9em; 1595 clear: both; 1596 } 1597 1598 .devhub-wrap .single-wp-parser-function .feedback-editor-title, 1599 .devhub-wrap .single-wp-parser-function .feedback-title, .devhub-wrap .single-wp-parser-method .feedback-editor-title, 1600 .devhub-wrap .single-wp-parser-method .feedback-title, .devhub-wrap .single-wp-parser-hook .feedback-editor-title, 1601 .devhub-wrap .single-wp-parser-hook .feedback-title, .devhub-wrap .single-wp-parser-class .feedback-editor-title, 1602 .devhub-wrap .single-wp-parser-class .feedback-title { 1603 font-size: 1.8rem; 1604 font-weight: 300; 1605 line-height: 2.2rem; 1606 margin-bottom: 1em; 1607 } 1608 1609 .devhub-wrap .single-wp-parser-function .feedback-toggle, .devhub-wrap .single-wp-parser-method .feedback-toggle, .devhub-wrap .single-wp-parser-hook .feedback-toggle, .devhub-wrap .single-wp-parser-class .feedback-toggle { 1610 margin: 0 0 0 1.5rem; 1611 display: inline-block; 1612 } 1613 1614 .devhub-wrap .single-wp-parser-function #wp-feedback-wrap, .devhub-wrap .single-wp-parser-method #wp-feedback-wrap, .devhub-wrap .single-wp-parser-hook #wp-feedback-wrap, .devhub-wrap .single-wp-parser-class #wp-feedback-wrap { 1615 padding-bottom: 1em; 1545 1616 } 1546 1617 … … 1607 1678 clear: both; 1608 1679 padding: 2rem 1.5rem .5rem; 1609 }1610 1611 .devhub-wrap .single-wp-parser-function .comment-footer, .devhub-wrap .single-wp-parser-method .comment-footer, .devhub-wrap .single-wp-parser-hook .comment-footer, .devhub-wrap .single-wp-parser-class .comment-footer {1612 margin: 0 1em;1613 padding: 0 0 1em 0;1614 position: relative;1615 overflow: auto;1616 }1617 1618 .devhub-wrap .single-wp-parser-function .comment-footer a, .devhub-wrap .single-wp-parser-method .comment-footer a, .devhub-wrap .single-wp-parser-hook .comment-footer a, .devhub-wrap .single-wp-parser-class .comment-footer a {1619 float: right;1620 }1621 1622 .devhub-wrap .single-wp-parser-function .comment-footer p, .devhub-wrap .single-wp-parser-method .comment-footer p, .devhub-wrap .single-wp-parser-hook .comment-footer p, .devhub-wrap .single-wp-parser-class .comment-footer p {1623 margin-bottom: 0;1624 1680 } 1625 1681
Note: See TracChangeset
for help on using the changeset viewer.