function BindRequest(n){n.add_endRequest(function(){disableEles("#btnMent",!1)})}function PreSubmit(){return UpdateEditorElement(),CKEDITOR.instances.ckMent.getData()==""?(alert("请输入评论内容！"),!1):(disableEles("#btnMent",!0),!0)}function InitAuditPop(){$("#aud_rblAudit").click(function(){var n=$("#aud_rblAudit_1").prop("checked"),t;$("#divOpn").toggleClass("hide",!n);$("label[for='aud_rblAudit_1']").text(n?"未通过，原因：":"未通过");n&&(t=CKEDITOR.instances.aud_tbOpn,t&&t.focus())});MakeEditor("#aud_tbOpn",null,110,!1,!1)}function toAudit(){return confirm("确定审核通过吗？")&&__doPostBack("aAudit",""),!1}function reply(n){var t=CKEDITOR.instances.ckMent,i;t&&(i=$(n).closest("tr").find("a:first").text(),t.insertHtml("@"+i+"<p><\/p>"),t.focus())}function toDel(){return confirm("确定删除吗？")&&__doPostBack("lbDel",""),!1}function quote(n){var r=CKEDITOR.instances.ckMent,t,i;if(r){t=$(n).closest("tr").find("td:first").html();t=t.substr(t.indexOf("<"));t=t.replace(/<\/a>/i,"<\/a> ");var e=$(n).closest("table").find(".con:first"),o=e.find("div.inbubble"),u=o.length>0?o.html():e.html(),f=u.toLowerCase();f.indexOf("<legend>引用 ")>-1?(i=f.lastIndexOf('<p class="replied"'),i==-1&&(i=f.lastIndexOf("<p class=replied")),i>0?r.insertHtml("<div class='quote'>"+u.substr(0,i)+"<div class='refsrc'>"+t+" 发表：<\/div>"+u.substr(i)+'<\/div><p class="replied"><\/p>'):r.insertHtml("<div class='qu'><fieldset><legend>引用 "+t+" 的评论：<\/legend>"+u+'<\/fieldset><\/div><p class="replied"><\/p>')):r.insertHtml("<div class='qu'><fieldset><legend>引用 "+t+" 的评论：<\/legend>"+u+'<\/fieldset><\/div><p class="replied"><\/p>');r.focus()}}function del(n){if(confirm("确定删除该评论吗？"))toDelId=$(n).closest("table").attr("rid"),__doPostBack("btnDel",toDelId);else return!1}function clearAll(){confirm("确定要清空当前主题下的所有评论吗？")&&__doPostBack("btnDel","0")}function auditCmnt(n){PageMethods.AuditCmnt(n,function(t){/\d+/.test(t)?$("table[rid="+n+"]").removeClass("unaudit").find("img[onclick*='auditCmnt']").remove():alert(t)})}function edit(n){var t=CKEDITOR.instances.ckMent;if(t){$("#editId").val($(n).closest("table").attr("rid"));$("#btnMent").val("修改评论");$("#btnCanel").removeClass("hide");$("#writeMent .cation").text("修改评论：");var i=$(n).closest("table").find("td:last"),r=i.find("div.inbubble"),u=r.length>0?r.html():i.html();t.editable().setHtml(u);t.focus()}}function canelEdit(){var n=CKEDITOR.instances.ckMent;n&&($("#editId").val(""),n.editable().setHtml(""),$("#btnCanel").addClass("hide"),$("#btnMent").val("发表评论"),$("#writeMent .cation").text("发表评论："))}function SaveOkPrompt(n,t){n=="edit"?(canelEdit(),ShowMsgPop("修改成功！"+(t?"":"在审核通过前，该评论不会显示。"))):(CKEDITOR.instances.ckMent.editable().setHtml(""),t?$("#comments").length==0&&ShowMsgPop("评论已提交成功！但您本人因权限原因，无法查看。"):ShowMsgPop("评论已提交，等待审核。"))}function toPage(n){$("#curPageIndex").val(n);showLoading();__doPostBack("curPageIndex","")}function toWrite(){var n=CKEDITOR.instances.ckMent;n&&n.focus()}function toEdit(n){location="infoEdit.aspx?id="+n}function toExport(){return toExportAs("#content",null,$("#pageTitle").text(),"#prompt")}function toPrint(n){return $("#content").printIt({pageTitle:$("#pageTitle").text(),event:n,exclude:"#prompt"}),!1}LoadEditor();var toDelId;$(function(){if($(".ui-tabs").tabs().fadeIn(350),MakeEditor("#ckMent","Compact",132,!1,!1),InitScroller(),!isPc){var n={tapToClose:!0};$("#content img").on("click",function(){var t=[{src:this.src,w:this.naturalWidth,h:this.naturalHeight}],i=new PhotoSwipe($f("gallery"),PhotoSwipeUI_Default,t,n);i.init()})}})