Make WordPress Core

Changeset 9114


Ignore:
Timestamp:
10/09/2008 08:27:39 PM (16 years ago)
Author:
azaozz
Message:

Use no-js reply on error in comment-reply.js, see #7635

Location:
trunk/wp-includes
Files:
3 edited

Legend:

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

    r9113 r9114  
    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='addComment.moveForm(\"$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='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\")'>$reply_text</a>";
    914914
    915915    return $before . $link . $after;
  • trunk/wp-includes/js/comment-reply.js

    r9113 r9114  
    22addComment = {
    33    moveForm : function(commId, parentId, respondId) {
    4         var t = this, div, comm = t.I(commId), respond = t.I(respondId);
    5        
     4        var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent');
     5
     6        if ( ! comm || ! respond || ! cancel || ! parent )
     7            return;
     8
    69        t.respondId = respondId;
    7        
     10
    811        if ( ! t.I('wp-temp-form-div') ) {
    912            div = document.createElement('div');
     
    1417
    1518        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() {
     19        parent.value = parentId;
     20        cancel.style.display = '';
     21
     22        cancel.onclick = function() {
    2123            var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId);
    22            
     24
     25            if ( ! temp || ! respond )
     26                return;
     27
    2328            t.I('comment_parent').value = '0';
    2429            temp.parentNode.insertBefore(respond, temp);
    2530            temp.parentNode.removeChild(temp);
    26             t.I('cancel-comment-reply-link').style.display = 'none';
    27             t.I('cancel-comment-reply-link').onclick = null;
     31            this.style.display = 'none';
     32            this.onclick = null;
    2833            return false;
    2934        }
    30         t.I('comment').focus();
     35
     36        try { t.I('comment').focus(); }
     37        catch(e) {}
     38
     39        return false;
    3140    },
    32    
     41
    3342    I : function(e) {
    3443        return document.getElementById(e);
  • trunk/wp-includes/script-loader.php

    r9113 r9114  
    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', false, '20081008');
     142    $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', false, '20081009');
    143143
    144144    if ( is_admin() ) {
Note: See TracChangeset for help on using the changeset viewer.