1 addComment={moveForm:function(d,f,i,c){var m=this,a,h=m.I(d),b=m.I(i),l=m.I("cancel-comment-reply-link"),j=m.I("comment_parent"),k=m.I("comment_post_ID");if(!h||!b||!l||!j){return}m.respondId=i;c=c||false;if(!m.I("wp-temp-form-div")){a=document.createElement("div");a.id="wp-temp-form-div";a.style.display="none";b.parentNode.insertBefore(a,b)}h.parentNode.insertBefore(b,h.nextSibling);if(k&&c){k.value=c}j.value=f;l.style.display="";l.onclick=function(){var n=addComment,e=n.I("wp-temp-form-div"),o=n.I(n.respondId);if(!e||!o){return}n.I("comment_parent").value="0";e.parentNode.insertBefore(o,e);e.parentNode.removeChild(e);this.style.display="none";this.onclick=null;return false};try{m.I("comment").focus()}catch(g){}return false},I:function(a){return document.getElementById(a)}}; |
1 |
|
2 addComment = { |
|
3 moveForm : function(commId, parentId, respondId, postId) { |
|
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'), post = t.I('comment_post_ID'); |
|
5 |
|
6 if ( ! comm || ! respond || ! cancel || ! parent ) |
|
7 return; |
|
8 |
|
9 t.respondId = respondId; |
|
10 postId = postId || false; |
|
11 |
|
12 if ( ! t.I('wp-temp-form-div') ) { |
|
13 div = document.createElement('div'); |
|
14 div.id = 'wp-temp-form-div'; |
|
15 div.style.display = 'none'; |
|
16 respond.parentNode.insertBefore(div, respond); |
|
17 } |
|
18 |
|
19 comm.parentNode.insertBefore(respond, comm.nextSibling); |
|
20 if ( post && postId ) |
|
21 post.value = postId; |
|
22 parent.value = parentId; |
|
23 cancel.style.display = ''; |
|
24 |
|
25 cancel.onclick = function() { |
|
26 var t = addComment, temp = t.I('wp-temp-form-div'), respond = t.I(t.respondId); |
|
27 |
|
28 if ( ! temp || ! respond ) |
|
29 return; |
|
30 |
|
31 t.I('comment_parent').value = '0'; |
|
32 temp.parentNode.insertBefore(respond, temp); |
|
33 temp.parentNode.removeChild(temp); |
|
34 this.style.display = 'none'; |
|
35 this.onclick = null; |
|
36 return false; |
|
37 } |
|
38 |
|
39 try { t.I('comment').focus(); } |
|
40 catch(e) {} |
|
41 |
|
42 return false; |
|
43 }, |
|
44 |
|
45 I : function(e) { |
|
46 return document.getElementById(e); |
|
47 } |
|
48 } |