text: (function(c,e){e.class_confirmcomment=Class.extend({init:function(){ltoptions.theme.comments.editor.off("keydown.confirmcomment").on("keydown.confirmcomment",function(a){!a.ctrlKey||13!=a.keyCode&&10!=a.keyCode||ltoptions.theme.comments.form.submit()});ltoptions.theme.comments.form.off("submit.confirmcomment").on("submit.confirmcomment",c.proxy(this.submit,this))},get:function(a){var b=ltoptions.theme.comments;return"content"==a?b.editor:b.form.find("input[name='"+a+"']")},error:function(a){return c.messagebox(lang.dialog.error,
  a)},error_field:function(a,b){var c=this;this.error(b).close=function(){c.get(a).focus()}},empty:function(a){a=this.get(a).val();return""==c.trim(a)},validemail:function(){var a=c.trim(this.get("email").val());return""==a?!1:/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/.test(a)},validate:function(){if(""==c.trim(this.get("content").val()))return this.error_field("content",lang.comment.emptycontent),!1;if(!ltoptions.theme.comments.comuser)return!0;if(this.empty("name"))this.error_field("name",
  lang.comment.emptyname);else{if(this.validemail())return!0;this.error_field("email",lang.comment.invalidemail)}return!1},send:function(){var a={},b=c(":input",ltoptions.theme.comments.form);b.each(function(){var b=c(this);a[b.attr("name")]=b.val();b.prop("disabled",!0)});var d=this;c.jsonrpc({method:"comment_add",params:a,callback:function(a){try{switch(a.code){case "confirm":d.confirm(a.confirmid);break;case "success":d.success(a);break;default:d.error(a.message)}}catch(b){form.error(b.message)}},
  error:c.proxy(d.error,d)}).always(function(){b.prop("disabled",!1)})},confirm:function(a){var b=this;c.confirmbox(lang.dialog.confirm,lang.comment.checkspam,lang.comment.robot,lang.comment.human,function(d){1==d&&c.jsonrpc({type:"get",method:"comment_confirm",params:{confirmid:a},callback:c.proxy(b.success,b),error:c.proxy(b.error,b)})})},success:function(a){if("cookies"in a)for(var b in a.cookies)set_cookie(b,a.cookies[b]);window.location=a.posturl},submit:function(){try{if(!this.validate())return!1;
  if(ltoptions.theme.comments.confirmcomment)return this.send(),!1}catch(a){e.onerror(a)}}});c(function(){ltoptions.theme.comments.form.length&&(e.confirmcomment=new e.class_confirmcomment)})})(jQuery,litepubl);
  