var setStateId=0,ip,comment={setTextArea:function(a,b){if($("#content"+setStateId+">textarea").val()!=undefined)$.post("?app=comment&controller=comment&action=edit&ajax=1",{commentid:b,content:$("#content"+setStateId+">textarea").val()},function(c){$("#content"+setStateId).html(c.conentet)},"json");else{a.innerHTML="<textarea onblur=\"comment.setTextArea($('#content"+b+"'),"+b+')" rows="5" style="width:100%;padding:3px">'+a.innerHTML.replace(/<[\/]?span[^>]*>/ig,"")+"</textarea>";$("#content"+b+">textarea").focus();
setStateId=b}},get_by_contentid:function(a){tableApp.load("contentid="+a);return true},multiCheck:function(){var a=tableApp.checkedIds();a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u64cd\u4f5c\u7684\u8bb0\u5f55\uff01"):ct.confirm("\u786e\u8ba4\u5ba1\u6838\u901a\u8fc7\u8bc4\u8bba\uff1f",function(){$.get("?app=comment&controller=comment&action=check&commentid="+a,{},function(b){if(b.state){ct.ok("\u64cd\u4f5c\u6210\u529f");tableApp.load()}else ct.error(b.error)},"json")})},multiDel:function(){var a=
tableApp.checkedIds();a.length<1?ct.warn("\u8bf7\u9009\u62e9\u9700\u8981\u64cd\u4f5c\u7684\u8bb0\u5f55\uff01"):ct.confirm("\u786e\u8ba4\u5220\u9664\u8fd9"+a.length+"\u6761\u8bc4\u8bba\uff1f",function(){$.get("?app=comment&controller=comment&action=delete&commentid="+a,{},function(b){if(b.state){ct.ok("\u64cd\u4f5c\u6210\u529f");tableApp.deleteRow(a)}else ct.error(b.error)},"json")})},searchDel:function(){$.get("?app=comment&controller=comment&action=search_delete",$("#search_f").serialize(),function(a){if(a.state){ct.ok("\u5220\u9664\u6210\u529f");
tableApp.load()}else ct.error(a.error)},"json")},check:function(a){$.get("?app=comment&controller=comment&action=check&commentid="+a,"",function(b){b.state?$("#div_"+a).slideToggle("slow",function(){$("#div_"+a).remove()}):ct.error(b.error)},"json")},del:function(a){$.get("?app=comment&controller=comment&action=delete&commentid="+a,"",function(b){b.state?$("#div_"+a).slideToggle("slow",function(){$("#div_"+a).remove()}):ct.error(b.error)},"json")},edit:function(a){$("#content"+a).dblclick()},resetReport:function(a){$.get("?app=comment&controller=comment&action=report_reset&commentid="+
a,"",function(b){b.state?$("#div_"+a).slideToggle("slow",function(){$("#div_"+a).remove()}):ct.error(b.error)},"json")},ipEdit:function(a){ct.form("\u4fee\u6539IP","?app=comment&controller=comment&action=ip_edit&commentid="+a,360,180,function(b){if(b.state){ct.ok("\u4fee\u6539\u6210\u529f");$("#ip_"+a).html(b.data.ip).next("span").html("("+b.data.location+")")}else ct.error(b.error);return true},function(){return true})},ipDisallow:function(a,b){ip=b.find(".ip").html();ct.confirm("\u6b64\u64cd\u4f5c\u9501\u5b9a\u7528\u6237"+
ipTime+"\u5c0f\u65f6\uff0c\u786e\u8ba4\u9501\u5b9a"+ip+"\uff1f",function(){$.get("?app=comment&controller=comment&action=ip_disallow",{ip:ip,commentid:a},function(c){if(c.state){$("#ip_"+a).attr("title","\u5df2\u9501\u5b9a");$("#ip_"+a).css("color","red");$("#ip_"+a).next()}else ct.error(c.error)},"json")})},ipDeleteAll:function(a,b){ip=b.find(".ip").html();ct.confirm("\u6b64\u64cd\u4f5c\u4e0d\u53ef\u6062\u590d\uff0c\u786e\u8ba4\u5220\u9664<span>"+ip+"</span>\u6240\u6709\u8bc4\u8bba\uff1f",function(){$.get("?app=comment&controller=comment&action=ip_delete",
{ip:ip,commentid:a},function(c){c.state?tableApp.load():ct.error(c.error)},"json")})},url:function(a){a>0&&ct.assoc.open("?app=member&controller=index&action=profile&userid="+a,"newtab")}};
