db981a3b27
* This moves our "development" versions from .dev.js to .js (same for css). * The compressed version then moves from .js to .min.js (same for css). By switching to the standard .min convention, it sets expectations for developers, and works nicely with existing tools such as ack. fixes #21633. git-svn-id: https://develop.svn.wordpress.org/trunk@21592 602fd350-edb4-49c9-b593-d223f7449a82
49 lines
1.2 KiB
JavaScript
49 lines
1.2 KiB
JavaScript
|
|
addComment = {
|
|
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');
|
|
|
|
if ( ! comm || ! respond || ! cancel || ! parent )
|
|
return;
|
|
|
|
t.respondId = respondId;
|
|
postId = postId || false;
|
|
|
|
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);
|
|
if ( post && postId )
|
|
post.value = postId;
|
|
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);
|
|
this.style.display = 'none';
|
|
this.onclick = null;
|
|
return false;
|
|
}
|
|
|
|
try { t.I('comment').focus(); }
|
|
catch(e) {}
|
|
|
|
return false;
|
|
},
|
|
|
|
I : function(e) {
|
|
return document.getElementById(e);
|
|
}
|
|
}
|