diff options
author | Andrew Nacin <nacin@git.wordpress.org> | 2013-08-07 05:25:25 +0000 |
---|---|---|
committer | Andrew Nacin <nacin@git.wordpress.org> | 2013-08-07 05:25:25 +0000 |
commit | b43712e0f79a9f5bea52217e06155e2f471c490c (patch) | |
tree | 23d331e7b2f29689571f03cfa5f9b7b3b6cafab8 /src/wp-includes/js/comment-reply.js | |
parent | 5bbd08e1d17079a2e852517351f7405884a156b3 (diff) | |
download | wordpress-b43712e0f79a9f5bea52217e06155e2f471c490c.tar.gz wordpress-b43712e0f79a9f5bea52217e06155e2f471c490c.zip |
New develop.svn.wordpress.org repository based on the old core.svn repository.
* All WordPress files move to a src/ directory.
* New task runner (Grunt), configured to copy a built WordPress to build/.
* svn:ignore and .gitignore for Gruntfile.js, wp-config.php, and node.js.
* Remove Akismet external from develop.svn. Still exists in core.svn.
* Drop minified files from src/. The build process will now generate these.
props koop.
see #24976.
and see http://wp.me/p2AvED-1AI.
git-svn-id: https://develop.svn.wordpress.org/trunk@25001 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'src/wp-includes/js/comment-reply.js')
-rw-r--r-- | src/wp-includes/js/comment-reply.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/wp-includes/js/comment-reply.js b/src/wp-includes/js/comment-reply.js new file mode 100644 index 0000000000..20154253a4 --- /dev/null +++ b/src/wp-includes/js/comment-reply.js @@ -0,0 +1,48 @@ + +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); + } +} |