function generate_report_dialog(t){"undefined"==typeof dui?$.getScript("/js/ui/dialog.js",function(){_generate_report_dialog(t)}):_generate_report_dialog(t)}function _generate_report_dialog(t){function e(t){return t.test(location.pathname)}function n(t){return t.test(location.pathname)}function o(){if(t.reasons){var e=[],n=[];if(t.reasons.group_reasons){var o="";$.each(p.group_reasons,function(t,n){n.desc&&n.desc.length>86?o='

'+n.desc.substring(0,86)+'...展开

'+n.desc+"

":n.desc&&n.desc.length<=86&&(o="

"+n.desc+"

"),e.push('
")})}t.reasons.douban_reasons&&$.each(p.douban_reasons,function(t,e){n.push('
")});var i=t.reasons.group_reasons&&t.reasons.group_reasons.length>0?'
违反本组发言规则
'+e.join("")+"
":"",s='

请选择对应理由,理由与内容不符,会延迟处理

'+i+'
违反豆瓣社区指导原则
'+n.join("")+'
侵犯我的权益

抄袭或未经授权转载我的内容、侵犯我的个人权益、侵犯我的企业权益

';return s}return"dui_config 缺少 reasons"}var i="8",s=t.type||"";s||(s="content",n(/^\/(subject|game|app)\/\w+/)||e(/movie|music|book/)?s="subject":n(/^\/people\/\w+\/?$/)?s="account":n(/^\/people\/\w+\/status\/\w+\/?$/)&&(s="comment")),s=s instanceof Array?s.join(","):s;var a='投诉已提交',r="http://help.douban.com/help/ask",d="/j/misc/report_form?type="+s,c="/misc/audit_report",l='为了便于工作人员进行受理,请您通过豆瓣帮助中心详细描述内容',u="

提交详细信息

",m=t.report_url?t.report_url:location.href,p=t.reasons?t.reasons:null,h=(t.is_group_member||!1,t.reason?t.reason:0),f="#report_value input[type=radio]:checked",v={title:t.title?t.title:"选择投诉原因",width:t.width?t.width:380,cls:t.cls?t.cls:"report-dialog"};if(t.is_group_member){if(!t.group_id)return void console.error("dui_config 缺少 group_id 参数");var _="/j/group/"+t.group_id+"/member_report";v.content=o(),v.buttons=[{text:"投诉",cls:"btn-report",method:function(e){var n=$(f).val(),o=$(f).data("report_type"),i={reason:n,type:o};t.comment_id&&(i.comment_id=t.comment_id),t.topic_id&&(i.topic_id=t.topic_id),$.post_withck(_,i,function(t){g.close(),pop_win(a,!0),setTimeout(function(){pop_win.close()},1e3)})}}]}else v.url=t.url?t.url:d;var g=dui.Dialog(v);g.report_url=m,g.is_report_dlg_singleton||(g.body.delegate(".btn-report","click",function(){if(h=$(f).val(),!t.reasons||!t.is_group_member)if("other"===h)g.node.find(".hd").html(u),g.node.find(".bd").html(l),g.update(),g.body.delegate(".bd a","click",function(){g.close()});else{var e="",n="",o=$(".victim-form .victim-msg").hide();if(h===i&&(e=$("#report_value .victim-input").val()||"",e?e.length>100&&(n="被冒充账号 id 最多不能超过 100 个字符"):n="被冒充账号 id 不能为空",n))return o.text(n).show(),void g.update();$.post_withck(c,{url:g.report_url,reason:h,extra_msg:e},function(){g.node.find(".hd").hide(),g.node.find(".bd").html(a),g.update(),setTimeout(function(){g.close()},1e3)})}}),g.is_report_dlg_singleton=!0),g.open(),g.body.delegate("input[type=radio]","click",function(t){var e=$(this),n=e.parents("dd").eq(0);n.length>0?(e.parents("dl").eq(0).find("p").hide(),n.find('p:not(".full-rsn-desc")').show()):g.node.find("dl p").hide();var o=$(f).val();o===i?g.node.find(".victim-form").show():g.node.find(".victim-form").hide(),g.update()}),g.body.delegate("a.show-full","click",function(t){var e=$(this).parents("p").eq(0);e.hide().siblings("p.full-rsn-desc").show(),g.update()}),g.node.find(".hd").show(),g.update()}function DoulistItem(t,e){return this.id=e,this.$node=t,this.$others=this.$node.find(".others"),this.$actions=this.$node.find(".actions"),this.$text=this.$node.find(".comment-text"),this.count_tmpl=' ({total})',this}DoulistItem.prototype={constructor:DoulistItem,init:function(){this.bindActionsEvents()},updateCount:function(t,e,n){var o,i=t.next(".count"),s=0|i.attr("data-count");(s||n)&&(o=s+n)?(i.remove(),t.after($(this.count_tmpl.replace(/{cls}/g,e).replace(/{total}/g,o))),i=t.next(".count"),i.attr("data-count",o)):i.remove()},bindActionsEvents:function(){var t=this;this.$node.delegate(".btn","click",function(e){e.preventDefault();var n=$(this).attr("data-action-type");return t[n]($(e.target)),!1}).delegate(".add-more-comments","click",function(t){return t.preventDefault(),$(this).parent().removeClass("comment-posted").find(".comment-text").focus(),!1}).find(".comment-form").bind("submit",function(e){return e.preventDefault(),!!$.trim($(this).find(".comment-text").val())&&(t.addComment(),!1)}),this.$node.delegate(".per-comment","mouseenter mouseleave",function(t){switch(t.type){case"mouseenter":$(this).find(".comment-report").css("visibility","visible");break;case"mouseleave":$(this).find(".comment-report").css("visibility","hidden")}}).delegate(".comment-report a","click",function(t){t.preventDefault();var e=$(this),n=e.closest(".per-comment").data("cid"),o=e.data("url"),i=o.replace(/[^\?]*(?=#)/,"c="+n);generate_report_dialog({report_url:i})})},getAllCommenters:function(){var t=[],e={};window.crt_uid&&(e[window.crt_uid]=1),$("a.commenter",this.$comments[0]).each(function(n,o){var i=o.href.split("/"),s=i[i.length-2];s in e||(t.push({uid:s,avatar:o.getAttribute("data-avatar"),username:o.innerHTML}),e[s]=1)}),this.commenters=t},filteredCommenters:function(t,e,n){for(var o=this.commenters||{},e=e||5,i=[],n=n||{},s=0,a=o.length;s-1?i.push(r):r.uid.indexOf(t)>-1&&i.push(r):i.push(r))}return{users:i}},bindCommentsEvents:function(){var t=this;t.getAllCommenters(),t.$others.delegate("p .btn-del","mouseenter",function(t){$(this).parent().addClass("mover")}).delegate("p .btn-del","mouseleave",function(t){$(this).parent().removeClass("mover")}),t.$text._tagsug_api||Do("tagsug",function(){t.$text.tagsug({max:5,customData:function(){return t.filteredCommenters.apply(t,arguments)}})})},like:function(t){var e=this;return window._USER_ABNORMAL?void(window.show_abnormal&&window.show_abnormal()):(t.removeClass("btn"),void $.post_withck("/j/doulist/item_like",{id:this.id},function(n){n=$.parseJSON(n),n.r||(t.text("已赞").attr({"data-action-type":"dislike",class:"btn btn-dislike"}),e.updateCount(t,"like",1))}))},dislike:function(t){var e=this;return window._USER_ABNORMAL?void(window.show_abnormal&&window.show_abnormal()):void $.post_withck("/j/doulist/item_dislike",{id:this.id},function(n){n=$.parseJSON(n),n.r||(t.text("赞").attr({"data-action-type":"like",class:"btn btn-like"}),e.updateCount(t,"like",-1))})},showLikes:function(t){if(window._USER_ABNORMAL)return void(window.show_abnormal&&window.show_abnormal());var e=$('
');""!==t&&(e.find("em").html(t),this.$others.find(".likers").remove().end().prepend(e))},showComments:function(t){var e=this;if(window._USER_ABNORMAL)return void(window.show_abnormal&&window.show_abnormal());e.$comments=e.$others.find(".comments"),t.text("加载中");var n=e.$comments.find(".comments-items"),o=e.$node.find(".btn-action-reply"),i=t.data("start")||0,s=100;0===i&&t.attr("data-action-type","hideComments"),$.getJSON("/j/doulist/item_comments",{id:e.id,start:i,limit:s},function(a){var r=a.comments,d=a.n_comments;e.showLikes(a.likers),e.$others.show(),o.data("count",d),0===i?(t.text("隐藏回复"),n.html(r)):(t.hide(),n.append(r)),i+=s,i