WordPress/wp-includes/js/comment-reply.min.js

1 line
1.1 KiB
JavaScript

var addComment={moveForm:function(a,b,c,d){var e,f,g,h,i,j=this,k=j.I(a),l=j.I(c),m=j.I("cancel-comment-reply-link"),n=j.I("comment_parent"),o=j.I("comment_post_ID"),p=l.getElementsByTagName("form")[0];if(k&&l&&m&&n&&p){j.respondId=c,d=d||!1,j.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",l.parentNode.insertBefore(e,l)),k.parentNode.insertBefore(l,k.nextSibling),o&&d&&(o.value=d),n.value=b,m.style.display="",m.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{for(var q=0;q<p.elements.length;q++)if(f=p.elements[q],"hidden"!==f.type&&!f.hasAttribute("disabled")){if("getComputedStyle"in window){for(g=f,i=!1;g.parentNode;){if(h=window.getComputedStyle(g),"none"===h.display||"hidden"===h.visibility){i=!0;break}g=g.parentNode}if(i)continue}f.focus();break}}catch(r){}return!1}},I:function(a){return document.getElementById(a)}};