Posted By

ksantoshp on 12/10/09


Tagged

wordpress comment


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

xmartyxcorex
kwameboame
Grow


Wordpress threaded/nested comment Javascript


 / Published in: PHP
 

URL: http://www.elegantthemes.com/preview/Lumin/?p=141

  1. addComment={
  2. moveForm:function(d,f,i,c){
  3. 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");
  4.  
  5. if(!h||!b||!l||!j){return}
  6. m.respondId=i;
  7. c=c||false;
  8.  
  9. if(!m.I("wp-temp-form-div")){
  10. a=document.createElement("div");
  11. a.id="wp-temp-form-div";
  12. a.style.display="none";
  13. b.parentNode.insertBefore(a,b)
  14. }
  15. h.parentNode.insertBefore(b,h.nextSibling);
  16.  
  17. if(k&&c){k.value=c}
  18.  
  19. j.value=f;
  20. l.style.display="";
  21. l.onclick=function(){
  22. var n=addComment,e=n.I("wp-temp-form-div"),o=n.I(n.respondId);
  23.  
  24. if(!e||!o){return;}
  25.  
  26. n.I("comment_parent").value="0";
  27. e.parentNode.insertBefore(o,e);
  28. e.parentNode.removeChild(e);
  29. this.style.display="none";
  30. this.onclick=null;
  31. return false;
  32. };
  33. try{m.I("comment").focus()}catch(g){}return false
  34. },
  35. I:function(a){return document.getElementById(a)}
  36. };

Report this snippet  

You need to login to post a comment.