Make WordPress Core

Ticket #7552: show-threaded-reply-via-js.2.diff

File show-threaded-reply-via-js.2.diff, 1.9 KB (added by Viper007Bond, 16 years ago)

Use jQuery and all of it's awesomeness

  • wp-includes/comment-template.php

     
    10371037
    10381038                <?php echo apply_filters('comment_text', get_comment_text()) ?>
    10391039
    1040                 <div class='reply'>
     1040                <div class="reply" style="display:none">
    10411041                <?php echo comment_reply_link(array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['depth'])) ?>
    10421042                <?php if ( 'ul' == $args['style'] ) : ?>
    10431043                </div>
  • wp-includes/js/comment-reply.js

     
    3232        document.location.href = "#respond";
    3333        document.getElementById("comment").focus();                             
    3434        document.getElementById("comment-parent").value = "0";
    35 }
    36  No newline at end of file
     35}
     36
     37jQuery(document).ready(function($){
     38        $(".thread-odd").find("div.reply").css("display", "block");
     39        $(".thread-even").find("div.reply").css("display", "block");
     40});
     41 No newline at end of file
  • wp-includes/script-loader.php

     
    141141        $scripts->add( 'jquery-ui-resizable', '/wp-includes/js/jquery/ui.resizable.js', array('jquery-ui-core'), '1.5.2' );
    142142        $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.5.2' );
    143143
    144         $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', false, '20080828');
     144        $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', array('jquery'), '20080929');
    145145
    146146        if ( is_admin() ) {
    147147                $scripts->add( 'ajaxcat', '/wp-admin/js/cat.js', array( 'wp-lists' ), '20071101' );