Changeset 9112
- Timestamp:
- 10/09/2008 07:37:05 AM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/default/comments.php
r9025 r9112 45 45 <div id="respond"> 46 46 47 <h3> Leave a Reply</h3>47 <h3><?php comment_form_title( 'Leave a Reply', 'Leave a Reply to %s' ); ?></h3> 48 48 49 <div id="cancel-comment-reply" style="display: none;">50 <small><?php echo cancel_comment_reply_link()?></small>49 <div class="cancel-comment-reply"> 50 <small><?php cancel_comment_reply_link(); ?></small> 51 51 </div> 52 52 … … 80 80 <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /> 81 81 <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> 82 < input type="hidden" name="comment_parent" id="comment-parent" value="0" />82 <?php comment_parent_field(); ?> 83 83 </p> 84 84 <?php do_action('comment_form', $post->ID); ?> -
trunk/wp-includes/comment-template.php
r9093 r9112 909 909 910 910 if ( get_option('comment_registration') && !$user_ID ) 911 $link = '<a href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';911 $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>'; 912 912 else 913 $link = "<a href='#' onclick='moveAddCommentForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text</a>";913 $link = "<a rel='nofollow' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#respond' onclick='moveAddCommentForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text</a>"; 914 914 915 915 return $before . $link . $after; … … 921 921 * @since 2.7.0 922 922 * 923 * @param string $text Optional. Text to display for cancel reply. 924 * @param string $respond_id Optional. HTML ID attribute for JS cancelCommentReply function. 925 * @param string $respond_root Optional. Second parameter for JS cancelCommentReply function. 926 */ 927 function cancel_comment_reply_link($text = '', $respond_id = 'respond', $respond_root = 'content') { 923 * @param string $text Optional. Text to display for cancel reply link. 924 */ 925 function cancel_comment_reply_link($text = '') { 928 926 if ( empty($text) ) 929 927 $text = __('Click here to cancel reply.'); 930 echo '<a href="#" onclick="cancelCommentReply(\'' . $respond_id . '\', \'' . $respond_root . '\'); return false;">' . $text . '</a>'; 928 929 $style = isset($_GET['replytocom']) ? '' : ' style="display:none;"'; 930 931 echo '<a rel="nofollow" id="cancel-comment-reply-link" href="' . wp_specialchars( remove_query_arg('replytocom') ) . '#respond"' . $style . '>' . $text . '</a>'; 932 } 933 934 /** 935 * Output hidden input HTML for replying to comments. 936 * 937 * @since 2.7.0 938 */ 939 function comment_parent_field() { 940 $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; 941 echo "<input type='hidden' name='comment_parent' id='comment-parent' value='$replytoid' />\n"; 942 } 943 944 /** 945 * Display text based on comment reply status. Only affects users with Javascript disabled. 946 * 947 * @since 2.7.0 948 * 949 * @param string $noreplytext Optional. Text to display when not replying to a comment. 950 * @param string $replytext Optional. Text to display when replying to a comment. Accepts "%s" for the author of the comment being replied to. 951 * @param string $linktoparent Optional. Boolean to control making the author's name a link to their comment. 952 */ 953 function comment_form_title( $noreplytext = 'Leave a Reply', $replytext = 'Leave a Reply to %s', $linktoparent = TRUE ) { 954 global $comment; 955 956 $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0; 957 958 if ( 0 == $replytoid ) 959 echo $noreplytext; 960 else { 961 $comment = get_comment($replytoid); 962 $author = ( $linktoparent ) ? '<a href="#comment-' . get_comment_ID() . '">' . get_comment_author() . '</a>' : get_comment_author(); 963 printf( $replytext, $author ); 964 } 931 965 } 932 966 … … 1047 1081 <?php echo apply_filters('comment_text', get_comment_text()) ?> 1048 1082 1049 <div class="reply" style="display:none">1083 <div class="reply"> 1050 1084 <?php echo comment_reply_link(array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['depth'])) ?> 1051 1085 <?php if ( 'ul' == $args['style'] ) : ?> -
trunk/wp-includes/js/comment-reply.js
r9082 r9112 1 function moveAddCommentForm(theId,threadId,respondId){ 2 jQuery("#"+respondId).appendTo("#"+theId); 3 jQuery("#comment-parent").val(threadId); 4 jQuery("#cancel-comment-reply").show(); 1 2 function moveAddCommentForm(commId, parentId, respondId) { 3 var div = document.createElement('div'); 4 jQuery("#"+respondId).before( jQuery(div).attr('id', 'wp-temp-form-div').hide() ).appendTo("#"+commId); 5 jQuery("#comment-parent").val(parentId); 6 jQuery("#cancel-comment-reply-link").show().click(function(){ 7 jQuery("#comment-parent").val("0"); 8 jQuery('#wp-temp-form-div').after( jQuery("#"+respondId) ).remove(); 9 jQuery(this).hide(); 10 return false; 11 }); 5 12 jQuery("#comment").focus(); 6 13 } 7 function cancelCommentReply(respondId,respondRoot){8 jQuery("#cancel-comment-reply").hide();9 jQuery("#"+respondId).appendTo("#"+respondRoot);10 document.location.href="#respond";11 jQuery("#comment").focus();12 jQuery("#comment-parent").val("0");13 }14 jQuery(document).ready(function($){15 $(".thread-odd").find("div.reply").show();16 $(".thread-even").find("div.reply").show();17 }); -
trunk/wp-includes/script-loader.php
r9103 r9112 140 140 $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.5.2' ); 141 141 142 $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', array('jquery'), '2008 0929');142 $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', array('jquery'), '20081009'); 143 143 144 144 if ( is_admin() ) {
Note: See TracChangeset
for help on using the changeset viewer.