WordPress.org

Make WordPress Core

Changeset 9113


Ignore:
Timestamp:
10/09/2008 11:11:56 AM (10 years ago)
Author:
azaozz
Message:

No jQuery requirement for comment-reply.js, see #7635

Location:
trunk/wp-includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/comment-template.php

    r9112 r9113  
    911911        $link = '<a rel="nofollow" href="' . site_url('wp-login.php?redirect_to=' . get_permalink()) . '">' . $login_text . '</a>';
    912912    else
    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>";
     913        $link = "<a rel='nofollow' href='" . wp_specialchars( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#respond' onclick='addComment.moveForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text</a>";
    914914
    915915    return $before . $link . $after;
     
    939939function comment_parent_field() {
    940940    $replytoid = isset($_GET['replytocom']) ? (int) $_GET['replytocom'] : 0;
    941     echo "<input type='hidden' name='comment_parent' id='comment-parent' value='$replytoid' />\n";
     941    echo "<input type='hidden' name='comment_parent' id='comment_parent' value='$replytoid' />\n";
    942942}
    943943
  • trunk/wp-includes/js/comment-reply.js

    r9112 r9113  
    11
    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     });
    12     jQuery("#comment").focus();
     2addComment = {
     3    moveForm : function(commId, parentId, respondId) {
     4        var t = this, div, comm = t.I(commId), respond = t.I(respondId);
     5       
     6        t.respondId = respondId;
     7       
     8        if ( ! t.I('wp-temp-form-div') ) {
     9            div = document.createElement('div');
     10            div.id = 'wp-temp-form-div';
     11            div.style.display = 'none';
     12            respond.parentNode.insertBefore(div, respond);
     13        }
     14
     15        comm.parentNode.insertBefore(respond, comm.nextSibling);
     16       
     17        t.I('comment_parent').value = parentId;
     18       
     19        t.I('cancel-comment-reply-link').style.display = '';
     20        t.I('cancel-comment-reply-link').onclick = function() {
     21            var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId);
     22           
     23            t.I('comment_parent').value = '0';
     24            temp.parentNode.insertBefore(respond, temp);
     25            temp.parentNode.removeChild(temp);
     26            t.I('cancel-comment-reply-link').style.display = 'none';
     27            t.I('cancel-comment-reply-link').onclick = null;
     28            return false;
     29        }
     30        t.I('comment').focus();
     31    },
     32   
     33    I : function(e) {
     34        return document.getElementById(e);
     35    }
    1336}
  • trunk/wp-includes/script-loader.php

    r9112 r9113  
    140140    $scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.5.2' );
    141141
    142     $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', array('jquery'), '20081009');
     142    $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', false, '20081008');
    143143
    144144    if ( is_admin() ) {
Note: See TracChangeset for help on using the changeset viewer.