Index: /trunk/wp-includes/comment-template.php
===================================================================
--- /trunk/wp-includes/comment-template.php (revision 9113)
+++ /trunk/wp-includes/comment-template.php (revision 9114)
@@ -911,5 +911,5 @@
$link = '' . $login_text . '';
else
- $link = "comment_ID ) ) . "#respond' onclick='addComment.moveForm(\"$add_below-$comment->comment_ID\", $comment->comment_ID, \"$respond_id\"); return false;'>$reply_text";
+ $link = "comment_ID ) ) . "#respond' onclick='return addComment.moveForm(\"$add_below-$comment->comment_ID\", \"$comment->comment_ID\", \"$respond_id\")'>$reply_text";
return $before . $link . $after;
Index: /trunk/wp-includes/js/comment-reply.js
===================================================================
--- /trunk/wp-includes/js/comment-reply.js (revision 9113)
+++ /trunk/wp-includes/js/comment-reply.js (revision 9114)
@@ -2,8 +2,11 @@
addComment = {
moveForm : function(commId, parentId, respondId) {
- var t = this, div, comm = t.I(commId), respond = t.I(respondId);
-
+ var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent');
+
+ if ( ! comm || ! respond || ! cancel || ! parent )
+ return;
+
t.respondId = respondId;
-
+
if ( ! t.I('wp-temp-form-div') ) {
div = document.createElement('div');
@@ -14,21 +17,27 @@
comm.parentNode.insertBefore(respond, comm.nextSibling);
-
- t.I('comment_parent').value = parentId;
-
- t.I('cancel-comment-reply-link').style.display = '';
- t.I('cancel-comment-reply-link').onclick = function() {
+ parent.value = parentId;
+ cancel.style.display = '';
+
+ cancel.onclick = function() {
var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId);
-
+
+ if ( ! temp || ! respond )
+ return;
+
t.I('comment_parent').value = '0';
temp.parentNode.insertBefore(respond, temp);
temp.parentNode.removeChild(temp);
- t.I('cancel-comment-reply-link').style.display = 'none';
- t.I('cancel-comment-reply-link').onclick = null;
+ this.style.display = 'none';
+ this.onclick = null;
return false;
}
- t.I('comment').focus();
+
+ try { t.I('comment').focus(); }
+ catch(e) {}
+
+ return false;
},
-
+
I : function(e) {
return document.getElementById(e);
Index: /trunk/wp-includes/script-loader.php
===================================================================
--- /trunk/wp-includes/script-loader.php (revision 9113)
+++ /trunk/wp-includes/script-loader.php (revision 9114)
@@ -140,5 +140,5 @@
$scripts->add( 'jquery-ui-dialog', '/wp-includes/js/jquery/ui.dialog.js', array('jquery-ui-resizable', 'jquery-ui-draggable'), '1.5.2' );
- $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', false, '20081008');
+ $scripts->add( 'comment-reply', '/wp-includes/js/comment-reply.js', false, '20081009');
if ( is_admin() ) {