!function(p){p(document).ready(function(){var e=p(document),f=CommentsAjax.ajax_url||"",v=CommentsAjax.action||"",a=CommentsAjax.id_form||"";e.on("submit","#"+a,function(e){function s(e){var a=p('
').html(e.message||"");"success"===e.error&&a.removeClass("error-message").addClass("success-message"),d.before(a),setTimeout(function(){a.remove()},1e4)}var n,o,t=p(this),a=CommentsAjax.loader||'',m=CommentsAjax.disconnect||"Servers have exploded.",r=CommentsAjax.list_args||"",i=CommentsAjax.list_nonce||"",c=CommentsAjax.commentlist||!1,d=t.find(":input[type=submit]"),l=p(a),u={action:v,form_data:{},list:{args:r,nonce:i}};return p.each(t.serializeArray(),function(e,a){void 0!==a.name&&void 0!==a.value&&(u.form_data[a.name]=a.value)}),d.addClass("disabled").attr({disabled:"disabled"}),d.after(l),p.post(f,u,function(e,a){void 0!==e.error&&!1!==e.error?s(e):void 0!==e.html&&""!==e.html&&(p("#cancel-comment-reply-link").trigger("click"),n=p(e.html),(o=c?p(c):p(".bac-comment").first().parent()).find(".bac-comment").remove(),o.append(n),o.find(".bac-comment-"+e.comment_id).addClass("new-comment"),p("body, html").stop().animate({scrollTop:Math.ceil(o.find(".bac-comment-"+e.comment_id).offset().top)},{easing:"linear",duration:1e3}),t.find("textarea").val(""),e.message&&s({error:"success",message:e.message,code:200}))},"json").always(function(){d.removeClass("disabled").removeAttr("disabled"),l.remove()}).fail(function(e,a){s({error:"error",message:m})}),e.preventDefault(),!1})})}(jQuery); //# sourceMappingURL=comments-ajax.min.js.map