2008-10-09 09:37:05 +02:00
|
|
|
|
2008-10-09 13:11:56 +02:00
|
|
|
addComment = {
|
2008-12-10 12:49:37 +01:00
|
|
|
moveForm : function(commId, parentId, respondId, postId) {
|
|
|
|
var t = this, div, comm = t.I(commId), respond = t.I(respondId), cancel = t.I('cancel-comment-reply-link'), parent = t.I('comment_parent'), post = t.I('comment_post_ID');
|
2008-10-09 22:27:39 +02:00
|
|
|
|
|
|
|
if ( ! comm || ! respond || ! cancel || ! parent )
|
|
|
|
return;
|
|
|
|
|
2008-10-09 13:11:56 +02:00
|
|
|
t.respondId = respondId;
|
2008-12-10 12:49:37 +01:00
|
|
|
postId = postId || false;
|
2008-10-09 22:27:39 +02:00
|
|
|
|
2008-10-09 13:11:56 +02:00
|
|
|
if ( ! t.I('wp-temp-form-div') ) {
|
|
|
|
div = document.createElement('div');
|
|
|
|
div.id = 'wp-temp-form-div';
|
|
|
|
div.style.display = 'none';
|
|
|
|
respond.parentNode.insertBefore(div, respond);
|
|
|
|
}
|
|
|
|
|
|
|
|
comm.parentNode.insertBefore(respond, comm.nextSibling);
|
2008-12-10 12:49:37 +01:00
|
|
|
if ( post && postId )
|
|
|
|
post.value = postId;
|
2008-10-09 22:27:39 +02:00
|
|
|
parent.value = parentId;
|
|
|
|
cancel.style.display = '';
|
|
|
|
|
|
|
|
cancel.onclick = function() {
|
2008-10-09 13:11:56 +02:00
|
|
|
var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId);
|
2008-10-09 22:27:39 +02:00
|
|
|
|
|
|
|
if ( ! temp || ! respond )
|
|
|
|
return;
|
|
|
|
|
2008-10-09 13:11:56 +02:00
|
|
|
t.I('comment_parent').value = '0';
|
|
|
|
temp.parentNode.insertBefore(respond, temp);
|
|
|
|
temp.parentNode.removeChild(temp);
|
2008-10-09 22:27:39 +02:00
|
|
|
this.style.display = 'none';
|
|
|
|
this.onclick = null;
|
2008-10-09 13:11:56 +02:00
|
|
|
return false;
|
|
|
|
}
|
2008-10-09 22:27:39 +02:00
|
|
|
|
|
|
|
try { t.I('comment').focus(); }
|
|
|
|
catch(e) {}
|
|
|
|
|
|
|
|
return false;
|
2008-10-09 13:11:56 +02:00
|
|
|
},
|
2008-10-09 22:27:39 +02:00
|
|
|
|
2008-10-09 13:11:56 +02:00
|
|
|
I : function(e) {
|
|
|
|
return document.getElementById(e);
|
|
|
|
}
|
|
|
|
}
|