define("common/daterange/daterange.js",function(){return function(e){function t(t){e.onchange(t),e.start_date=t.start_date,e.end_date=t.end_date,a(t)}function a(){if(e.end_date===d.format("date"))for(var t=0;t<i.length;t++){var a=i[t];e.start_date===d.clone().d(0-a+1).format("date")?l.eq(t).addClass("selected"):l.eq(t).removeClass("selected")}c.val(e.start_date),s.val(e.end_date)}var d=new Date,n=-180;e.days&&(n=e.days),e.relative&&d.d(e.relative);var r=d.clone().format("date"),o=d.clone().d(n).format("date"),c=$(".daterange_start_date"),s=$(".daterange_end_date");c.datetimepicker({format:"yyyy-mm-dd",weekstart:1,minView:2,autoclose:!0,startDate:o,endDate:r}),s.datetimepicker({format:"yyyy-mm-dd",weekstart:1,minView:2,autoclose:!0,startDate:o,endDate:r}),$(".daterange_search").click(function(e){e.preventDefault(),t({start_date:c.val(),end_date:s.val()})});var i=[7,14,30],l=$(".daterange_stoggle span").each(function(e){var a=$(this);a.click(function(){t({start_date:d.clone().d(0-i[e]+1).format("date"),end_date:d.clone().format("date")})})});a(e)}});
;define("common/daterange/daterange_new.js",function(e){var t=e("common/daterange/tpl.whe");return function(e,a){function d(e){c.start_date=e.start_date,c.end_date=e.end_date,c.onchange(e),n(e)}function n(){if(c.end_date===o.format("date"))for(var e=0;e<f.length;e++){var t=f[e];c.start_date===o.clone().d(0-t+1).format("date")?m.eq(e).addClass("selected"):m.eq(e).removeClass("selected")}l.val(c.start_date),_.val(c.end_date)}var r=$(t()).appendTo(e),o=new Date,c=$.extend({},a);c.relative&&o.d(c.relative);var i=o.clone().format("date"),s=o.clone().d(-180).format("date"),l=r.find(".daterange_start_date"),_=r.find(".daterange_end_date");l.datetimepicker({format:"yyyy-mm-dd",weekstart:1,minView:2,autoclose:!0,startDate:s,endDate:i}),_.datetimepicker({format:"yyyy-mm-dd",weekstart:1,minView:2,autoclose:!0,startDate:s,endDate:i}),$(".daterange_search").click(function(e){e.preventDefault(),d({start_date:l.val(),end_date:_.val()})});var f=[7,14,30],m=$(".daterange_stoggle span").each(function(e){var t=$(this);t.click(function(){d({start_date:o.clone().d(0-f[e]+1).format("date"),end_date:o.clone().format("date")})})});return n(c),{trigger:function(){d({start_date:c.start_date,end_date:c.end_date})}}}});
;define("common/util/util.js",function(n,o){function t(n){for(var o=n.replace(/\+/g," ").split("&"),t={},a=0;a<o.length;++a){var e=o[a].split("=");2==e.length&&(t[decodeURIComponent(e[0])]=decodeURIComponent(e[1]))}return t}o.GET=t(window.location.search.slice(1)),o.e=function(n){if(null==n)return"";n+="";for(var o="",t=0;t<n.length;t++){var a=n[t];switch(a){case"'":o+="&#39;";break;case'"':o+="&#34;";break;case"<":o+="&lt;";break;case">":o+="&gt;";break;case"&":o+="&amp;";break;default:o+=a}}return o},function(){var n='<div class="bodymask_loading"><div class="bodymask_loading_bg"></div><div class="bodymask_loading_img"></div></div>',t=$(n).appendTo("body");o.loadingShow=function(){t.show()},o.loadingHide=function(){t.hide()}}(),function(){var n='<div class="bodymask"></div>',t=$(n).appendTo("body");o.maskShow=function(n){n=n||{},t.show(),t.unbind("click"),n.click&&t.bind("click",n.click)},o.maskHide=function(){t.hide()}}(),o.snsLogin=function(n){window.location="http://web.toutiao.com/auth/connect/?"+$.param({platform:n,type:"toutiao",next:location.protocol+"//"+window.location.host})},o.imgSize=function(){var n={},o=0;return function(t,a){var e=o++,i=n[o]=new Image;i.onload=function(){a(null,{width:i.width,height:i.height}),delete n[e]},i.onabort=i.onerror=function(){delete n[e],a(new Error)},i.src=t}}(),o.squareimg=function(n,t,a,e){var i,c;3===arguments.length?isNaN(a)?c=a:i=a:(i=a,c=e),c=c||function(){},o.imgSize(t,function(o,a){if(!o){var e=1;i=i||n.clientWidth;var r,s,d=a.width,l=a.height,u=i,h=d/l;h>e?(r=i,s=i/h):(s=u,r=u*h);var f=n.style;f.width=Math.floor(r)+"px",f.height=Math.floor(s)+"px",f.padding=Math.floor((u-s)/2)+"px "+Math.floor((i-r)/2)+"px",n.src=t,c({width:r,height:s})}})},o.mapParam=function(n){for(var o={},t=0;t<n.length;t++){var a=n[t];o[a.name]=a.value}return o},o.ajax=function(n,o,t){function a(n){return n.description||n.desc||n.reason||n.message||n.msg}var e={method:"POST",dataType:"json",timeout:3e4};return"object"==typeof n?(e=$.extend(e,n),t=e.callback||$.noop,delete e.callback):(e.url=n,$.isFunction(o)?t=o:(e.data=o,t=t||$.noop)),$.ajax(e).always(function(n,o){if("success"===o){var e=n,i=e.data||{},c=a(i)||a(e),r=e.code;null==r&&(r=i.error_code),null==r&&(r="success"===e.message||"success"===e.msg?0:1),t(r,c,i,e)}else{var s,d=n;s=0===d.status?-100:-d.status,t(s,"网络错误",{},{data:{}})}})},window.Util=o});
;define("common/stip/stip.js",function(require,exports,module){$.fn.hoverTitle=function(t){return t&&this.on("mouseenter","[title]",function(){var t=$(this);t.attr("data-title",t.attr("title")),t.removeAttr("title"),t.trigger("mouseenter")}),this.on("mouseenter","[data-title]",function(){var t=$(this),i=t.data("jtip");i||(i=$('<div class="stip2"></div>').appendTo("body"),t.data("jtip",i)),i.text(t.attr("data-title")),i.show();var o=t.offset();o.top-=i.innerHeight(),o.left+=t.innerWidth()/2,o.left-=i.innerWidth()/2,i.css(o),i.stop(!0).animate({opacity:.9},100)}).on("mouseleave","[data-title]",function(){var t=$(this),i=t.data("jtip");i&&i.is(":visible")&&i.stop(!0).animate({opacity:0},100,function(){t.data("jtip",0),i.remove()})})},$.fn.hoverTip=function(){return this.each(function(){var t=$(this),i=$('<div class="stip"></div>').appendTo("body");t.hover(function(){var t=$(this),o=t.offset();o.left+=t.width()/2,o.top+=t.height();var e;(e=t.attr("title"))?t.attr("title",""):e=t.data("title"),i.html(e),i.stop(!0).css($.extend(o,{display:"block"})).animate({opacity:.9},100)},function(){i.is(":hidden")||i.fadeOut(200)})})},exports.slideTip=function(t){var i=$('<div class="stip_small"></div>').appendTo("body");return t.hover(function(){var t=$(this),o=t.offset();o.left+=t.width()/2,i.html(t.data("title")),i.is(":hidden")?i.css($.extend(o,{display:"block"})).animate({opacity:.63},100):i.stop(!0).animate($.extend(o,{opacity:.63}),100)},function(){i.is(":hidden")||i.fadeOut(200)}),i},exports.popupTip=function(opt){var defaultDuration=3e3;opt.callback=opt.callback||$.noop,null==opt.duration&&(opt.duration=defaultDuration);var jEle=$(function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="spopup_fixed" tabindex="-1">\n	<div class="spopup_fixed_bg"></div>\n    <div class="spopup stip_popup ',__p+=obj.status?"sc-success":"sc-error",__p+='">\n        <div class="stip_popup_icon"></div>\n        <div class="stip_popup_text">'+(null==(__t=obj.msg)?"":__t)+"</div>\n    </div>\n</div>";return __p}(opt)).appendTo("body").show().focus();setTimeout(function(){jEle.addClass("show")},1),opt.duration<=0?setTimeout(opt.callback,defaultDuration):(setTimeout(function(){jEle.removeClass("show")},opt.duration-200),setTimeout(function(){opt.callback(),jEle.remove()},opt.duration))},exports.alert=function(t,i,o){exports.popupTip({msg:t,status:i,duration:o})}});
;define("common/facecrop/facecrop.js",function(require,exports,module){function popup(url,conf){function updatePreview(i){if(parseInt(i.w,10)>0){var e=viewW/i.w,o=viewH/i.h,n={width:Math.round(e*width),height:Math.round(o*height),top:0-Math.round(o*i.y),left:0-Math.round(e*i.x)};res={x:Math.round(i.x),y:Math.round(i.y),w:Math.round(i.w),h:Math.round(i.h)},jviewImg.css(n)}}var w_h=conf.width/conf.height;jpop&&jpop.remove();var html=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="facecrop popup">\n    <div class="popup_head">\n        <div class="popup_close"></div>\n        <div class="popup_title">上传图片</div>\n    </div>\n    <div class="facecrop_content sclearfix">\n        <img src="" class="facecrop_img">\n        <div class="facecrop_view">\n            <img src="" class="facecrop_view_img">\n        </div>\n    </div>\n    <div class="popup_foot sclearfix">\n        <div class="popup_btn popup_btn_cancel jcancel">取消</div>\n        <div class="popup_btn popup_btn_ok jok">确定</div>\n    </div>\n</div>';return __p}();jpop=$(html).appendTo("body"),jpop.find(".jok").click($.loadWrap(function(){return res.image_url=url,res.scale_w=conf.width,res.scale_h=conf.height,$.get("/crop_photo/",res).done(function(i){i.new_url?(util.maskHide(),jpop.remove(),_callback(null,{web_url:i.new_url,web_uri:i.new_uri})):Stip.popupTip({msg:"上传失败",status:!1})})})),jpop.find(".jcancel,.popup_close").click(function(){util.maskHide(),jpop.remove()});var width,height,jimg=jpop.find(".facecrop_img"),jview=jpop.find(".facecrop_view"),jviewImg=jpop.find(".facecrop_view_img"),viewW=150,viewH=Math.round(viewW/w_h);jview.css({width:viewW,height:viewH}),jviewImg.prop("src",url);var api;jimg.prop("src",url).Jcrop({bgColor:"#fff",onChange:updatePreview,onSelect:updatePreview,aspectRatio:w_h,boxWidth:460,boxHeight:$(window).height()-200},function(){api=this;var i=this.getBounds();width=Math.round(i[0]),height=Math.round(i[1]);var e=Math.min(width,Math.round(height*w_h)),o=Math.round(e/w_h);api.setSelect([0,0,e,o]),res={x:0,y:0,w:e,h:o}})}var _callback,res,jpop,util=require("common/util/util.js"),Stip=require("common/stip/stip.js"),imgSize=function(){var i;return function(e,o){i=new Image,i.onload=function(){o(null,{width:i.width,height:i.height})},i.onerror=function(){o(new Error)},i.src=e}}();return function(i,e,o){2===arguments.length&&(o=e,e={}),e=$.extend({width:200,height:200},e),_callback=o,util.loadingShow(),imgSize(i,function(o){return util.loadingHide(),o?void _callback(o):(util.maskShow(),void popup(i,e))})}});
;define("common/schart/schart.js",function(a){function r(a,r){for(var i='<div class="schartbar sclearfix"><div class="schartbar_content"><div class="schartbar_rows"></div><div class="schartbar_bars"></div></div></div>',c="",v=5;v>0;v--)c+='<div class="schartbar_row" style="height:20%;"><div class="schartbar_rowtitle">'+20*v+"%</div></div>";c+='<div class="schartbar_row0"><div class="schartbar_rowtitle">0%</div></div>';for(var e="",l=r.cols,v=0;v<l.length;v++){var d,h,o=l[v];r.total?(d=Math.round(100*o.value/r.total),h=d+"%<br/>"+o.value):(d=o.value,h=d+"%"),e+='<div class="schartbar_bar"><div class="schartbar_barvalue" data-title="'+t.e(h)+'" style="height:'+t.e(d)+'%;"></div><div class="schartbar_bartitle">'+t.e(o.name)+"</div></div>"}var b=$(i);b.find(".schartbar_rows").html(c),b.find(".schartbar_bars").html(e),a.html(b);var n=s.slideTip(b.find(".schartbar_barvalue"));return{remove:function(){n.remove(),b.remove()}}}var s=a("common/stip/stip.js"),t=a("common/util/util.js");return{percent20:r}});
;define("common/index/index.js",function(o){$(function(){var i=(o("common/schart/schart.js"),o("pagelet/pager/pager.js"));$(".indexsum_btn em").hoverTip(),i({jele:$(".page_page_number"),total:90,size:10,index:0,render:function(){}});var e={$modal:$(".j-bind-mobile"),cookieName:"indexbindmobile",show:function(){e.$modal.modal("show")},hide:function(){},event:function(){var o=this;this.$modal.on("hide.bs.modal",function(){}),this.$modal.find(".widget_btn_cancel").on("click",function(){o.$modal.modal("hide"),o._addCookie()}),this.$modal.find(".widget_btn").on("click",function(){o._addCookie(),location.href="/settings/#bind=true"})},_addCookie:function(){$.cookie(this.cookieName,1)},_removeCookie:function(){$.removeCookie(this.cookieName)},getCookie:function(){return $.cookie(this.cookieName)},init:function(){1!=e.getCookie()&&(e.event(),e.show())}};e.init()})});
;define("common/pager/pager.js",function(e){{var n=e("common/stip/stip.js"),i=e("common/pager/pager.whe");e("common/util/util.js")}return function(e){function t(){e.cb(p+1,function(e){if(null!=e.length&&(d=e.length),2>d)return void r.hide();s.text(d);var n=!1,i=!1;0===p&&(n=!0),p===d-1&&(i=!0),l[n?"addClass":"removeClass"]("disabled"),u[i?"addClass":"removeClass"]("disabled"),o.val(p+1)})}function a(){function e(){var e=Number($.trim(o.val()))-1;e>=0&&d>e?(p=e,t()):(o.val(p+1),n.popupTip({msg:"请输入正确的页码",status:!1}))}u.click(function(e){e.preventDefault(),u.is(".disabled")||(p++,t())}),l.click(function(e){e.preventDefault(),l.is(".disabled")||(p--,t())}),c.click(function(n){n.preventDefault(),e()}),o.keypress(function(n){13===n.keyCode&&e()})}var r=$(i());e.jele.html(r);var l=r.find(".pager1-prev"),u=r.find(".pager1-next"),o=r.find(".pager1-num"),s=r.find(".pager1-total"),c=r.find(".pager1-jump");a();var p=0,d=0;return t(),{jump:function(e){p=e-1,t()}}}});
;define("common/popup/dialog.js",function(require,exports,module){var tmpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="spopup_fixed" tabindex="-1">\n    <div class="spopup_fixed_bg"></div>\n    <div class="spopup_dialog spopup_dialog_'+(null==(__t=obj.type)?"":_.escape(__t))+'">\n        <div class="spopup_dialog_body">\n            ',(obj.title||obj.content)&&(__p+='\n                <div class="spopup_dialog_tip">\n                    <div class="spopup_dialog_title">'+(null==(__t=$.safeGet(obj.title))?"":__t)+'</div>\n                    <div class="spopup_dialog_content">'+(null==(__t=$.safeGet(obj.content))?"":__t)+"</div>\n                </div>\n            "),__p+='\n        </div>\n        <div class="spopup_dialog_btns">\n        </div>\n    </div>\n</div>';return __p};return function(t){t=$.extend({type:"info"},t);for(var o=t.okExecute,n=t.cancelExecute,e=t.cancelTxt?t.cancelTxt:"取消",i=t.okTxt?t.okTxt:"确定",p={ok:{text:i,html:'<div class="spopup_dialog_btn widget_btn_ok snoshadow"></div>',click:function(){d.remove(),o&&"function"==typeof o&&o()}},cancel:{text:e,html:'<div class="spopup_dialog_btn widget_btn_cancel snoshadow"></div>',click:function(){d.remove(),n&&"function"==typeof n&&n()}}},d=$(tmpl(t)).hide().appendTo("body"),_=d.find(".spopup_dialog_btns"),s=t.btns||[],l=0;l<s.length;l++){var c=s[l];"string"==typeof c&&(c={type:c}),c=$.extend({},p[c.type],c);var a=$(c.html).text(c.text);a.click(c.click),_.append(a)}return{show:function(){d.show();var t=d.find(":input");return t.length?t.focus():d.focus(),this},hide:$.proxy(d,"hide"),remove:$.proxy(d,"remove"),jele:d}}});
;define("common/popup/popup.js",function(o){function n(o,n){var t=p({title:o,btns:[{type:"ok",click:function(){n&&n(),t.remove()}}]});t.show()}var p=o("common/popup/dialog.js");return{alert:n}});
;define("common/select/select.js",function(require,exports,module){var selectTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+='<select placeholder="请选择" class="form-control channel-select j_channel_dom" name="tag" index="'+(null==(__t=index)?"":__t)+'">\n	',1==index&&(__p+="\n	<option value=''>请选择</option>\n	"),__p+="\n	";for(var key in collection)__p+="\n	<option value='"+(null==(__t=key)?"":__t)+"' ",tag_name&&tag_name==key&&(__p+=" selected "),__p+=" > "+(null==(__t=collection[key].value)?"":__t)+"</option>\n	";__p+="\n</select>"}return __p},SelectClass=function(e,t,n){this.menu=e,this.$el=n,this.initial=t?t:[],this.selectList=this.initial,e&&n&&this.init()};return SelectClass.getInstance=function(e){var t=e.attr("instanceId");return SelectClass.instance[t]},SelectClass.prototype={init:function(){this._clearSelect(),this._menuInit(this.menu,this.initial,0),this._eventInit()},instanceStore:function(e){var t=0;if(SelectClass.instance){for(var n in SelectClass.instance)t<parseInt(n)&&(t=parseInt(n));t+=1,SelectClass.instance[t.toString()]=this,e.attr("instanceId",t)}else SelectClass.instance={},SelectClass.instance[0]=this,e.attr("instanceId","0")},get:function(){for(var e,t=this.$el,n=t.find("select"),i=[],l=0;l<n.length;l++)e=n.eq(l),i.push(e.val());return i},_eventInit:function(){{var e,t,n=this.$el,i=this,l=this.menu;this.initial}n.on("change","select",function(){t=$(this).attr("index"),t=parseInt(t),e=$(this).val(),i.selectList.length>t-1&&(i.selectList.length=t-1),i.selectList.push(e),i._deleteIndexSelect(t+1),i._loadChildMenu(l,e)})},_buildHtml:function(e,t,n){var i=selectTemplate({collection:e,tag_name:t,index:n});this.$el.append(i)},_deleteIndexSelect:function(e){for(var t,n=this.$el,i=n.find("select"),l=0;l<i.length;l++)t=i.eq(l),parseInt(t.attr("index"))>=e&&t.remove()},_loadChildMenu:function(e,t){for(var n=this.selectList,i=n.indexOf(t),l=e,s=0;s<n.length&&(l=l[n[s]].child,n[s]!=t);s++);l&&this._buildHtml(l,t,i+2)},_menuInit:function(e,t,n){var i=t[n],n=n?n:0;this._buildHtml(e,i,n+1),i||0!=t.length||this.$el.find("select").val(""),n<t.length-1&&this._menuInit(e[i].child,t,n+1)},_clearSelect:function(){var e=this.$el;e.html("")}},SelectClass});
;define("common/signtip/signtip.js",function(require,exports,module){var Util=require("common/util/util.js");$(function(){var m=$.cookie("__m_");if(!m){var jpop=$(function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="popup signtip">\n    <div class="signtip_title">温馨提示</div>\n    <div class="signtip_prev">\n        今日头条•媒体平台基于特殊的个性化推荐机制，我们在处理帐号申请时会按照如下标准进行审核：\n    </div>\n    <div class="signtip_content">\n        1、谢绝泛时政类内容及社会新闻类内容的帐号申请；<br/>\n        2、谢绝低质、低俗、营销内容的帐号申请；<br/>\n        3、目前仅支持中国内地年满18周岁的人士凭身份证进行登记申请，且<b class="sn">一个身份证号仅支持一个帐号申请。</b><br/>\n    </div>\n    <div class="signtip_btns">\n        <a href="" class="signform_btn jbtn">我知道了</a>\n    </div>\n</div>';return __p}()).appendTo("body");jpop.show(),Util.maskShow(),jpop.find(".jbtn").click(function(i){i.preventDefault(),Util.maskHide(),jpop.hide(),$.cookie("__m_",1,{expires:30,path:"/"})})}})});
;define("common/ui/daterange_pager.js",function(e){var a=e("common/pager/pager.js"),t=e("common/daterange/daterange_new.js");return function(e,n,d){var r=new Date;r.d("-1");var o={start_date:r.clone().d("-6").format("date"),end_date:r.format("date"),pagenum:1},_=a({jele:n,cb:function(e,a){o.pagenum=e,d(o,a)}});t(e,{start_date:o.start_date,end_date:o.end_date,relative:-1,onchange:function(e){o.start_date=e.start_date,o.end_date=e.end_date,_.jump(1)}})}});
;define("common/ui/tab.js",function(){return function(a,n,t){function i(a){var n=t.apply(null,arguments);if(n!==!1&&(o.currentValue=a,!s.is(this))){var i=$(this);s.removeClass("active"),i.addClass("active"),r.hide(),r=c[a]||e,r.show(),s=i}}2==arguments.length?$.isFunction(n)?(t=n,n=$()):t=$.noop:1===arguments.length&&(n=$(),t=$.noop);var e=$(),s=e,r=e,u={},c={};n.each(function(){var a=$(this);c[a.data("tab")]=a}),a.each(function(){var a=$(this),n=a.data("tab");u[n]=a,a.click(function(){i.call(this,n)})});var o=function(a){var n=u[a]||e;i.apply(n[0],arguments)};return o.pages=c,o.tabs=u,o}});
;define("common/ui/toastr.js",function(){function e(e,t,n){return g({type:T.error,iconClass:m().iconClasses.error,message:e,optionsOverride:n,title:t})}function t(e,t){return e||(e=m()),h=$("#"+e.containerId),h.length?h:(t&&(h=d(e)),h)}function n(e,t,n){return g({type:T.info,iconClass:m().iconClasses.info,message:e,optionsOverride:n,title:t})}function i(e){v=e}function o(e,t,n){return g({type:T.success,iconClass:m().iconClasses.success,message:e,optionsOverride:n,title:t})}function s(e,t,n){return g({type:T.warning,iconClass:m().iconClasses.warning,message:e,optionsOverride:n,title:t})}function a(e,n){var i=m();h||t(i),l(e,i,n)||c(i)}function r(e){var n=m();return h||t(n),e&&0===$(":focus",e).length?void f(e):void(h.children().length&&h.remove())}function c(e){for(var t=h.children(),n=t.length-1;n>=0;n--)l($(t[n]),e)}function l(e,t,n){var i=n&&n.force?n.force:!1;return e&&(i||0===$(":focus",e).length)?(e[t.hideMethod]({duration:t.hideDuration,easing:t.hideEasing,complete:function(){f(e)}}),!0):!1}function d(e){return h=$("<div/>").attr("id",e.containerId).addClass(e.positionClass).attr("aria-live","polite").attr("role","alert"),h.appendTo($(e.target)),h}function u(){return{tapToDismiss:!0,toastClass:"toast",containerId:"toast-container",debug:!1,showMethod:"fadeIn",showDuration:300,showEasing:"swing",onShown:void 0,hideMethod:"fadeOut",hideDuration:1e3,hideEasing:"swing",onHidden:void 0,closeMethod:!1,closeDuration:!1,closeEasing:!1,extendedTimeOut:1e3,iconClasses:{error:"toast-error",info:"toast-info",success:"toast-success",warning:"toast-warning"},iconClass:"toast-info",positionClass:"toast-top-right",timeOut:5e3,titleClass:"toast-title",messageClass:"toast-message",escapeHtml:!1,target:"body",closeHtml:'<button type="button">&times;</button>',newestOnTop:!0,preventDuplicates:!1,progressBar:!1}}function p(e){v&&v(e)}function g(e){function n(e){return null==e&&(e=""),new String(e).replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function i(){a(),c(),l(),d(),u(),r()}function o(){x.hover(O,T),!D.onclick&&D.tapToDismiss&&x.click(v),D.closeButton&&y&&y.click(function(e){e.stopPropagation?e.stopPropagation():void 0!==e.cancelBubble&&e.cancelBubble!==!0&&(e.cancelBubble=!0),v(!0)}),D.onclick&&x.click(function(e){D.onclick(e),v()})}function s(){x.hide(),x[D.showMethod]({duration:D.showDuration,easing:D.showEasing,complete:D.onShown}),D.timeOut>0&&(H=setTimeout(v,D.timeOut),k.maxHideTime=parseFloat(D.timeOut),k.hideEta=(new Date).getTime()+k.maxHideTime,D.progressBar&&(k.intervalId=setInterval(b,10)))}function a(){e.iconClass&&x.addClass(D.toastClass).addClass(E)}function r(){D.newestOnTop?h.prepend(x):h.append(x)}function c(){e.title&&(I.append(D.escapeHtml?n(e.title):e.title).addClass(D.titleClass),x.append(I))}function l(){e.message&&(M.append(D.escapeHtml?n(e.message):e.message).addClass(D.messageClass),x.append(M))}function d(){D.closeButton&&(y.addClass("toast-close-button").attr("role","button"),x.prepend(y))}function u(){D.progressBar&&(B.addClass("toast-progress"),x.prepend(B))}function g(e,t){if(e.preventDuplicates){if(t.message===C)return!0;C=t.message}return!1}function v(e){var t=e&&D.closeMethod!==!1?D.closeMethod:D.hideMethod,n=e&&D.closeDuration!==!1?D.closeDuration:D.hideDuration,i=e&&D.closeEasing!==!1?D.closeEasing:D.hideEasing;return!$(":focus",x).length||e?(clearTimeout(k.intervalId),x[t]({duration:n,easing:i,complete:function(){f(x),D.onHidden&&"hidden"!==S.state&&D.onHidden(),S.state="hidden",S.endTime=new Date,p(S)}})):void 0}function T(){(D.timeOut>0||D.extendedTimeOut>0)&&(H=setTimeout(v,D.extendedTimeOut),k.maxHideTime=parseFloat(D.extendedTimeOut),k.hideEta=(new Date).getTime()+k.maxHideTime)}function O(){clearTimeout(H),k.hideEta=0,x.stop(!0,!0)[D.showMethod]({duration:D.showDuration,easing:D.showEasing})}function b(){var e=(k.hideEta-(new Date).getTime())/k.maxHideTime*100;B.width(e+"%")}var D=m(),E=e.iconClass||D.iconClass;if("undefined"!=typeof e.optionsOverride&&(D=$.extend(D,e.optionsOverride),E=e.optionsOverride.iconClass||E),!g(D,e)){w++,h=t(D,!0);var H=null,x=$("<div/>"),I=$("<div/>"),M=$("<div/>"),B=$("<div/>"),y=$(D.closeHtml),k={intervalId:null,hideEta:null,maxHideTime:null},S={toastId:w,state:"visible",startTime:new Date,options:D,map:e};return i(),s(),o(),p(S),D.debug&&console&&console.log(S),x}}function m(){return $.extend({},u(),O.options)}function f(e){h||(h=t()),e.is(":visible")||(e.remove(),e=null,0===h.children().length&&(h.remove(),C=void 0))}var h,v,C,w=0,T={error:"error",info:"info",success:"success",warning:"warning"},O={clear:a,remove:r,error:e,getContainer:t,info:n,options:{},subscribe:i,success:o,version:"2.1.2",warning:s};return O});
;define("common/util/async.js",function(n,t,e){!function(){function n(){}function t(n){return n}function r(n){return!!n}function u(n){return!n}function i(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function o(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function c(n){return U(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function a(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function f(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function l(n){return f(Array(n),function(n,t){return t})}function s(n,t,e){return a(n,function(n,r,u){e=t(e,n,r,u)}),e}function p(n,t){a(B(n),function(e){t(n[e],e)})}function h(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function m(n){var t,e,r=-1;return c(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=B(n),t=e.length,function(){return r++,t>r?e[r]:null})}function y(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function v(n){return function(t,e,r){return n(t,r)}}function d(t){return function(e,r,u){u=o(u||n),e=e||[];var c=m(e);if(0>=t)return u(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return u(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&u(null));f+=1,r(e[n],n,i(function(n){f-=1,n?(u(n),l=!0):s()}))}}()}}function g(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function k(n){return function(t,e,r,u){return n(d(e),t,r,u)}}function b(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function w(t,e,r,u){u=o(u||n),e=e||[];var i=c(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){i[t]=r,e(n)})},function(n){u(n,i)})}function O(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(f(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function S(n,t,e,r){O(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function E(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function L(n,t){return t}function I(t,e,r){r=r||n;var u=c(e)?[]:{};t(e,function(n,t,e){n(y(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function x(t,e,r){function u(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(a(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){c-=1;var e=!1,r=arguments;a(t,function(n){a(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+c===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var c=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){u(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){u(s,n,!0,t)},process:function(){for(;!s.paused&&c<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=f(n,function(n){return n.data});0===s.tasks.length&&s.empty(),c+=1,l.push(n[0]);var r=i(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return c},workersList:function(){return l},idle:function(){return s.tasks.length+c===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)P.setImmediate(s.process)}}};return s}function A(n){return y(function(t,e){t.apply(null,e.concat([y(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&a(e,function(t){console[n](t)}))})]))})}function T(n){return function(t,e,r){n(l(t),e,r)}}function z(n){return y(function(t,e){var r=y(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function q(n){return y(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var C,P={},H="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=H&&(C=H.async),P.noConflict=function(){return H.async=C,P};var M=Object.prototype.toString,U=Array.isArray||function(n){return"[object Array]"===M.call(n)},W=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},B=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},D="function"==typeof setImmediate&&setImmediate,F=D?function(n){D(n)}:function(n){setTimeout(n,0)};P.nextTick="object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:F,P.setImmediate=D?F:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,v(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,v(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return d(t)(n,v(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function u(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=o(r||n),t=t||[];for(var c,a=m(t),f=0;null!=(c=a());)f+=1,e(t[c],c,i(u));0===f&&r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function u(){var n=!0;return null===a?r(null):(e(t[a],a,i(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.setImmediate(u):u()}})),void(n=!1))}r=o(r||n),t=t||[];var c=m(t),a=c();u()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){d(t)(n,e,r)},P.map=g(w),P.mapSeries=b(w),P.mapLimit=k(w),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=f(n,t).reverse();P.reduce(i,e,r,u)},P.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=U(n)?[]:{}),P.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},P.select=P.filter=g(O),P.selectLimit=P.filterLimit=k(O),P.selectSeries=P.filterSeries=b(O),P.reject=g(S),P.rejectLimit=k(S),P.rejectSeries=b(S),P.any=P.some=E(P.eachOf,r,t),P.someLimit=E(P.eachOfLimit,r,t),P.all=P.every=E(P.eachOf,u,u),P.everyLimit=E(P.eachOfLimit,u,u),P.detect=E(P.eachOf,t,L),P.detectSeries=E(P.eachOfSeries,t,L),P.detectLimit=E(P.eachOfLimit,t,L),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,f(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e,r){function u(n){g.unshift(n)}function i(n){var t=h(g,n);t>=0&&g.splice(t,1)}function c(){l--,a(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=o(r||n);var f=B(t),l=f.length;if(!l)return r(null);e||(e=l);var m={},v=0,d=!1,g=[];u(function(){l||r(null,m)}),a(f,function(n){function o(){return e>v&&s(k,function(n,t){return n&&m.hasOwnProperty(t)},!0)&&!m.hasOwnProperty(n)}function a(){o()&&(v++,i(a),l[l.length-1](g,m))}if(!d){for(var f,l=U(t[n])?t[n]:[t[n]],g=y(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};p(m,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else m[n]=e,P.setImmediate(c)}),k=l.slice(0,l.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has inexistant dependency");if(U(f)&&h(f,n)>=0)throw new Error("Has cyclic dependencies")}o()?(v++,l[l.length-1](g,m)):u(a)}})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return y(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();u.push(i?r(i):e),q(n).apply(null,u)}})}if(e=o(e||n),!U(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){I(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){I(d(t),n,e)},P.series=function(n,t){I(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},P.apply=y(function(n,t){return y(function(e){return n.apply(null,t.concat(e))})}),P.concat=g(j),P.concatSeries=b(j),P.whilst=function(t,e,r){if(r=r||n,t()){var u=y(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},P.doWhilst=function(n,t,e){var r=0;return P.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},P.until=function(n,t,e){return P.whilst(function(){return!n.apply(this,arguments)},t,e)},P.doUntil=function(n,t,e){return P.doWhilst(n,function(){return!t.apply(this,arguments)},e)},P.during=function(t,e,r){r=r||n;var u=y(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},P.doDuring=function(n,t,e){var r=0;P.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},P.queue=function(n,t){var e=x(function(t,e){n(t[0],e)},t,1);return e},P.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,U(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void a(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return x(n,1,t)},P.log=A("log"),P.dir=A("dir"),P.memoize=function(n,e){var r={},u={};e=e||t;var i=y(function(t){var i=t.pop(),o=e.apply(null,t);o in r?P.setImmediate(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([y(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=T(P.map),P.timesSeries=T(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(l(n),t,e,r)},P.seq=function(){var t=arguments;return y(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([y(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=z(P.eachOf),P.applyEachSeries=z(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?u(n):void o(r)}var u=i(e||n),o=q(t);r()},P.ensureAsync=q,P.constant=y(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return y(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}W(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},e.exports=P}()});
;define("common/util/bdshare.js",function(t,e,n){var o="6649976",i="http://s.share.baidu.com/",a=function(){var t=(new Date).getTime(),e=(new Date).getTime()+1e3,n=(new Date).getTime()+3e3;return t.toString(32)+e.toString(32)+n.toString(32)},r=function(t,e){for(var n=t.length,o="",i=1;e>=i;i++){var a=Math.floor(n*Math.random());o+=t.charAt(a)}return o},c=function(){var t=(new Date).toString(36),e=r("0123456789abcdefghijklmnopqrstuvwxyz",3);return t+e};n.exports=function(t,e){e=e||{};var n=a(),r=0,u="",l=document.title,s=e.wbuid||"",d=c(),m=(window.isAppPage?"app":"detail/list",encodeURIComponent(e.pic||"")),p=encodeURIComponent(e.url||""),h=encodeURIComponent(e.comment||""),f=encodeURIComponent(e.desc||""),g={tsina:"2504490989",tqq:"801083581",t163:"",tsohu:""};"tsina"===t?l=(e.text||l)+(e.weibotext||u):("tqq"===t&&(e.text=e.text.replace("@今日头条","@headlineapp")),l=e.text||l),l=encodeURIComponent(l.substring(0,300));var w="?click=1&url="+p+"&uid="+o+"&to="+t+"&type=text&relateUid="+s+"&pic="+m+"&title="+l+"&key="+g[t]+"&sign=on&desc="+f+"&comment="+h+"&searchPic=0&l="+n+"&linkid="+d+"&sloc=&apiType=0&buttonType="+r,b=i+w,v=i+"commit"+w+"&t="+Math.random(),x=function(){var t=[];return function(e){var n=t.push(new Image)-1;t[n].onload=function(){t[n]=t[n].onload=null},t[n].src=e}}();setTimeout(function(){x(v)},1500),window.open(b,"_blank","height=500,width=700,left=0,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,status=no")}});
;define("common/util/dict.js",function(t,a){a.lasttag="lasttag"});
;define("common/util/formcheck.js",function(){jQuery.fn.extend({form_check:function(r){function t(r,t){var i=$(r).attr("id");if(i){var l=$(r).attr("class").split(/\s+/),f=parseInt($(r).attr("minlength"))||1,c=parseInt($(r).attr("maxlength"))||0,u=$.trim($(r).val())||"",d=u.length,h=-1==l.indexOf("email")?!1:!0,p=-1==l.indexOf("id_card")?!1:!0,m=-1==l.indexOf("url")?!1:!0,v=-1==l.indexOf("time")?!1:!0,g=$(r).get(0).nodeName.toLowerCase(),b=$(r).attr("type")||"",x=!1;return"select"==g?u?(x=!0,e(i,"valid","",b)):e(i,"error",s,b,!0):"input"==g&&"checkbox"==b?r.checked?(e(i,"valid","",b),x=!0):e(i,"error",s,b):0==d?e(i,"error",s,b):f>d?e(i,"error","请输入长度最少是"+f+"的字符串",b):c&&d>c?e(i,"error","最大允许长度为"+c+"的字符串",b):h&&!o.test(u)?e(i,"error","请输入正确格式的电子邮件",b):m&&!url_pattern.test(u)?e(i,"error","请输入正确格式的链接地址",b):p&&!n(u)?e(i,"error","请输入合法的身份证号码",b):v&&a(u)?e(i,"error","请输入正确的时间格式，如2014-10-20 20:35",b):(x=!0,e(i,"valid","",b),m&&t&&u&&!/^((https|http|ftp|rtsp|mms):\/\/)/.test(u)&&(u="http://"+u,$(r).val(u))),x}}function e(r,t,e,a,n){var i="#"+r+'+ label[for="'+r+'"][class="error"]',l=$("#"+r);"checkbox"==a&&(i="."+r+'+ label[for="'+r+'"][class="error"]',l=$("."+r));var s=!!$(i).length;s?"valid"==t?$(i).remove():$(i).html(e):"error"==t&&($label=$("<label>"),$label.attr("for",r).addClass("error").html(e),n&&$label.attr("style","display:inline-block;margin-left:5px;"),l.after($label))}function a(r){if(!r||"string"!=typeof r)return!0;var t=!1;if(/(\d{4})-(\d{2})-(\d{2})(\s+)(\d{2}):(\d{2})/.test(r)){var e=r.split(/\s+/),a=e[0],n=e[1],i=a.split("-"),l=n.split(":"),s=(i[0]-0,i[1]-1),o=i[2]-0,f=l[0]-0,c=l[1]-0;(s>11||o>31||f>23||c>59)&&(t=!0)}else t=!0;return t}function n(r){if(!r||"string"!=typeof r||18!=r.length)return!1;r=r.toLowerCase();var t=/(^\d{17}(\d|X)$)/i;if(!t.test(r))return!1;for(var e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],a=[1,0,"x",9,8,7,6,5,4,3,2],n=0,i="",l=0;l<r.length-1;l++)n+=parseInt(r.substr(l,1))*e[l];return i=n%11,a[i]!=r.substr(r.length-1,1)?!1:!0}if(0!=this.length){var i=this.get(0),l=$(i);if("form"==i.nodeName.toLowerCase()){var s="必选字段",o=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;l.submit(function(){var e=[],a=$(".required",l).filter("input,textarea,select");return a.each(function(r,a){var n=t(a,!0);n===!1&&e.push(a),$(a).change(function(){t(this,!1)}),$(a).keyup(function(){t(this,!1)})}),e.length?(e[0].focus(),!1):r?r():!0})}}}})});
;define("common/util/labelupload.js",function(){!function(){function t(){$('<iframe src="javascript:false;"></iframe>').appendTo(e).remove()}var e=$("<div/>").css({position:"absolute",bottom:5,left:5,width:1,height:1,overflow:"hidden"});$(function(){e.appendTo("body")});var a=0,o=0;$.fn.labelUpload=function(n){a++;var p=this;n=$.extend({contentType:"html",dataType:"text",onstart:$.noop,oncomplete:$.noop},n);var i=$('<form method="post" enctype="multipart/form-data" action="'+n.action+'"/>'),r=$('<input type="file" name="'+n.name+'" id="labelupload_'+a+'" />');return n.accept&&r.prop("accept",n.accept),r.change(function(){if($(this).val()){n.onstart(),o++;var a=$('<iframe name="labelupload_iframe_'+o+'"/>').hide();a.appendTo(e),i.attr("target",a.attr("name")),a.one("load",function(){t();var e;try{var o,l=a.contents().find("body");o="html"===n.contentType.toLowerCase()?l.html():l.text(),"json"===n.dataType.toLowerCase()&&(o=$.parseJSON(o)),e=[null,o,{fileName:r.val().replace(/^.*\\/,"")}]}catch(c){e=["上传失败"]}n.oncomplete.apply(p,e),a.remove(),i[0].reset()}),i.submit()}}),i.append(r),e.append(i),this.attr("for",r.attr("id")),this}}()});
;define("common/util/omap.js",function(t,r,e){"use strict";function s(){this._values={},this._keys={},this._order=[],this._id=(new Date).getTime()+"$"+String(Math.random()).slice(2),this._nextId=0}var i=function(t,r,e){t[r]=e},h=function(t,r){for(var e=0;e<t.length;e++)if(t[e]===r)return e;return-1};e.exports=s,s.from=function(t,r){for(var e=this,s=new e,i=0;i<t.length;i++){var h=t[i],o=r?"function"==typeof r?r(h,i,t):h[r]:i,n=s._hash(o);s._order.push(n),s._keys[n]=o,s._values[n]=h}return s},s.fromTuples=function(t){for(var r=this,e=new r,s=0;s<t.length;s++){var i=t[s],h=i[0],o=e._hash(h);e._order.push(o),e._keys[o]=i[0],e._values[o]=i[1]}return e},s.prototype._hash=function(t){var r=typeof t;if(null===t||void 0===t||"boolean"===r||"number"===r)return"%"+t;if("string"===r)return'"'+t;if("object"!==r&&"function"!==r)return"?"+t;if(t instanceof Date)return"@"+Number(t);if(t instanceof RegExp)return"!"+t;var e="__hash$"+this._id;return void 0===t[e]&&(i(t,e,this._nextId),this._nextId+=1),"#"+t[e]},s.prototype.count=function(){return this._order.length},s.prototype.keyAt=function(t){return 0>t||t>this._order.length?void 0:this._keys[this._order[t]]},s.prototype.indexOf=function(t){var r=this._hash(t);return h(this._order,r)},s.prototype.insert=function(t,r,e){var s=this._hash(r),i=h(this._order,s);-1!==i&&this._order.splice(i,1),t>=this._order.length?this._order.push(s):0>t?this._order.unshift(s):this._order.splice(t,0,s),this._keys[s]=r,this._values[s]=e},s.prototype.set=function(t,r){var e=this._hash(t),s=h(this._order,e);-1===s&&this._order.push(e),this._keys[e]=t,this._values[e]=r},s.prototype.get=function(t){var r=this._hash(t);return this._values[r]},s.prototype.remove=function(t){var r=this._hash(t),e=h(this._order,r);return-1===e?!1:(this._order.splice(e,1),delete this._keys[r],delete this._values[r],!0)},s.prototype.unshift=function(t,r){var e=this._hash(t),s=h(this._order,e);-1!==s&&this._order.splice(s,1),this._order.unshift(e),this._keys[e]=t,this._values[e]=r},s.prototype.shift=function(){if(!this._order.length)return void 0;var t=this._order.shift(),r=this._keys[t],e=this._values[t];return delete this._keys[t],delete this._values[t],[r,e]},s.prototype.push=function(t,r){var e=this._hash(t),s=h(this._order,e);-1!==s&&this._order.splice(s,1),this._order.push(e),this._keys[e]=t,this._values[e]=r},s.prototype.pop=function(){if(!this._order.length)return void 0;var t=this._order.pop(),r=this._keys[t],e=this._values[t];return delete this._keys[t],delete this._values[t],[r,e]},s.prototype.items=function(){for(var t=[],r=0;r<this._order.length;r++){var e=this._order[r];t.push([this._keys[e],this._values[e]])}return t},s.prototype.values=function(){for(var t=[],r=0;r<this._order.length;r++){var e=this._order[r];t.push(this._values[e])}return t},s.prototype.keys=function(){for(var t=[],r=0;r<this._order.length;r++){var e=this._order[r];t.push(this._keys[e])}return t},s.prototype.forEach=function(t){for(var r=0;r<this._order.length;r++){var e=this._order[r];t(this._values[e],this._keys[e],this)}},s.prototype.map=function(t){for(var r=[],e=0;e<this._order.length;e++){var s=this._order[e];r.push(t(this._values[s],this._keys[s],this))}return r},s.prototype.filter=function(t){for(var r=new s,e=0;e<this._order.length;e++){var i=this._order[e],h=this._keys[i],o=this._values[i];t(o,h,this)&&(r._order.push(i),r._keys[i]=h,r._values[i]=o)}return r},s.prototype.reduce=function(t,r){var e=0,s=r;if(void 0===s){if(!this._order.length)throw new TypeError("Must provide an initial value for empty maps");s=this._values[this._order[0]],e=1}for(;e<this._order.length;e++){var i=this._order[e];s=t(s,this._values[i],this._keys[i],this)}return s},s.prototype.reduceRight=function(t,r){var e=this._order.length,s=r;if(void 0===s){if(!this._order.length)throw new TypeError("Must provide an initial value for empty maps");s=this._values[this._order[e-1]],e-=1}for(var e=this._order.length;e>0;e--){var i=this._order[e-1];s=t(s,this._values[i],this._keys[i],this)}return s}});
;define("common/util/re.js",function(){});
;define("common/vali/core.js",function(){return function(t){function n(t,n){var a=this.data("vali_effect")||l.effect;if(null==t){n=i(this,n);var r=this.data("vali_require");r===!0&&(r="必填项"),r&&!n&&(t=r)}return a.call(this,t,n),[t,n]}function a(t){var n,a=t[0];return"checkbox"===a.type||"radio"===a.type?a.checked&&(n=t.val()||"on"):n=t.val(),n}function i(t,n){null==n&&t.is(":input")&&(n=a(t));var i=t.data("vali_name")||t.attr("name");return n=r(n),null==i||null==n?null:{name:i,value:n}}function r(t){if(!t)return null;var n=typeof t;return"string"===n?t=$.trim(t):"object"===n&&($.isArray(t)&&0===t.length?t=null:$.isEmptyObject(t)&&(t=null)),null==t||""===t?null:t}var l={valiFunc:function(t){t()},effect:function(t){t?(this.addClass("error"),this.data("vali_jmsg").html(t)):(this.removeClass("error"),this.data("vali_jmsg").html(""))}};t.unbind(".vali").bind("change.vali",function(){var t=$(this);e.call(t,$.proxy(n,t))}).one("blur.vali",function(t){if(t.target===this){var n=$(this);n.is(":input")&&!n.val()&&n.trigger("change")}});var e=function(t){var n=this.data("vali_func")||l.valiFunc,i=this.data("vali_require");if(i===!0&&(i="必填项"),!this.is(":input")||null==i)return n.apply(this,arguments);var r=a(this);i?r?n.apply(this,arguments):t(i):r?n.apply(this,arguments):t()},u=function(a){function i(l){if(l>=t.length)return a(r,u,c);var s=t.eq(l);e.call(s,function(){var t=n.apply(s,arguments),a=t[0],e=t[1];a?null==r&&(r=a,u=s):e&&c.push(e),i(l+1)})}if("reset"===a)return void t.each(function(){var t=$(this),n=t.data("vali_effect")||l.effect;n.call(t)});var r,u,c=[];i(0)};return u}});
;define("common/vali/vali.js",function(F){var u=F("common/util/util.js"),a=F("common/vali/core.js");return a._int=function(F){return/^\d*$/.test(F)?void 0:"请输入正整数"},a.simple=function(F){var u=$(F.tpl(F)),a=u.find(":input").eq(0);return a.data("vali_func",F.func),a.data("vali_require",F.require),a.data("vali_name",F.name),a.data("vali_jmsg",u.find(".jmsg")),{jbox:u,name:F.name,jvali:a}},a.returnWrap=function(F){return function(u){return u.apply(this,[].concat(F.call(this,$.trim(this.val()))))}},a.mixin=function(){var F=$.extend.apply($,arguments),u=["name","effect","func","jmsg","require"];for(var a in u){var t=u[a];F["vali_"+t]=F[t],delete F[t]}return F},a.mobile=function(F){return/^1\d{10}$/.test(F)?void 0:"请输入正确的手机号码"},a.email=function(F){return/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(F)?void 0:"请输入正确的邮箱地址"},a.cnid=function(F){var u="请输入正确的身份证";if(!F||"string"!=typeof F||18!=F.length)return u;F=F.toLowerCase();var a=/(^\d{17}(\d|X)$)/i;if(!a.test(F))return u;for(var t=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2],n=[1,0,"x",9,8,7,6,5,4,3,2],e=0,i="",r=0;r<F.length-1;r++)e+=parseInt(F.substr(r,1),10)*t[r];return i=e%11,n[i]!=F.substr(F.length-1,1)?u:void 0},a.range=function(F,u,a,t){var n;n=u&&a?"请输入"+u+"到"+a+"个字":u?"请最少输入"+u+"个字":"请最多输入"+a+"个字",F=$.trim(F);var e;return e=t?F.replace(/[^\x00-\xff]/g,"**").length/2:F.length,u&&u>e?n:a&&e>a?n:void 0},a.url=function(F){return/^((https|http):\/\/)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(F)?void 0:"请输入正确的链接"},a.canUseMediaName=function(F){var t=$.trim(this.val()),n=a.range(t,2,10,!0);return n?F(n):void u.ajax({url:"/can_use_media_name/",method:"GET",data:{name:t},callback:function(u,a){0==u?F():(101036==u&&(a='该帐号已占用请修改，或<a href="http://toutiao.com/a5332817397/" target="_blank" class="slink">申诉取回此帐号</a>'),F(a))}})},a.mediaNameId=function(F){var t=$.trim(this.val()),n=a.range(t,2,10,!0);return n?F(n):void u.ajax("/infringement/get_media_id/",{name:t},function(u,a,n){0===u?F(null,{text:t,value:n.media_id}):F("无此头条号")})},a});
;define("common/videoposter/uploader.js",function(e,i,t){var o="/tools/upload_picture/",E="/static/uploadify/uploadify.swf",a="upfile",l="组图上传功能基于flash插件，在您的浏览器中未检测到相应的flash插件。",p="不会被添加到上传队列中",n="您一次上传的图片个数超过了上传队列最大限制，请确保每次批量上传图片数量少于 ",u={swf:E,uploader:o,fileObjName:a,buttonText:"上传图片",fileSizeLimit:"5MB",fileTypeExts:"*.gif; *.jpg; *.jpeg; *.png",method:"post",multi:!0,width:150,height:40,uploadLimit:999,queueSizeLimit:30,overrideEvents:[],removeCompleted:!0,preventCaching:!1,removeTimeout:1,onFallback:f,onSelectError:c,buttonClass:"upload_button_click"},s=function(){alert.apply(this,arguments)},f=function(){s(l)},c=function(e,i){switch(i){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:s(n+u.queueSizeLimit+"个");break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:s("文件："+e.name+" 超出了文件大小限制（"+u.fileSizeLimit+"），"+p);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:s("文件："+e.name+" 是空文件，"+p);break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:s("文件："+e.name+" 不在允许的图片类型范围（"+u.fileTypeExts+"），"+p)}};t.exports=function(e,i){"object"==typeof i&&$.extend(u,i),e.uploadify(u)}});
;define("common/videoposter/videoposter.js",function(require,exports,module){var systemTemplate=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="modal videoposter-modal" data-backdrop="static">\n	<div class="modal-dialog-wrapper">\n		<div class="modal-dialog">\n			<div class="modal-content">\n				<div class="modal-body">\n					<div class="videoposter-header">\n						<a class="video_poster_nav j_video_poster_nav" ga="视频封面-上传封面点击事件">上传封面</a>\n						<a class="video_poster_nav j_video_poster_nav active" ga="视频封面-系统封面点击事件">系统封面</a>\n					</div>\n					<div class="videoposter-main">\n						<ul class="videoposter-items" data-node="con"></ul>\n					</div>\n					<div class="videoposter-footer">\n						<button class="new-btn submit" data-node="ok" ga="视频封面-系统封面点击确认按钮">确认</button>\n						<button class="new-btn cancel" data-node="cancel" ga="视频封面-系统封面点击取消按钮">取消</button>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>';return __p},uploaderTemplate=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+="<div class=\"modal video-uploader-modal\" data-backdrop=\"static\">\n	<div class=\"modal-dialog-wrapper\">\n		<div class=\"modal-dialog\">\n			<div class=\"modal-content\">\n				<h1 class='video_uploader_line'></h1>\n				<div class=\"modal-body\">\n					<div class=\"videoposter-header\">\n						<div class=\"close\"></div>\n						<a class=\"video_poster_nav j_video_poster_nav active\" ga=\"视频封面-上传封面点击事件\">上传封面</a>\n						<a class=\"video_poster_nav j_video_poster_nav\" ga=\"视频封面-系统封面点击事件\">系统封面</a>\n					</div>\n					<div class=\"video-uploader-main j_video_cover_main\"> \n						<div class= 'video-uploder-wrap  j_video_upload'>\n							<div class='video-uploader-upload-background'>\n							</div>\n							<div class='video-uploader-upload-bottom'>\n								<div class='button'>\n									<a class='j_upload' id='video_uplod'>选择图片</a> \n								</div>\n							</div>\n							<div class='video-uploader-upload-note'>\n								<span>上传图片不超过5m，最大高度和宽度不超过5000像素</span>\n								<div>提示：上传优质的封面，将有利于获得更多的推荐机会。请务必上传和视频内容相关、有引导价值的图片，如有作弊情况将被封号处理。</div>\n							</div>\n						</div>\n						<div class= 'video-loading  j_video_loading'>\n							<div class='video_loading_note j_video_loading_note'>图片上传中</div>\n							<div class='video_loading_outer'>\n								<div class='video_loading_inner j_video_loading_inner'>\n								</div>\n								<div class='video-cancel j_video-cancel'></div>\n							</div>\n						</div>\n						<div class= 'video-error  j_video_error'>\n						</div>\n						<div class= 'video-modify  j_video_modify' >\n							<div id='modify_video_cover'>\n							</div>\n						</div>\n\n					</div>\n\n				</div>\n			</div>\n		</div>\n	</div>\n</div>";return __p},Upload=require("common/videoposter/uploader.js"),videoIntance=null,poster_fetching='<li class="videoposter-loading"></li>',$poster_tip=$('<li class="videoposter-tip"></li>'),uploadUrl="http://mp.toutiao.com/tools/upload_picture/",list_tmpl='<li class="videoposter-item" data-node="item" data-index="{index}"><img class="videoposter-image" src="{src}"><div class="videoposter-image-hover"></div>',logger=function(){return layoutLogger?layoutLogger:{error:$.noop,notice:$.noop,warming:$.noop}},VideoPoster=function(){this._init()};VideoPoster.prototype={_init:function(){var e=0==document.location.href.indexOf("https"),i=-1!=document.location.href.indexOf("/articles/");this.isHttps=e,this._hasSystemRender=!1,this._hasUploaderRender=!1,this._systemDes=null,this.$systemEl=$(systemTemplate({isHttps:e,isListPage:i})),this.$systemCon=this.$systemEl.find('[data-node="con"]'),this.$systemOk=this.$systemEl.find('[data-node="ok"]'),this.$systemCancel=this.$systemEl.find('[data-node="cancel"]'),this.systemCoverList=null,this._systemEventInit(),this._curTab="system",this.$uploaderEl=$(uploaderTemplate()),this.$uploaderUploadEl=this.$uploaderEl.find(".j_video_upload"),this.$uploaderLoadingEl=this.$uploaderEl.find(".j_video_loading"),this.$uploaderFailEl=this.$uploaderEl.find(".j_video_error"),this.$uploaderModifyEl=this.$uploaderEl.find(".j_video_modify"),this.$uploaderInnerProcess=this.$uploaderEl.find(".j_video_loading_inner"),this.$uploaderCancel=this.$uploaderEl.find(".j_video-cancel"),this.$uploaderNote=this.$uploaderEl.find(".j_video_loading_note"),this._uploaderEventInit(),this.uploderPreId=null,this.uploderImageId=null,this.uploderImageUrl=null,this.uploaderImageUri=null,this.uploadStatus=!0,this.imageEditerId=null,this.hasInitEditor=!1,this.coverData=null,this.hasVideoUploaded=!1},show:function(e){return this._systemDes=e,this._hasSystemRender||this._render("system"),this._uploaderShow(),this},hide:function(){this._systemHide(),this._uploaderHide()},updateCover:function(){this.hasVideoUploaded=!0,this.coverData&&this._uploaderSaveCallback(this.coverData)},clearData:function(){this.hasVideoUploaded=!1,delete this.coverData},_render:function(e,i){"system"==e?this._systemRender(i):"uploader"==e&&this._uploaderDialogRender(i)},_systemRender:function(){var e="2视频封面-"+this._systemDes.source+"-确认",i="2视频封面-"+this._systemDes.source+"-取消";this.$systemEl.appendTo("body"),this._hasSystemRender=!0,this.$systemOk.attr("ga",e),this.$systemCancel.attr("ga",i)},_systemShow:function(e){this.$systemCon.data("processing",!1).html(poster_fetching),this.$systemEl.modal(),this._getSystemVideoCoverList(e)},_getSystemVideoCoverList:function(e){var i="视频封面图数据获取失败",o="视频处理中，暂无系统封面，请使用上传封面",t=this,a=e.id,s=e.type;$.ajax({type:"GET",url:"/video/video_thumb/",data:{id:a,type:s},dataType:"json"}).done(function(e){if("success"==e.message){var a="",s=JSON.parse(e.data);if(0!=s.code)return void t._ajaxFeedback(o,!1);var d=s.data;if(0==d.length)return void t._ajaxFeedback(i,!1);t.systemCoverList=d;for(var n=0;n<d.length;n++){var l=list_tmpl.replace("{index}",n);a+=l.replace("{src}",d[n].img)}t.$systemCon.html(a),logger().notice("系统封面上传成功")}else t._ajaxFeedback(i,!1),logger().error("系统封面上传失败",$.getNginxLogId(arguments))}).fail(function(){logger().error("系统封面上传失败，接口错误了",$.getNginxLogId(arguments)),t._ajaxFeedback(i,!1)})},_ajaxFeedback:function(e,i){var o=this;this.$systemCon.html($poster_tip.text(e)),i&&o.hide()},_systemHide:function(){this.$systemEl.modal("hide")},_systemEventInit:function(){this.$systemEl.on("click",'[data-node="cancel"]',$.proxy(this._systemButtonCancel,this)),this.$systemEl.on("click",'[data-node="ok"]',$.proxy(this._systemButtonConfirm,this)),this.$systemEl.on("click",'[data-node="item"]',$.proxy(this._systemItemSelected,this)),this.$systemEl.on("click",".j_video_poster_nav",$.proxy(this._swichTab,this))},_systemItemSelected:function(e){var i=$(e.target),o=i.parents("li");$(".videoposter-item").each(function(e,i){var t=$(i);t.is(o)?t.toggleClass("selected"):t.removeClass("selected")})},_systemButtonConfirm:function(){var e=this.$systemCon.find(".selected");if(0!=e.length){var i=e.data("index"),o=this.systemCoverList[i];if(o&&!this.$systemCon.data("processing")){this.$systemCon.data("processing",!0);var t=this,a=t._systemDes.id,s=t._systemDes.type,d=o.uri,n=o.img,l={id:a,type:s,thumb_uri:d,modify_type:2},r="视频封面更新失败";$.ajax({type:"POST",url:"/video/update_video_thumb/",data:{json_data:JSON.stringify(l)},dataType:"json"}).done(function(e){if("success"==e.message){var i="视频封面更新成功";t._ajaxFeedback(i,!0);var o=t._systemDes.success;"function"==typeof o&&o(a,n,d)}else logger().error("系统封面更新失败",$.getNginxLogId(arguments)),t._ajaxFeedback(r,!0)}).fail(function(){logger().error("系统封面更新失败，接口错误",$.getNginxLogId(arguments)),t._ajaxFeedback(r,!0)}).always(function(){t.$systemCon.data("processing",!1)})}}},_systemButtonCancel:function(){this._systemHide()},_swichTab:function(e){var i=$(e.target),o=i.parents(".videoposter-header"),t=o.find("a").index(i);i.hasClass("active")||(0==t?(this._systemHide(),this._uploaderShow()):(this._systemShow(this._systemDes),this._uploaderHide()))},_uploaderShow:function(){this._hasUploaderRender||this._uploaderDialogRender(),this.$uploaderEl.modal(),this._uploaderUploadShow()},_uploaderHide:function(){this.$uploaderEl.modal("hide")},_uploaderDialogRender:function(){var e=this;this.$uploaderEl.appendTo("body"),this._hasUploaderRender=!0,e._uploaderBindUploadEvent()},_uploaderEventInit:function(){this.$uploaderEl.on("click",".j_video-cancel",$.proxy(this._uploaderCancelUpload,this)),this.$uploaderEl.on("click",".j_video_poster_nav",$.proxy(this._swichTab,this)),this.$uploaderEl.on("click",".close",$.proxy(this._uploaderHide,this))},_uploaderBindUploadEvent:function(){var e=this.$uploaderEl,i=this,o=e.find("#video_uplod"),t={};t.onUploadStart=function(e){i.uploderPreId=e.id,i.uploadStatus=!0,i._uploaderLoadingShow("图片上传中",0)},t.onUploadSuccess=function(e,o){var t;i.uploadStatus&&(i._uploaderModifyShow(),i.uploderImageId=e.id,"string"==typeof o&&(o=JSON.parse(o)),t=i.isHttps?"https://p.pstatp.com/large/"+o.original:o.url,i.uploderImageUrl=t,i.uploaderImageUri=o.original)},t.onUploadError=function(){i._uploaderFailShow(),i._uploaderUploadShow()},t.onUploadProgress=function(e,o,t){i._uploaderLoadingShow("图片上传中",parseInt(100*o/t))},Upload(o,t)},_uploaderCancelUpload:function(){this.uploadStatus=!1,this._uploaderUploadShow()},_uploaderUploadShow:function(){this._uploaderLoadingFormat(),this.$uploaderLoadingEl.hide(),this.$uploaderFailEl.hide(),this.$uploaderModifyEl.hide(),this.$uploaderUploadEl.removeClass("hiding_uploader")},_uploaderLoadingShow:function(e,i){this.$uploaderUploadEl.addClass("hiding_uploader"),this.$uploaderLoadingEl.show(),this.$uploaderFailEl.hide(),this.$uploaderModifyEl.hide(),e||(e="上传图片中"),void 0==i&&(i=0),this.$uploaderNote.html(e),this.$uploaderInnerProcess.css({width:i+"%"})},_uploaderLoadingFormat:function(){this._uploaderLoadingShow()},_uploaderFailShow:function(){alert("图片上传失败")},_uploaderModifyShow:function(){this.$uploaderLoadingEl.hide(),this.$uploaderUploadEl.addClass("hiding_uploader"),this.$uploaderFailEl.hide(),this.$uploaderModifyEl.show(),this.hasInitEditor?xiuxiu.loadPhoto(this.uploderImageUrl):this.xiuxiuInit(),this.$uploaderInnerProcess.css({width:"0%"})},xiuxiuInit:function(){var e=this;xiuxiu.setLaunchVars("cropPresets","640x360"),xiuxiu.setLaunchVars("avatarPreview",{visible:!0,label:"裁剪预览",large:{width:140,height:140,label:"大尺寸"}}),xiuxiu.setLaunchVars("cameraEnabled",0),xiuxiu.setLaunchVars("localFileEnabled",0),xiuxiu.embedSWF("modify_video_cover",5,"100%","400px"),xiuxiu.setUploadURL(uploadUrl),xiuxiu.setUploadType(2),xiuxiu.setUploadDataFieldName("upfile"),xiuxiu.onInit=function(i){e.imageEditerId=i,xiuxiu.loadPhoto(e.uploderImageUrl)},xiuxiu.onUploadResponse=function(i){var o=e._systemDes.not_cover_save,t=e.hasVideoUploaded;e.coverData=i,!o||t?e._uploaderSaveCallback(i):e._uploadCallback()}},xiuxiuDestory:function(){this.imageEditerId&&(xiuxiu.remove(this.imageEditerId),this.imageEditerId=null)},_getModifyType:function(e,i){var o,t={api:"meta",ref_id:this._systemDes.id},a={30:"transcoding",10:"done"},s=this;$.ajax({type:"POST",url:"/video/video_api/",data:{json_data:JSON.stringify(t)},dataType:"json"}).done(function(i){o=JSON.parse(i.data),0==o.code&&o.data?(s._systemDes.video_status=a[o.data.status],e()):e()}).fail(function(){i()})},_uploaderSaveCallback:function(e){"string"==typeof e&&(e=JSON.parse(e));var i=this;i._getModifyType(function(){i._saveCallBackWithUpdate(e)},function(){i._saveCallBackWithUpdate(e)})},_saveCallBackWithUpdate:function(e){var i=this,o=this._systemDes.id,t=(e.url,i._systemDes.type),a=e.original,s=(this._systemDes.success,this._systemDes.video_status),d="transcoding"===s?3:1,n="视频封面更新失败",l={id:o,type:t,thumb_uri:a,modify_type:d};$.ajax({type:"POST",url:"/video/update_video_thumb/",data:{json_data:JSON.stringify(l)},dataType:"json"}).done(function(e){if("success"==e.message){logger().notice("视频封面更新成功"),i._uploadCallback()}else logger().error("自定义封面更新失败",$.getNginxLogId(arguments)),alert(n),i._ajaxFeedback(n,!0)}).fail(function(){alert(n),logger().error("自定义封面更新失败，接口出错",$.getNginxLogId(arguments)),i._ajaxFeedback(n,!0)})},_uploadCallback:function(){var e=this.coverData;if(e){"string"==typeof e&&(e=JSON.parse(e));var i=e.url,o=this._systemDes.id,t=this._systemDes.success,a=e.original;"function"==typeof t&&t(o,i,a),this._uploaderUploadShow(),this._uploaderHide()}}},module.exports=function(){return videoIntance||(videoIntance=new VideoPoster),videoIntance}});
;define("common/daterange/tpl.whe",function(){return function(){{var a="";wheei.safeParse,wheei.safeEncode}return a+='<div class="daterange"><div class="daterange_stoggle"><span class="daterange_stoggle_span">7天</span><span class="daterange_stoggle_span">14天</span><span class="daterange_stoggle_span">30天</span></div><div class="daterange_split"></div><input type="text" data-node="daterange_start_date" readonly class="daterange_start_date" value="2014-11-01"><label class="daterange_date_label" for="daterange_start_date"></label><span class="daterange_and">至</span><input type="text" data-node="daterange_end_date" readonly class="daterange_end_date" value="2014-11-07"><label class="daterange_date_label" for="daterange_end_date"></label><a href="" class="daterange_search"></a></div>'}});
;define("common/pager/pager.whe",function(){return function(){{var a="";wheei.safeParse,wheei.safeEncode}return a+='<div class="pager1"><a href="" class="pager1-prev disabled">上一页</a><span class="pager1-state">第<input type="text" class="pager1-num"/>/<span class="pager1-total"></span></span><a href="" class="pager1-jump">跳转</a><a href="" class="pager1-next">下一页</a></div>'}});
;define("common/popup/input.whe",function(){return function(i){var e="",n=(wheei.safeParse,wheei.safeEncode);return e+='<div class="dialog_input"><div class="dialog_input_title">',e+=n(i.label),e+='</div><input type="text" name="',e+=n(i.name),e+='" class="form1_input dialog_input_input" placeholder="',e+=n(i.hint),e+='"><div class="sred dialog_input_msg jmsg"></div></div>'}});
;define("common/sstep/sstep.whe",function(){return function(e){var s="",t=(wheei.safeParse,wheei.safeEncode),i=100/(e.arr.length-1);s+='<div class="sstep"><div class="sstep_bg"><div class="sstep_bgc" style="width:',s+=t(100*e.step/(e.arr.length-1)),s+='%;"></div></div><div class="sstep_wrap">';var r=e.arr;if(r)for(var a=0,n=r.length;n>a;a++){var d=r[a],v=a;s+='<div class="sstep_item ',v<e.step?s+=" done ":v==e.step&&(s+=" current "),s+=' " ',v===e.arr.length-1?s+=' style="float:right;margin-left:-50px;" ':(s+=' style="margin-right: ',s+=t(i),s+='%" '),s+=' ><div class="sstep_item_text">',s+=t(d),s+="</div></div>"}return s+="</div></div>"}});
;define("pagelet/pager/pager.js",function(e){function n(e){function n(n){e.render(f,f*a,(f+1)*a,n);var i=!1,t=!1;0===f&&(i=!0),f===l-1&&(t=!0),s[i?"addClass":"removeClass"]("disabled"),u[t?"addClass":"removeClass"]("disabled"),d.val(f+1)}function t(){function e(){var e=Number($.trim(d.val()))-1;e>=0&&l>e?(f=e,n()):(d.val(f+1),i.popupTip({msg:"请输入正确的页码",status:!1}))}u.click(function(e){e.preventDefault(),u.is(".disabled")||(f++,n())}),s.click(function(e){e.preventDefault(),s.is(".disabled")||(f--,n())}),o.click(function(n){n.preventDefault(),e()}),d.keypress(function(n){13===n.keyCode&&e()})}var a,l,r=e.jele,s=r.find(".page_number-prev"),u=r.find(".page_number-next"),d=r.find(".page_number-num"),p=r.find(".page_number-total"),o=r.find(".page_number-jump"),f=e.index||0;return null==e.length?(a=e.size,l=Math.ceil(e.total/e.size)):(a=0,l=e.length),2>l?void r.hide():(p.text(l),t(),void n(!0))}var i=e("common/stip/stip.js");return n});
;define("pagelet/signform/spec/website.js",function(require,exports,module){var Vali=require("common/vali/vali.js"),websiteTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+='">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td><input type="text" class="signform_input" name="'+(null==(__t=name)?"":_.escape(__t))+'"></td>\n</tr>\n<tr class="signform_sub">\n    <td></td>\n    <td>\n        <div class="">\n            <div class="form1_checkbox">\n                同意接入该网站（域名）下全部内容\n            </div>\n        </div>\n        <div class="form1_msg jmsg"></div>\n        <div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+"</div>\n    </td>\n</tr>";return __p};return function(e){e=$.extend({tpl:websiteTpl,label:"网站",name:"website",require:!0,require_check:!0,func:Vali.returnWrap(function(n){var r=Vali.url(n);if(r)return r;var i=t.checkbox();return window.website_grant_auth_status=i?1:0,e.require_check&&!i?"请同意接入该网站(域名)下全部内容":void 0})},e);var n=Vali.simple(e),t=n.jbox.find(".form1_checkbox").change(function(){n.jvali.trigger("change")});return t.checkbox(),e.noconfirm&&(t.checkbox(!0),t.parent().hide()),n}});
;define("pagelet/signform/spec/media_name.js",function(e){var a=e("common/vali/vali.js");return function(e){return function(s){var r=e.getEle("input",$.extend({label:"头条号名称",name:"media_name",func:a.mediaNameId},s));return r.jvali.data("vali_effect",function(e){var a=this.data("vali_jmsg");e?(this.addClass("error"),a.removeClass("sgreen").addClass("sred").text(e)):(this.removeClass("error"),a.addClass("sgreen").removeClass("sred").text("有效的头条号"))}),r}}});
;define("pagelet/signform/spec/images.js",function(require,exports,module){require("common/util/labelupload.js");var Stip=require("common/stip/stip.js"),tpl=require("pagelet/signform/spec/images.whe"),itemTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="signform_images_item">\n    <img src="'+(null==(__t=obj)?"":_.escape(__t))+'" class="signform_images_item_img">\n    <div class="signform_images_item_del" data-node="del"></div>\n</div>';return __p};return function(e){return function(i){function n(e){var i=$(itemTpl(e)),n=i.nodes();return n.del.click(function(){i.trigger("item_del")}),i}function t(){r.toggle(o.box.find(".signform_images_item").length!==i.max)}i=$.extend({name:"images",max:1},i);var a=$(tpl(i)),o=a.nodes(),r=o.btn;a.data({vali_require:i.require,vali_jmsg:o.msg,vali_name:i.name,vali_func:function(e){var i=o.box.find(".signform_images_item"),n=$.map(i,function(e){return $(e).data("value")});e(null,n)}}),r.labelUpload({name:"photo",dataType:"json",action:"/upload_photo/?type=json",accept:"image/*",onstart:function(){r.addClass("loading")},oncomplete:function(e,i){return r.removeClass("loading"),e?Stip.alert("上传失败"):(o.box.append(n(i.web_url).data("value",i)),void t())}}),r.click(function(e){return r.hasClass("loading")?void e.preventDefault():void 0}),o.box.on("item_del",function(e){$(e.target).remove(),t()});var l;return i.tr?(row=e.getEle("row",{label:i.tr}),row.jbox.find("[data-node=dd]").append(a),l={jbox:row.jbox,jvali:a}):l={jbox:a,jvali:a},l}}});
;define("pagelet/signform/spec/checkbox.js",function(e){var c=e("pagelet/signform/spec/checkbox.whe"),n=e("common/vali/vali.js");return function(e){e=n.mixin({label:"",name:"checkbox",effect:$.noop,require:!1,func:function(e){var c=o.checkbox()?1:null;e(null,c)}},e);var o=$(c(e));return o.checkbox(),o.data(e),{jbox:o,jvali:o}}});
;define("pagelet/signform/spec/row.js",function(e){var n=e("pagelet/signform/spec/row.whe"),o=e("common/vali/vali.js");return function(e){e=o.mixin({effect:$.noop},e);var r=$(n(e));r.data(e);var a=r.nodes();return{jbox:r,jvali:r,jdd:a.dd}}});
;define("pagelet/signform/spec/files.js",function(require,exports,module){require("common/util/labelupload.js");var Stip=require("common/stip/stip.js"),tpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="signform_files">\n    <div class="signform_files_label">'+(null==(__t=obj.label)?"":_.escape(__t))+'</div>\n    <div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+'</div>\n    <div class="signform_files_box" data-node="box">\n    </div>\n    <label class="widget_btn_cancel snoshadow signform_files_btn" data-node="btn"></label>\n    <div class="signform_msg" data-node="msg"></div>\n</div>';return __p},itemTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="signform_files_item">\n    <span class="signform_files_item_text">'+(null==(__t=obj)?"":_.escape(__t))+'</span>\n    <span class="signform_files_item_del slink" data-node="del">删除</span>\n</div>';return __p};return function(e){function n(e){var n=$(itemTpl(e)),i=n.nodes();return i.del.click(function(){n.trigger("item_del")}),n}function i(){s.toggle(t.box.find(".signform_files_item").length!==e.max)}e=$.extend({name:"files",max:1},e);var a=$(tpl(e)),t=a.nodes(),s=t.btn;return a.data({vali_name:e.name,vali_require:e.require,vali_jmsg:t.msg,vali_func:function(e){var n=t.box.find(".signform_files_item"),i=$.map(n,function(e){return $(e).data("value")});e(null,i)}}),s.labelUpload({name:"file",dataType:"json",action:"/api/upload_file/",accept:"*",onstart:function(){s.addClass("loading")},oncomplete:function(e,a,l){return s.removeClass("loading"),e?e="上传失败":"success"!==a.message&&(e=a.reason),e?Stip.alert(e):(t.box.append(n(l.fileName).data("value",a.sids[0])),void i())}}),s.click(function(e){return s.hasClass("loading")?void e.preventDefault():void 0}),t.box.on("item_del",function(e){$(e.target).remove(),i()}),{jbox:a,jvali:a}}});
;define("pagelet/signform/spec/id.js",function(require,exports,module){var Vali=require("common/vali/vali.js"),Util=require("common/util/util.js"),tpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+='">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td>\n        <div data-node="box">\n            \n        </div>\n    </td>\n</tr>\n<tr class="signform_sub">\n    <td></td>\n    <td>\n        <div class="widget_btn_cancel snoshadow signform_id_add" data-node="btn">'+(null==(__t=btn)?"":_.escape(__t))+'</div>\n        <div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+"</div>\n    </td>\n</tr>";return __p},itemTpl=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="signform_id_item">\n    <span class="slink signform_id_item_del" data-node="del">删除</span>\n    <div class="form1_msg signform_id_item_msg" data-node="msg"></div>\n</div>';return __p};return function(n){function t(n){var t=$(itemTpl());t.prepend(n);var i=t.nodes();return n.data("vali_jmsg",i.msg),i.del.click(function(){t.trigger("item_del")}),{jbox:t,jvali:n}}var i={};return i.author=function(){return n.getEle("media_name",{name:"data"}).jvali},i.article2=function(){return $('<input type="text" class="signform_input">').data({vali_require:!0,vali_name:"data",vali_func:function(n){var t=$.trim(this.val());return(t=t.replace(/^https?:\/\//,""))?Vali.url(t)?n("请输入正确的文章链接"):void Util.ajax("/infringement/get_article_item_id/",{url:t},function(i,e,r){0==i?n(null,{text:t,value:r.article_id}):n(e)}):n("请输入文章链接")}})},function(n){n=$.extend({label:"侵权头条号",contentType:"author",name:"ids",require:!0},n);var e,r=$(tpl(n)),a=r.nodes(),o=a.btn;o.click(function(){var e=i[n.contentType]();a.box.append(t(e).jbox),l()});var l=function(){var t=a.box.find(".signform_input");e=Vali(t),o.toggle(t.length!==n.max),1===t.length&&n.require&&a.box.find(".signform_id_item_del").hide()};a.box.on("item_del",function(n){$(n.target).remove(),l()});var _=a.box.data({vali_require:n.require,vali_effect:$.noop,vali_name:n.name,vali_func:function(n){e(function(t,i,e){n(t,$.map(e,function(n){return n.value}))})}});return o.click(),{jbox:r,jvali:_}}}});
;define("pagelet/signform/spec/password2.js",function(n){var a=n("common/vali/vali.js");return function(n){return function(e){var t=n.getEle("password",$.extend({require:"请输入密码",hint:"字母、数字或者英文符号，最短8位。必须包含数字、大小写字母"},e,{func:function(n){var a=this.val();return a.length<8?n("密码长度不足8位"):/(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/.test(a)?n():n("密码必须包含大小写字母、数字或符号")}})),r=!0;t.jvali.change(function(){i.jvali.trigger("change")});var i=n.getEle("password",$.extend({},e,{label:"确认密码",hint:"请再次输入密码",require:null,func:a.returnWrap(function(n){return r?[null,""]:n?t.jvali.val()!==n?"两次输入密码不一致":[null,""]:"请再次输入密码"})}));i.jvali.focus(function(){r=!1});var l=a(t.jvali.add(i.jvali)),u=$("<"+t.jbox.prop("tagName").toLowerCase()+">").hide().data("vali_name",e.name).data("vali_effect",function(){}).data("vali_func",function(n){r=!1,l(function(a,e,t){return a?n(a):n(null,t[0].value)})});return{jbox:u.add(t.jbox).add(i.jbox),jvali:u}}}});
;define("pagelet/signform/spec/captcha.js",function(require,exports,module){var tmpl=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div style="display:none">\n    <div class="form1_dt">验证码</div>\n    <div class="form1_dd">\n        <img class="signbasic_captcha_img" data-node="img">\n        <input maxlength="4" type="text" class="signform_input signbasic_captcha_input" data-node="input" name="captcha">\n        <div class="signform_msg" data-node="msg"></div>\n    </div>\n</div>';return __p};return function(){var n={},i=$(tmpl()),a=i.nodes();return a.input.data({vali_jmsg:a.msg}),a.img.click($.loadWrap(function(){n.onClick()})),n.jbox=i,n.jvali=a.input,n.render=function(n){a.img._src("data:image/png;base64,"+n),i.show()},n.onClick=$.noop,n}});
;define("pagelet/signform/config.js",function(){return{license_uri:{hint:"组织机构代码证信息清晰<br/>最大2M"},identity_uri:{hint:"照片形式请参考示例进行拍摄<br/>身份证上的信息清晰可见<br/>身份证号码必须清晰可识别，大小不超过2M"},avatar_uri:{hint:"要求清晰、健康、代表品牌形象<br/>请勿使用二维码，最大5M，200x200像素"},name:{hint:"2-10个字，请勿使用包含特殊符号或含有明显营销推广意图的媒体名"},desc:{hint:"10-30个字，要求内容完整通顺，无特殊符号，请勿添加任何联系方式如微博、手机号、QQ"},notes:{hint:"10~300个字，请提供您本人的专栏、博客或微信公众号等链接，我们会以您提供的文章做为参考依据，审核您申请的帐号。"},company_name:{hint:"请与组织机构代码证名称一致"},email:{},qq:{hint:"QQ、微信等"}}});
;define("pagelet/signform/thumb/thumb.js",function(require,exports,module){function makeUpload(e){e=$.extend({callback:function(e){this.data("value",e),this.trigger("change")},img:"https://p.pstatp.com/origin/6329/4231483611"},e);var i=$(thumbTpl(e)),a=i.find(".jvali"),t=i.find(".jimg");t._src(e.img);var n=i.findAndSelf(".jtrigger");return a.data("vali_jmsg",i.find(".jmsg")).data("vali_require",e.require).data("vali_name",e.name).data("vali_func",function(e){var i=a.data("value");return e(null,i&&i.web_uri)}).change(function(i){if(i.target===this){var n,r=a.data("value");n=r?r.web_url:e.img,t._src(n)}}),setTimeout(function(){new Uploader({container:a,trigger:n,name:"photo",action:"/upload_photo/?type=json",accept:"image/*",change:function(){a.addClass("loading"),Util.loadingShow(),this.submit()},error:function(){a.removeClass("loading"),Util.loadingHide(),alert("上传失败")},success:function(i){a.removeClass("loading"),Util.loadingHide();try{i=$.parseJSON(i),"success"===i.message?e.callback.call(a,i):alert("上传失败")}catch(t){alert("上传失败")}}})},1),{jbox:i,jvali:a,jimg:t}}var Util=require("common/util/util.js"),thumbTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+='">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td>\n        <div class="signform_face sclearfix '+(null==(__t=name)?"":_.escape(__t))+' jvali">\n            <img class="signform_face_img jimg">\n            <div class="signform_face_btn jtrigger">\n                上传\n            </div>\n            <div class="signform_face_msg jmsg"></div>\n            <div class="signform_face_text">'+(null==(__t=obj.hint)?"":__t)+"</div>\n        </div>\n    </td>\n</tr>";return __p},projectConfig=require("pagelet/signform/config.js"),Stip=require("common/stip/stip.js"),Facecrop=require("common/facecrop/facecrop.js"),baseConfig={image:{name:"image",label:"图片",hint:"不超过2M"},authorize_uri:{name:"authorize_uri",label:"确认书扫描件",url:"http://s0.pstatp.com/site/image/pgc/%E7%94%B3%E8%AF%B7%E5%B8%90%E5%8F%B7%E7%A1%AE%E8%AE%A4%E4%B9%A61505.doc",require:!0},license_uri:{name:"license_uri",require:!0,label:"组织机构代码证",hint:"组织机构代码证信息清晰<br/>最大2M"},identity_uri:{name:"identity_uri",img:"https://p.pstatp.com/origin/6333/2829507413",require:!0,label:"运营者身份证照片",hint:"照片形式请参考示例进行拍摄<br/>身份证上的信息清晰可见<br/>身份证号码必须清晰可识别，大小不超过2M",tip:"示例："},avatar_uri:{name:"avatar_uri",hint:"要求清晰、健康、代表品牌形象<br/>请勿使用二维码，最大5M，200x200像素",require:!0,label:"头条号头像"}};for(var key in baseConfig){var _config=projectConfig[key];_config&&$.extend(baseConfig[key],_config)}exports.image=function(e){return makeUpload($.extend(baseConfig.image,e))},exports.authorize_uri=function(e){return e=$.extend(baseConfig.authorize_uri,e),e.hint='请下载<a href="'+Util.e(e.url)+'" target="_blank" class="slink">确认书模版</a>，填写后上传',makeUpload(e)},exports.license_uri=function(e){return makeUpload($.extend(baseConfig.license_uri,e))},exports.identity_uri=function(e){var i=makeUpload($.extend(baseConfig.identity_uri,e));return i},exports.avatar_uri=function(e){var i=makeUpload($.extend({callback:function(e){var i=this;i.addClass("loading"),Facecrop(e.web_url,function(e,a){i.removeClass("loading"),e?Stip.popupTip({msg:"上传失败",status:!1}):i.data("value",a).trigger("change")})}},baseConfig.avatar_uri,e));return i}});
;define("pagelet/signform/tag/tag.js",function(e){var a=e("common/vali/vali.js"),t=e("pagelet/signform/tag/tag.whe");return function(e){function l(e,a){var t=$();t.push($("<option/>").text("请选择").val("")[0]);for(var l in e)t.push($("<option/>").text(e[l]).val(l)[0]);a.html(t).show().trigger("change")}e=a.mixin({name:"tag",label:"分类",require:"请选择分类",func:function(e){for(var a=[],t=0;t<n.length;t++){var l=n.eq(t);if(l.is(":visible")){var r=l.val();if(!r){a=[];break}a.push(r)}}e(null,a.join("/"))}},e);var r=$(t(e)),i=r.nodes(),n=$('<select class="form1_select"></select><select class="form1_select"></select><select class="form1_select"></select>').hide();_.each(n,function(a,t){var r=$(a);r.change(function(){var a=e.data["video_category_level"+(t+2)];if(a){for(var r=0;t>=r;r++){var i=n.eq(r).val();if(a=a[i],!a)break}if(a)l(a,n.eq(t+1));else for(var r=t+1;3>r;r++)n.eq(r).hide()}o.change()})});var o=i.con;return l(e.data.video_category_level1,n.eq(0)),o.append(n),e.vali_jmsg=i.msg,o.data(e),{jbox:r,jvali:o}}});
;define("pagelet/signform/vposter/vposter.js",function(e){var a=e("pagelet/signform/vposter/vposter.whe"),t=e("common/vali/vali.js"),o=e("common/videoposter/videoposter.js");return function(e){function s(){var e=u.data("value")||n;c.img.prop("src",e)}function i(){v.id=0,v.video_status="",u.data("value","").change()}var n="//mp.toutiao.com/static/resource/pgc_web/static/style/image/default_vposter.18ba5ad.jpg";e=t.mixin({name:"vposter",label:"视频封面",require:"请设置视频封面",func:function(e){e(null,u.data("value"))}},e);var r=$(a(e)),c=r.nodes();e.vali_jmsg=c.msg;var u=c.btn;u.data(e);var v={reset:i,id:0,jbox:r,jvali:u};return u.click(function(){o().show({id:v.id,video_status:v.video_status,source:e.source,type:2,success:function(e,a){u.data("value",a).change()}})}),u.change(s),s(),v}});
;define("pagelet/signform/weixin/weixin.js",function(n){var e=n("common/vali/vali.js"),i=n("pagelet/signform/weixin/tpl.whe");return function(n){n=$.extend({tpl:i,label:"微信公众号授权",name:"weixin",hint:"请填写一篇微信文章链接",func:e.returnWrap(function(n){if(n){var i=e.url(n);if(i)return i}return t.checkbox()?n?[null,n]:"请填写一篇微信文章链接":void 0})},n);var r=e.simple(n),t=r.jbox.find(".form1_checkbox").change(function(){r.jvali.trigger("change")});return t.checkbox(!0),r}});
;define("pagelet/signform/simple/simple.js",function(require,exports,module){var Vali=require("common/vali/vali.js"),textTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+='">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td><textarea name="'+(null==(__t=name)?"":_.escape(__t))+'" class="signform_text"></textarea></td>\n</tr>\n<tr class="signform_sub">\n    <td></td>\n    <td>\n        <div class="form1_msg jmsg"></div>\n        ',obj.hint&&(__p+='<div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+"</div>"),__p+="\n    </td>\n</tr>";return __p},inputTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item  ',obj.require&&(__p+=" require "),__p+=' ">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td><input type="'+(null==(__t=obj.type||"text")?"":_.escape(__t))+'" class="signform_input" ',obj.name&&(__p+=' name="'+(null==(__t=obj.name)?"":_.escape(__t))+'" '),__p+=' ></td>\n</tr>\n<tr class="signform_sub">\n    <td></td>\n    <td>\n        <div class="form1_msg jmsg"></div>\n        <div class="signform_hint jhint">'+(null==(__t=obj.hint||"")?"":_.escape(__t))+"</div>\n    </td>\n</tr>";return __p},selectTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+=' ">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td>\n        <select name="'+(null==(__t=name)?"":_.escape(__t))+'">\n            ';for(var i in items){var item=items[i];__p+='\n                <option value="'+(null==(__t=item.value)?"":_.escape(__t))+'">'+(null==(__t=item.text)?"":_.escape(__t))+"</option>\n            "}__p+='\n        </select>\n    </td>\n</tr>\n<tr class="signform_sub">\n    <td></td>\n    <td>\n        <div class="form1_msg jmsg"></div>\n        ',obj.hint&&(__p+='<div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+"</div>"),__p+="\n    </td>\n</tr>"}return __p},config=require("pagelet/signform/config.js"),simples={input:{tpl:inputTpl,label:"名称",name:"input",require:!0},_int:{tpl:inputTpl,label:"整数",name:"int",require:!0,func:Vali.returnWrap(Vali._int)},url:{tpl:inputTpl,label:"链接",name:"url",func:Vali.returnWrap(Vali.url),require:!0},post_code:{tpl:inputTpl,label:"邮编",name:"post_code",require:!0,func:Vali.returnWrap(function(e){return/^\d{6}$/.test(e)?void 0:"请输入正确的邮政编码"})},text:{tpl:textTpl,label:"文本",name:"text",require:!0},password:{tpl:inputTpl,label:"密码",type:"password",name:"password",require:!0,func:Vali.returnWrap(function(){return this.val().length<6?"密码至少6位":void 0})},name:{tpl:inputTpl,label:"头条号名称",name:"name",require:!0,func:Vali.canUseMediaName},address:{tpl:inputTpl,label:"企业地址",name:"address",require:!0},position:{tpl:inputTpl,label:"身份/岗位",name:"position",require:!0},desc:{tpl:textTpl,label:"头条号介绍",name:"desc",require:!0,func:Vali.returnWrap(function(e){return Vali.range(e,10,30)})},notes:{tpl:textTpl,label:"辅助材料",name:"notes",require:!0,func:Vali.returnWrap(function(e){return Vali.range(e,10,300,!0)})},company_name:{tpl:inputTpl,label:"企业名称",name:"company_name",require:!0},email:{tpl:inputTpl,label:"联系邮箱",name:"email",require:!0,func:Vali.returnWrap(Vali.email)},real_name:{tpl:inputTpl,label:"运营者姓名",name:"real_name",require:!0},identity_number:{tpl:inputTpl,label:"运营者身份证号",name:"identity_number",require:!0,func:Vali.returnWrap(Vali.cnid)},qq:{tpl:inputTpl,label:"其他联系方式(选填)",name:"qq"},mobile:{tpl:inputTpl,label:"运营者电话",name:"mobile",require:!0,func:Vali.returnWrap(Vali.mobile)},gov_type:{tpl:selectTpl,label:"机构级别",name:"gov_type",require:!0,items:[{text:"请输入"},{text:"国家级",value:1},{text:"省部级",value:2},{text:"厅局（地市）级",value:3},{text:"县处级",value:4},{text:"县处级以下",value:5}]}};for(var key in simples){var _config=config[key];_config&&$.extend(simples[key],_config)}return simples});
;define("pagelet/signform/media/media.js",function(){return function(e,a,t,n){function i(e,a,t){e[a]=t;var n=e._keys;return n||(n=e._keys=[]),n.push(a),t}function r(e,a){for(var t=e,n=0;n<a.length;n++){var r=a[n],l=t[r[0]];l||(l=i(t,r[0],{value:r[0],text:r[1],children:{_keys:[]}})),t=l.children}}for(var l={},c=0;c<n.length;c++){var d=n[c];r(l,d)}e.data("vali_func",function(e){var a=$.map(f.find(".form1_checkbox"),function(e){var a=$(e);return a.checkbox()?{name:"media_level_3_tags",value:a.data("value")}:void 0});if(h.val()){if(a.push({name:"media_level_1_tags",value:h.val()}),o.is(":hidden"))return e(null,a);if(o.val())return a.push({name:"media_level_2_tags",value:o.val()}),e(null,a)}return e()});{var h=$('<select class="form1_select"></select>').appendTo(e),o=$('<select class="form1_select"></select>').hide().appendTo(e),f=a,v=h[0],s=o[0];$(new Option("请选择",""))}v.add(new Option("请选择",""));for(var u=l._keys,c=0;c<u.length;c++){var g=l[u[c]],p=$(new Option(g.text,g.value));p.data("data",g),v.add(p[0])}h.change(function(){var e=$(this).children().filter(function(){return this.selected}),a=e.data("data");if(a){var t=a.children,n=t._keys;if(0===n.length)o.hide(),o.empty(),o.trigger("change");else if(1===n.length){o.hide(),o.empty();var i=t[n[0]],e=$(new Option(i.text,i.value));e.data("data",i),s.add(e[0]),o.trigger("change")}else{o.empty(),s.add(new Option("请选择",""));for(var r=0;r<n.length;r++){var i=t[n[r]],e=$(new Option(i.text,i.value));e.data("data",i),s.add(e[0])}o.show(),o.trigger("change")}}else o.hide(),o.empty(),o.trigger("change")}),o.change(function(){f.empty();var e=$(this).children().filter(function(){return this.selected}),a=e.data("data");if(a&&a.children._keys.length)for(var n=a.children,i=n._keys,r=0;r<i.length;r++){var l=n[i[r]],c=$('<div class="form1_checkbox"></div>');c.text(l.text),c.data("value",l.value),c.checkbox(),f.append(c),t.show()}else t.hide()}),f.on("change",".form1_checkbox",function(){var e=f.find(".form1_checkbox").filter(".checked");e.length>3&&($(this).checkbox(!1),alert("最多选3个"))}),e.change(function(a){if(e.is(a.target)){var t=e.data("value");if(t){var n=t.split("/"),i=n[0],r=n[1],l=n[2];if(null!=i&&(h.val(i).trigger("change"),null!=r&&(o.val(r).trigger("change"),null!=l))){var c=l.split("."),d=f.find(".form1_checkbox");d.filter(function(){return~c.indexOf($(this).data("value"))}).each(function(){$(this).checkbox(!0)})}}}})}});
;define("pagelet/signform/media/media_vali.js",function(require,exports,module){var mediaTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+='">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td>\n        <span class="jbox">\n            \n        </span>\n        <span class="signform_inlinemsg jmsg"></span>\n        <div class="signform_hint sred">\n            '+(null==(__t=obj.hint)?"":__t)+'\n        </div>\n    </td>\n</tr>\n<tr class="signform_checktags jext" style="display:none">\n    <td></td>\n    <td>\n        <div id="media_checks_box">\n            <div class="signform_hint">\n                专业擅长：\n            </div>\n            <div class="signform_checktags_div jchecks">\n            </div>\n            <div class="signform_hint">\n                选择专业擅长的标签，推荐的更精准（最多3个）\n            </div>\n        </div>\n    </td>\n</tr>';return __p},Media=require("pagelet/signform/media/media.js");return function(n){return function(i){i=$.extend({label:"领域",name:"media",require:!0},i);var e=$(mediaTpl(i)),a=e.find(".jbox");return a.data("vali_jmsg",e.find(".jmsg")),a.data("vali_require",i.require),a.data("vali_name",i.name),Media(a,e.find(".jchecks"),e.findAndSelf(".jext"),n),{jbox:e,jvali:a}}}});
;define("pagelet/signform/location/location.js",function(){return function(e,t){var n=$('<select class="form1_select"></select>').appendTo(e),a=$('<select class="form1_select"></select>').hide().appendTo(e),i=n[0],l=a[0];e.data("vali_func",function(e){if(n.val()){if(!a.is(":visible"))return e(null,{province_text:n.find(":selected").text(),province:n.val()});if(a.val())return e(null,{province_text:n.find(":selected").text(),province:n.val(),city_text:a.find(":selected").text(),city:a.val()})}return e()}),i.add(new Option("请选择",""));for(var r=0;r<t.length;r++){var c=t[r],s=c.key,o=c.value,d=new Option(s[0],s[1]);i.add(d),$(d).data("subs",o)}n.change(function(){var e=n.children().filter(function(){return this.selected}),t=e.data("subs");if(t&&t.length){a.empty(),l.add(new Option("请选择",""));for(var i=0;i<t.length;i++){var r=t[i],c=new Option(r[0],r[1]);l.add(c)}a.show()}else a.hide()}),e.change(function(t){if(e.is(t.target)){var i=e.data("value");if(i){var l=i.split("/"),r=l[0],c=l[1];n.val(r).trigger("change"),c&&a.val(c).trigger("change")}}})}});
;define("pagelet/signform/location/location_vali.js",function(require,exports,module){var locationTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item ',obj.require&&(__p+=" require "),__p+='">\n    <td class="signform_dt">'+(null==(__t=label)?"":_.escape(__t))+'</td>\n    <td>\n        <span class="jbox">\n            \n        </span>\n        <span class="signform_inlinemsg jmsg"></span>\n    </td>\n</tr>';return __p},Location=require("pagelet/signform/location/location.js");return function(n){return function(a){a=$.extend({label:"所在地",name:"location",require:"请填写所在地"},a);var e=$(locationTpl(a)),i=e.find(".jbox");return i.data("vali_jmsg",e.find(".jmsg")),i.data("vali_require",a.require),i.data("vali_name",a.name),Location(i,n),{jbox:e,jvali:i}}}});
;define("pagelet/signform/spec/preset.js",function(){return{qualification_uri:["images",{max:5,name:"qualification_uri",label:"",require:!1,tr:"专业资质",hint:wheei.markSafe('上传资质证明可提高审核通过率，最多可上传5张照片。健康、财经等领域必须提供相应资质证明 <span class="icon1_info" data-title="健康领域可提供执业医师证、公共营养师/心理咨询师资格证、公立医院医疗机构执业许可证等；财经领域可提供证券/基金/期货/保险执业资格证、投资分析师/理财规划师资格证等"></span>')}]}});
;define("pagelet/signform/field.js",function(e){function i(e,n){if(x[e])return i.apply(null,x[e]);var s;n=$.extend({name:e},n);var r=d[e];return r?s=a.simple($.extend({},r,n)):E[e]?s=E[e](n):L[e]&&(s=L[e](y[e])(n)),s.name||(s.name=n.name),s}function n(e,i){e.is(":input")?e.val(i):e.data("value",i),e.trigger("change")}var a=e("common/vali/vali.js"),s=e("pagelet/signform/spec/website.js"),r=e("pagelet/signform/spec/media_name.js"),t=e("pagelet/signform/spec/images.js"),o=e("pagelet/signform/spec/checkbox.js"),p=e("pagelet/signform/spec/row.js"),l=e("pagelet/signform/spec/files.js"),g=e("pagelet/signform/spec/id.js"),m=e("pagelet/signform/spec/password2.js"),f=e("pagelet/signform/spec/captcha.js"),c=e("pagelet/signform/thumb/thumb.js"),u=e("pagelet/signform/tag/tag.js"),v=e("pagelet/signform/vposter/vposter.js"),j=e("pagelet/signform/weixin/weixin.js"),d=e("pagelet/signform/simple/simple.js"),w=e("pagelet/signform/media/media_vali.js"),h=e("pagelet/signform/location/location_vali.js"),x=e("pagelet/signform/spec/preset.js"),b=function(e){for(var i in c)if(e[i]){var n=i.replace(/uri$/,"url");e[i]={web_url:e[n],web_uri:e[i]},delete e[n]}return e},k=function(e,a){var s=[];a=b(a||{});for(var r in e){var t=e[r],o=t[0],p=$.extend({name:o},t[1]),l=i(o,p);n(l.jvali,a[p.name]),s.push(l)}return s},y=k.init={};k.getEle=i;var E=$.extend({checkbox:o,tag:u,weixin:j,vposter:v,captcha:f,row:p,files:l,website:s},c),L={media:w,location:h};return E.password2=m(k),E.id=g(k),E.media_name=r(k),E.images=t(k),k.parseLocation=function(e){if(!e)return"";var i=e.split("/"),n=i[0],a=i[1],s=y.location,r=[],t=_.find(s,function(e){return e.key[1]==n});if(t&&(r.push(t.key[0]),a)){var o=_.find(t.value,function(e){return e[1]==a});o&&r.push(o[0])}return r.join("/")},k.setValue=n,k});
;define("pagelet/account/account.js",function(require,exports,module){var Util=require("common/util/util.js"),Stip=require("common/stip/stip.js"),Vali=require("common/vali/vali.js"),FieldFac=require("pagelet/signform/field.js"),statusTmpl=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+="",__p+=0===ad_apply_status?'\n    <div class="signform_btn account_ad_status_btn disabled">申请</div>\n':1===ad_apply_status?'\n    <span class="sgreen">已开通</span>\n':2===ad_apply_status?'\n    <div class="signform_btn account_ad_status_btn">申请</div>\n':3===ad_apply_status?'\n    <span class="sred">待审核</span>\n':"\n\n",__p+="";return __p},debutTmpl=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+="",__p+=5==claim_origin_status?'\n<div class="signform_btn account_ad_status_btn disabled">申请</div>\n':0==claim_origin_status?'\n<button class="j_debut_apply">申请</button>\n':2==claim_origin_status?'\n<span class="sgreen">已开通</span>\n':4==claim_origin_status||1==claim_origin_status?'\n<span class="sred">待审核</span>\n':'\n<div class="signform_btn account_ad_status_btn disabled">申请</div>\n',__p+="\n";return __p};module.exports=Pagelet.extend({el:"#pagelet-account",events:{"click .j_debut_apply":"debutForm","click .j_debut_submit":"debutSubmit"},init:function(t){this.$el.on("click",".account_ad_status_btn",function(){var t=$(this);if(!t.is(".disabled")){var a=t.parent(),i=a.data("data");$.post("/apply_ad_permission/",{ad_type:i}).always(function(t){"success"===t.message?(a.html(statusTmpl(t.data)),alert("third"===i?"感谢您对头条的喜爱，您的帐号符合开通头条广告的标准，已为您开通":"感谢您对头条的喜爱，广告审核需要2个工作日，请耐心等待")):Stip.popupTip({msg:t.message})})}}),$("#status_toutiao").html(statusTmpl({ad_apply_status:t.toutiao_ad_apply_status})),$("#status_third").html(statusTmpl({ad_apply_status:t.third_party_ad_apply_status})),$("#status_debut").html(debutTmpl({claim_origin_status:t.claim_origin_status})),this.init_million(t)},init_million:function(t){function a(t){0==t?e.html(l):1==t||4==t?e.html("审核中..."):2==t?e.html('<span class="sgreen">已开通</span>'):(5==t||3==t)&&(l.addClass("disabled"),e.html(l))}var i=$("#million_modal"),n=$("#million_table"),s=$("#million_submit"),e=$("#million_status"),l=$('<div class="widget_btn snoshadow million_btn">申请</div>');l.click(function(){l.is(".disabled")||i.modal()}),a(t.thousand_media_status);var u=FieldFac([["real_name",{name:"name",label:"姓名"}],["identity_number",{name:"id",label:"身份证号"}],["input",{name:"address",label:"现居住地"}],["mobile",{name:"phone",label:"手机号"}],["url",{require:!1,name:"weixin",label:"微信公众号"}],["url",{require:!1,name:"weibo",label:"微博"}],["url",{require:!1,name:"sohu",label:"搜狐"}],["url",{require:!1,name:"zhihu",label:"知乎"}],["input",{require:!1,name:"other",label:"其他",hint:"可填其他平台链接，如个人博客、百度百家、十五言、简书、Lofter等（请用分号隔开）;或其他可证明您具备原创能力的说明，如所出版图书、在刊物上发表过的署名文章等。",func:Vali.returnWrap(function(t){return[null,t.replace(/\u003b|\uff1b/g,";")]})}],["files",{name:"cert",label:"辅助证明材料",max:5}]]),o=u[u.length-1],r=$('<tr class="signform_item"><td class="signform_dt">辅助证明材料</td><td></td></tr>');r.children().eq(1).append(o.jbox),o.jbox=r,n.find("tbody").append($($.map(u,function(t){return t.jbox.toArray()})));var _=Vali($($.map(u,function(t){return t.jvali.toArray()})));s.click(function(){_(function(t,n,s){t||Util.ajax("/apply_thousand_media_post/",s,function(t,n,s){return 0!=t?void Stip.alert(n):(a(s.thousand_media_status),void i.modal("hide"))})})})},debutForm:function(){this.$el.find(".debut-apply-form").modal("show")},debutSubmit:function(){var t={},a=!0;return this.$el.find(".debut-apply-form").find("input").each(function(){$.trim($(this).val())&&(a=!1),t[$(this).data("name")]=$(this).val()}),t.other&&t.other.replace(/\u003b|\uff1b/g,";"),a?(Stip.popupTip({msg:"请至少填写一项"}),!1):void $.post("/apply_claim_origin_post/",t).always(function(t){t.message||(t.reason="请求失败，请稍后重试"),Stip.popupTip("success"===t.message?{status:!0,msg:t.reason,duration:0,callback:function(){location.href="/account_info/"}}:{msg:t.reason})})}})});
;define("pagelet/mobile_register/mobile_inherit.js",function(require,exports,module){var stip=require("common/stip/stip.js"),unbindTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="unbind-mobile-text">\n    <p>'+(null==(__t=reason)?"":_.escape(__t))+'，绑定到当前头条号需要解除原绑定，可能会造成原头条号无法登陆，请谨慎决定是否解绑？</p>\n</div>\n<div class="btn-group">\n    <div class="widget_btn j-get-captcha" ga="原手机解绑">是，确认解绑</div>\n    <div class="widget_btn_cancel j-cancel-bind">否，我再想想</div>\n</div>\n<div class="unbind-mobile-warn">\n    <p>警告：</p>\n    <p>解绑后，将无法用此手机号登录，可能永久丢失此账号的所有访问历史、兴趣偏好记录、收藏文章和话题等内容将会清空，也可能无法再次登陆/找回该账号。</p>\n</div>';return __p},unbindExistPhoneNum="";module.exports={el:".mobile-wrapper",isImgPicShow:!1,unbindExist:!1,events:{"click .j-submit-mobile":"onSubmitMobile","click .j-get-captcha":"onGetCaptcha","click .j-img-captcha-pic":"refreshPicCaptcha","click .j-cancel-bind":"onUnbindCancel"},action:{submit:"/mobile_register_post/"},page:"",init:function(i){i&&i.page&&(this.page=i.page),/msie/.test(navigator.userAgent.toLowerCase())&&$("[placeholder]").removeAttr("placeholder")},showBindMobile:function(){this.$el.find(".j-setting-mobile").show(),this.$el.find(".j-setting-bind-mobile").hide()},hideBindMobile:function(){this.$el.find(".j-setting-mobile").hide(),this.$el.find(".j-setting-bind-mobile").show()},disabledMobileInput:function(){this.$el.find("input").each(function(){$(this).attr("disabled","disabled")})},enableMobileInput:function(){this.$el.find("input").each(function(){$(this).removeAttr("disabled")})},onUnbindCancel:function(){this.unbindExist=!1,$(".j-unbind-mobile").modal("hide")},checkPhoneNum:function(i){var t=this.$el.find(".j-mobile-error");return/\d{11}/.test(i)?!0:(t.text("手机号码错误，请重新输入").show(300,"linear",function(){setTimeout(function(){t.hide(300,"linear")},3e3)}),!1)},checkCaptcha:function(i){var t=this.$el.find(".j-mobile-captcha");return/\d{4}/.test(i)?!0:(t.text("验证码错误，请重新输入").show(300,"linear",function(){setTimeout(function(){t.hide(300,"linear")},3e3)}),!1)},checkPassword:function(i){var t=this.$el.find(".j-password-error");return i?!0:(t.text("请设置密码").show(300,"linear",function(){setTimeout(function(){t.hide(300,"linear")},3e3)}),!1)},checkImgPic:function(){},onGetCaptcha:function(i,t,e){function n(){s.text("重新发送验证码").removeAttr("disabled"),t+=1}function a(i){s.text("重新发送验证码("+i+"s)")}var s=$(i.target),o=this.$el.find(".j-mobile-num").val(),t=t||1;if(ga("send","event","mobile-register-send-captcha","clicked"),!this.checkPhoneNum(o))return!1;s.attr("disabled","disabled");var c=this.countDown(60,a,n);this.getCaptcha(o,t,function(){clearTimeout(c),n()},e)},refreshPicCaptcha:function(){var i=this,t="/resend_verified_picture/";$.ajax({url:t,type:"GET",dataType:"json"}).done(function(t){t&&"success"==t.message||stip.popupTip({msg:t.reason,status:!1}),t&&t.data&&t.data.captcha&&i.renderPicCaptcha(t.data.captcha)}).fail(function(){stip.popupTip({msg:"网络错误，请稍后重试",status:!1})})},renderPicCaptcha:function(i){var t=this.$el.find(".j-setting-img-captcha"),e=t.find(".img-captcha-pic"),n=new Image;n.src="data:image/gif;base64,"+i,e.html(n),t.show()},showUnbindModal:function(i){var t=$(".j-unbind-mobile");t.find(".modal-body").html(unbindTpl(i)),this.unbindExist=!0,t.modal("show")},getCaptcha:function(i,t,e,n){var a=this,s=this.$el.find(".img-captcha").val(),o="/get_activate_code/",c={mobile:i,type:t,picture_code:s};a.unbindExist&&(unbindExistPhoneNum||(unbindExistPhoneNum=i),unbindExistPhoneNum==i?(c.unbind_exist=1,c.type=1):a.unbindExist=!1,$(".j-unbind-mobile").modal("hide")),$.ajax({url:o,type:"POST",data:c,dataType:"json"}).done(function(i){if(i&&1001==i.code)return a.showUnbindModal({reason:i.reason}),!1;if(i&&"success"==i.message){if(n)return!1;stip.popupTip({msg:i.reason,status:!0})}else stip.popupTip({msg:i.reason,status:!1}),e();i&&i.data&&i.data.captcha&&a.renderPicCaptcha(i.data.captcha)}).fail(function(){stip.popupTip({msg:"网络错误，请稍后重试",status:!1})})},countDown:function(i,t,e,n){var a=this,i=i||40,n=n||1e3,t=$.isFunction(t)?t:function(){};t.call(a,i);var s=setInterval(function(){0==--i?(clearInterval(s),e.call(a)):t.call(a,i)},n);return s},onSubmitMobile:function(){var i=this,t=i.action.submit,e=this.$el.find(".j-mobile-num").val(),n=this.$el.find(".j-captcha").val(),a=this.$el.find(".img-captcha").val(),s=this.$el.find(".j-mobile-password").val();if(ga("send","event","mobile-register-submit","clicked"),!this.checkPhoneNum(e))return!1;if(!this.checkCaptcha(n))return!1;if(this.$el.find(".j-mobile-password").length>0&&!this.checkPassword(s))return!1;var o={mobile:e,activate_code:n,picture_code:a,password:s};i.unbindExist&&(unbindExistPhoneNum==e?o.unbind_exist=1:i.unbindExist=!1),this.disabledMobileInput(),$.ajax({url:t,type:"POST",data:o,dataType:"json"}).done(function(t){stip.popupTip(t&&"success"==t.message?{msg:t.reason,status:!0,callback:function(){"force_register"==i.page?history.back():window.location="/activate_user_email/"}}:{msg:t.reason,status:!1}),t&&t.data&&t.data.captcha&&i.renderPicCaptcha(t.data.captcha)}).fail(function(){stip.popupTip({msg:"网络错误，请稍后重试",status:!1})}).always(function(){i.enableMobileInput()})}}});
;define("pagelet/account_settings/account_settings.js",function(t,e,i){{var a=t("pagelet/mobile_register/mobile_inherit.js");t("common/stip/stip.js")}i.exports=Pagelet.extend($.extend(a,{el:"#pagelet-account_settings",unbindExist:!1,action:{submit:"/bind_mobile/"},events:{"click .j-submit-mobile":"onSubmitMobile","click .widget_btn_cancel":"cancel","click .j-setting-bind-mobile":"showBindMobile","click .j-get-captcha":"onGetCaptcha","click .j-img-captcha-pic":"refreshPicCaptcha","click $watermark_radio":"onWatermarkRadioClick","click $watermark_submit":"onWatermarkSubmitClick","click .j-cancel-bind":"onUnbindCancel"},init:function(){var t=location.hash;/msie/.test(navigator.userAgent.toLowerCase())&&$("[placeholder]").removeAttr("placeholder"),/bind=true/.test(t)?this.showBindMobile():this.hideBindMobile()},cancel:function(){this.hideBindMobile()},onWatermarkRadioClick:function(t){var e=$(t.target),i=e.data("type"),a=e.is(".selected");a||(e.addClass("selected"),1==i?this.$dom.watermark_signature.show():this.$dom.watermark_signature.hide(),this.$dom.watermark_radio.each(function(t,i){$(i).is(e)||$(i).removeClass("selected")}),this.$dom.watermark_tip.html(""))},onWatermarkSubmitClick:function(){var t=this.$dom.watermark_radio.filter(".selected");if(0!=t.length){var e=t.data("type");$.ajax({url:"/settings_post/",type:"POST",dataType:"json",context:this,data:{watermark:e},success:function(t){"success"==t.message?this.$dom.watermark_tip.html("已保存").show():this.$dom.watermark_tip.html(t.reason).show()},error:function(){this.$dom.watermark_tip.html("服务异常，请稍后再试").show()}})}}}))});
;define("pagelet/add_avatar/add_avatar.js",function(a){var t=a("common/vali/vali.js"),i=a("common/util/util.js"),o=a("common/stip/stip.js"),n=a("pagelet/signform/field.js"),e=$("#pagelet_add_avatar").nodes(),l=n.getEle("avatar_uri");e.start.after(l.jbox);var r=t(l.jvali);e.submit.click($.loadDone(function(a){r(function(t,n,e){return t?a():void i.ajax("/minimal_media_account_completion_post/",e,function(t,i){return 0!=t?(a(),o.alert(i)):void(window.location="/profile/")})})}))});
;define("pagelet/popalert/popalert.js",function(e,o,t){var n=$("#popalert-modal"),i=$("#popalert-tip"),c=$("#popalert-submit"),l=$("#popalert-cancel");t.exports=function(e,o,t){if(o)if(i.text(o),"alert"==e){var p=function(e){(13==e.keyCode||32==e.keyCode)&&n.modal("hide")};$(document).one("keyup",p),c.one("click",function(){$(document).off("keyup",p)}),l.hide(),n.modal()}else if("confirm"==e){if("function"!=typeof t)return;c.one("click",t),l.one("click",function(){c.off("click",t)}),l.show(),n.modal()}}});
;define("pagelet/privacy_validate/privacy.js",function(require,exports,module){var mobileClass=require("pagelet/mobile_register/mobile_inherit.js"),template=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="modal fade privacy-operation-modal">\n    <div class="modal-dialog">\n        <div class="modal-content">\n            <div class="modal-body">\n                <p class="top-tip j-top-tip">\n                </p>\n                <input class="j-mobile-num" value="00000000000" type="hidden"/>\n                <div class="privacy-check">\n                    <label>短信验证码</label>\n                    <input type="text" class="j-captcha" placeholder="请输入验证码"/>\n                    <button class="j-get-captcha primary-btn">发送验证码</button>\n                    <p class="j-mobile-captcha mobile-error-tips"></p>\n                </div>\n                <div class="setting-mobile-body j-setting-img-captcha" style="display: none">\n                    <label>图片验证码</label>\n                    <input placeholder="请输入图片验证码" class="mobile-input captcha img-captcha" type="text"/>\n                    <div class="j-img-captcha-pic img-captcha-pic"></div>\n                    <p class="j-img-captcha mobile-error-tips"></p>\n                </div>\n                <div class="privacy-tips">\n                    <h4 class="privacy-tips-title">友情提示：</h4>\n                    <p>1.网络通讯异常可能造成短信丢失，请重新获取或稍后再试。</p>\n                    <p>2.请核实手机是否已欠费停机，或者屏蔽了系统短信。</p>\n                </div>\n            </div>\n            <div class="privacy-footer">\n                <button type="button" class="btn new-btn submit j-submit-mobile">提交</button>\n                &nbsp;&nbsp;&nbsp;&nbsp;\n                <button type="button" class="btn new-btn cancel" data-dismiss="modal">取消</button>\n            </div>\n        </div>\n    </div>\n</div>\n';return __p},stip=require("common/stip/stip.js");module.exports=Pagelet.extend($.extend(mobileClass,{el:"body",events:{},callback:$.noop,init:function(t){this.$el=t.$el,this.create(),this.bindEvent()},create:function(){this.$el.append(template({}))},bindEvent:function(){var t=this;this.$privacyOperateModal=this.$el.find(".privacy-operation-modal"),this.$phoneNum=this.$el.find(".j-mobile-num"),this.$el.on("click",".j-get-captcha",function(i,a){a?t.onGetCaptcha(i,3,a.noPrompt):t.onGetCaptcha(i,3)}).on("click",".j-submit-mobile",function(i){t.onSubmitMobile(i)})},show:function(t){var i="您正在执行敏感操作，我们需要验证您的身份，我们已经给您绑定的手机号{@1}发送了验证码";this.$el.find(".j-get-captcha").trigger("click",{noPrompt:!0}),t&&$.isFunction(t.callback)&&(this.callback=t.callback),t&&t.mobile&&this.$privacyOperateModal.find(".j-top-tip").text(i.replace(/{@1}/g,t.mobile)),this.$privacyOperateModal.modal()},hide:function(){this.$privacyOperateModal.modal("hide")},checkPrivacyCaptcha:function(t,i,a){var n=this,e="/validate_code_check/";$.ajax({url:e,data:t,type:"POST",dataType:"json"}).done(function(t){$.isFunction(i)&&(t&&"success"==t.message?(stip.popupTip({msg:t.reason,status:!0}),i(t),n.hide()):stip.popupTip({msg:t.reason,status:!1}))}).fail(function(){stip.popupTip({msg:"网络错误，请稍后重试",status:!1})}).always(function(){$.isFunction(a)&&a()})},onSubmitMobile:function(){var t=this,i=(this.$el.find(".j-mobile-num").val(),this.$el.find(".j-captcha").val()),a=this.$el.find(".img-captcha").val();return this.checkCaptcha(i)?void this.callback(i,a,t):!1}}))});
;define("pagelet/adincome/adincome.js",function(a,t,i){var n=a("common/vali/vali.js"),e=a("pagelet/signform/field.js"),s=a("common/util/util.js"),h=a("pagelet/popalert/popalert.js"),c=a("pagelet/privacy_validate/privacy.js").create({$el:$("#pagelet-adincome")});i.exports=Pagelet.extend({el:"#pagelet-adincome",events:{"click $withdraw":"onWithdrawClick","click $editBankCard":"onEditBankCard","click $cancelBankcardEdit":"onCancelBankcardEdit","click $submitBankcardEdit":"onSubmitBankcardEdit"},init:function(a){that=this,this.display_income=+a.display_income||0,this.pay_name=a.pay_name,this.bank_identity_number=a.bank_identity_number,this.bank_card_no=a.bank_card_no,this.bank_name=a.bank_name,this.bn1=a.bn1,this.bn2=a.bn2,this.bank_branch_name=a.bank_branch_name,this.bank_status=a.bank_status,this.can_pay_apply_status=a.status,this.mobile=a.mobile,this.small_flow=a.small_flow,this.$cash_modal=$("#cash-modal"),this.$cash_modal_tip=$("#cash-modal-tip"),this.$cash_modal_submit=$("#cash-modal-submit"),this.$cash_modal_cancel=$("#cash-modal-cancel"),this.$withdraw_tip=$("#withdraw-tip"),this.$bankcard_edit_box=$("#bankcard-edit"),this.$bankcard_binded=$("#bankcard-binded"),this.$bankcard_unbinded=$("#bankcard-unbinded"),this.$bankcard_modify_btn=$("#bankcard-modify"),this.$bind_bankcard_btn=$("#bind-bankcard"),this.$bank_branch_tip=$("#bank-branch-tip"),this.$other_bankname_cell=$("#other_bankname"),this.$pay_name=$("#pay_name"),this.$bank_identity_number=$("#bank_identity_number"),this.$bank_card_no=$("#bank_card_no"),this.$bank_card_home=$("#bank_card_home"),this.$other_bank_name=$("#other_bank_name"),this.$bank_branch_name=$("#bank_branch_name"),this.$bank_card_home.change(function(){var a=$(this),t=a.val(),i=a.find("option:selected").data("tel");if(t){var n="开户行查询：可拨打"+t+"服务电话"+i+"进行查询";that.$bank_branch_tip.text(n).show(),that.$other_bankname_cell.addClass("hide")}else that.$other_bankname_cell.removeClass("hide"),that.$bank_branch_tip.hide();that.$other_bank_name.val(""),that.$bank_branch_name.val("")});var t=e.getEle("location");$("#location").append(t.jbox),t.jvali.data("value",a.bank_location||"").change(),this.locationVali=n(t.jvali)},onSubmitBankcardEdit:function(){var a,t=this.removeSlash($.trim(this.$pay_name.val())),i=this.removeSlash($.trim(this.$bank_identity_number.val())),n=this.removeSlash($.trim(this.$bank_card_no.val())),e=this.removeSlash($.trim(this.$bank_card_home.val())),s=this.removeSlash($.trim(this.$other_bank_name.val())),c=this.removeSlash($.trim(this.$bank_branch_name.val())),o="";return t&&i&&n&&c&&(e||s)?$.isNumeric(n)?18!=i.length?o="身份证无效":this.locationVali(function(t,i,n){t?o=t:a=$.so(n).location}):o="银行卡号无效":o="银行卡信息不完整",o?void h("alert",o):void $.ajax({type:"POST",url:"/bank_info/",data:$.extend({pay_name:t,bank_identity_number:i,bank_card_no:n,bank_name:e,other_bank_name:s,bank_branch_name:c},a),success:function(a){"success"==a.message?(window.scrollTo(0,0),location.reload()):h("alert",a.reason)},error:function(){h("alert","服务异常，请稍后再试")}})},removeSlash:function(a){return a.replace(/\\/g,"")},onWithdrawClick:function(){var a=this;if(!(this.display_income<100)){if(1==this.can_pay_apply_status)return void h("alert","请完善银行卡信息");if(2==this.can_pay_apply_status)return void h("alert","请等待当前待打款手续结束");if(this.display_income>=100){var t="提现金额：<span>"+this.display_income+"</span> 元<p>"+s.e($("#cash-tip").text())+"</p>";this.popCashModal(t,$.proxy(this.whitdraw_submit,a))}}},whitdraw_submit:function(a,t){var i=this;$.post("/api/pgc_accounting/",t||{}).done(function(a){"success"==a.message?(h("alert","申请提现成功"),setTimeout(function(){location.reload()},1e3)):9999===a.code?c.show({mobile:a.mobile||"",callback:function(a,t){i.whitdraw_submit("",{activate_code:a,picture_code:t||""})}}):h("alert",a.reason)}).fail(function(){h("alert","申请提现失败")})},withdrawTips:function(a){var t=this;t.$withdraw_tip.text(a).show(),setTimeout(function(){t.$withdraw_tip.slideUp("slow")},1e3)},popCashModal:function(a,t){if(a&&"function"==typeof t){var i=this;this.$cash_modal_tip.html(a),this.$cash_modal_submit.one("click",t),this.$cash_modal_cancel.one("click",function(){i.$cash_modal_submit.off("click",t)}),this.$cash_modal.modal()}},onEditBankCard:function(a){var t=this,i=$(a.target);this.isCheckBindBankStatus||1!=this.small_flow?(i.addClass("hide"),t.$bankcard_edit_box.removeClass("hide")):c.show({mobile:t.mobile||"",callback:function(a,n){this.checkPrivacyCaptcha({activate_code:a,picture_code:n},function(){i.addClass("hide"),t.isCheckBindBankStatus=!0,t.$bankcard_edit_box.removeClass("hide")})}})},onCancelBankcardEdit:function(){this.$bankcard_unbinded.length?this.$bankcard_unbinded.is(".hide")?this.$bankcard_modify_btn.removeClass("hide"):this.$bind_bankcard_btn.removeClass("hide"):this.$bankcard_modify_btn.removeClass("hide"),this.$bankcard_edit_box.addClass("hide"),this.$bank_branch_tip.text("").hide(),this.resetBandcardInfo()},resetBandcardInfo:function(){this.$pay_name.val(this.pay_name),this.$bank_identity_number.val(this.bank_identity_number),this.$bank_card_no.val(this.bank_card_no),this.$bank_branch_name.val(this.bank_branch_name),this.bn1?(this.$other_bankname_cell.addClass("hide"),this.$other_bank_name.val(""),this.$bank_card_home.val(this.bn1)):(this.$bank_card_home.val(""),this.$other_bankname_cell.removeClass("hide"),this.$other_bank_name.val(this.bn2))}})});
;define("pagelet/adsettings/adsettings.js",function(t,a,e){var i=t("common/ui/tab.js"),s=t("common/util/util.js");e.exports=Pagelet.extend({el:"#pagelet-adsettings",events:{},init:function(t){t.force_use_toutiao_ad&&$("#ad_tab").addClass("disabled");var a=i($("#ad_tab [data-tab]"),$(),function(a,e){return t.force_use_toutiao_ad&&3!=a?!1:void(e||s.ajax("/pgc_ad_type/",{pgc_ad_type:a},function(){}))});if(setTimeout(function(){a(t.ad_tab,!0)},10),$("#praise_tab").length){var e=i($("#praise_tab [data-tab]"),$(),function(t,a){a||s.ajax("/media/set_praise_status/",{praise_status:t},function(){})});setTimeout(function(){e(t.praise_tab,!0)},10)}}})});
;define("pagelet/daterange/daterange.js",function(){return function(e){function t(t){e.onchange(t),e.start_date=t.start_date,e.end_date=t.end_date,a(t)}function a(){if(e.end_date===d.format("date"))for(var t=0;t<i.length;t++){var a=i[t];e.start_date===d.clone().d(0-a+1).format("date")?s.eq(t).addClass("selected"):s.eq(t).removeClass("selected")}o.val(e.start_date),c.val(e.end_date)}var d=new Date;e.relative&&d.d(e.relative);var n=d.clone().format("date"),r=d.clone().d(-180).format("date"),o=$(".daterange_start_date"),c=$(".daterange_end_date");o.datetimepicker({format:"yyyy-mm-dd",weekstart:1,minView:2,autoclose:!0,startDate:r,endDate:n}),c.datetimepicker({format:"yyyy-mm-dd",weekstart:1,minView:2,autoclose:!0,startDate:r,endDate:n}),$(".daterange_search").click(function(e){e.preventDefault(),t({start_date:o.val(),end_date:c.val()})});var i=[7,14,30],s=$(".daterange_stoggle span").each(function(e){var a=$(this);a.click(function(){t({start_date:d.clone().d(0-i[e]+1).format("date"),end_date:d.clone().format("date")})})});return a(e),{trigger:function(){t(e)}}}});
;define("pagelet/adstats/adstats.js",function(t,a,e){var i=/^([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.|-]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/,d=t("common/util/util.js"),n=t("pagelet/daterange/daterange.js");e.exports=Pagelet.extend({el:"#pagelet-adstats",events:{"click $ad_mail":"onAdMailClick","click $ad_mail_send":"onAdMailSendClick","keypress $ad_mail_input":"onAdMailInputKeyPress"},init:function(t){this.view_type=t.view_type||"ad_stats",this.start_date=t.start_date,this.end_date=t.end_date,this.year=t.year-0,this.month=t.month-1,this.day=t.day-0,this.ad_impr_count=t.ad_impr_count,this.ad_click_count=t.ad_click_count,this.$ad_trend_con=$("#ad-trend-con"),n({start_date:t.start_date,end_date:t.end_date,relative:t.relative,onchange:function(t){window.location="?"+$.param($.extend({},d.GET,t,{}))}}),this.hightchart(),"ad_stats_third_party"==this.view_type&&this.third_party_ad_init()},hightchart:function(){var t=[{key:"广告展示量",val:this.ad_impr_count},{key:"广告点击量",val:this.ad_click_count}],a=[],e=["#91ce00","#458bc4","#ff001a","#ffad00","#22c2af","#ae5d9d"];"ad_stats"==this.view_type?a[0]={pointInterval:864e5,pointStart:Date.UTC(this.year,this.month,this.day),name:t[0].key,data:t[0].val}:(a[0]={pointInterval:864e5,pointStart:Date.UTC(this.year,this.month,this.day),name:t[0].key,data:t[0].val},a[1]={pointInterval:864e5,pointStart:Date.UTC(this.year,this.month,this.day),name:t[1].key,data:t[1].val}),this.$ad_trend_con.highcharts({chart:{height:350},title:{text:null},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%m/%e"}},colors:e,yAxis:{title:{text:""},min:0,minTickInterval:null,plotLines:[{value:0,width:1,color:"#808080"}],allowDecimals:!1,tickPixelInterval:30,gridLineWidth:0},legend:{layout:"vertical",align:"right",verticalAlign:"middle",borderWidth:0},plotOptions:{spline:{lineWidth:1.5,states:{hover:{lineWidth:2}}},series:{marker:{radius:3,symbol:"circle"}}},tooltip:{xDateFormat:"%Y-%m-%d",shared:!0},series:a})},third_party_ad_init:function(){this.$modal=$("#ad-mail-modal"),this.$feedback=$(".ad-mail-feedback"),this.$error=$(".ad-mail-error"),this.$sendBox=$(".ad-mail-send"),this.$mail=$("#ad-mail-receiver"),$(".gg-tag").tooltip({selector:"[data-toggle=tooltip]",container:"body"})},onAdMailClick:function(){this.$modal.modal(),this.$feedback.hide(),this.$error.hide(),this.$sendBox.show(),this.$mail.val("");try{ga("send","event","ad-send-mail-link","clicked")}catch(t){}},onAdMailSendClick:function(){var t=this.start_date,a=this.end_date,e=$.trim(this.$mail.val()),d=this;if(!i.test(e))return void this.$error.show().find(".ad-mail-errtxt").html("请输入正确的邮箱地址");$.ajax({type:"POST",async:!0,url:"/send_ad_stats/",data:{start_date:t,end_date:a,receiver:e},dataType:"json"}).done(function(t){d.$sendBox.hide(),d.$feedback.show(),"success"==t.message&&setTimeout(function(){d.$modal.modal("hide")},2e3),d.$feedback.html(t.reason)}).fail(function(){alert("抱歉，服务异常，请稍后再试")});try{ga("send","event","ad-send-mail-submit","clicked")}catch(n){}},onAdMailInputKeyPress:function(){this.$error.hide()}})});
;define("pagelet/andience_age_distribution/andience_age_distribution.js",function(require,exports,module){var eventCenter=window.listener,listTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="<table class='andience_age_table'>\n	<thead>\n		<tr>\n			<th>年龄</th>\n			<th>用户数</th>\n		</tr>\n	</thead>\n	<tbody>\n		";for(var o in ageArr)__p+="\n			<tr>\n				<td>"+(null==(__t=ageArr[o].age)?"":__t)+"</td>\n				<td>"+(null==(__t=ageArr[o].num)?"":__t)+"</td>\n			</tr>\n		";__p+="\n	</tbody>\n</table>"}return __p};module.exports=Pagelet.extend({el:"#andience_age_distribution",init:function(){this.cacheInit(),this.dataInit(),this.eventCenter(),this.chartInit()},cacheInit:function(){this.$el=$(this.el),this.$ageChart=this.$el.find("#andience_age_chart"),this.$ageList=this.$el.find("#andience_age_list")},dataInit:function(){this.setting={age:{},ageArray:[]}},chartInit:function(){this.echarts=echarts.init(document.getElementById("andience_age_chart"))},eventCenter:function(){var t=this;eventCenter.on("andience_age_distribution","sysData",function(e,n){t.dataProcess(n),t.renderChart(),t.renderList()})},dataProcess:function(t){var e,n,i=this.setting,a=[];$.extend(i,t),e=i.age;for(var r in e)n="-18"==r?"0-18":"50-"==r?"50+":r,a.push({age:n,num:e[r]});a.sort(function(t,e){return parseInt(t.age)-parseInt(e.age)}),i.ageArr=a},renderChart:function(){for(var t=[],e=[],n=this.setting.ageArr,i=0;i<n.length;i++)t.push(n[i].age),e.push(n[i].num);var a={color:["#ff635c"],grid:{show:!1},tooltip:{trigger:"axis"},calculable:!0,legend:{show:!1,data:["年龄分布"]},xAxis:[{type:"category",data:t,axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!1}}],yAxis:[{type:"value",name:"",min:0,axisLabel:{formatter:"{value}"},axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!0,lineStyle:{type:"dotted"}}}],series:[{name:"数量",type:"bar",barCategoryGap:"70%",data:e}]};this.echarts.setOption(a,!0)},renderList:function(){var t=this.$ageList,e=listTemplate(this.setting);t.html(e)}})});
;define("pagelet/andience_chart/andience_chart.js",function(t,e,a){var n=window.listener,s=t("common/stip/stip.js"),i=t("common/daterange/daterange.js"),d="/statistic/audience_daily_stat_for_chart/",r=function(t,e){for(var a=new Date(t).getTime(),n=new Date(e).getTime(),s=a,i=[];n>=s;)i.push(new Date(s).format("date")),s+=864e5;return i};a.exports=Pagelet.extend({el:"#andience_chart",init:function(){this.cacheInit(),this.dataInit(),this.eventInit(),this.httpRequest()},cacheInit:function(){var t=this.$el=$(this.el);this.$startDate=t.find("#daterange_start_date"),this.$endDate=t.find("#daterange_end_date")},dataInit:function(){var t=new Date;this.echarts=echarts.init(document.getElementById("andience_chart_map")),this.setting={reader_data:[],subscriber_data:[],startDate:t.clone().d(-5).format("date"),endDate:t.clone().d(-1).format("date")}},eventInit:function(){this.dateRangeInit()},dateRangeInit:function(){var t=this.setting,e=this;i({start_date:t.startDate,end_date:t.endDate,relative:0,days:"-1000",onchange:function(t){startDate=t.start_date,endDate=t.end_date,e.updateData(startDate,endDate)}})},updateData:function(t,e){var a=this.setting;a.startDate=t,a.endDate=e,this.httpRequest()},httpRequest:function(){var t=this,e=this.setting,a={start_date:e.startDate,end_date:e.endDate};$.ajax({url:d,type:"GET",dataType:"json",data:a}).done(function(a){t.dataProcess(a),n.trigger("andiences_table","updateDate",{start_date:e.startDate,end_date:e.endDate})}).fail(function(){s.popupTip({msg:"网络错误，请稍后重试",status:!1})})},dataProcess:function(t){"success"==t.message?($.extend(this.setting,t.data),this.sysDate(t),this.render()):s.popupTip({msg:t.reason?t.reason:"未知错误",status:!1})},sysDate:function(t){var e=this.setting,a=t.data.start_date==e.startDate;a||s.popupTip({msg:"仅支持360天以内的日期区间",status:!1}),e.startDate=t.data.start_date,e.endDate=t.data.end_date,this.$startDate.val(e.startDate),this.$endDate.val(e.endDate)},render:function(){var t=["#ff635c","#679dff"],e=["新增用户","新增订阅"],a=[],n=["reader_data","subscriber_data"],s=this.setting,i=[];a=r(s.startDate,s.endDate);for(var d=0;d<n.length;d++)i.push({name:e[d],type:"line",data:s[n[d]],itemStyle:{normal:{borderColor:t[d]}},symbol:"circle"});var o={title:{text:""},color:t,tooltip:{trigger:"axis"},legend:{data:e},xAxis:[{type:"category",boundaryGap:!0,axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},data:a,axisTick:{show:!1},splitLine:{show:!1}}],yAxis:[{type:"value",axisLabel:{formatter:"{value}"},axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!0,lineStyle:{type:"dotted"}}}],series:i};this.echarts.setOption(o,!0)}})});
;define("pagelet/andience_client/andience_client.js",function(require,exports,module){var eventCenter=window.listener,template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="<div class ='andience_client andience_item'>\n	<div class='andience_title'>\n		终端分布\n	</div>\n	<div class ='andience_bar'>\n		<div class='bar_wrap'>\n			<div class='bar_inner j_bar_inner' style='width:"+(null==(__t=device.percent)?"":__t)+"%'>\n			</div>\n		</div>\n		<div class ='bar_note'>\n			<span class='bar_note_sharp orange'></span>\n			<span class='bar_note_title'>Android("+(null==(__t=parseInt(device.percent))?"":__t)+"%)</span>\n			<span class='bar_note_sharp blue'></span>\n			<span class='bar_note_title'>iOS("+(null==(__t=100-parseInt(device.percent))?"":__t)+"%)</span>\n		</div>\n		<div class='clearboth'></div>\n	</div>\n	<div class='clearboth'></div>\n</div>";return __p};module.exports=Pagelet.extend({el:"#andience_client",init:function(){this.cacheInit(),this.dataInit(),this.eventCenter()},cacheInit:function(){this.$el=$(this.el)},dataInit:function(){this.setting={gender:{female:0,male:0,percent:0},device:{android:0,iphone:0,percent:0}}},eventCenter:function(){var e=this;eventCenter.on("andience_client","sysData",function(n,t){$.extend(e.setting,t),e.dataProcess(),e.render()})},dataProcess:function(){var e=this.setting,n=e.device,t=100*n.Android/(n.Android+n.IOS);t=t?t:0,n.percent=t},render:function(){var e=this.$el,n=template(this.setting);e.html(n)}})});
;define("pagelet/andience_normal/andience_normal.js",function(require,exports,module){var eventCenter=window.listener,template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="<div class ='andience_sex  andience_item'>\n		<div class='andience_title'>\n			性别比例\n		</div>\n		<div class ='andience_bar'>\n			<div class='bar_wrap'>\n				<div class='bar_inner j_bar_inner' style='width:"+(null==(__t=gender.percent)?"":__t)+"%'>\n				</div>\n			</div>\n			<div class ='bar_note'>\n				<span class='bar_note_sharp orange'></span>\n				<span class='bar_note_title'>女("+(null==(__t=parseInt(gender.percent))?"":__t)+"%)</span>\n				<span class='bar_note_sharp blue'></span>\n				<span class='bar_note_title'>男("+(null==(__t=100-parseInt(gender.percent))?"":__t)+"%)</span>\n			</div>\n			<div class='clearboth'></div>\n		</div>\n	</div>\n";return __p};module.exports=Pagelet.extend({el:"#andience_normal",init:function(){this.cacheInit(),this.dataInit(),this.eventCenter()},cacheInit:function(){this.$el=$(this.el)},dataInit:function(){this.setting={gender:{female:0,male:0,percent:0},device:{android:0,iphone:0,percent:0}}},eventCenter:function(){var e=this;eventCenter.on("andience_normal","sysData",function(n,t){$.extend(e.setting,t),e.dataProcess(),e.render()})},dataProcess:function(){var e=this.setting,n=e.gender,t=100*n.female/(n.female+n.male);t=t?t:0,n.percent=t},render:function(){var e=this.$el,n=template(this.setting);e.html(n)}})});
;define("pagelet/andience_overview/andience_overview.js",function(t,e,n){var i=t("common/stip/stip.js"),o=(window.listener,"/statistic/audience_overview/"),s=function(t){var e=parseInt(t).toString(),n=e.split(""),i=[],o=n.length;if(isNaN(t))return t;if(1e7>t){for(var s=0;o>s;s++)(o-s)%3==0&&0!=s&&i.push(","),i.push(n[s]);return i.join("")}if(t>=1e7&&1e8>t){for(var s=0;o>s;s++)o-s>4&&((o-4-s)%3==0&&0!=s&&i.push(","),i.push(n[s]));return i.join("")+"万"}if(t>=1e8){for(var s=0;o>s;s++)o-s>8?((o-8-s)%3==0&&0!=s&&i.push(","),i.push(n[s])):o-s==8?(i.push("."),i.push(n[s])):o-s==7&&("0"==n[s]&&"0"==n[s-1]?(n.pop(),n.pop()):i.push(n[s]));return i.join("")+"亿"}};n.exports=Pagelet.extend({el:"#andience_overview",init:function(){this.cacheInit(),this.dataInit(),this.httpRequest()},cacheInit:function(){var t=this.$el=$(this.el);this.$addAndience=t.find(".j_add_andience"),this.$totalAndience=t.find(".j_total_andience"),this.$addBook=t.find(".j_add_book"),this.$totalBook=t.find(".j_total_book"),this.$subNote=t.find(".j_sub_note")},dataInit:function(){this.config={new_reader_count:this.$addAndience,total_reader_count:this.$totalAndience,new_like_count:this.$addBook,total_subscriber_count:this.$totalBook},this.setting={new_reader_count:0,total_reader_count:0,new_like_count:0,total_subscriber_count:0}},httpRequest:function(){var t=new Date,e=this,n={start_date:t.clone().d(-1).format("date"),end_date:t.clone().d(-1).format("date")};$.ajax({url:o,type:"GET",dataType:"json",data:n}).done(function(t){e.processData(t)}).fail(function(){i.popupTip({msg:"网络错误，请稍后重试",status:!1})})},processData:function(t){"success"==t.message?($.extend(this.setting,t.data),this.tipControl(),this.render()):i.popupTip({msg:t.reason?t.reason:"未知错误",status:!1})},tipControl:function(){var t=!0,e=this.setting;for(var n in e)t=t&&e[n]&&"-"!=e[n];t||this.$subNote.show()},render:function(){var t=this.setting,e=this.config;for(var n in e)this.renderCountProcess(e[n],t[n])},renderCountProcess:function(t,e){var n,i,o=t.html();o=isNaN(o)?0:parseInt(o),n=o,i=parseInt((e-o)/10);var a=setInterval(function(){e>n?(n+=i,t.html(s(n))):(t.html(s(e)),clearInterval(a))},100)}})});
;define("pagelet/andience_region_distribution/andience_region_distribution.js",function(require,exports,module){var eventCenter=window.listener,listTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="<div class='andience_region_title'>\n	<table>\n		<thead>\n			<tr>\n				<th>省份</th>\n				<th>用户数</th>\n			</tr>\n		</thead>\n	</table>\n<div>\n<div class='andience_region_list'>	\n	<table class='andience_region_table'>\n		<tbody>\n			";for(var o in provinceArr)__p+="\n				<tr>\n					<td>"+(null==(__t=provinceArr[o].name)?"":__t)+"</td>\n					<td>"+(null==(__t=provinceArr[o].value)?"":__t)+"</td>\n				</tr>\n			";__p+="\n		</tbody>\n	</table>\n</div>"}return __p};module.exports=Pagelet.extend({el:"#andience_region_distribution",init:function(){this.cacheInit(),this.dataInit(),this.eventCenter(),this.chartInit()},cacheInit:function(){this.$el=$(this.el),this.$regionMap=this.$el.find("#andience_region_map"),this.$regionShaped=this.$el.find("#andience_region_shaped"),this.$regionList=this.$el.find("#andience_region_right")},dataInit:function(){this.setting={province:{},provinceArr:[],barProvinceArr:[]}},chartInit:function(){this.mapEcharts=echarts.init(document.getElementById("andience_region_map")),this.shapedEcharts=echarts.init(document.getElementById("andience_region_shaped"))},eventCenter:function(){var e=this;eventCenter.on("andience_region_distribution","sysData",function(t,n){e.dataProcess(n),e.renderShape(),e.renderMap(),e.renderList()})},dataProcess:function(e){var t=this.setting.provinceArr;$.extend(this.setting,e);for(var n in e.province)t.push({name:n,value:e.province[n]});t.sort(function(e,t){return t.value-e.value})},renderMap:function(){var e=this.setting.provinceArr,t={title:{text:"地域分布",left:"center"},tooltip:{trigger:"item"},legend:{orient:"vertical",left:"left",data:["地域分布"]},toolbox:{show:!1},series:[{name:"地域分布",type:"map",mapType:"china",roam:!1,itemStyle:{normal:{label:{show:!0}},emphasis:{label:{show:!0}}},data:e}]};this.mapEcharts.setOption(t,!0)},renderShape:function(){for(var e=this.setting.provinceArr,t=[],n={name:"其他",value:0},i=0;i<e.length;i++)10>i?t.push(e[i]):n.value=n.value+e[i].value;t.push(n);var r={title:{text:"",x:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},series:[{name:"地域分布",type:"pie",radius:"55%",center:["50%","60%"],data:t,itemStyle:{emphasis:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]};this.shapedEcharts.setOption(r,!0)},renderList:function(){var e=this.$regionList,t=listTemplate(this.setting);e.html(t)}})});
;define("pagelet/andiences_table/andiences_table.js",function(require,exports,module){var template=(require("common/util/util.js"),function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="<table class='subscriber-tbl'>\n	<thead>\n		<tr>\n			<th>时间</th>\n			<th>新增用户</th>\n			<th>累计用户</th>\n			<th>新增订阅</th>\n			<th>取消订阅</th>\n			<th>累计订阅</th>\n		</tr>\n	</thead>\n	<tbody>\n		";for(var o in content)__p+="\n			<tr>\n				<td><a>"+(null==(__t=content[o].date)?"":_.escape(__t))+"</a></td>\n				<td>"+(null==(__t=content[o].new_reader_count)?"":__t)+"</td>\n				<td>"+(null==(__t=content[o].total_reader_count)?"":__t)+"</td>\n				<td>"+(null==(__t=content[o].new_like_count)?"":__t)+"</td>\n				<td>"+(null==(__t=content[o].new_dislike_count)?"":__t)+"</td>\n				<td>"+(null==(__t=content[o].total_subscriber_count)?"":__t)+"</td>\n			</tr>\n		";__p+="\n	</tbody>\n</table>\n\n\n<div class ='pagination'>\n	  <a class='page j_page_pre' page=\""+(null==(__t=page-1)?"":__t)+"\">上一页</a>\n	  <a> <span>第</span><input type='text' class='pagination-input j_pagination_input' value='"+(null==(__t=0==pageAll?0:page)?"":__t)+"'><span>/"+(null==(__t=pageAll)?"":__t)+"页</span></a>\n	   <a class='page j_page_next' page='"+(null==(__t=page+1)?"":__t)+"'>下一页</a>\n</div>\n"}return __p}),eventCenter=window.listener,stip=require("common/stip/stip.js"),url="/statistic/audience_daily_stat/",exportUrl="/statistic/audience_daily_export/";module.exports=Pagelet.extend({el:"#pagelet-andiences-table",events:{},init:function(){this.cacheInit(),this.dataInit(),this.eventInit(),this.eventCenter(),this.requestUrl()},cacheInit:function(){this.$el=$(this.el),this.$andienceTable=this.$el.find(".j_andience_table"),this.$andienceExport=this.$el.find(".j_andience_export")},dataInit:function(){var t=new Date;this.setting={startDate:t.clone().d(-1).format("date"),endDate:t.clone().d(-1).format("date"),content:[],page:1,pageAll:1}},eventCenter:function(){var t=(this.setting,this);eventCenter.on("andiences_table","updateDate",function(e,n){t.setting.startDate=n.start_date,t.setting.endDate=n.end_date,t.requestUrl()})},eventInit:function(){{var t=$(this.el),e=this,n=this.setting,a=(n.start_date,n.pageAll);n.start_date,n.end_date,n.page}t.on("keydown",".pagination-input",function(t){a=n.pageAll,13===t.which&&($(this).val()<=parseInt(a)?e.goToPage($(this).val()):stip.popupTip({msg:"该页面不存在",status:!1}))}),this.$andienceExport.bind("click",function(){var t=e.setting,n=exportUrl+"?start_date="+t.startDate;n=n+"&end_date="+t.endDate,$("body").append('<iframe style="display:none" src="'+n+'"></iframe>')}),this.$el.on("click",".j_page_next",function(){e.next()}),this.$el.on("click",".j_page_pre",function(){e.pre()})},requestUrl:function(){var t=this.setting,e=this,n={start_date:t.startDate,end_date:t.endDate,pagenum:t.page};$.ajax({url:url,type:"GET",dataType:"json",data:n}).done(function(t){e.dataProcess(t)}).fail(function(){stip.popupTip({msg:"网络错误，请稍后重试",status:!1})})},dataProcess:function(t){"success"==t.message?(this.setting.content=t.data.data_list,this.setting.page=t.data.pagenum,this.setting.pageAll=t.data.total_pagenum,this.render()):stip.popupTip({msg:t.reason?t.reason:"未知错误",status:!1})},goToPage:function(t){var e=this.setting;parseInt(t)>0&&parseInt(t)<=e.pageAll?(this.setting.page=t,this.requestUrl()):stip.popupTip({msg:"对不起,该页不存在",status:!1})},next:function(){this.goToPage(this.setting.page+1)},pre:function(){this.goToPage(this.setting.page-1)},render:function(){var t=template(this.setting);this.$andienceTable.html(t)}})});
;define("pagelet/article1/article1.js",function(e){$(function(){var a=window.pageData,t=e("pagelet/pager/pager.js"),n=e("common/util/util.js"),i=(e("pagelet/daterange/daterange.js")({start_date:a.start_date,end_date:a.end_date,relative:-1,onchange:function(e){window.location="?"+$.param($.extend({},n.GET,e,{pagenum:1}))}}),a.sort_field_name),d=a.sort_flag,r=$(".th-order"),l="asc"===d?!0:!1;r.filter("[data-field="+i+"]").switchClass(d),r.click(function(e){e.preventDefault();var a=$(this),t=a.data("field"),d=!1;i==t&&(d=!l),window.location="?"+$.param($.extend({},n.GET,{sort_field_name:t,sort_flag:d?"asc":"desc",pagenum:1}))}),t({jele:$(".pager"),length:a.total_pagenum,index:a.pagenum-1,render:function(e,a,t,i){i||(window.location="?"+$.param($.extend({},n.GET,{pagenum:e+1})))}})})});
;define("pagelet/article2/article2.js",function(e){$(function(){var a=window.pageData,t=e("pagelet/pager/pager.js"),n=e("common/util/util.js"),i=(e("pagelet/daterange/daterange.js")({start_date:a.start_date,end_date:a.end_date,relative:-1,onchange:function(e){window.location="?"+$.param($.extend({},n.GET,e,{pagenum:1}))}}),a.sort_field_name),d=a.sort_flag,r=$(".th-order"),l="asc"===d?!0:!1;r.filter("[data-field="+i+"]").switchClass(d),r.click(function(e){e.preventDefault();var a=$(this),t=a.data("field"),d=!1;i==t&&(d=!l),window.location="?"+$.param($.extend({},n.GET,{sort_field_name:t,sort_flag:d?"asc":"desc",pagenum:1}))}),t({jele:$(".pager"),length:a.total_pagenum,index:a.pagenum-1,render:function(e,a,t,i){i||(window.location="?"+$.param($.extend({},n.GET,{pagenum:e+1})))}})})});
;define("pagelet/audience_property_service/audience_property_service.js",function(require,exports,module){var eventCenter=window.listener,url="/statistic/audience_property/",emtryTem=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+="<div class='no_result'>暂无数据</div>";return __p};module.exports=Pagelet.extend({el:"#scontent",init:function(){this.dataInit(),this.eventCenter(),this.httpRequest()},dataInit:function(){this.setting={gender:{female:0,male:0},device:{android:0,iphone:0},province:{},age:{}}},eventCenter:function(){var e=this;eventCenter.on("audience_property_service","updateData",function(){e.httpRequest()})},dataProcess:function(e){var t=this.setting,n=$("#andience_normal"),i=$("#andience_client"),a=$("#andience_region_distribution"),r=$("#andience_age_distribution"),d=$(this.el).find(".stage");t.gender=e.data.gender,t.device=e.data.device,t.province=e.data.province,t.age=e.data.age,e.data.gender?(eventCenter.trigger("andience_normal","sysData",e.data),eventCenter.trigger("andience_region_distribution","sysData",e.data),eventCenter.trigger("andience_age_distribution","sysData",e.data),eventCenter.trigger("andience_client","sysData",e.data)):(n.remove(),i.remove(),a.remove(),r.remove(),d.append(emtryTem()))},httpRequest:function(){var e=this;$.ajax({url:url,type:"GET",dataType:"json"}).done(function(t){e.dataProcess(t)}).fail(function(){stip.popupTip({msg:"网络错误，请稍后重试",status:!1})})}})});
;define("pagelet/claim_origin/claim_origin.js",function(i){return function(t){var e=i("common/util/util.js"),a=i("common/stip/stip.js");$("#claim_origin_table").on("click",'[data-node="del"]',function(){var i=$(this),n=i.closest("tr").data("id");e.ajax("/article/delete_dup_article/",{pgc_id:t.pgc_id,dup_id:n},function(t,e){return 0!=t?a.alert(e):(i.replaceWith("已删除"),void a.alert("已删除"))})})}});
;define("pagelet/column/column.js",function(require,exports,module){var pager=require("common/pager/pager.js"),Vali=require("common/vali/vali.js"),Dialog=require("common/popup/dialog.js"),Stip=require("common/stip/stip.js"),inputDialog=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="column_input_dialog">\n    <div class="column_input_dialog_title">请输入专栏名称</div>\n    <input type="text" name="name" class="signform_input column_input_dialog_input" data-node="input" placeholder="专栏名称不多于8个汉字或16个字母">\n    <div class="sred column_input_dialog_msg" data-node="msg"></div>\n</div>';return __p},selectDialog=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="modal_dialog">\n    <div class="select_dialog_bg"></div>\n    <div class="select_article_dialog">\n        <div class="select_article_dialog_title">选择文章</div>\n        <ul class="select_article_dialog_articles">\n        </ul>\n        <div class="select_article_dialog_pager"></div>\n        <div class="select_article_dialog_footer">\n            <div class="select_dialog_btn dialog_btn_ok">确定</div>\n            <div class="select_dialog_btn dialog_btn_cancel">取消</div>\n        </div>\n    </div>\n</div>';return __p},ctmpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="column_item">\n    <span class="column_item_title">'+(null==(__t=obj.name)?"":_.escape(__t))+'</span>\n    <div class="column_item_btns">\n        <span class="column_item_btn column_item_btn_edit cedit" data-title="编辑专栏"></span>\n        <span class="column_item_btn column_item_btn_del cdel" data-title="删除专栏"></span>\n        <!-- <span class="column_item_btn column_item_btn_sort csort" data-title="拖拽进行排序"></span> -->\n    </div>\n</div>';return __p},atmpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="article_item">\n    <span class="article_item_title">'+(null==(__t=obj.title)?"":_.escape(__t))+'</span>\n    <div class="article_item_btns">\n        <span class="article_item_btn article_item_btn_del adel" data-title="移除文章"></span>\n    </div>\n</div>';return __p},stmpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<li class="select_article_dialog_article"><i class="article_radio"></i>'+(null==(__t=obj.title)?"":_.escape(__t))+"</li>";return __p};return function(t){$(function(){function n(t){Dialog({btns:["ok"],title:t}).show()}function e(t,n){var e=Dialog({btns:[{type:"ok",click:function(){e.remove(),t()}},"cancel"],title:"删除确认",content:n}).show()}function i(t){Stip.popupTip({msg:t,status:!1})}function a(t,n){for(var e=[],i=0;i<n.length;i++){var a=n[i],l=$(ctmpl(a));l.data({name:a.name,column_no:a.column_no}),e.push(l)}t.append(e),t.find(".column_item").eq(0).click()}function l(t){if(!t)return void x.text("");var n=t.data("column_no"),e="获取文章列表失败";pager({jele:$(".pagination"),cb:function(t,a){$.ajax({type:"GET",url:"/column/get_article/",data:{column_no:n,type:0,page_no:t},dataType:"json"}).done(function(t){if("success"===t.message){if(!t.data)return;var n=t.data;a({length:n.total});var l=n.article_list;if(0===l.length)return void x.text("");for(var c=[],o=0;o<l.length;o++){var s=l[o],r=$(atmpl(s));r.data({title:s.title,article_id:s.article_id}),c.push(r)}x.html(c)}else i(e)}).fail(function(){i(e)})}})}function c(){var t=T.children().length;return t}function o(){var t=c();if(t>=q){var e="最多可创建"+q+"个专栏";return void n(e)}w({success:function(t){var n="添加专栏失败",e=b(t);$.ajax({type:"POST",url:"/column/add/",data:{column_list:JSON.stringify(e)},dataType:"json"}).done(function(e){if("success"===e.message){var a=e.data;if(0===a.length)return;var l=a[a.length-1],c=$(ctmpl({name:t}));c.data({name:l.name,column_no:l.column_no}),T.append(c),c.click()}else i(n)}).fail(function(){i(n)})}})}function s(){var t=$(this).closest(".column_item"),n=t.find(".column_item_title"),e=t.data("name"),a=t.data("column_no");w({name:e,success:function(e){var l="编辑专栏失败",c=j(a,e);$.ajax({type:"POST",url:"/column/rename/",data:{column_list:JSON.stringify(c)},dataType:"json"}).done(function(a){"success"===a.message?(n.text(e),t.data("name",e)):i(l)}).fail(function(){i(l)})}})}function r(){var t="删除专栏后，文章不会被删除，专栏设置不可恢复，请谨慎操作",n=$(this).closest(".column_item");e(function(){var t="删除专栏失败",e=n.data("column_no"),a=y(e);$.ajax({type:"POST",url:"/column/delete/",data:{column_list:JSON.stringify(a)},dataType:"json"}).done(function(e){"success"===e.message?(n.remove(),0!==T.children().length?T.find(".column_item").eq(0).click():l()):i(t)}).fail(function(){i(t)})},t)}function d(){var t=$(this).closest(".column_item");t.hasClass("selected")||t.addClass("selected").siblings(".column_item").removeClass("selected"),l(t)}function _(){var t=c();if(0===t){var e="暂无专栏，请先添加专栏";return void n(e)}u()}function u(){function t(){return 0===O.length?void e.hide():(m(o,O),e.hide(),void(O=[]))}var e=$(selectDialog()),a=e.find(".dialog_btn_ok"),l=e.find(".dialog_btn_cancel"),c=e.find(".select_article_dialog_articles"),o=T.find(".selected"),s=o.data("column_no"),r="获取文章列表失败";pager({jele:e.find(".select_article_dialog_pager"),cb:function(t,a){$.ajax({type:"GET",url:"/column/get_article/",data:{column_no:s,type:1,page_no:t},dataType:"json"}).done(function(t){if("success"===t.message){var l=t.data;a({length:l.total});var o=l.article_list;if(0===o.length)return n("暂无更多文章"),void e.hide();for(var s=[],d=0;d<o.length;d++){var _=o[d];if(_.title){var u=$(stmpl(_));u.data({title:_.title,article_id:_.article_id});for(var m=0;m<O.length;m++)if(O[m]===_.article_id){u.addClass("selected");break}s.push(u)}}c.html(s)}else i(r)}).fail(function(){i(r)})}}),e.on("click",".article_radio",v),a.click(t),l.click(function(){e.hide(),O=[]}),$("body").append(e)}function m(t,n){var e="添加文章失败",a=t.data("column_no");$.ajax({type:"POST",url:"/column/add_article/",data:{column_no:a,article_id_list:JSON.stringify(n)},dataType:"json"}).done(function(n){"success"===n.message?l(t):i(e)}).fail(function(){i(e)})}function p(){var t="该文章将从专栏中移除，文章不会被删除";e(function(){var t="移除文章失败",n=T.find(".selected"),e=x.find(".selected"),a=n.data("column_no"),l=e.data("article_id");$.ajax({type:"POST",url:"/column/delete_article/",data:{column_no:a,article_id:l},dataType:"json"}).done(function(n){"success"===n.message?e.remove():i(t)}).fail(function(){i(t)})},t)}function f(){var t=$(this).closest(".article_item");t.hasClass("selected")||t.addClass("selected").siblings(".article_item").removeClass("selected")}function v(){var t=$(this).closest(".select_article_dialog_article"),n=t.data("article_id");if(t.hasClass("selected")){t.removeClass("selected");for(var e=0;e<O.length;e++)O[e]===n&&O.splice(e,1)}else t.addClass("selected"),O.push(n)}function g(){S.click(o),C.click(_),T.on("click",".column_item",d),T.on("click",".cedit",s),T.on("click",".cdel",r),x.on("click",".article_item",f),x.on("click",".adel",p)}function h(){for(var t=[],n=T.find(".column_item"),e=0;e<n.length;e++){var i=n.eq(e).data(),a={name:i.name,column_no:i.column_no};t.push(a)}return t}function b(t){var n=h(),e={name:t};return n.push(e),n}function j(t,n){for(var e=h(),i=0;i<e.length;i++){var a=e[i];a.column_no===t&&(a.name=n)}return e}function y(t){for(var n=h(),e=0;e<n.length;e++){var i=n[e];i.column_no===t&&n.splice(e,1)}return n}var k=$("#pagelet-column"),T=k.find(".column_list"),x=k.find(".article_list"),S=k.find(".add_column"),C=k.find(".add_article"),q=5,O=[];g(),$("body").hoverTitle(),a(T,t.data);var w=function(){function t(){i(function(t,n,e){t||(a.hide(),c($.so(e).name))})}var n=$(inputDialog()),e=n.nodes();e.input.data({vali_jmsg:e.msg,vali_require:"请输入专栏名称",vali_func:Vali.returnWrap(function(t){return Vali.range(t,0,8,!0)&&"专栏名称不多于8个汉字或16个字母"})});var i=Vali(e.input),a=Dialog({btns:[{type:"ok",click:t},{type:"cancel",click:function(){a.hide()}}]}),l=a.jele.find(".spopup_dialog_body");l.append(n);var c;return function(t){c=t.success||$.noop,i("reset"),e.input.val(t.name||""),a.show(),e.input.focus()}}()})}});
;define("pagelet/comment_service/comment_service.js",function(t){var e=t("common/stip/stip.js"),s={getCom:"/comment/",getOtherCom:"/comment/dongtai_list/",replyCom:"/comment/action/",raiseCom:"/comment/digg/",reportCom:"/comment/report_user/",deleteCom:"/comment/delete/",checkNewCom:"/comment/notification_count/"},o={el:"#pagelet-comment",init:function(){},checkNewCom:function(t){$.ajax({type:"GET",url:s.checkNewCom}).done(function(e){"success"===e.message&&e.data.update_count>0&&t(e.data.update_count)})},getCom:function(t,o){$.ajax({type:"GET",url:s.getCom,data:t,dataType:"json"}).done(function(t){"success"===t.message?o(t):e.popupTip({msg:"获取评论失败",status:!1})}).fail(function(){e.popupTip({msg:"获取评论失败",status:!1})})},getOtherCom:function(t,o){$.ajax({type:"GET",url:s.getOtherCom,data:t,dataType:"json"}).done(function(t){"success"===t.message?o(t.data):e.popupTip({msg:"获取评论失败",status:!1})}).fail(function(){e.popupTip({msg:"获取评论失败",status:!1})})},raiseCom:function(t,o){$.ajax({type:"POST",url:s.raiseCom,data:t,dataType:"json"}).done(function(t){"success"===t.message?o():e.popupTip({msg:"点赞失败",status:!1})}).fail(function(){e.popupTip({msg:"点赞失败",status:!1})})},reportCom:function(t){$.ajax({type:"POST",url:s.reportCom,data:t,dataType:"json"}).done(function(t){e.popupTip("success"===t.message?{msg:"举报成功",status:!0}:{msg:"举报失败",status:!1})}).fail(function(){e.popupTip({msg:"举报失败",status:!1})})},replyCom:function(t,o){$.ajax({type:"POST",url:s.replyCom,data:t,dataType:"json"}).done(function(t){"success"===t.message?(o(t.data),e.popupTip({msg:"回复评论成功",status:!0})):e.popupTip({msg:"回复评论失败",status:!1})}).fail(function(){e.popupTip({msg:"回复评论失败",status:!1})})},deleteCom:function(t,o){$.ajax({type:"POST",url:s.deleteCom,data:t,dataType:"json"}).done(function(t){"success"===t.message?o():e.popupTip({msg:"删除评论失败",status:!1})}).fail(function(){e.popupTip({msg:"删除评论失败",status:!1})})}};return o});
;define("pagelet/comment_basic/comment_basic.js",function(t,e,i){var o=t("pagelet/comment_service/comment_service.js"),n=t("common/stip/stip.js"),m=t("common/popup/dialog.js"),s=window.listener;i.exports=Pagelet.extend({el:"#comment",init:function(t){this.$el=t._$el,this.initEvents()},initEvents:function(){this.$el.on("click",".j_action_list",$.proxy(this.showOtherComment,this)),this.$el.on("click",".j_action_raise",$.proxy(this.raiseComment,this)),this.$el.on("click",".j_action_delete",$.proxy(this.deleteComment,this)),this.$el.on("click",".j_action_reply",$.proxy(this.replyComment,this)),this.$el.on("click",".j_action_report",$.proxy(this.showReportModal,this))},showOtherComment:function(t){var e=$(t.target).closest(".comment-item"),i=e.find(".other-item"),n=e.data().comment_count,m=e.data().is_author_comment,a=e.data().dongtai_id;if(0===n||e.hasClass("other-item")){if(m)return;this.replyComment(t)}else if(0===i.length){var r={dongtai_id:e.data().dongtai_id,count:n,offset:0};o.getOtherCom(r,function(t){s.trigger("comment-item","showOther"+a,{item:e,user_id:t.user_id,data:t.data})})}else s.trigger("comment-item","hideOther"+a,e)},raiseComment:function(t){var e=$(t.target).closest(".comment-item"),i=e.find(".j_action_raise").eq(0),m=e.find(".j_raise_num").eq(0);if(i.hasClass("selected"))n.popupTip({msg:"您已经顶过",status:!1});else{var s=this.getCommentData(e);o.raiseCom(s,function(){i.addClass("selected");var t=m.text();m.text(++t)})}},deleteComment:function(t){var e=this,i=$(t.target).closest(".comment-item"),a=i.parents(".comment-item"),r=a.find(".j_list_num"),c=a.data().dongtai_id,l=m({btns:[{type:"ok",click:function(){l.remove();var t=e.getCommentData(i);o.deleteCom(t,function(){i.remove();var t=r.text();r.text(--t),0===a.find(".other-item").length&&s.trigger("comment-item","hideOther"+c,a),n.popupTip({msg:"删除评论成功",status:!0})})}},"cancel"],title:"删除确认",content:"确认删除此评论？删除后不可恢复"}).show()},replyComment:function(t){var e=$(t.target).closest(".comment-item"),i=e.find(".j_action_reply").eq(0),o=i.text(),n=e.data().dongtai_id;"回复"===o?(i.text("收起"),e.hasClass("other-item")?s.trigger("comment-other-item","showReply"+n,e):s.trigger("comment-item","showReply"+n,e)):(i.text("回复"),e.hasClass("other-item")?s.trigger("comment-other-item","hideReply"+n,e):s.trigger("comment-item","hideReply"+n,e))},showReportModal:function(t){var e=$(t.target).closest(".comment-item"),i=this.getCommentData(e);s.trigger("comment-report","showReport",i)},getCommentData:function(t){var e={dongtai_id:t.data().dongtai_id,cursor:t.data().create_time,user_id:t.data().user_id};return e}})});
;define("pagelet/comment_reply/comment_reply.js",function(e,t,n){var i=e("pagelet/comment_service/comment_service.js"),o=e("common/stip/stip.js"),r=window.listener;n.exports=Pagelet.extend({el:"#comment",init:function(e){this.$el=e._$el,this.eventCenter(e._data),this.initEvents(),this.checkInputNum(this.$el)},eventCenter:function(e){var t=this;r.on("comment-reply","showReply"+e.dongtai_id,function(e,n){t.showReply(n)},t),r.on("comment-reply","hideReply"+e.dongtai_id,function(e,n){t.hideReply(n)},t)},initEvents:function(){this.$el.on("click",".j_reply",$.proxy(this.replyComment,this))},showReply:function(e){var t=e,n=t.find(".comment-reply").eq(0);n.addClass("show"),n.slideDown("slow")},hideReply:function(e){var t=e,n=t.find(".comment-reply").eq(0);n.removeClass("show"),n.slideUp("slow")},replyComment:function(e){var t,n,s,m=$(e.target).closest(".comment-item"),a=m.find("textarea").eq(0),l=m.data().dongtai_id,d=m.data().user_id,c=m.data().screen_name,_=a.val();if(!_)return void o.popupTip({msg:"评论内容不能为空",status:!1});if(m.hasClass("other-item")){var p=m.parents(".comment-item"),u=!0;n=p.data().dongtai_id,s=p,t=p.find(".j_list_num")}else n=l,s=m,t=m.find(".j_list_num");var h={dongtai_id:n,reply_comment_id:l,reply_user_id:d,content:_};i.replyCom(h,function(e){a.val(""),r.trigger("comment-item","showOther"+n,{item:s,user_id:e.user_id,data:[{digg_count:0,content:_,create_time:e.create_time,id:e.dongtai_id,user:{avatar_url:e.avatar_url,user_id:e.user_id},is_other_comment:u,reply_user:{user_id:d,screen_name:c}}]}),m.find(".j_action_reply").text("回复"),m.hasClass("other-item")?r.trigger("comment-other-item","hideReply"+l,m):r.trigger("comment-item","hideReply"+l,m);var i=t.text();t.text(++i)})},checkInputNum:function(e){var t=this;e.on("keyup","textarea",function(e){var n=600,i=$(this).closest(".comment-reply").find("textarea"),o=$(this).closest(".comment-reply").find(".j_reply_left_num");return 13===e.keyCode||108===e.keyCode?(t.replyComment(e),e.returnValue=!1,!1):void o.html(n-i.val().length)})}})});
;define("pagelet/comment_other_item/comment_other_item.js",function(require,exports,module){var Basic=require("pagelet/comment_basic/comment_basic.js"),Reply=require("pagelet/comment_reply/comment_reply.js"),basic=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-basic">\n    <div class="reader-avatar"><a href="http://toutiao.com/user/'+(null==(__t=obj.user.user_id)?"":_.escape(__t))+'/" target="_blank"><img src="'+(null==(__t=obj.user.avatar_url)?"":_.escape(__t))+'" alt="reader-avatar"></a></div>\n    <div class="comment-display">\n        <div class="comment-info">\n            ',__p+=obj.is_author_comment?'\n                <span class="reader-name">我的回复</span>\n            ':'\n                <a href="http://toutiao.com/user/'+(null==(__t=obj.user.user_id)?"":_.escape(__t))+'/" class="reader-name" target="_blank">'+(null==(__t=obj.user.screen_name)?"":_.escape(__t))+"</a>\n            ",__p+='\n            <span class="comment-time">'+(null==(__t=obj.display_time)?"":_.escape(__t))+'</span>\n        </div>\n        <div class="comment-content j_action_list">\n            ',obj.is_other_comment&&obj.reply_user&&(__p+='\n                回复<a href="http://toutiao.com/user/'+(null==(__t=obj.reply_user.user_id)?"":_.escape(__t))+'/" class="reader-name" target="_blank">'+(null==(__t=obj.reply_user.screen_name)?"":_.escape(__t))+"</a>：\n            "),__p+="\n            "+(null==(__t=obj.content)?"":_.escape(__t))+"\n        </div>\n        ",obj.is_other_comment||(__p+='\n            <div class="related-info">\n                ',__p+=obj.is_article_comment?'\n                    <span>评论我的文章：<a href="http://toutiao.com/a'+(null==(__t=obj.group.group_id)?"":_.escape(__t))+'/" class="related-article" target="_blank">「'+(null==(__t=obj.group.title)?"":_.escape(__t))+"」</a></span>\n                ":'\n                    <span>回复我的评论：<a href="http://toutiao.com/a'+(null==(__t=obj.group.group_id)?"":_.escape(__t))+'" class="related-comment" target="_blank">“'+(null==(__t=obj.content)?"":_.escape(__t))+"”</a></span>\n                ",__p+="\n            </div>\n        "),__p+='\n        <div class="comment-actions">\n            <div class="actions-left">\n                ',obj.is_other_comment||(__p+='\n                    <span class="comment-action-raise comment-action j_action_raise ',obj.is_raised&&(__p+="selected"),__p+='"><i></i><span class="comment-action-num j_raise_num">'+(null==(__t=obj.digg_count)?"":_.escape(__t))+'</span></span>\n                    <span class="comment-action-list comment-action j_action_list"><i></i><span class="comment-action-num j_list_num">'+(null==(__t=obj.comment_count)?"":_.escape(__t))+"</span></span>\n                "),__p+='\n            </div>\n            <div class="actions-right">\n                ',obj.is_author_comment?__p+='\n                    <span class="comment-action-delete comment-action j_action_delete">删除</span>\n                ':(__p+='\n                    <span class="comment-action-reply comment-action j_action_reply">回复</span>\n                    ',obj.is_other_comment||(__p+='\n                        <span class="comment-action-report comment-action j_action_report">举报</span>\n                    '),__p+="\n                "),__p+="\n            </div>\n        </div>\n    </div>\n</div>";return __p},reply=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-reply">\n    <div class="reply-body">\n        <textarea placeholder="回复该评论：" maxlength="600"></textarea>\n    </div>\n    <div class="reply-footer">\n        <span class="reply-tip"><!-- 按下Shift+Enter键换行， -->还可以输入<span class="j_reply_left_num">600</span>字</span>\n        <button class="reply-confirm j_reply">发送(Enter)</button>\n    </div>\n</div>';return __p},eventCenter=window.listener;module.exports=Pagelet.extend({el:"#comment",init:function(e){this.$el=e._$el,this.$basic=this.$el.find(".comment-basic-panel"),this.$reply=this.$el.find(".comment-reply-panel"),this.eventCenter(e._data),this.render(e._data)},eventCenter:function(e){var t=this;eventCenter.on("comment-other-item","showReply"+e.dongtai_id,function(e,n){t.showReply(n)}),eventCenter.on("comment-other-item","hideReply"+e.dongtai_id,function(e,n){t.hideReply(n)})},render:function(e){this.$el.data({create_time:e.create_time,dongtai_id:e.dongtai_id});var t=$(basic(e)),n=$(reply(e));Basic.create({_$el:t,_data:e}),Reply.create({_$el:n,_data:e}),this.$basic.append(t),this.$reply.append(n)},showReply:function(e){var t=e;t.is_author_comment||eventCenter.trigger("comment-reply","showReply"+t.data().dongtai_id,e)},hideReply:function(e){var t=e;eventCenter.trigger("comment-reply","hideReply"+t.data().dongtai_id,e)}})});
;define("pagelet/comment_other_getmore/comment_other_getmore.js",function(e,t,o){var n=e("pagelet/comment_service/comment_service.js"),i=window.listener;o.exports=Pagelet.extend({el:"#comment",init:function(e){this.$el=e._$el,this.eventCenter(e._data),this.initEvents()},eventCenter:function(e){var t=this;i.on("comment-other-getmore","hide"+e.dongtai_id,function(e,o){t.hideOtherGetmore(o)},t),i.on("comment-other-getmore","show"+e.dongtai_id,function(e,o){t.showOtherGetmore(o)},t)},initEvents:function(){this.$el.on("click",".click-for-more",$.proxy(this.loadMoreOtherComment,this))},hideOtherGetmore:function(e){var t=e,o=t.find(".comment-other-getmore");o.hide()},showOtherGetmore:function(e){var t=e,o=t.find(".comment-other-getmore"),n=t.find(".click-for-more"),i=t.find(".loading-more");o.show(),n.show(),i.hide()},loadMoreOtherComment:function(e){var t=$(e.target).closest(".comment-item"),o=t.find(".click-for-more"),r=t.find(".loading-more");o.hide(),r.show();var m=t.find(".other-item").length,h=t.data().dongtai_id,d={dongtai_id:h,count:3,offset:m};n.getOtherCom(d,function(e){r.hide(),i.trigger("comment-item","showOther"+h,{item:t,user_id:e.user_id,data:e.data})})}})});
;define("pagelet/comment_item/comment_item.js",function(require,exports,module){var Basic=require("pagelet/comment_basic/comment_basic.js"),Reply=require("pagelet/comment_reply/comment_reply.js"),Other=require("pagelet/comment_other_item/comment_other_item.js"),More=require("pagelet/comment_other_getmore/comment_other_getmore.js"),basic=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-basic">\n    <div class="reader-avatar"><a href="http://toutiao.com/user/'+(null==(__t=obj.user.user_id)?"":_.escape(__t))+'/" target="_blank"><img src="'+(null==(__t=obj.user.avatar_url)?"":_.escape(__t))+'" alt="reader-avatar"></a></div>\n    <div class="comment-display">\n        <div class="comment-info">\n            ',__p+=obj.is_author_comment?'\n                <span class="reader-name">我的回复</span>\n            ':'\n                <a href="http://toutiao.com/user/'+(null==(__t=obj.user.user_id)?"":_.escape(__t))+'/" class="reader-name" target="_blank">'+(null==(__t=obj.user.screen_name)?"":_.escape(__t))+"</a>\n            ",__p+='\n            <span class="comment-time">'+(null==(__t=obj.display_time)?"":_.escape(__t))+'</span>\n        </div>\n        <div class="comment-content j_action_list">\n            ',obj.is_other_comment&&obj.reply_user&&(__p+='\n                回复<a href="http://toutiao.com/user/'+(null==(__t=obj.reply_user.user_id)?"":_.escape(__t))+'/" class="reader-name" target="_blank">'+(null==(__t=obj.reply_user.screen_name)?"":_.escape(__t))+"</a>：\n            "),__p+="\n            "+(null==(__t=obj.content)?"":_.escape(__t))+"\n        </div>\n        ",obj.is_other_comment||(__p+='\n            <div class="related-info">\n                ',__p+=obj.is_article_comment?'\n                    <span>评论我的文章：<a href="http://toutiao.com/a'+(null==(__t=obj.group.group_id)?"":_.escape(__t))+'/" class="related-article" target="_blank">「'+(null==(__t=obj.group.title)?"":_.escape(__t))+"」</a></span>\n                ":'\n                    <span>回复我的评论：<a href="http://toutiao.com/a'+(null==(__t=obj.group.group_id)?"":_.escape(__t))+'" class="related-comment" target="_blank">“'+(null==(__t=obj.content)?"":_.escape(__t))+"”</a></span>\n                ",__p+="\n            </div>\n        "),__p+='\n        <div class="comment-actions">\n            <div class="actions-left">\n                ',obj.is_other_comment||(__p+='\n                    <span class="comment-action-raise comment-action j_action_raise ',obj.is_raised&&(__p+="selected"),__p+='"><i></i><span class="comment-action-num j_raise_num">'+(null==(__t=obj.digg_count)?"":_.escape(__t))+'</span></span>\n                    <span class="comment-action-list comment-action j_action_list"><i></i><span class="comment-action-num j_list_num">'+(null==(__t=obj.comment_count)?"":_.escape(__t))+"</span></span>\n                "),__p+='\n            </div>\n            <div class="actions-right">\n                ',obj.is_author_comment?__p+='\n                    <span class="comment-action-delete comment-action j_action_delete">删除</span>\n                ':(__p+='\n                    <span class="comment-action-reply comment-action j_action_reply">回复</span>\n                    ',obj.is_other_comment||(__p+='\n                        <span class="comment-action-report comment-action j_action_report">举报</span>\n                    '),__p+="\n                "),__p+="\n            </div>\n        </div>\n    </div>\n</div>";return __p},reply=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-reply">\n    <div class="reply-body">\n        <textarea placeholder="回复该评论：" maxlength="600"></textarea>\n    </div>\n    <div class="reply-footer">\n        <span class="reply-tip"><!-- 按下Shift+Enter键换行， -->还可以输入<span class="j_reply_left_num">600</span>字</span>\n        <button class="reply-confirm j_reply">发送(Enter)</button>\n    </div>\n</div>';return __p},other=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-item other-item">\n    <div class="comment-basic-panel"></div>\n    ',obj.is_author_comment||(__p+='\n        <div class="comment-reply-panel"></div>\n    '),__p+="\n</div>";return __p},more=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-other-getmore">\n    <div class="get-more click-for-more">点击查看更多<i class="arrow-down"></i></div>\n    <div class="get-more loading-more">正在加载…</div>\n</div>';return __p},eventCenter=window.listener;module.exports=Pagelet.extend({el:"#comment",init:function(e){this.$el=e._$el,this.$basic=this.$el.find(".comment-basic-panel"),this.$reply=this.$el.find(".comment-reply-panel"),this.$other=this.$el.find(".comment-others-panel"),this.eventCenter(e._data),this.render(e._data)},eventCenter:function(e){var t=this;eventCenter.on("comment-item","showReply"+e.dongtai_id,function(e,n){t.showReply(n)}),eventCenter.on("comment-item","hideReply"+e.dongtai_id,function(e,n){t.hideReply(n)}),eventCenter.on("comment-item","showOther"+e.dongtai_id,function(e,n){t.showOther(n)},t),eventCenter.on("comment-item","hideOther"+e.dongtai_id,function(e,n){t.hideOther(n)})},render:function(e){console.log(e),this.$el.data({create_time:e.create_time,dongtai_id:e.dongtai_id,comment_count:e.comment_count});var t=$(basic(e)),n=$(reply(e));Basic.create({_$el:t,_data:e}),Reply.create({_$el:n,_data:e});var a=$(more(e));More.create({_$el:a,_data:e}),this.$other.append(a),this.$basic.append(t),this.$reply.append(n)},showReply:function(e){var t=e,n=t.find(".top-triangle"),a=t.find(".comment-opers-panel");t.addClass("show-opers"),a.show(),n.removeClass("left"),eventCenter.trigger("comment-reply","showReply"+t.data().dongtai_id,t)},hideReply:function(e){var t=e,n=t.find(".other-item"),a=t.find(".top-triangle"),o=t.find(".comment-opers-panel");eventCenter.trigger("comment-reply","hideReply"+t.data().dongtai_id,t),0===n.length?(t.removeClass("show-opers"),o.slideUp("fast")):a.addClass("left")},showOther:function(e){var t=e.item,n=t.find(".top-triangle"),a=t.find(".comment-opers-panel");t.addClass("show-opers"),a.show(),n.addClass("left"),this.renderData(e)},hideOther:function(e){var t=e,n=t.find(".comment-reply"),a=t.find(".others-list"),o=t.find(".top-triangle"),i=t.find(".comment-opers-panel");n.hasClass("show")?o.removeClass("left"):(t.removeClass("show-opers"),i.slideUp("fast")),a.text("")},renderData:function(e){for(var t=[],n=e.item,a=e.user_id,o=e.data,i=n.find(".others-list"),s=0;s<o.length;s++){var r=o[s],_=this.processData(r,a),c=$(other(_));c.data({create_time:_.create_time,dongtai_id:_.dongtai_id,user_id:_.user.user_id,screen_name:_.user.screen_name,is_author_comment:_.is_author_comment}),Other.create({_$el:c,_data:_}),t.push(c)}i.append(t)},processData:function(e,t){var n=e.user.user_id;e.is_author_comment=n===t?!0:!1;var a=this.calculateTime(e.create_time);return e.display_time=a,e.is_other_comment=!0,e.dongtai_id=e.id,e},calculateTime:function(e){var t=new Date,n=new Date(1e3*e),a=(t-n)/1e3,o=0,i="";return 60>=a?i="刚刚":a>60&&3600>=a?(o=Math.floor(a/60),i=o+"分钟前"):a>3600&&86400>a?(o=Math.floor(a/3600),i=o+"小时前"):i=n.m()+"-"+n.d()+":"+n.h()+"-"+n.M(),i}})});
;define("pagelet/comment/comment.js",function(require,exports,module){var Service=require("pagelet/comment_service/comment_service.js"),Item=require("pagelet/comment_item/comment_item.js"),comment_item=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="comment-item j_comment_item">\n    <div class="comment-basic-panel"></div>\n    <div class="comment-opers-panel">\n        <span class="top-triangle"></span><span class="top-triangle inner"></span>\n        <div class="comment-reply-panel"></div>\n        <div class="comment-others-panel">\n            <div class="others-list"></div>\n        </div>\n    </div>\n</div>';return __p},eventCenter=window.listener;module.exports=Pagelet.extend({el:"#comment",init:function(e){this.$el=$(this.el),this.$list=this.$el.find(".comment-list"),this.eventCenter(),this.render(e),setInterval(this.checkNewComment,3e4)},eventCenter:function(){var e=this;eventCenter.on("comment","newComment",function(t,n){e.renderNewComment(n)},e),eventCenter.on("comment","moreComment",function(){e.renderMoreComment()},e)},render:function(e){var t=this,n=t.renderData(e);t.$list.append(n),0===n.length?eventCenter.trigger("comment-getmore","none"):n.length<10?eventCenter.trigger("comment-getmore","hide"):eventCenter.trigger("comment-getmore","show")},checkNewComment:function(){Service.checkNewCom(function(e){eventCenter.trigger("comment-new-hint","newComment",e)})},renderNewComment:function(e){var t=this,n=t.getCommentData(0),r=t.$list.find(".j_comment_item").eq(0);Service.getCom(n,function(n){e();var i=t.renderData(n);r.before(i)})},renderMoreComment:function(){var e=this,t=e.getCommentData(1);Service.getCom(t,function(t){e.render(t)})},getCommentData:function(e){var t=this.$list.find(".j_comment_item"),n=t.eq(e?t.length-1:0),r=e?0:1,i={cursor:n.data().create_time,new_comment:r};return i},renderData:function(e){for(var t=[],n=e.user_id,r=e.data,i=0;i<r.length;i++){var m=r[i],o=this.processData(m,n),a=$(comment_item(o));a.data({create_time:o.create_time,dongtai_id:o.dongtai_id,user_id:o.user.user_id,screen_name:o.user.screen_name}),Item.create({_$el:a,_data:o}),t.push(a)}return t},processData:function(e,t){var n=e.user.user_id;e.is_article_comment=n===t?!1:!0;var r=this.calculateTime(e.create_time);return e.display_time=r,e.is_raised=1===e.user_digg?!0:!1,e},calculateTime:function(e){var t=new Date,n=new Date(1e3*e),r=(t-n)/1e3,i=0,m="";return 60>=r?m="刚刚":r>60&&3600>=r?(i=Math.floor(r/60),m=i+"分钟前"):r>3600&&86400>r?(i=Math.floor(r/3600),m=i+"小时前"):m=n.m()+"-"+n.d()+":"+n.h()+"-"+n.M(),m}})});
;define("pagelet/comment_getmore/comment_getmore.js",function(e,o,n){var i=window.listener;n.exports=Pagelet.extend({el:"#comment-getmore",init:function(){this.$el=$(this.el),this.$click_for_more=this.$el.find(".click-for-more"),this.$loading_more=this.$el.find(".loading-more"),this.$no_more=this.$el.find(".no-more"),this.eventCenter(),this.initEvents()},eventCenter:function(){var e=this;i.on("comment-getmore","hide",function(){e.$el.hide()},e),i.on("comment-getmore","show",function(){e.$click_for_more.show(),e.$loading_more.hide(),e.$no_more.hide()},e),i.on("comment-getmore","none",function(){e.$click_for_more.hide(),e.$loading_more.hide(),e.$no_more.show()},e)},initEvents:function(){this.$el.on("click",".click-for-more",$.proxy(this.loadMoreComment,this))},loadMoreComment:function(){this.$click_for_more.hide(),this.$loading_more.show(),i.trigger("comment","moreComment")}})});
;define("pagelet/comment_new_hint/comment_new_hint.js",function(n,e,t){var i=window.listener;t.exports=Pagelet.extend({el:"#new-comment-hint",init:function(){this.$el=$(this.el),this.$new_comment_num=this.$el.find(".new-comment-num"),this.eventCenter(),this.initEvents()},eventCenter:function(){var n=this;i.on("comment-new-hint","newComment",function(e,t){n.$new_comment_num.text(t),n.$el.slideDown()},n)},initEvents:function(){this.$el.on("click",".new-comment-hint",$.proxy(this.showNewComment,this))},showNewComment:function(){}})});
;define("pagelet/comment_report/comment_report.js",function(t,e,i){var n=t("pagelet/comment_service/comment_service.js"),o=t("common/stip/stip.js"),r=window.listener;i.exports=Pagelet.extend({el:"#comment-report-modal",init:function(){this.$el=$(this.el),this.$other_reason=this.$el.find("#report-other-reason"),this.$textarea=this.$el.find("textarea"),this.eventCenter(),this.bindEvent(),this.commentData={}},eventCenter:function(){var t=this;r.on("comment-report","showReport",function(e,i){t.showModal(),t.commentData=i},t)},bindEvent:function(){var t=this;this.$el.on("click","input",function(e){var i=e.target.value;"0"===i?t.$textarea.show():t.$textarea.hide()}),this.$el.on("click",".confirm-report",$.proxy(this.reportComment,this)),this.$el.on("click",".close-dialog",$.proxy(this.hideModal,this))},reportComment:function(){var t=this,e=t.$el.find('input[name="report"]:checked');if(0===e.length)o.popupTip({msg:"请选择举报类型",status:!1});else{var i=e.val(),r="";if("0"===i&&(r=t.$textarea.val(),!r))return void o.popupTip({msg:"请填写举报内容",status:!1});var a={report_type:i,content:r,dongtai_id:t.commentData.dongtai_id,report_user_id:t.commentData.user_id};t.hideModal(),n.reportCom(a)}},showModal:function(){this.$el.fadeIn()},hideModal:function(){this.clearData(),this.$textarea.hide(),this.$el.fadeOut()},clearData:function(){var t=this.$el.find('input[name="report"]:checked'),e=this.$el.find('input[name="report"]');if(0===t.length)return!0;var i=t.val();i>0?e[i-1].checked=!1:e[e.length-1].checked=!1,this.$textarea.val("")}})});
;define("pagelet/complain/complain.js",function(t,a,e){var i=t("common/util/util.js");e.exports=Pagelet.extend({el:"#pagelet-complain",events:{"click $complain_submit":"onComplainSubmitClick","click $upload":"onUploadClick","change $upload":"onUploadChange"},init:function(t){this.complain_id=t.id,$(".complain_files").on("click",".file i",function(){var t=$(".file").length;$(this).parent().remove(),1==t&&$(".complain_files").hide()})},onComplainSubmitClick:function(){var t=$("#complain_text"),a=$.trim(t.val()),e=$("#agree_this");return a.length<10?(alert("请输入至少10个字以上的材料说明"),void t.focus()):e[0].checked?void this.complain_post():(alert('请勾选 "'+$(".agree_this").text()+'"'),void e.focus())},onUploadClick:function(t){var a=($(t.target),$(".file").length),e=5;return a==e?(alert("您最多只能上传 "+e+" 份材料"),void t.preventDefault()):void 0},onUploadChange:function(t){var a=$(t.target),e=/\.(jpg|png|jpeg)$/i;return e.test(a.val())?(this.upload_file(a.attr("id")),void this.toggleStatus()):(alert("请上传jpg、jpeg、png格式的文件"),void a.val(""))},upload_file:function(t){var a=this;$.ajaxFileUpload({url:"/api/storage_put/",secureuri:!1,fileElementId:t,dataType:"json",beforeSend:function(){},complete:function(){},success:function(t){"success"==t.message&&$(".complain_files").show().children("td:last-child").append('<div class="file"><a href="/api/storage_get/?sid='+i.e(t.sids[0])+'"  data-id="'+i.e(t.sids[0])+'" target="_blank">'+i.e(t.names[0])+'</a><i title="删除">x</i></div>'),$("#complain_upload").val(""),a.toggleStatus(!0)},error:function(){a.toggleStatus(!0)}})},toggleStatus:function(t){t?($(".upload").removeClass("uploading").children("span").text("上传文件"),$("#complain_upload").removeAttr("disabled")):($(".upload").addClass("uploading").children("span").text("上传中..."),$("#complain_upload").attr("disabled","disabled"))},complain_post:function(){{var t=$.trim($("#complain_text").val()),a=[],e=[];t.length}$(".file").each(function(){a.push($("a",$(this)).attr("data-id")),e.push($("a",$(this)).text())}),$.ajax({type:"POST",async:!0,url:"/api/report_and_complain_post/?"+Date.now(),data:{json_data:JSON.stringify({text:t,urls:a,names:e}),article_pgc_id:this.complain_id},dataType:"json"}).done(function(t){"success"==t.message?(alert("提交成功"),setTimeout(function(){location.href="/articles/"},500)):alert(t.reason)}).fail(function(){})}})});
;define("pagelet/content_chart/content_chart.js",function(t,e,n){var i=window.listener,o=(function(){var t=Array.prototype.indexOf;t||(Array.prototype.indexOf=function(t){for(var e=this,n=0;n<e.length;n++)if(e[n]==t)return n})}(),function(t,e){for(var n=new Date(t).getTime(),i=new Date(e).getTime(),o=n,a=[];i>=o;)a.push(new Date(o).format("date")),o+=864e5;return a});n.exports=Pagelet.extend({el:"#pagelet-content-chart",events:{},init:function(){this.dataInit(),this.eventCenter(),this.echarts=echarts.init(document.getElementById("chart_content")),this.bindEvent()},dataInit:function(){this.$el=$(this.el),this.$comment_count=this.$el.find(".j_comment"),this.$go_detail_count=this.$el.find(".j_read_amount"),this.$impression_count=this.$el.find(".j_recommend"),this.$repin_count=this.$el.find(".j_collection"),this.$share_count=this.$el.find(".j_forward"),this.$chart=this.$el.find(".j_chart"),this.$chart_title=this.$el.find(".j_chart_title"),this.setting={show:["impression_count","go_detail_count","comment_count","share_count","repin_count"],tip:{comment_count:"评论量",go_detail_count:"阅读量",impression_count:"推荐量",repin_count:"收藏量",share_count:"转发量"},dom:{comment_count:".j_comment",go_detail_count:".j_read_amount",impression_count:".j_recommend",repin_count:".j_collection",share_count:".j_forward"},color:{comment_count:"#ff9642",go_detail_count:"#7baaff",impression_count:"#ff635c",repin_count:"#3fcac2",share_count:"#78c83c"},data:{comment_count:[],go_detail_count:[],impression_count:[],repin_count:[],share_count:[]},startDate:"",endDate:""}},bindEvent:function(){var t,e=this.$chart,n=this.setting,i=this,o=n.show;e.on("click","input",function(){var e=$(this).attr("data");t=o.indexOf(e),this.checked?-1==t&&o.push(e):-1!=t&&o.splice(t,1),i.judgeDataType()?i.renderMulty():i.renderSingle()})},synData:function(t){if(t.origin.detail_list)for(var e in this.setting.data)this.setting.data[e]=t.origin.detail_list[e];this.setting.startDate=t.startDate,this.setting.endDate=t.endDate},eventCenter:function(){var t=this;i.on("content_chart","updateData",function(e,n){t.synData(n),t.judgeDataType()?(t.$chart_title.hide(),t.renderMulty()):(t.$chart_title.show(),t.renderSingle())},t)},judgeDataType:function(){var t=this.setting.data.comment_count.length;return t>1?!0:!1},renderSingle:function(){for(var t=this.setting,e=[],n=[],i=t.tip,o=t.show,a=0;a<o.length;a++)e.push(i[o[a]]),n.push(t.data[o[a]][0]);var s={color:["#ff635c"],grid:{show:!1},tooltip:{trigger:"axis"},calculable:!0,legend:{show:!1,data:["文章分析"]},xAxis:[{type:"category",data:e,axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!1},axisTick:{show:!1}}],yAxis:[{type:"value",name:"",min:0,axisLabel:{formatter:"{value}"},axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!0,lineStyle:{type:"dotted"}}}],series:[{name:"数量",type:"bar",barCategoryGap:"70%",data:n}]};this.echarts.setOption(s,!0)},renderMulty:function(){for(var t=this.setting,e=t.startDate,n=t.endDate,i=["impression_count","go_detail_count","comment_count","share_count","repin_count"],a=t.tip,s=(t.isFirseMulty,{}),r=t.color,c=o(e,n),l=[],h=[],d=[],u=0;u<i.length;u++)l.push(a[i[u]]),h.push(r[i[u]]),d.push({name:a[i[u]],type:"line",data:t.data[i[u]],itemStyle:{normal:{borderColor:r[i[u]]}},symbol:"circle"});s={"评论量":!1,"阅读量":!0,"推荐量":!0,"收藏量":!1,"转发量":!1};var _={title:{text:""},grid:{show:!1},color:h,tooltip:{trigger:"axis"},legend:{data:l,selected:s},xAxis:[{type:"category",boundaryGap:!0,axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},data:c,axisTick:{show:!1},splitLine:{show:!1}}],yAxis:[{type:"value",axisLabel:{formatter:"{value}"},axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!0,lineStyle:{type:"dotted"}}}],series:d};this.echarts.setOption(_,!0)}})});
;define("pagelet/content_detail_header/content_detail_header.js",function(t,e,a){var n=t("common/stip/stip.js"),s=t("common/daterange/daterange.js"),i=window.listener,d={content_article_stat:"/statistic/content_article_stat/",content_daily_stat:"/statistic/content_daily_stat/"};a.exports=Pagelet.extend({el:"#content_detail_header",events:{"click .j_sort_by_article":"loadByArticle","click .j_sort_by_date":"loadByDate"},init:function(){this.cacheInit(),this.dataInit(),this.eventInit(),this.requestUrl(),this.eventCenter()},cacheInit:function(){this.$el=$(this.el),this.$article=this.$el.find(".j_sort_by_article"),this.$dateBtn=this.$el.find(".j_sort_by_date")},eventCenter:function(){var t=this;i.on("content_detail_header","gotoPage",function(){t.requestUrl()})},dataInit:function(){var t=new Date;this.setting={type:"article",startDate:t.clone().d(-7).format("date"),endDate:t.clone().d(-1).format("date"),content:[],page:1,pageAll:1}},eventInit:function(){var t=this,e=this.setting;s({start_date:e.startDate,end_date:e.endDate,relative:0,days:"-1000",onchange:function(e){startDate=e.start_date,endDate=e.end_date,t.updateData(startDate,endDate)}})},updateData:function(t,e){var a=this.setting;a.startDate=t,a.endDate=e,a.page=1,this.requestUrl()},requestUrl:function(){var t=this,e=this.setting,a="article"==e.type?d.content_article_stat:d.content_daily_stat,s={start_date:e.startDate,end_date:e.endDate,pagenum:e.page};$.ajax({url:a,type:"GET",dataType:"json",data:s}).done(function(e){t.dataProcess(e)}).fail(function(){n.popupTip({msg:"网络错误，请稍后重试",status:!1})})},dataProcess:function(t){var e=this.setting;0==t.code||"success"==t.message?(e.content=t.data.data_list?t.data.data_list:[],e.page=t.data.pagenum,e.pageAll=t.data.total_pagenum,e.total_num=t.data.total_num?t.data.total_num:10*e.pageAll,this.updateDateInstance(t),i.trigger("content_detail_table","updateData",e)):n.popupTip({msg:t.message?t.message:"未知错误",status:!1})},updateDateInstance:function(t){var e=this.setting,a=this.$el,s=a.find("#daterange_start_date"),i=a.find("#daterange_end_date"),d=t.data.start_date==e.startDate;d||n.popupTip({msg:"仅支持360天以内的日期区间",status:!1}),e.startDate=t.data.start_date,e.endDate=t.data.end_date,s.val(e.startDate),i.val(e.endDate)},loadByArticle:function(){i.trigger("content_detail_table","showTip",{show:!0}),this.$article.addClass("active"),this.$dateBtn.removeClass("active"),this.setting.type="article",this.requestUrl()},loadByDate:function(){i.trigger("content_detail_table","showTip",{show:!1}),this.$article.removeClass("active"),this.$dateBtn.addClass("active"),this.setting.type="date",this.requestUrl()}})});
;define("pagelet/content_detail_table/content_detail_table.js",function(require,exports,module){var template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){if(__p+="","article"==type){__p+="\n	<table class='table_article'>\n			<thead>\n				<tr>\n					<th>标题</th>\n					<th>推荐量</th>\n					<th>阅读量</th>\n					<th>评论量</th>\n					<th>收藏量</th>\n					<th>转发量</th>\n				</tr>\n			</thead>\n			<tbody>\n				";for(var o in content)__p+="\n					<tr>\n						<td><a href='"+(null==(__t=content[o].link)?"":__t)+"'>"+(null==(__t=content[o].title)?"":_.escape(__t))+"</a></td>\n						<td>"+(null==(__t=content[o].impression_count)?"":__t)+"</td>\n						<td>"+(null==(__t=content[o].go_detail_count)?"":__t)+"</td>\n						<td>"+(null==(__t=content[o].comment_count)?"":__t)+"</td>\n						<td>"+(null==(__t=content[o].repin_count)?"":__t)+"</td>\n						<td>"+(null==(__t=content[o].share_count)?"":__t)+"</td>\n					</tr>\n				";__p+="\n			</tbody>\n	</table>\n"}else{__p+="\n	<table class='table_article'>\n				<thead>\n					<tr>\n						<th>时间</th>\n						<th>推荐量</th>\n						<th>阅读量</th>\n						<th>评论量</th>\n						<th>收藏量</th>\n						<th>转发量</th>\n					</tr>\n				</thead>\n				<tbody>\n					";for(var o in content)__p+="\n						<tr>\n							<td>"+(null==(__t=content[o].date)?"":_.escape(__t))+"</td>\n							<td>"+(null==(__t=content[o].impression_count)?"":__t)+"</td>\n							<td>"+(null==(__t=content[o].go_detail_count)?"":__t)+"</td>\n							<td>"+(null==(__t=content[o].comment_count)?"":__t)+"</td>\n							<td>"+(null==(__t=content[o].repin_count)?"":__t)+"</td>\n							<td>"+(null==(__t=content[o].share_count)?"":__t)+"</td>\n						</tr>\n					";__p+="\n				</tbody>\n		</table>\n"}__p+="\n\n\n<div class ='pagination'>\n	  <a class='page j_page_pre' page=\""+(null==(__t=page-1)?"":__t)+"\">上一页</a>\n	  <a> <span>第</span><input type='text' class='pagination-input j_pagination_input' value='"+(null==(__t=0==pageAll?0:page)?"":__t)+"'><span>/"+(null==(__t=pageAll)?"":__t)+"页</span></a>\n	   <a class='page j_page_next' page='"+(null==(__t=page+1)?"":__t)+"'>下一页</a>\n</div>\n"}return __p},popTemplate=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+="<div class='modal-backdrop fade in j_pop_select_detail_back'></div>\n<div class='modal fade in pop_select_detail j_pop_select_detail' id='pop_select_detail'>\n	<div class='modal-dialog'>\n		<div class='modal-content'>\n			<div class='modal-body'>\n				<div class='title'>\n					选择文章\n				</div>\n				<div class='download_list j_download_list'>\n					\n				</div>\n\n				<div class='edit-btns'>\n					<button type=\"button\" class=\"edit-btn btn j_close_content_detail\">关闭</button>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>";return __p},detailTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="<ul>\n	";for(var i=1;i<Math.ceil(total_num/500)+1;i++)__p+="\n	<li><a target='_blank' href='/statistic/content_article_export/?start_date="+(null==(__t=startDate)?"":__t)+"&end_date="+(null==(__t=endDate)?"":__t)+"&pagenum="+(null==(__t=i)?"":__t)+"'>第"+(null==(__t=500*(i-1)+1)?"":__t)+"篇 - 第"+(null==(__t=500*i>total_num?total_num:500*i)?"":__t)+"篇</a></li>\n	";__p+="\n</ul>"}return __p},stip=require("common/stip/stip.js"),eventCenter=(require("common/popup/dialog.js"),window.listener),urls={content_article_export:"/statistic/content_article_export/",content_daily_export:"/statistic/content_daily_export/"};module.exports=Pagelet.extend({el:"#content_detail_table",events:{"click .j_export":"exportEvent"},init:function(){this.cacheInit(),this.dataInit(),this.eventInit(),this.eventCenter()},dataInit:function(){var t=new Date;this.setting={type:"article",startDate:t.clone().d(-1).format("date"),endDate:t.clone().d(-1).format("date"),content:[],page:1,pageAll:1}},cacheInit:function(){this.$el=$(this.el),this.$contentTable=this.$el.find(".j_content_table"),this.$exportButton=this.$el.find(".j_export"),this.$popDialog=$("#pop_select_detail"),this.$contentNote=this.$el.find(".j_content_note")},eventInit:function(){var t=this;this.$el.on("keyup",".j_pagination_input",function(n){13==n.which&&(isNaN($(this).val())||t.goToPage($(this).val()))}),this.$el.on("click",".j_page_next",function(){t.next()}),this.$el.on("click",".j_page_pre",function(){t.pre()}),$("body").on("click",".j_close_content_detail",function(){t.popHide()})},eventCenter:function(){var t=this;eventCenter.on("content_detail_table","updateData",function(n,e){t.setting=e,t.render()}),eventCenter.on("content_detail_table","showTip",function(n,e){e&&e.show?t.$contentNote.show():t.$contentNote.hide()})},exportEvent:function(){var t=this.setting,n=t.startDate,e=t.endDate;this.judgePopDialog()?this.popShow():"article"==t.type?this.exportByArticle(n,e,1):t.total_num>5e3?stip.popupTip({msg:"你选择的时间区间的文章数超过5000篇,请重新选择时间区域",status:!1}):this.exportByDate(n,e)},popShow:function(){console.log(this.setting);var t=this.setting,n=$("body"),e=n.find(".j_pop_select_detail_back"),i=e.find(".j_download_list"),_=n.find(".j_pop_select_detail");_.length?(_.show(),e.show(),i.show()):(n.append(popTemplate(t)),_=n.find(".j_pop_select_detail"),e=n.find(".j_pop_select_detail_back"),i=_.find(".j_download_list"),e.show(),_.show(),i.html(detailTemplate(t)))},popHide:function(){var t=$("body"),n=t.find(".j_pop_select_detail_back"),e=t.find(".j_pop_select_detail");e.length&&(e.hide(),n.hide())},exportByArticle:function(t,n,e){var i=urls.content_article_export+"?start_date="+t;i=i+"&end_date="+n,i=i+"&pagenum="+e,$("body").append('<iframe style="display:none" src="'+i+'"></iframe>')},exportByDate:function(t,n){var e=urls.content_daily_export+"?start_date="+t;e=e+"&end_date="+n,$("body").append('<iframe style="display:none" src="'+e+'"></iframe>')},judgePopDialog:function(){var t=this.setting,n="article"==t.type;return n=n&&t.total_num>500},goToPage:function(t){this.setting.page=t,eventCenter.trigger("content_detail_header","gotoPage",t)},next:function(){this.setting.page<this.setting.pageAll?(this.setting.page=this.setting.page+1,eventCenter.trigger("content_detail_header","gotoPage",this.setting.page)):stip.popupTip({msg:"已经是最后一页",status:!1})},pre:function(){this.setting.page>1?(this.setting.page=this.setting.page-1,eventCenter.trigger("content_detail_header","gotoPage",this.setting.page)):stip.popupTip({msg:"已经是第一页",status:!1})},render:function(){var t=template(this.setting);this.$contentTable.html(t)}})});
;define("pagelet/content_overview/content_overview.js",function(t,e,a){var n=t("common/stip/stip.js"),i=t("common/daterange/daterange.js"),s=window.listener,r="/statistic/content_overview/",o=function(t){var e=parseInt(t).toString(),a=e.split(""),n=[],i=a.length;if(isNaN(t))return t;if(1e7>t){for(var s=0;i>s;s++)(i-s)%3==0&&0!=s&&n.push(","),n.push(a[s]);return n.join("")}if(t>=1e7&&1e8>t){for(var s=0;i>s;s++)i-s>4&&((i-4-s)%3==0&&0!=s&&n.push(","),n.push(a[s]));return n.join("")+"万"}if(t>=1e8){for(var s=0;i>s;s++)i-s>8?((i-8-s)%3==0&&0!=s&&n.push(","),n.push(a[s])):i-s==8?(n.push("."),n.push(a[s])):i-s==7&&("0"==a[s]&&"0"==a[s-1]?(a.pop(),a.pop()):n.push(a[s]));return n.join("")+"亿"}};a.exports=Pagelet.extend({el:"#pagelet-content-overview",events:{},init:function(t){this.setting={startDate:"",endDate:"",data:{},origin:{}},this.cacheInit(),this.option=t,this.synData(),this.dateRangeInit()},cacheInit:function(){var t=this.$el=$(this.el);this.$recomend=t.find(".j_recommend"),this.$readAmount=t.find(".j_read_amount"),this.$comment=t.find(".j_comment"),this.$forward=t.find(".j_forward"),this.$collection=t.find(".j_collection")},synData:function(){{var t=this.option.startDate,e=this.option.endDate,a=this.setting,n=new Date;new Date}t&&(a.startDate=t),e&&(a.endDate=e),a.startDate||(a.startDate=n.clone().d(-1).format("date")),a.endDate||(a.endDate=n.clone().d(-1).format("date"))},dateRangeInit:function(){var t=this.setting,e=this,a=t.startDate,n=t.endDate;e.updateData(a,n),i({start_date:t.startDate,end_date:t.endDate,relative:0,days:"-1000",onchange:function(t){a=t.start_date,n=t.end_date,e.updateData(a,n)}})},updateData:function(t,e){var a=this.setting,i={},s=this;a.startDate=t,a.endDate=e,i.start_date=t,i.end_date=e,$.ajax({url:r,type:"GET",dataType:"json",data:i}).done(function(t){s.dataProcess(t)}).fail(function(){n.popupTip({msg:"网络错误，请稍后重试",status:!1})})},dataProcess:function(t){var e=this.setting;"success"==t.message?($.extend(e.data,t.data),$.extend(e.origin,t.data),this.updateDateInstance(),s.trigger("content_chart","updateData",e),this.numberParse(),this.renderData()):n.popupTip({msg:t.reason?t.reason:"未知错误",status:!1})},updateDateInstance:function(){var t=this.setting,e=this.$el,a=e.find("#daterange_start_date"),i=e.find("#daterange_end_date"),s=t.origin.start_date==t.startDate;s||n.popupTip({msg:"仅支持360天以内的日期区间",status:!1}),t.startDate=t.origin.start_date,t.endDate=t.origin.end_date,a.val(t.startDate),i.val(t.endDate)},numberParse:function(){var t=this.setting,e=t.data;for(var a in e)"object"!=typeof e[a]&&(e[a]=o(e[a]))},renderData:function(){var t=this.$recomend,e=this.$readAmount,a=this.$comment,n=this.$forward,i=this.$collection,s=this.setting.origin,r={impression_count:t,go_detail_count:e,share_count:n,comment_count:a,repin_count:i};for(var o in r)this.renderCountProcess(r[o],s[o])},renderCountProcess:function(t,e){var a,n,i=t.html();i=isNaN(i)?0:parseInt(i),a=i,n=parseInt((e-i)/10),0==n&&(n=1);var s=setInterval(function(){e>a?(a+=n,t.html(o(a))):(t.html(o(e)),clearInterval(s))},100)}})});
;define("pagelet/donate_history/donate_history.js",function(e){var n=e("common/util/util.js"),t=e("pagelet/pager/pager.js");return function(e){t({jele:$(".pager"),length:e.total_pagenum,index:e.pagenum-1,render:function(e,t,a,o){o||(window.location="?"+$.param($.extend({},n.GET,{pagenum:e+1})))}})}});
;define("pagelet/donate_report/donate_report.js",function(t,e,a){var i=t("common/util/util.js"),n=t("pagelet/daterange/daterange.js");a.exports=Pagelet.extend({el:"#pagelet-donate_report",init:function(t){this.start_date=t.start_date,this.end_date=t.end_date,this.year=t.year-0,this.month=t.month-1,this.day=t.day-0,this.income_list=t.income_list,this.$ad_trend_con=$("#ad-trend-con"),n({start_date:t.start_date,end_date:t.end_date,relative:-1,onchange:function(t){window.location="?"+$.param($.extend({},i.GET,t,{}))}}),this.hightchart()},hightchart:function(){var t=[],e=["#FF6F6F","#669CFF","#ff001a","#ffad00","#22c2af","#ae5d9d"];t[0]={pointInterval:864e5,pointStart:Date.parseCN(this.start_date).t(),name:"赞赏收入",data:this.income_list},this.$ad_trend_con.highcharts({chart:{height:350},title:{text:null},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%m/%e"}},colors:e,yAxis:{title:{text:""},min:0,minTickInterval:null,plotLines:[{value:0,width:1,color:"#808080"}],allowDecimals:!1,tickPixelInterval:30,gridLineWidth:0},legend:{layout:"vertical",align:"right",verticalAlign:"middle",borderWidth:0},plotOptions:{spline:{lineWidth:1.5,states:{hover:{lineWidth:2}}},series:{marker:{radius:3,symbol:"circle"}}},tooltip:{xDateFormat:"%Y-%m-%d",shared:!0},series:t})}})});
;define("pagelet/double_title/title.js",function(t,e,i){var s=(t("common/stip/stip.js"),t("pagelet/popalert/popalert.js"));i.exports=function(t){function e(){i.checkbox(),l.is_abtest&&(i.checkbox(!0),i.addClass("disabled"),a.show().val(l.slave_title)),i.change(function(){l.is_abtest?(l.is_abtest=0,a.hide()):t.debutData.isChecked?(l.is_abtest=1,a.show()):(s("alert","启用副标题必须先申请原创标签"),i.checkbox(!1))})}var i=$(".subtitle_label"),a=$(".j-subtitle_abtest_input"),l={};return l.isChecked=!1,t.$debutEvent.on("spec.init",function(t,i){l.slave_title=i.slave_title,l.slave_item_id=i.slave_item_id,l.is_abtest=i.has_slave_article,e(i)}),t.$debutEvent.on("cancel",function(){i.checkbox(!1),l.is_abtest=0,a.hide()}),l.validate=function(){return l.slave_title=a.val(),$.trim(l.slave_title)?!0:(s("alert","请填写副标题"),!1)},l}});
;define("pagelet/email_active_result/email_active_result.js",function(t){var e=t("common/util/util.js"),i=t("common/stip/stip.js");return function(t){$("#resend").click($.loadWrap(function(){return e.ajax(t.activate_url,{},function(t,e){i.alert(0==t?"成功发送激活邮件":e)})}))}});
;define("pagelet/exponential_history/exponential_history.js",function(e,t,a){var i=(e("common/stip/stip.js"),e("common/daterange/daterange.js")),n=window.listener,r=function(e,t){for(var a=new Date(e).getTime(),i=new Date(t).getTime(),n=a,r=[];i>=n;)r.push(new Date(n).format("date")),n+=864e5;return r};a.exports=Pagelet.extend({el:"#pagelet-exponential-history",init:function(){this._cacheInit(),this._dataInit(),this._eventCenter(),this._eventInit()},_cacheInit:function(){this.$el=$(this.el)},_dataInit:function(){var e=new Date;this.config={dataList:[],radarData:{},dateConfig:{start_date:e.clone().d(-7).format("date"),end_date:e.clone().d(-1).format("date"),radar_date:e.clone().d(-1).format("date")},isFirstRequest:1},this.echart=echarts.init(document.getElementById("exponential_history_line"))},_eventCenter:function(){var e=this;n.on("exponential_history","updateData",function(t,a){a&&(e.config=a,e._updateDateItem(a.dateConfig),a.dataList.length>1?e._renderLine():e._renderSingle())})},_eventInit:function(){var e,t,a=this.config;i({start_date:a.dateConfig.start_date,end_date:a.dateConfig.end_date,relative:0,days:"-1000",onchange:function(a){e=a.start_date,t=a.end_date,n.trigger("exponential_radar","updateDate",{start_date:e,end_date:t})}})},_updateDateItem:function(e){e.start_date&&this.$el.find(".daterange_start_date").val(e.start_date),e.start_date&&this.$el.find(".daterange_end_date").val(e.end_date)},_renderLine:function(){var e=["头条号指数","活跃度","健康度","专业度","原创度","互动度"],t={"活跃度":!1,"健康度":!1,"专业度":!1,"原创度":!1,"互动度":!1,"头条号指数":!0},a=[],i=[],n={total_score:[],freq_score:[],quality_score:[],stability_score:[],ori_score:[],interactive_score:[]},o={freq_score:"活跃度",quality_score:"健康度",stability_score:"专业度",ori_score:"原创度",interactive_score:"互动度",total_score:"头条号指数"},s={freq_score:"#ff9642",quality_score:"#7baaff",stability_score:"#ff635c",ori_score:"#3fcac2",interactive_score:"#78c83c",total_score:"#ff5f63"},d=this.config,c=d.dateConfig.start_date,l=d.dateConfig.end_date;a=r(c,l);for(var _ in n)for(var f=0;f<d.dataList.length;f++)n[_].push(d.dataList[f][_]);for(var h in n)i.push({name:o[h],type:"line",data:n[h],symbol:"circle",itemStyle:{normal:{borderColor:s[h]}}});var p={title:{text:""},grid:{show:!1},color:["#ff5f63","#7baaff","#ff9642","#78c83c","#3fcac2","#3fdc26"],tooltip:{trigger:"axis"},legend:{data:e,selected:t},xAxis:[{type:"category",boundaryGap:!0,axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},data:a,axisTick:{show:!1},splitLine:{show:!1}}],yAxis:[{type:"value",axisLabel:{formatter:"{value}"},axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!0,lineStyle:{type:"dotted"}}}],series:i};this.echart.setOption(p,!0)},_renderSingle:function(){var e,t=this.config,a=(t.dateConfig.start_date,t.dateConfig.end_date,["活跃度","健康度","专业度","原创度","互动度"]),i=[];if(0!=t.dataList.length){e=t.dataList[0],i.push(e.freq_score),i.push(e.quality_score),i.push(e.stability_score),i.push(e.ori_score),i.push(e.interactive_score);var n={color:["#ff635c"],grid:{show:!1},tooltip:{trigger:"axis"},calculable:!0,legend:{show:!1,data:["头条号指数"]},xAxis:[{type:"category",data:a,axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!1},axisTick:{show:!1}}],yAxis:[{type:"value",name:"",min:0,axisLabel:{formatter:"{value}"},axisLine:{lineStyle:{color:"#e8e8e8",width:"1px"}},splitLine:{show:!0,lineStyle:{type:"dotted"}}}],series:[{name:"数量",type:"bar",barCategoryGap:"70%",data:i}]};this.echart.setOption(n,!0)}}})});
;define("pagelet/exponential_introduce/exponential_introduce.js",function(t,e,n){n.exports=Pagelet.extend({el:"#pagelet-exponential-introduce",init:function(){this._cacheInit(),this._eventInit()},_cacheInit:function(){this.$el=$(this.el)},_eventInit:function(){var t=this;this.$el.on("click",".j_tab",function(){var e=t.$el.find(".j_tab"),n=e.index($(this));t._swichTab($(this)),t._swichContentTab(n)})},_swichTab:function(t){var e=this.$el.find(".j_tab");e.removeClass("active"),t.addClass("active")},_swichContentTab:function(t){var e=this.$el.find(".j_content_tab");e.hide(),e.eq(t).show(300)}})});
;define("pagelet/exponential_radar/exponential_radar.js",function(t,e,a){var i=t("common/stip/stip.js"),n=window.listener,s="/statistic/recommend_factor/";a.exports=Pagelet.extend({el:"#pagelet-exponential-radar",init:function(){this._cacheInit(),this._dataInit(),this._httpRequest(),this._eventCenter()},_cacheInit:function(){this.$el=$(this.el),this.$scoreNode=this.$el.find(".j_exponential_rada_score"),this.echart=echarts.init(document.getElementById("exponential-radar-content")),this.$subNote=this.$el.find(".j_sub_note"),this.$nowTime=this.$el.find(".j_sub_time")},_dataInit:function(){var t=new Date;this.config={dataList:[],radarData:{},dateConfig:{start_date:t.clone().d(-7).format("date"),end_date:t.clone().d(-1).format("date"),radar_date:t.clone().d(-1).format("date")},isFirstRequest:1}},_httpRequest:function(){var t=this.config.dateConfig,e=this;$.ajax({url:s,type:"GET",dataType:"json",data:t}).done(function(t){e._tipControl(t.data.is_newest),e._processData(t)}).fail(function(){i.popupTip({msg:"网络错误，请稍后重试",status:!1})})},_processData:function(t){var e,a,s=this.config;t&&"success"==t.message?t.data&&(s.dateConfig.start_date=t.data.start_date,s.dateConfig.end_date=t.data.end_date,s.dataList=t.data.data,a=s.dataList.length,s.dataList.length&&(s.radarData=s.dataList[a-1]),n.trigger("exponential_history","updateData",s),this._renderRadar(),s.isFirstRequest&&(this._updateRadarTime(t.data.end_date),this.isFirstRequest=0)):(e=t.reason?t.reason:"服务端出现未知错误",i.popupTip({msg:e,status:!1}))},_eventCenter:function(){var t=this;n.on("exponential_radar","updateDate",function(e,a){t.config.dateConfig=a,t._httpRequest()})},_updateRadarTime:function(t){var e=this.$el.find(".j_exponential_radar_time");e.html(t)},_renderRadar:function(){for(var t=[],e=this.config.radarData,a=["freq_score","ori_score","quality_score","interactive_score","stability_score"],i=0;i<a.length;i++)t.push(e[a[i]].toFixed(1));var n={title:{text:"",subtext:""},color:["#ff5f63"],tooltip:{trigger:"axis"},legend:{orient:"vertical",x:"center",y:"bottom",data:["头条号指数"]},toolbox:{show:!1},polar:[{indicator:[{text:"活跃度",max:10,min:-2.7},{text:"原创度",max:10,min:-2.7},{text:"健康度",max:10,min:-2.7},{text:"互动度",max:10,min:-2.7},{text:"专业度",max:10,min:-2.7}],axisLine:{show:!1},splitArea:{show:!0}}],calculable:!0,series:[{name:"头条号指数",type:"radar",data:[{value:t,name:""}]}]};this.$scoreNode.html(e.total_score),this.echart.setOption(n,!0)},_tipControl:function(t){var e=!1;0===t&&(e=!0,this.$nowTime.text(this.convertTimeFormat())),this.$subNote.toggle(e)},convertTimeFormat:function(){var t=new Date,e=t.getFullYear(),a=t.getMonth()+1,i=t.getDate()-2,n=e+"/"+(a>9?a:"0"+a)+"/"+(i>9?i:"0"+i);return n}})});
;define("pagelet/fans1/fans1.js",function(e){var a=e("pagelet/pager/pager.js");$(function(){a({jele:$(".pager"),length:pageData.total_pagenum,index:pageData.pagenum-1,render:function(e,a,n,g){g||(window.location="?pagenum="+(e+1))}})})});
;define("pagelet/fans2/fans2.js",function(a){$(function(){function e(a){for(var e=[],n=0;n<a.length;n++){var t=a[n];e.push({name:t[0],value:t[1]})}return e}var n=a("common/schart/schart.js"),t=a("common/util/util.js"),s=a("common/stip/stip.js"),r=a("pagelet/pager/pager.js");s.slideTip($(".fans2_genderbar"));var p,l=e(pageData.province_list),o=$(".fans2_localchart");r({jele:$(".pager"),total:l.length,size:6,index:0,render:function(a,e,s){p&&p.remove();var r=l.slice(e,s);p=n.percent20(o,{cols:r});for(var c="",i=0;i<r.length;i++){var g=r[i];c+="<p><span>"+t.e(g.name)+"</span><span>"+t.e(g.value)+"%</span></p>"}$("#localtb").html(c)}});for(var c=e(pageData.age_list),i="",g=0;g<c.length;g++){var v=c[g];i+="<p><span>"+t.e(v.name)+"</span><span>"+t.e(v.value)+"%</span></p>"}n.percent20($(".fans2_agechart"),{cols:c}),$("#agetb").html(i)})});
;define("pagelet/figure/dataParser.js",function(require,exports,module){var templateEntry=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+="<div class ='figure-upload-bg'>\n</div>\n<div class = 'figure-upload-button-wrap'>\n	<div id='file_upload' class='figure-upload-button j_figure_upload_button'>选择图片</div>\n</div>\n<div class = 'figure-upload-note'>\n	图集功能使用须知：<br>\n1、图集支持绝大部分图片格式，大小不超过5M, 最长边不超过10000像素；<br>\n2、<span class='figure_red'>禁止使用图集模式发布文字类、统计图类、gif图、画质粗糙的视频截图</span>，该类文章将被退回且禁止修改并占据当天1篇的发文限额，建议使用文章模式发布；<br>\n3、涉及政治敏感、黄色暴力、血腥恐怖等图集，将被删除或不予推荐展示，且占据当天1篇的发文限额；<br>\n4、鼓励作者发布优质原创图集，包括但不限于图片故事、社会见闻、旅行记录、自然风光、城市掠影、历史照片、艺术摄影等优质内容；详见<a class='figure_red' href='\nhttp://toutiao.com/i6268419583481217538/'>图集内容规范</a>\n\n</div>\n";return __p},tempalteFigure=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";for(var o in gallery_info)__p+='\n<li id="gallery_'+(null==(__t=gallery_info[o].gallery_id)?"":__t)+'" class="gallery-item sclearfix">\n	<div class="gallery-sub-item gallery-no"></div>\n			<div class="gallery-sub-item gallery-img gallery-img-loading">\n				',gallery_info[o].url&&(__p+="\n					<img src='"+(null==(__t=gallery_info[o].url)?"":__t)+"' data-uri='"+(null==(__t=gallery_info[o].uri)?"":__t)+"' data-width='"+(null==(__t=gallery_info[o].width)?"":__t)+"' data-height='"+(null==(__t=gallery_info[o].height)?"":__t)+"'/>\n				"),__p+='\n				<div id="gallery-modify-'+(null==(__t=gallery_info[o].gallery_id)?"":__t)+'"></div>\n			</div>\n			<div class="gallery-sub-item gallery-txt">\n				<textarea class="new gallery-desc" maxlength="200" placeholder=\'图片说明（不超过200个字）\'>'+(null==(__t=gallery_info[o].desc?gallery_info[o].desc:"")?"":__t)+"</textarea>\n			</div>\n			<div class=\"gallery-sub-item gallery-action\">\n				<div class='gellery-button-list'>\n					<a class='modify-file' id='modify_file_"+(null==(__t=gallery_info[o].gallery_id)?"":__t)+'\' data-title=\'更换图片\'  title="更换图片"></a>\n					<a class="gallery-icon gallery-modify-icon" ></a>\n					<a class="gallery-icon gallery-del-icon" data-title=\'删除\' title="删除" data-instanceid="'+(null==(__t=gallery_info[o].gallery_id)?"":__t)+'"></a>\n					<a class="gallery-icon gallery-sort-icon" data-title=\'拖动排序\'  title="拖动排序"></a>\n				</div>\n			</div>\n\n	</li>\n';__p+=" "}return __p},postTemplate={title:"","abstract":"",content:"",authors:"",tag:"",self_appoint:0,save:0,pgc_id:"",video_vid:0,video_vu:"",video_vname:"",video_vposter:"",vids_to_del:[],show_ads:0,force_ads:2,urgent_push:0,subsidy:0,pgc_feed_covers:[],article_type:3},_parseGalleryId=function(e){var a=e.attr("id"),l=a.substr(8);return l},parseGalleryInfo=function(e,a){for(var l,t=[],r=a.find("li"),n=0;n<r.length;n++)l=e[_parseGalleryId(r.eq(n))],l.desc=$.trim(r.eq(n).find(".gallery-desc").val()),t.push(l);return t},parseContent=function(e){var a=JSON.stringify(e);return a="{!-- PGC_GALLERY:"+a+" --}"},parseItem=function(e){var a=tempalteFigure(e);return a},genrateRandomCode=function(){var e=parseInt((new Date).getTime()*Math.random());return e},galleryDataGenrate=function(e){for(var a,l=0;l<e.length;l++)a=genrateRandomCode(),e[l].gallery_id=a;return e};module.exports={postTemplate:postTemplate,parseContent:parseContent,parseItem:parseItem,templateEntry:templateEntry,tempalteFigure:tempalteFigure,galleryDataGenrate:galleryDataGenrate,genrateRandomCode:genrateRandomCode,parseGalleryInfo:parseGalleryInfo}});
;define("pagelet/figure/uploader.js",function(e,i,t){var a="/tools/upload_picture/",o="/static/uploadify/uploadify.swf",E="upfile",l="组图上传功能基于flash插件，在您的浏览器中未检测到相应的flash插件。",p="不会被添加到上传队列中",u="您一次上传的图片个数超过了上传队列最大限制，请确保每次批量上传图片数量少于 ",n={swf:o,uploader:a,fileObjName:E,buttonText:"上传图片",fileSizeLimit:"5MB",fileTypeExts:"*.gif; *.jpg; *.jpeg; *.png",method:"post",multi:!0,uploadLimit:999,queueSizeLimit:30,overrideEvents:[],removeCompleted:!0,preventCaching:!1,removeTimeout:1,onFallback:s,onSelectError:r,buttonClass:"upload_button_click"},f=function(){alert.apply(this,arguments)},s=function(){f(l)},r=function(e,i){switch(i){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:f(u+n.queueSizeLimit+"个");break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:f("文件："+e.name+" 超出了文件大小限制（"+n.fileSizeLimit+"），"+p);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:f("文件："+e.name+" 是空文件，"+p);break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:f("文件："+e.name+" 不在允许的图片类型范围（"+n.fileTypeExts+"），"+p)}};t.exports=function(e,i){"object"==typeof i&&$.extend(n,i),e.uploadify(n)}});
;define("pagelet/figure/service.js",function(e,t,n){var o="/edit_article_post/",i=e("common/popup/dialog.js"),r=(e("pagelet/figure/dataParser.js"),function(e){var t=$(".j_pagelet_figure"),n=t.find(".alert"),o=n.find("span");o.html(e),n.slideDown(),setTimeout(function(){n.slideUp()},3e3)}),c=function(e){return e.length<5||e.length>30?(r("标题长度应该在5-30字之间"),!1):!0},u=function(e){var t=!0;return t=t&&c(e.title),t&&e.gallery_info.length<3&&(r("请至少上传三张图片"),t=!1),t},a=function(e){var t=!0;return e.gallery_info.length<1&&(r("请至少上传一张图片我才能为您保存哦！"),t=!1),""==e.title&&(r("标题不能为空"),t=!1),t},s=function(e){var t=!1;for(var n in e)t=t||e[n].desc;return t},f=function(e){i({title:"未填写图片说明",content:"增加图片说明可获得更好的推荐效果和阅读体验",btns:["ok","cancel"],okExecute:function(){e&&e()},okTxt:"发布",cancelTxt:"返回"}).show()},l=function(e){"提交成功"==e.message?(r("提交成功"),setTimeout(function(){document.location.href="/"},1e3)):r(e.message)},g=function(e){"保存成功"==e.message?(r("保存成功"),setTimeout(function(){document.location.href="/"},1e3)):r(e.message)},m=function(){r("网络错误")},d=function(e,t,n){t.error=m,t.success=n?g:l,t.error=m,$.ajax(e,t)};n.exports={url:o,submitCheck:u,storeCheck:a,ajax:d,errorTip:r,dialog:f,checkFigureNote:s}});
;define("pagelet/tabNewGuide/tabNewGuide.js",function(e,o,i){var n,c,t="tab_new_quiz",a="tab_new_page",k=function(e,o){this.cookieName=e,n=$(o).find(".quiz_new"),c=$(o).find(".page_new")};k.prototype={newIconDisplay:function(){"1"==$.cookie(t)&&n.hide(),"1"==$.cookie(a)&&c.hide()},setCookie:function(){this.cookieName==t?($.cookie(t,"1"),n.hide()):this.cookieName==a&&($.cookie(a,"1"),c.hide())},checkCookie:function(){"1"!=$.cookie(t)&&n.show(),"1"!=$.cookie(a)&&c.show()}},i.exports=k});
;define("pagelet/figure/plus.js",function(){!function(n){n.fn.lightHover=function(){var i=n(this);return i.hover(function(){i.css({opacity:.8})},function(){i.css({opacity:1})}),i}}($)});
;define("pagelet/figure/figure.js",function(t,e,i){var l=t("pagelet/figure/uploader.js"),a=t("pagelet/figure/dataParser.js"),n=t("pagelet/figure/service.js"),o=t("common/util/util.js"),s=t("pagelet/tabNewGuide/tabNewGuide.js");t("pagelet/figure/plus.js"),t("common/stip/stip.js"),i.exports=Pagelet.extend({el:".j_pagelet_figure",init:function(t){var e;this.options=t,this.$el=$(this.el),this.$upload=this.$el.find(".j_figure_upload"),this.$itemWrap=this.$el.find(".j_pagelet_figure_image"),this.$itemList=this.$itemWrap.find(".j_pagelet_item_list"),this.$title=this.$el.find("#figure-title"),this.$titleNote=this.$el.find("#j_figure_text_input"),this.$radioAd=this.$el.find(".j_radio"),this.$cancel=this.$el.find("#cancel"),this.$submit=this.$el.find("#submit"),this.$store=this.$el.find("#store"),this.$tag=this.$el.find("#channel_tags"),this.noop=$.noop,this.postContent=a.postTemplate,e=this.postContent,e.pgc_id=t.pgc_id?t.pgc_id:"",e.content=t.content?t.content:"",e.title=t.title?t.title:"",e.gallery_info=t.gallery_info[0]?t.gallery_info[0].list:[],e.gallery_data={},this.hasShowGallery=e.gallery_info.length?!0:!1,this.fileNumber=0,this.galleryAmount=0,this.judgeStatus()?(this.renderGalleryTemplate(),this.$itemWrap.slideDown()):(this.renderEntryTemplate(),this.entryTemplateUploaderEvent()),this.dragModal(),this.bindTitleEnterEvent(),this.toggleAdEvent(),this.cancelGallery(),this.submitGallery(),this.storeGallery(),this.addGalleryUploaderEvent(),this.bindHover(),this.$el.hoverTitle();var i=$(".j_post_tabs"),l=new s("tab_new_page",i);l.checkCookie(),l.setCookie(),l.newIconDisplay()},bindHover:function(){var t=this.$el;t.find(".uploadify").lightHover()},judgeStatus:function(){var t=this.options;return t.type=t.pgc_id?1:0,t.type},renderEntryTemplate:function(){var t=a.templateEntry,e=t({}),i=(this.$el,this.$upload);i.append(e)},entryTemplateSlideUp:function(){var t=this.$upload;t.slideUp(function(){t.css({height:"1px",opacity:"0",display:"block","z-index":"-1",left:"-3000px",top:"-3000px",position:"absolute"})})},entryTemplateSlideDown:function(){var t=this.$upload;t.slideDown()},uploaderEvent:function(t,e,i,a,n,o,s){var r=this,d={};d.onUploadStart=function(t,i,l){e.call(r,t,i,l)},d.onUploadSuccess=function(t,e,l){i.call(r,t,e,l)},d.onUploadError=function(t,e){a&&a.call(r,t,e,n)},d.onSelect=function(t){o&&o.call(r,t)},s&&"object"==typeof s&&$.extend(d,s),l(t,d)},entryTemplateUploaderEvent:function(){var t=this.$el,e=t.find("#file_upload"),i=this.onAppendUploadSart,l=this.onUploadSuccess,a=this.selectEvent,n=this.handleUploadErrorGallery;this.uploaderEvent(e,i,l,n,!1,a,{width:"140",height:"40"})},selectEvent:function(){this.fileNumber=this.fileNumber+1},addGalleryUploaderEvent:function(){var t=this.$el,e=t.find("#addButton"),i=this.onAppendUploadSart,l=this.onUploadSuccess,a=this.handleUploadErrorGallery;this.uploaderEvent(e,i,l,a,!1,this.noop,{width:"75",height:"20"})},renderGalleryTemplate:function(){var t=this.postContent.gallery_info;t=a.galleryDataGenrate(t),this.appendGalleryView(t),this.appendGalleryModel(t),this.batchBindItemEvent(t)},appendGalleryModel:function(t){for(var e=this.postContent.gallery_data,i=0;i<t.length;i++)e[t[i].gallery_id]=t[i]},galleryTemplateSlideDown:function(){var t=this.$itemWrap;t.slideDown()},galleryTemplateSlideUp:function(){var t=this.$itemWrap;t.slideUp()},switchToGallery:function(){var t=this.$itemWrap;this.hasShowGallery=!0,this.entryTemplateSlideUp(),t.slideDown()},appendGalleryView:function(t){var e=this.$itemList;e.append(a.parseItem({gallery_info:t})),this.galleryAmount=this.galleryAmount+t.length,this.updateGalleryAmount()},updateGalleryView:function(t,e){var i,l,a='<img src="'+o.e(t.url)+'" data-uri="'+o.e(t.uri)+'" data-width="'+t.width+'" data-height="'+t.height+'" >',n=this.$itemList;i=n.find("#gallery_"+e),l=i.find(".gallery-img"),l.prepend(a),l.find("img")[0].onload=function(){l.removeClass("gallery-img-loading")},l.find("img")[0].onerror=function(){l.removeClass("gallery-img-loading")}},deleteGalleryView:function(t){var e,i=this.$itemList;e=i.find("#gallery_"+t),e.remove()},updateGalleryModel:function(t,e){var i=this.postContent.gallery_data,l=i.file_id;i[e]={url:t.url,uri:t.original,height:t.height,width:t.width,web_uri:t.original,url_pattern:"{{image_domain}}",file_id:l,gallery_id:e}},onAppendUploadSart:function(t){var e=this.hasShowGallery,i=a.genrateRandomCode(),l=this.postContent.gallery_data,n=[];!e&&this.switchToGallery(),n.push({gallery_id:i}),l[i]={file_id:t.id},this.appendGalleryView(n),this.bindItemEvent(i)},onModifyUploadStart:function(t,e,i,l){var a=this.postContent.gallery_data,n=a[l];n.last_file_id=n.file_id,n.file_id=t.id},handleUploadErrorGallery:function(t,e,i){var l,a=t.id,n=this.postContent.gallery_data;for(var o in n)if(a==n[o].file_id){l=o;break}i||(this.deleteGalleryView(l),delete n[l],this.galleryAmount--,this.updateGalleryAmount())},onUploadSuccess:function(t,e){var i,l=JSON.parse(e),a=(this.$upload,this.postContent.gallery_data),n=t.id;for(var o in a)if(n==a[o].file_id){i=o;break}this.fileNumber==this.galleryAmount&&delete this.fileNumber,this.updateGalleryView(l,i),this.updateGalleryModel(l,i)},updateGalleryAmount:function(){var t=this.$el,e=t.find("#addAmount"),i="已经添加"+this.galleryAmount+"张图片";e.html(i)},batchBindItemEvent:function(t){for(var e=(this.$itemList,0);e<t.length;e++)this.bindItemEvent(t[e].gallery_id),this.bindImageLoadEvent(t[e].gallery_id)},bindImageLoadEvent:function(t){var e=this.$itemList,i=e.find("#gallery_"+t),l=i.find(".gallery-img"),a=l.find("img")[0];a&&(a.onload=function(){l.removeClass("gallery-img-loading")},a.onerror=function(){$imageItem.removeClass("gallery-img-loading")})},bindItemEvent:function(t){var e,i=this.$itemList,l=i.find("#gallery_"+t),a=i.find("#modify_file_"+t),n=1==l.attr("event")?!0:!1,o=this,s=function(e,i,l){o.onModifyUploadStart(e,i,l,t)},r=function(t,e,i){l.attr("event","1"),o.onUploadSuccess(t,e,i)},d=o.handleUploadErrorGallery;n||(o.uploaderEvent(a,s,r,d,!0,o.noop,{width:"22",height:"30"}),o.bindItemDelEvent(l,t),e=l.find(".uploadify"),e.attr("data-title","更换图片"))},bindItemDelEvent:function(t,e){var i=this.postContent.gallery_data,l=this;t.find(".gallery-del-icon").bind("click",function(){t.slideUp(),l.galleryAmount--,l.updateGalleryAmount(),setTimeout(function(){l.deleteGalleryView(e),delete i[e]},2e3)})},bindTitleEnterEvent:function(){var t,e,i=this.$title,l=this.$titleNote;i.keyup(function(){t=i.val(),e=t.length,l.html("（剩余"+(30-e>0?30-e:0)+"个字）"),e>30&&i.val(t.substr(0,30))})},toggleAdEvent:function(){var t=this.$radioAd;t.bind("click",function(){t.hasClass("disabled")||t.toggleClass("checked")})},dragModal:function(){var t=this.$itemList;t.sortable({placeholder:"ui-state-highlight",disabled:!1,handle:".gallery-sort-icon"})},cancelGallery:function(){var t=this.$cancel;t.bind("click",function(){document.location.href="/"})},submitGallery:function(){var t,e,i=(n.submitCheck,this.$submit),l=this.$itemList,o=this.$title,s=this.$tag,r=this.$radioAd,d=this.postContent,h=this.postContent.gallery_data;i.bind("click",function(){t=a.parseGalleryInfo(h,l),e=a.parseContent({list:t}),d.title=o.val(),d.content=e,d.tag=s.val(),d.show_ads=r.hasClass("checked")?1:0,d.save=1,d.gallery_info=t,n.submitCheck(d)&&(n.checkFigureNote(t)?n.ajax(n.url,{method:"post",data:d}):n.dialog(function(){n.ajax(n.url,{method:"post",data:d})}))})},storeGallery:function(){var t,e,i=(n.submitCheck,this.$store),l=this.$itemList,o=this.$title,s=this.$tag,r=this.$radioAd,d=this.postContent,h=this.postContent.gallery_data,p=this;i.bind("click",function(){t=a.parseGalleryInfo(h,l),e=a.parseContent({list:t}),d.title=o.val(),d.content=e,d.tag=s.val(),d.show_ads=r.hasClass("checked")?1:0,d.save=0,d.gallery_info=t,n.storeCheck(d)&&p.postStore(d)})},postStore:function(t){n.ajax(n.url,{method:"post",data:t},"store")}})});
;define("pagelet/force_register/force_register.js",function(e,i,r){var t=e("pagelet/mobile_register/mobile_inherit.js");r.exports=Pagelet.extend($.extend(t,{action:{submit:"/bind_mobile/"},page:"force_register"}))});
;define("pagelet/forget/forget.js",function(o){var t=o("common/util/util.js"),e=o("common/stip/stip.js"),i=o("common/vali/vali.js"),a=o("pagelet/signform/field.js"),n=$("#pagelet_forget").nodes(),s=a.getEle("email",{label:"登录邮箱",hint:""});n.start.after(s.jbox);var l=i(s.jvali);n.submit.click($.loadDone(function(o){l(function(i,a,n){i?(o(),$("body").animate({scrollTop:a.offset().top-10},200,function(){a.focus()})):t.ajax("/forget_password/",n,function(t,i){o(),e.popupTip({status:0===t,msg:i})})})}))});
;define("pagelet/header/header.js",function(require,exports,module){var MESSAGE_LIST_TEMPLATE=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";var len=data.cnt;len>=5&&(len=5),__p+="\n";for(var i=0;len>i;i++){var item=data[i];__p+='\n	<li class="sys-msg-item">\n		<div class="sys-msg-info"><a class="sys-msg-viewer" href="/message/#message">'+(null==(__t=item.content)?"":_.escape(__t))+'</a>\n		</div>\n		<div class="sys-msg-time">'+(null==(__t=item.create_time)?"":_.escape(__t))+"</div>\n	</li>\n"}__p+="\n"}return __p};module.exports=Pagelet.extend({el:"#pagelet-header",events:{"click $sys_msg_inform":"onSysMsgInformClick","click $sys_msg_subscribe":"onSysMsgSubscribeClick","click $sys_msg_collect":"onSysMsgCollectClick","click $sys_msg_comment":"onSysMsgCommentClick","click $sys_msg_retransmit":"onSysMsgRetransmitClick","click .sys-msg-viewer":"onSysMsgViewerClick","mouseenter $sys_msg_wrapper":"onSysMsgWrapperMouseEnter","mouseleave $sys_msg_wrapper":"onSysMsgMouseLeave","click $sys_msg_wrapper":"onSysMsgWrapperClick","mouseenter $sys_msg_entity":"onSysMsgEntityMouseEnter","mouseleave $sys_msg_entity":"onSysMsgMouseLeave","click $sys_msg_entity":"onSysMsgEntityClick","click .sns_account":"forceStatic","click $sys_msg_close":"onSysMsgCloseClick"},init:function(t){var s=this;if(this.from_pgc=1,this.count=5,this.openMessagePanel=!1,this.max_cursor=0,this.improtantInformFlag=!1,this.oneday=864e5,this.onehour=36e5,this.oneminute=6e4,this.sys_local_timegap=!1,this.new_inform_num=$(this.el).find(".new_inform_num"),this.new_comment_num=$(this.el).find(".new_comment_num"),this.new_subscribe_num=$(this.el).find(".new_subscribe_num"),this.new_collect_num=$(this.el).find(".new_collect_num"),this.new_retransmit_num=$(this.el).find(".new_retransmit_num"),this.informNum=this.stringToNum(this.new_inform_num),this.commentNum=this.stringToNum(this.new_comment_num),this.subscribeNum=this.stringToNum(this.new_subscribe_num),this.collectNum=this.stringToNum(this.new_collect_num),this.retransmitNum=this.stringToNum(this.new_retransmit_num),this.typeArray=[2,4,5,6,43,72,84],t._sys_time&&t._local_time){var e=t._sys_time.split("-"),n=new Date(e[0],e[1]-1,e[2],e[3],e[4],e[5]).getTime();n&&(this.sys_local_timegap=n-t._local_time)}this.$dom.sys_msg_sum&&(this.getNewMessageCount(),this.showMsgSum(),this.toggleMsgNum(),this.getNewImprotantInformCount(),this.hashChange(),$(window).on("hashchange",this.hashChange.bind(s))),this.initHeaderNav()},onSysMsgEntityMouseEnter:function(){this.improtantInformFlag||this.$dom.sys_msg_wrapper.show()},onSysMsgMouseLeave:function(){this.openMessagePanel=!1,this.$dom.sys_msg_wrapper.hide()},onSysMsgEntityClick:function(){window.location.href="/message/#inform"},onSysMsgWrapperMouseEnter:function(){this.improtantInformFlag||(this.openMessagePanel=!0,this.$dom.sys_msg_wrapper.show())},onSysMsgWrapperClick:function(){this.openMessagePanel=!1,this.$dom.sys_msg_wrapper.hide()},getNewMessageCount:function(){var t={};$.ajax({url:"//toutiao.com/dongtai/notification/count/?include=2,43,4,5,6,72,84&detail=1",type:"GET",dataType:"jsonp",context:this,data:t,success:function(t){if("success"==t.message){var s=t.data.update_count;if(s>0){var e=t.data.detail_counts;this.parseObjectToNum(e),this.getHashVal(),this.informNum>99&&(this.informNum="99+"),this.subscribeNum>99&&(this.subscribeNum="99+"),this.collectNum>99&&(this.collectNum="99+"),this.commentNum>99&&(this.commentNum="99+"),this.retransmitNum>99&&(this.retransmitNum="99+"),this.new_inform_num.text(this.informNum),this.new_subscribe_num.text(this.subscribeNum),this.new_collect_num.text(this.collectNum),this.new_comment_num.text(this.commentNum),this.new_retransmit_num.text(this.retransmitNum),this.toggleMsgNum(),this.showMsgSum()}}}})},convertTimeFormat:function(t){var s=0;this.sys_local_timegap!==!1&&(s=(new Date).getTime()+this.sys_local_timegap);for(var e=0;e<t.length;e++){var n=new Date(1e3*t[e].create_time),i="",m=s-n;if(s&&m<this.oneday)switch(!0){case m<=this.oneminute:i="1分钟内";break;case m<this.onehour:i=parseInt(m/this.oneminute)+"分钟前";break;case m<this.oneday:i=parseInt(m/this.onehour)+"小时前"}else{var a=n.getFullYear(),o=n.getMonth()+1,r=n.getDate(),u=n.getHours(),h=n.getMinutes();i=a+"-"+(o>9?o:"0"+o)+"-"+(r>9?r:"0"+r)+" "+(u>9?u:"0"+u)+":"+(h>9?h:"0"+h)}t[e].create_time=i}},parseObjectToNum:function(t){var s=[];for(var e in t)s.push(parseInt(e));this.setAllTypeNumZero();for(var n=0,i=s.length;i>n;n++)this.parseTypeNum(t,s[n])},setAllTypeNumZero:function(){this.informNum=0,this.subscribeNum=0,this.collectNum=0,this.retransmitNum=0,this.commentNum=0},parseTypeNum:function(t,s){var e=0,n=this.typeArray;switch(s){case n[0]:e=t[n[0]],this.subscribeNum=parseInt(e),this.new_subscribe_num.attr("data-num",this.subscribeNum);break;case n[1]:e=t[n[1]],this.collectNum=parseInt(e),this.new_collect_num.attr("data-num",this.collectNum);break;case n[2]:e=t[n[2]],this.retransmitNum=parseInt(e),this.new_retransmit_num.attr("data-num",this.retransmitNum);break;case n[3]:e=t[n[3]],this.informNum+=parseInt(e),this.new_inform_num.attr("data-num",this.informNum);break;case n[4]:e=t[n[4]],this.commentNum=parseInt(e),this.new_comment_num.attr("data-num",this.commentNum);break;case n[5]:e=t[n[5]],this.informNum+=parseInt(e),this.new_inform_num.attr("data-num",this.informNum);break;case n[6]:e=t[n[6]],this.informNum+=parseInt(e),this.new_inform_num.attr("data-num",this.informNum);break;default:this.informNum=parseInt(e),this.new_inform_num.attr("data-num",this.informNum)}},getNewImprotantInformCount:function(){var t={};$.ajax({url:"//toutiao.com/dongtai/notification/count/?include=84&detail=1",type:"GET",dataType:"jsonp",context:this,data:t,success:function(t){if("success"==t.message){var s=t.data.update_count;s>0&&this.showImportantInformInfo(s)}}})},showImportantInformInfo:function(t){var s={count:this.count,from_pgc:this.from_pgc,reset_count:0};$.ajax({url:"//toutiao.com/dongtai/notification/list/?include=84",type:"GET",dataType:"jsonp",context:this,data:s,success:function(s){s=s||{},"success"===s.message&&(s.data.data.cnt=t,this.convertTimeFormat(s.data.data),this.$dom.sys_msg_impor_con.append(MESSAGE_LIST_TEMPLATE(s.data)),this.showMsgSum())},error:function(){}}),this.$dom.sys_msg_important_inform.addClass("sys-msg-important-show"),this.improtantInformFlag=!0,this.$dom.sys_msg_wrapper.hide(),this.showMsgSum()},getHashVal:function(){var t=location.hash;if("string"==typeof t&&0!=t.length&&"#"==t.substr(0,1))switch(t=t.substr(1)){case"inform":this.informNum=0,this.new_inform_num.attr("data-num",0);break;case"subscribe":this.subscribeNum=0,this.new_subscribe_num.attr("data-num",0);break;case"collect":this.collectNum=0,this.new_collect_num.attr("data-num",0);break;case"comment":this.commentNum=0,this.new_comment_num.attr("data-num",0);break;case"retransmit":this.retransmitNum=0,this.new_retransmit_num.attr("data-num",0);break;default:this.informNum=0,this.new_inform_num.attr("data-num",0)}},hashChange:function(){var t=location.hash;if("string"==typeof t&&0!=t.length){"#"==t.substr(0,1)&&(t=t.substr(1));var s={inform:"inform",subscribe:"subscribe",collect:"collect",retransmit:"retransmit",comment:"comment"};this.getHashVal(),t in s&&this.getNewMessageCount(),this.showMsgSum()}},toggleMsgNum:function(){this.showNum(this.new_inform_num),this.showNum(this.new_comment_num),this.showNum(this.new_subscribe_num),this.showNum(this.new_collect_num),this.showNum(this.new_retransmit_num)},showNum:function(t){var s=this.stringToNum(t);0==s?t.hide():t.text(s).show()},stringToNum:function(t){var s=t.text(),e=0;return e=0==s.length?0:s},showMsgSum:function(){var t=parseInt(this.new_retransmit_num.attr("data-num"))+parseInt(this.new_inform_num.attr("data-num"))+parseInt(this.new_comment_num.attr("data-num"))+parseInt(this.new_subscribe_num.attr("data-num"))+parseInt(this.new_collect_num.attr("data-num"));0!=t?(t>99&&(t="99+"),this.$dom.sys_msg_sum.text(t).show()):this.$dom.sys_msg_sum.hide()},onSysMsgInformClick:function(){this.informNum=0,this.new_inform_num.attr("data-num",0),this.showMsgSum(),this.new_inform_num.text(0),this.toggleMsgNum()},onSysMsgCommentClick:function(){this.commentNum=0,this.new_comment_num.attr("data-num",0),this.showMsgSum(),this.new_comment_num.text(0),this.toggleMsgNum()},onSysMsgSubscribeClick:function(){this.subscribeNum=0,this.new_subscribe_num.attr("data-num",0),this.showMsgSum(),this.new_subscribe_num.text(0),this.toggleMsgNum()},onSysMsgCollectClick:function(){this.collectNum=0,this.new_collect_num.attr("data-num",0),this.showMsgSum(),this.new_collect_num.text(0),this.toggleMsgNum()},onSysMsgRetransmitClick:function(){this.retransmitNum=0,this.new_retransmit_num.attr("data-num",0),this.showMsgSum(),this.new_retransmit_num.text(0),this.toggleMsgNum()},onSysMsgViewerClick:function(){this.$dom.sys_msg_important_inform.removeClass("sys-msg-important-show"),this.improtantInformFlag=!1},onSysMsgCloseClick:function(){this.improtantInformFlag&&(this.$dom.sys_msg_important_inform.removeClass("sys-msg-important-show"),this.improtantInformFlag=!1)},forceStatic:function(t){var s,e;try{"a"!=$(t.target)[0].tagName.toLocaleLowerCase()&&(s=$(t.target).closest("a"),e=s.find(".new_user_name"),"未激活用户"==e.html()&&t.preventDefault())}catch(t){}},initHeaderNav:function(){try{var t=$("#pagelet-header .user-panel"),s=t.find(".new_user_name");"未激活用户"==s.html()&&t.find(".authors_list").remove()}catch(e){}}})});
;define("pagelet/history/history.js",function(require,exports,module){var COMPLAIN_TEMPLATE=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){if(__p+='<span class="tab">申诉详情</span>\n<table class="appeal_tbl">\n	<tr>\n		<td>申诉说明</td>\n		<td>'+(null==(__t=text)?"":_.escape(__t))+"</td>\n	</tr>\n	<tr>\n		<td>申诉材料</td>\n		<td>\n		",urls.length){__p+="\n			";for(var i=0;i<urls.length;i++)__p+='\n		<a href="/api/storage_get/?sid='+(null==(__t=urls[i])?"":_.escape(__t))+'" title="'+(null==(__t=names[i])?"":_.escape(__t))+'" target="_blank">'+(null==(__t=names[i])?"":_.escape(__t))+"</a>\n			";__p+="\n		"}else __p+="\n		无\n		";__p+="\n		</td>\n	</tr>\n</table>"}return __p};module.exports=Pagelet.extend({el:"#pagelet-history",events:{"click $get_complain":"onGetComplainClick"},init:function(){$(".event_history").tooltip({selector:"[data-toggle=tooltip]",container:"body"})},onGetComplainClick:function(t){var e=$(t.target),n=e.data("id");$.ajax({type:"POST",async:!0,url:"/api/user_report_and_complain/?"+Date.now(),data:{id:n},dataType:"json"}).done(function(t){"success"==t.message?($(".appeal_info").html(COMPLAIN_TEMPLATE(JSON.parse(t.pgc_report_and_complain.content))).show(),$(document).scrollTop($(".event_history").offset().top+$(".event_history").height())):($(".appeal_info").hide(),alert(t.reason?t.reason:"查询过程遇到异常，请稍后再试"))}).fail(function(){$(".appeal_info").hide()})}})});
;define("pagelet/incubator/incubator.js",function(e){var n=e("common/vali/vali.js"),i=e("common/util/util.js"),t=e("common/stip/stip.js"),r=e("pagelet/signform/field.js"),a=e("pagelet/signform/simple/input2.whe"),l=e("pagelet/signform/simple/text2.whe"),u=$("#incubator_basic"),p=$("#incubator_project"),o=r([["input",{tpl:a,name:"user_name",require:!0,label:"联系人姓名"}],["input",{tpl:a,name:"mobile",require:!0,func:n.returnWrap(n.mobile),label:"联系人电话"}],["input",{tpl:a,name:"email",require:!0,func:n.returnWrap(n.email),label:"联系邮箱"}],["input",{tpl:a,name:"from_which",require:!0,label:"从哪里得知头条号创作空间",hint:"今日头条、头条号微信公众号等渠道"}],["input",{tpl:a,name:"station_num",require:!0,label:"所需工位数量"}],["input",{tpl:a,name:"project_name",require:!0,label:"项目名称",hint:"项目对外推广名、宣传名"}],["input",{tpl:a,name:"recommend_person",require:!1,label:"推荐人",hint:"无推荐人可不填"}]]),m=r([["input",{tpl:a,name:"online_time",require:!0,label:"项目上线时间",hint:"自媒体即为头条号、微信公众号等平台开通时间"}],["input",{tpl:a,name:"user_num",require:!0,label:"用户数",hint:"产品用户数；各媒体平台的粉丝数、关注数等"}],["input",{tpl:a,name:"platform",require:!1,label:"你们的作品发布在哪些平台上？",hint:"包括但不限于：头条号平台、微信公众平台、微博、视频网站、在线电台等"}],["input",{tpl:l,name:"operate",require:!1,label:"在各平台上的运营数据如何？",hint:"粉丝数、阅读量、播放量等"}],["input",{tpl:l,name:"masterpiece",require:!1,label:"列举你们最有代表性的作品",hint:"请尽可能提供作品名称、数据表现、链接等"}],["input",{tpl:l,name:"income",require:!0,label:"目前项目的收入及收入来源情况"}],["input",{tpl:l,name:"profit_model",require:!0,label:"计划如何发展用户及变现",hint:"你所计划的商业模式、盈利方式"}],["input",{tpl:l,name:"description",require:!0,label:"介绍一下你及你的团队",hint:"之前的学习经历、工作经历、创业经历、其他具有代表性的项目或作品等"}]]),c=function(){var e=["input",{tpl:a,name:"recommend_project",require:!0,label:"列举近期三个让你眼前一亮的新媒体相关项目"}],i=r([e,e,e]),t=$("<div>").append($($.map(i,function(e,n){return n>0&&e.jbox.find(".form2_dt").remove(),e.jbox.toArray()}))),l=n($($.map(i,function(e){return e.jvali[0]})));return t.data({vali_effect:$.noop,vali_name:"recommend_project",vali_func:function(e){l(function(n,i,t){n?e(n):e(null,JSON.stringify($.map(t,function(e){return e.value})))})}}),{jbox:t,jvali:t}}();m.push(c),u.append($($.map(o,function(e){return e.jbox[0]}))),p.append($($.map(m,function(e){return e.jbox[0]})));var f=n($($.map(o.concat(m),function(e){return e.jvali[0]})));$("#submit").click($.loadDone(function(e){f(function(n,r,a){return n?(e(),void $(window).scrollTop(r.offset().top-50)):void i.ajax("/space/incubator_apply/",a,function(n,i){return e(),0!=n?void t.alert(i):void t.popupTip({msg:"提交成功，我们会认真评审，10个工作日内将邮件告知您评审结果。",status:!0,callback:function(){window.location="/"}})})})}))});
;define("pagelet/infringement/form.js",function(require,exports,module){function render(e){var a=["投诉","申诉"][e],n=$("#pagelet_infringement");$("#infringement_form").html(formTpl({COMPLAIN_TEXT:a}));var t=n.nodes(),i=function(){var e={},a=t.tabs.find(".form1_checkbox"),n=t.arrowbar,i=n.children(),r=Tab(a,t.group.add(t.person),function(e){var a=r.tabs[e],t=a.offset();i.css("left",t.left-n.offset().left)}),l=[["media_name"],["company_name",{label:"名称",hint:"请填写权利人名称"}],["input",{name:"identity_number",label:"有效证件号",hint:"请填写有效营业执照或组织机构代码证"}],["license_uri",{name:"identity_uri",label:"有效证件扫描件",hint:"请上传营业执照或组织机构代码证清晰彩色原件扫描件或数码照"}],["location",{label:"通信地址"}],["input",{name:"street",label:"",hint:"请填写街道地址"}],["post_code"],["real_name",{label:"联系人"}],["mobile",{label:"联系人手机"}],["email",{hint:""}]],o=FieldFac(l);t.group.append($.map(o,function(e){return"street"===e.name&&e.jbox.removeClass("require"),e.jbox.toArray()})),e.group=Vali($($.map(o,function(e){return e.jvali[0]})));var l=[["media_name"],["company_name",{label:"姓名",hint:"请填写权利人姓名"}],["identity_number",{label:"身份证号"}],["identity_uri",{label:"身份证照片"}],["location",{label:"通信地址"}],["input",{name:"street",label:"",hint:"请填写街道地址"}],["post_code"],["mobile",{label:"手机号码"}],["email",{hint:""}]],c=FieldFac(l);return t.person.append($.map(c,function(e){return"street"===e.name&&e.jbox.removeClass("require"),e.jbox.toArray()})),e.person=Vali($($.map(c,function(e){return e.jvali[0]}))),setTimeout(function(){r("group"),r.pages.person.hide()},1),function(a){var n=e[r.currentValue];n(function(e,n,t){a.call(this,e,n,{tab:r.currentValue,data:t})})}}(),r=function(){var e={},n=t.agent_tabs.find(".form1_checkbox"),i=t.agent_arrowbar,r=i.children(),l=Tab(n,t.agent_group.add(t.agent_person),function(e){var a=l.tabs[e],n=a.offset();r.css("left",n.left-i.offset().left)}),o=[["company_name",{label:"名称",hint:"请填写代理人名称"}],["input",{name:"identity_number",label:"有效证件号",hint:"请填写有效营业执照或组织机构代码证"}],["license_uri",{name:"identity_uri",label:"有效证件扫描件",hint:"请上传营业执照或组织机构代码证清晰彩色原件扫描件或数码照"}],["location",{label:"通信地址"}],["input",{name:"street",label:"",hint:"请填写街道地址"}],["post_code"],["real_name",{label:"联系人"}],["mobile",{label:"联系人手机"}],["email",{hint:""}],["image",{label:"代理委托书",require:!0,hint:"请上传代理委托书<br/>委托书由提交者拟定，必须明确代理人及权利人全称/姓名、授权委托权限，并含有代理人及权利人的完整签章，能证明代理人有完整权限代表权利人实施本次"+a+"。"}]],c=FieldFac(o);t.agent_group.append($.map(c,function(e){return"street"===e.name&&e.jbox.removeClass("require"),e.jbox.toArray()})),e.group=Vali($($.map(c,function(e){return e.jvali[0]})));var o=[["company_name",{label:"姓名",hint:"请填写代理人姓名"}],["identity_number",{label:"身份证号"}],["identity_uri",{label:"身份证照片"}],["location",{label:"通信地址"}],["input",{name:"street",label:"",hint:"请填写街道地址"}],["post_code"],["mobile",{label:"手机号码"}],["email",{hint:""}],["image",{label:"代理委托书",hint:"请上传代理委托书<br/>委托书由提交者拟定，必须明确代理人及权利人全称/姓名、授权委托权限，并含有代理人及权利人的完整签章，能证明代理人有完整权限代表权利人实施本次"+a+"。"}]],s=FieldFac(o);return t.agent_person.append($.map(s,function(e){return"street"===e.name&&e.jbox.removeClass("require"),e.jbox.toArray()})),e.person=Vali($($.map(s,function(e){return e.jvali[0]}))),l("group"),t.agent_cb.change(function(){t.agent.toggle(t.agent_cb.checkbox())}).checkbox(),setTimeout(function(){l.pages.person.hide(),t.agent_cb.trigger("change")},1),function(a){if(t.agent_cb.checkbox()){var n=e[l.currentValue];n(function(e,n,t){a.call(this,e,n,{tab:l.currentValue,data:t})})}else a()}}(),l=function(){var e,n={},i=Tab($(),t.images_tabpages.children(),function(a){e.toggle("article_fake"===a)}),r=[["images",{name:"evidence_trademark_regis_uri",label:"商标注册书",hint:"商标被冒用，请上传企业名营业执照及商标注册书扫描件。"}],["images",{name:"evidence_business_license_uri",label:"营业执照",hint:"企业名称被冒用，请上传企业营业执照扫描件。"}],["images",{name:"evidence_identity_uri",label:"身份证",hint:"个人名称或头像被冒用，请上传个人手持身份证照片扫描件。"}],["images",{name:"evidence_other_uri",max:5,label:"其他",hint:"请上传可以证明"+a+"内容不实的证明材料。最多5张"}]],l=FieldFac(r);n.author_fake=Vali($($.map(l,function(e){return e.jvali[0]}))),i.pages.author_fake.append($.map(l,function(e){return e.jbox.toArray()}));var r=[["images",{name:"pub_evidence_uri",label:"出版证明材料",hint:"请上传原创文件的版权证明，如无版权证明的，请提供原创文章首次发表的截图或链接。"}],["images",{name:"regal_pub_pic_uri",label:"合法出版物照片",hint:"请上传可以证明"+a+"内容不实的证明材料。"}],["images",{name:"original_article_pic_uri",label:"原创文章截图",hint:"请上传原创文件的版权证明，如无版权证明的，请提供原创文章首次发表的截图或链接。"}],["images",{name:"evidence_other_uri",max:5,label:"其他",hint:"请上传可以证明"+a+"内容不实的证明材料。最多5张"}]],o=FieldFac.getEle("input",{name:"original_article_uri",label:"原创文章链接(选填)",hint:"请提供原创文章的链接。",require:!1,func:Vali.returnWrap(function(e){return Vali.url(e)})});e=o.jbox,t.proof.append(e);var l=FieldFac(r),c=$($.map(l,function(e){return e.jvali[0]}));n.article_fake=Vali(c.add(o.jvali)),i.pages.article_fake.append($.map(l,function(e){return e.jbox.toArray()}));var r=[["images",{name:"evidence_other_uri",max:5,label:"其他",hint:"请上传可以证明"+a+"内容不实的证明材料。最多5张"}]],l=FieldFac(r);return n.article_low=Vali($($.map(l,function(e){return e.jvali[0]}))),i.pages.article_low.append($.map(l,function(e){return e.jbox.toArray()})),i.pages.author_fake.hide(),i.pages.article_low.hide(),i.pages.article_fake.hide(),[function(e){var a=n[i.currentValue];a(function(a,n,t){e.call(this,a,n,{tab:i.currentValue,data:t})})},i]}(),o=l[0],c=l[1],s=function(){var e={},n=Tab(t.complain_tabs.children(),t.complain_tabpages.children(),function(e){c(e)}),i=[["id",{contentType:"author",max:1,name:"infringement_media_id",btn:"添加更多头条号",label:"侵权头条号"}],["text",{name:"desc",label:""+a+"描述"}]],r=FieldFac(i);e.author_fake=Vali($($.map(r,function(e){return e.jvali[0]}))),n.pages.author_fake.append($.map(r,function(e){return e.jbox.toArray()}));var i=[["id",{contentType:"article2",max:1,name:"infringement_article_uri",btn:"添加更多链接",label:"侵权文章链接"}],["text",{name:"desc",label:""+a+"描述"}]],r=FieldFac(i);e.article_fake=Vali($($.map(r,function(e){return e.jvali[0]}))),n.pages.article_fake.append($.map(r,function(e){return e.jbox.toArray()}));var i=[["id",{contentType:"article2",max:1,name:"infringement_article_uri",btn:"添加更多链接",label:"侵权文章链接"}],["text",{name:"desc",label:""+a+"描述"}]],r=FieldFac(i);return e.article_low=Vali($($.map(r,function(e){return e.jvali[0]}))),n.pages.article_low.append($.map(r,function(e){return e.jbox.toArray()})),n.pages.article_low.hide(),n.pages.article_fake.hide(),n("author_fake"),function(a){var t=e[n.currentValue];t(function(e,t,i){a.call(this,e,t,{tab:n.currentValue,data:i})})}}();t.submit.click($.loadDone(function(a){async.map([i,r,s,o],function(e,a){e(function(e,n,t){e?a([e,n]):a(null,t)})},function(n,t){if(a(),n)Stip.alert(n[0]),$("body").animate({scrollTop:n[1].offset().top});else{var i={},r=$.so(t[0].data);r.tab=t[0].tab;var l={person:1,group:2};if($.extend(i,{complaint_media_id:r.media_name.value,complaint_media_name:r.media_name.text,organization_type:l[r.tab],company_name:r.company_name,identity_number:r.identity_number,identity_uri:r.identity_uri,address:r.location.province_text+(r.location.city_text||"")+r.street,post_code:r.post_code,real_name:r.real_name,mobile:r.mobile,email:r.email}),t[1]){var o=$.so(t[1].data);o.tab=t[1].tab,$.extend(i,{agent:1,agent_organization_type:l[o.tab],agent_company_name:o.company_name,agent_identity_number:o.identity_number,agent_identity_uri:o.identity_uri,agent_address:o.location.province_text+(o.location.city_text||"")+o.street,agent_post_code:o.post_code,agent_real_name:o.real_name,agent_mobile:o.mobile,agent_email:o.email,agent_book_uri:o.image})}else i.agent=0;var c={author_fake:1,article_fake:2,article_low:3},s=$.so(t[2].data);s.tab=t[2].tab,s.infringement_media_id=s.infringement_media_id||[],s.infringement_article_uri=s.infringement_article_uri||[],$.extend(i,{infringement_type:c[s.tab],infringement_desc:s.desc,infringement_media_id:$.map(s.infringement_media_id,function(e){return e.value}),infringement_media_name:$.map(s.infringement_media_id,function(e){return e.text}),infringement_article_id:$.map(s.infringement_article_uri,function(e){return e.value}),infringement_article_uri:$.map(s.infringement_article_uri,function(e){return e.text})});var _=$.so(t[3].data);for(var d in _)i[d]="original_article_uri"===d?_[d]:$.map(_[d],function(e){return e.web_uri});i.complaint_type=e,mainTab("print",i)}})}))}var formTpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<table class="infringement_table">\n    <col class="signform_col_dt" />\n    <col class="signform_col_dd" />\n    <tr class="signform_item require">\n        <td class="signform_dt">权利人类型</td>\n        <td data-node="tabs" class="form1_checkboxtabs">\n            <span class="form1_checkbox" data-node="group_tab" data-tab="group">组织</span>\n            <span class="form1_checkbox" data-node="person_tab" data-tab="person">个人</span>\n        </td>\n    </tr>\n</table>\n<div class="infringement_case_tabs" data-node="arrowbar">\n    <div class="infringement_case_tab"></div>\n</div>\n\n<table class="infringement_table" data-tab="group" data-node="group">\n    <col class="signform_col_dt" />\n    <col class="signform_col_dd" />\n</table>\n<table class="infringement_table" data-tab="person" data-node="person">\n    <col class="signform_col_dt" />\n    <col class="signform_col_dd" />\n</table>\n<table class="infringement_table">\n    <col class="signform_col_dt" />\n    <col class="signform_col_dd" />\n    <tr class="signform_item">\n        <td class="signform_dt">是否为代理人</td>\n        <td>\n            <div class="form1_checkbox" data-node="agent_cb">我是代理人</div>\n        </td>\n    </tr>\n    <tr>\n        <td></td>\n        <td>\n            <div class="signform_hint">代理人：指经权利人合法授权的人。权利人委托代理人发出通知的，代理人必须提供权利人的委托书。代理人发出的每个不同的通知均需获得权利人的分别明确授权。</div>\n        </td>\n    </tr>\n</table>\n<div data-node="agent">\n    <table class="infringement_table">\n        <col class="signform_col_dt" />\n        <col class="signform_col_dd" />\n        <tr class="signform_item require">\n            <td class="signform_dt">代理人类型</td>\n            <td data-node="agent_tabs" class="form1_checkboxtabs">\n                <span class="form1_checkbox" data-node="group_tab" data-tab="group">组织</span>\n                <span class="form1_checkbox" data-node="person_tab" data-tab="person">个人</span>\n            </td>\n        </tr>\n    </table>\n    <div class="infringement_case_tabs" data-node="agent_arrowbar">\n        <div class="infringement_case_tab"></div>\n    </div>\n    <table class="infringement_table" data-tab="group" data-node="agent_group">\n        <col class="signform_col_dt" />\n        <col class="signform_col_dd" />\n    </table>\n    <table class="infringement_table" data-tab="person" data-node="agent_person">\n        <col class="signform_col_dt" />\n        <col class="signform_col_dd" />\n    </table>\n</div>\n<div class="page_tabs sclearfix">\n    <div class="page_tab selected">'+(null==(__t=obj.COMPLAIN_TEXT)?"":_.escape(__t))+'内容</div>\n</div>\n\n<table class="infringement_table">\n    <col class="signform_col_dt" />\n    <col class="signform_col_dd" />\n    <tr class="signform_item require">\n        <td class="signform_dt">'+(null==(__t=obj.COMPLAIN_TEXT)?"":_.escape(__t))+'分类</td>\n        <td>\n            <a href="#catinfo" role="button" data-toggle="modal" class="slink sright">填写说明</a>\n            <div data-node="complain_tabs" class="form1_checkboxtabs">\n                <span class="form1_checkbox" data-tab="author_fake">冒充他人</span>\n                <span class="form1_checkbox" data-tab="article_fake">文章抄袭</span>\n                <span class="form1_checkbox" data-tab="article_low">文章造谣诽谤</span>\n            </div>\n        </td>\n    </tr>\n</table>\n<div data-node="complain_tabpages">\n    <table class="infringement_table" data-tab="author_fake">\n        <col class="signform_col_dt" />\n        <col class="signform_col_dd" />\n    </table>\n    <table class="infringement_table" data-tab="article_fake">\n        <col class="signform_col_dt" />\n        <col class="signform_col_dd" />\n    </table>\n    <table class="infringement_table" data-tab="article_low">\n        <col class="signform_col_dt" />\n        <col class="signform_col_dd" />\n    </table>\n</div>\n\n<div class="page_tabs sclearfix">\n    <div class="page_tab selected">证明材料</div>\n</div>\n\n<table class="infringement_table infringement_proof" data-node="proof">\n    <col class="signform_col_dt" />\n    <col class="signform_col_dd" />\n    <tr>\n        <td class="signform_dt">有效证明材料<br>&nbsp;&nbsp;扫描件(选填)</td>\n        <td>\n            <div class="signform_hint">支持.jpg .jpeg .bmp .gif格式照片，大小不超过2M。</div>\n            <div data-node="images_tabpages">\n                <div data-tab="author_fake"></div>\n                <div data-tab="article_fake"></div>\n                <div data-tab="article_low"></div>\n            </div>\n        </td>\n    </tr>\n</table>\n<div class="infringement_submits">\n    <div class="widget_btn_ok infringement_submit" data-node="submit" ga="保存并下一步">保存并下一步</div>\n</div>';return __p},Tab=require("common/ui/tab.js"),Vali=require("common/vali/vali.js"),async=require("common/util/async.js"),Stip=require("common/stip/stip.js"),FieldFac=require("pagelet/signform/field.js");return function(){return{render:function(e){null!=e&&render(e)}}}});
;define("pagelet/infringement/text.js",function(n){var i=n("common/ui/tab.js");return function(n){var t=n.nodes();t.complain_btn.click(function(){mainTab("form",0)}),t.explain_btn.click(function(){mainTab("form",1)});var a=i(t.tabs.children("[data-tab]"),t.pages.children(),function(n){window.location.hash=n}),e=(window.location.hash||"").slice(1);return setTimeout(function(){t.pages.children().hide(),a(e||"complain")},1),{render:function(){}}}});
;define("pagelet/infringement/print.js",function(require,exports,module){var tpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="infringement_print_body">\n    <h3>头条号侵权投诉'+(null==(__t=["","反"][obj.complaint_type])?"":_.escape(__t))+'通知书</h3>\n    <table class="infringement_print_table">\n        <colgroup>\n            <col width="100"/>\n            <col width="80"/>\n            <col width="50"/>\n            <col width="100"/>\n            <col width="80"/>\n            <col width="80"/>\n            <col width="100"/>\n        </colgroup>\n        <tbody>\n            <tr>\n                <td rowspan="4">权利人</td>\n                <td>姓名/名称</td>\n                <td colspan="2">'+(null==(__t=obj.company_name)?"":_.escape(__t))+'</td>\n                <td>有效证件(复印件附后)</td>\n                <td colspan="2">'+(null==(__t=obj.identity_number)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td>通信地址</td>\n                <td colspan="3">'+(null==(__t=obj.address)?"":_.escape(__t))+"</td>\n                <td>邮编</td>\n                <td>"+(null==(__t=obj.post_code)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td>联系人</td>\n                <td colspan="2">'+(null==(__t=obj.real_name)?"":_.escape(__t))+'</td>\n                <td>电话</td>\n                <td colspan="2">'+(null==(__t=obj.mobile)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td>E-mail</td>\n                <td colspan="5">'+(null==(__t=obj.email)?"":_.escape(__t))+'</td>\n                <!-- <td>传真</td>\n                <td colspan="2"></td> -->\n            </tr>\n            ',obj.agent&&(__p+='\n            <tr>\n                <td rowspan="4">代理人</td>\n                <td>姓名/名称</td>\n                <td colspan="2">'+(null==(__t=obj.agent_company_name)?"":_.escape(__t))+'</td>\n                <td>有效证件(复印件附后)</td>\n                <td colspan="2">'+(null==(__t=obj.agent_identity_number)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td>通信地址</td>\n                <td colspan="3">'+(null==(__t=obj.agent_address)?"":_.escape(__t))+"</td>\n                <td>邮编</td>\n                <td>"+(null==(__t=obj.agent_post_code)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td>联系人</td>\n                <td colspan="2">'+(null==(__t=obj.agent_real_name)?"":_.escape(__t))+'</td>\n                <td>电话</td>\n                <td colspan="2">'+(null==(__t=obj.agent_mobile)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td>E-mail</td>\n                <td colspan="5">'+(null==(__t=obj.agent_email)?"":_.escape(__t))+"</td>\n            </tr>\n            "),__p+='\n            <tr>\n                <td>投诉公众帐号或文章链接</td>\n                <td colspan="6">\n                    '+(null==(__t=(obj.infringement_media_name||[]).join("，"))?"":_.escape(__t))+"\n                    "+(null==(__t=(obj.infringement_article_uri||[]).join("，"))?"":_.escape(__t))+'\n                </td>\n            </tr>\n            <tr>\n                <td colspan="2">投诉分类</td>\n                <td colspan="5">'+(null==(__t=["","冒充他人","文章抄袭","文章造谣诽谤"][obj.infringement_type])?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td colspan="2">投诉描述</td>\n                <td colspan="5">'+(null==(__t=obj.infringement_desc)?"":_.escape(__t))+'</td>\n            </tr>\n            <tr>\n                <td colspan="2">证明资料</td>\n                <td colspan="5">\n                ',obj.evidence_trademark_regis_uri&&(__p+="\n                    商标注册书,\n                "),__p+="\n                ",obj.evidence_business_license_uri&&(__p+="\n                    营业执照,\n                "),__p+="\n                ",obj.evidence_identity_uri&&(__p+="\n                    身份证,\n                "),__p+="\n                ",obj.pub_evidence_uri&&(__p+="\n                    出版证明材料,\n                "),__p+="\n                ",obj.regal_pub_pic_uri&&(__p+="\n                    合法出版物照片,\n                "),__p+="\n                ",obj.original_article_pic_uri&&(__p+="\n                    原创文章截图,\n                "),__p+="\n                ",obj.evidence_other_uri&&(__p+="\n                    其他\n                "),__p+='\n                </td>\n            </tr>\n            <tr>\n                <td colspan="2">保证声明</td>\n                <td colspan="5">\n                    <p>权利人及其代理人（统称为：声明人）诚意作如下保证声明：</p>\n                    <p>声明人在通知书中的陈述和提供的相关材料皆是真实、有效和合法的，并保证承担和赔偿头条号因根据声明人的通知书对相关帐号的处理而给头条号造成的任何损失，包括但不限于头条号因向被投诉方或用户赔偿而产生的损失及头条号名誉、商誉损害等。</p>\n                </td>\n            </tr>\n            <tr>\n                <td colspan="2">权利人(或其代理人)\n                    <br>签名(盖章)</td>\n                <td colspan="5">\n                    <br>\n                    <br>\n                    <br>\n                    <span class="sright">年&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;月&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日</span>\n                </td>\n            </tr>\n            <tr>\n                <td colspan="2">备注</td>\n                <td colspan="5">\n                    <br>\n                    <br>\n                    <br>\n                    <br>\n                    <br>\n                </td>\n            </tr>\n            <tr>\n                <td colspan="7">\n                    <strong>填写说明：</strong>\n                    <p>一、“权利人或代理人”，包含自然人、法人和其他组织。权利人：指拥有版权、商标权、专利权等合法权益的原始所有人，代理人：指经权利人合法授权的人。权利人委托代理人发出通知的，代理人必须提供权利人的委托书。代理人发出的每个不同的通知均需获得权利人的分别明确授权。</p>\n                    <p>二、“有效证件”，包括自然人的身份证、护照，法人的工商营业执照、登记证明或其他证明主体资格的合法、有效材料。填写有效证件号码需同时注明证件类型，并将证件的复印件作为本通知的附件一并提供。</p>\n                    <p>三、“投诉头条号”，是指权利人认为未经合法授权，侵犯权利人的合法权益的头条号。</p>\n                    <p>四、“投诉内容”，指权利人认为侵犯其合法权益的服务内容。</p>\n                    <p>五、“证明材料”，包括权利人拥有权利的权属证明材料（包括但不限于相关有权机构颁发的版权、商标权及专利权等登记证明及其他能证明权利人拥有相关权利的有效权属证明等）和被投诉方提供的服务构成侵权的证明（包括但不限于被投诉方提供的服务构成对权利人的版权、商标权或专利权等侵权的有效证明材料等）。填写证明材料应以附件的形式提供证明性文件的原件或复印件。</p>\n                    <p>六、“通知要求”，指发出本通知的一方向接受通知一方提出的需要履行的具体事项。包括要求对被投诉方提供的服务采取何种措施的要求，如保留或删除相关内容、封禁相关帐号等。</p>\n                    <p>七、“权利人或代理人签名（签章）”，指权利人合法、有效的签章（自然人应签名，法人应加盖相应公章或其他合法、有效签章）。</p>\n                    <p>八、权利人或代理人应该提供的材料一般应提供原件，不能提供原件的，应提供复印件，并在相应复印件上有权利人合法、有效的签章（自然人应签名，法人应加盖相应公章或其他合法、有效签章），若材料涉外的，应按照法律的规定进行公证转递，并同时提供相应的公证转递材料。</p>\n                </td>\n            </tr>\n        </tbody>\n    </table>\n</div>';return __p};return function(n){var t,_=n.nodes();return _.back.click(function(){mainTab("form")}),_.next.click(function(){mainTab("upload",t)}),{render:function(n){n&&(t=n,_.pos.html(tpl(t)))}}}});
;define("pagelet/infringement/upload.js",function(n){var i=n("common/vali/vali.js"),t=n("common/util/util.js"),e=n("common/stip/stip.js"),a=n("pagelet/signform/field.js");return function(n){var o,r=n.nodes(),c=a.getEle("image",{name:"complaint_notice_uri",label:"投诉通知书扫描件",hint:"投诉通知书请上传加盖公章或签名的《头条号投诉通知书》扫描件，表格中的内容不得修改"});r.start.after(c.jbox);var l=i(c.jvali);return r.back.click(function(){mainTab("print")}),r.submit.click($.loadDone(function(n){l(function(i,a,r){i?n():(r=$.so(r),$.extend(r,o),t.ajax("/infringement/infringement_post/",{json_data:JSON.stringify(r)},function(i,t){0===i?e.popupTip({status:!0,msg:"提交成功",duration:0,callback:function(){window.location="/infringement/history/?type="+r.complaint_type}}):(n(),e.alert(t))}))})})),{render:function(n){o=n,c.jvali.data("value","").trigger("change")}}}});
;define("pagelet/infringement/infringement.js",function(n){var e=n("common/ui/tab.js"),i={};i.text=n("pagelet/infringement/text.js"),i.form=n("pagelet/infringement/form.js"),i.print=n("pagelet/infringement/print.js"),i.upload=n("pagelet/infringement/upload.js");var t=$("#infringement_tabs"),r=e($(),t.children(),function(n){i[n].render.apply(null,[].slice.call(arguments,1)),$(window).scrollTop(0)});for(var a in i)i[a]=i[a](r.pages[a]);setTimeout(function(){t.children().hide(),r("text")},1),window.mainTab=r});
;define("pagelet/infringement_history/infringement_history.js",function(){});
;define("pagelet/list/list.js",function(require,exports,module){var Dialog=require("common/popup/dialog.js"),bdshare=require("common/util/bdshare.js"),util=require("common/util/util.js"),Stip=require("common/stip/stip.js"),popalert=require("pagelet/popalert/popalert.js"),videoposter=require("common/videoposter/videoposter.js"),ESSAY_LIST_API="/api/media_article_list/",LIST_TEMPLATE=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";for(var i=0;i<data.articles.length;i++){var item=data.articles[i];__p+='\n<div class="essay-item" data-id="'+(null==(__t=item.group_id)?"":_.escape(__t))+'" data-idd="'+(null==(__t=item.id)?"":_.escape(__t))+'" data-iid="'+(null==(__t=item.item_id)?"":_.escape(__t))+'" data-gid="'+(null==(__t=item.group_id)?"":_.escape(__t))+'" data-pid="'+(null==(__t=item.pgc_id)?"":_.escape(__t))+'">\n	<div class="essay-basic-info ',item.large_image_url&&(__p+="essay-show-image"),__p+='">\n		<div class="sclearfix">\n		<a class="essay-title" href="'+(null==(__t=item.article_url)?"":_.escape(__t))+'" target="_blank">'+(null==(__t=item.title)?"":_.escape(__t))+"</a>\n		</div>\n		",item.slave_title&&(__p+='\n		<span class="slave-title">'+(null==(__t=item.slave_title)?"":_.escape(__t))+'</span>\n		<span class="stip_hint" data-title="推荐：'+(null==(__t=item.slave_impression_count)?"":_.escape(__t))+"<br> 站内阅读："+(null==(__t=item.slave_go_detail_count-item.slave_external_visit_count)?"":_.escape(__t))+"<br/> 站外阅读："+(null==(__t=item.slave_external_visit_count)?"":_.escape(__t))+"<br>评论："+(null==(__t=item.slave_comment_count)?"":_.escape(__t))+"<br>转发："+(null==(__t=item.slave_share_count)?"":_.escape(__t))+'"></span>\n		'),__p+='\n		<div class="essay-static sclearfix">\n			',item.is_top_article&&(__p+='\n			<span class="essay-top" id="essay-top"></span>\n			'),__p+="\n			",item.was_recommended&&(__p+='\n				<span class="essay-recommended" id="essay-recommended"></span>\n			'),__p+="\n			",item.claim_origin&&(__p+='\n				<span class="essay-claim_origin" id="essay-claim_origin"></span>\n			'),__p+='\n\n\n			<span class="essay-type">\n				',item.article_category?__p+="\n					"+(null==(__t=item.article_category_cn)?"":_.escape(__t))+"\n				":(__p+="\n					",__p+=item.tag_name?""+(null==(__t=item.tag_name)?"":_.escape(__t)):"新闻",__p+="\n				"),__p+='\n			</span>\n\n			<span class="essay-time">'+(null==(__t=item.create_time2)?"":_.escape(__t))+'</span>\n			<span class="essay-status j_essay-status">'+(null==(__t=item.status_desc)?"":_.escape(__t))+"</span>\n			",!item.timer_status||"审核中"!==item.status_desc&&"定时发表中"!==item.status_desc&&"已发表"!==item.status_desc||(__p+='\n				<span class="essay-status">\n					<i class="essay-timer-icon j_essay_timer_icon" data-title="定时发表时间：<br/>'+(null==(__t=item.timer_time)?"":_.escape(__t))+'"></i>\n					',"定时发表中"===item.status_desc&&(__p+='\n						<a href="javascript:;" target="_self" class="essay-static-action j_essay_post_now" data-node="essayPostNow">立即发表</a>\n					'),__p+="\n				</span>\n			"),__p+='\n			<span class="essay-status">'+(null==(__t=2==item.push_status?"(已弹窗)":"")?"":_.escape(__t))+"</span>\n			",__p+="\n           ",1===item.spread_status?__p+='\n               <a href="http://ad.toutiao.com/ad/create_article/?from_pgc_groupid='+(null==(__t=item.group_id)?"":_.escape(__t))+'" target="_self" class="essay-static-action essay-link">推广</a>\n           ':2===item.spread_status&&(__p+='\n               <a href="http://ad.toutiao.com/ad/?qt=ad_id&q='+(null==(__t=item.ad_id)?"":_.escape(__t))+'" target="_self" class="essay-static-action essay-link">查看</a>\n			'),__p+="\n\n			",item.is_unpass&&item.confirm_reason&&(__p+='\n			<span class="essay-confirm-reason" title="'+(null==(__t=item.confirm_reason)?"":_.escape(__t))+'">'+(null==(__t=item.confirm_reason)?"":_.escape(__t))+"</span>\n			"),__p+="\n\n\n			",(item.is_passed||item.passed_modify_to_verify||1==obj.source_type)&&(__p+="\n				",item.can_user_modify&&(__p+='\n					<a href="/edit_article/?pgc_id='+(null==(__t=item.id)?"":_.escape(__t))+'" class="essay-static-action essay-modify after-pass-modify" data-node="essay_modify" data-passed="true"><i class="essay-modify-icon"  ga=\'列表页－修改\'></i>修改</a>\n				'),__p+="\n			"),__p+="\n\n			",(item.is_passed||1==obj.source_type)&&(__p+="\n				",item.is_top_article?__p+='\n				<a href="javascript:;" class="essay-static-action essay-cancel-top" data-node="essayCancelTop" data-gid="'+(null==(__t=item.group_id)?"":_.escape(__t))+"\" ga='取消顶置'>取消置顶</a>\n				":item.group_id&&(__p+='\n				<a href="javascript:;" class="essay-static-action essay-set-top" data-node="essaySetTop" data-gid="'+(null==(__t=item.group_id)?"":_.escape(__t))+'" data-pid="'+(null==(__t=item.id)?"":_.escape(__t))+'" data-tm="'+(null==(__t=item.create_time)?"":_.escape(__t))+"\" ga='列表页－顶置'>置顶</a>\n				"),__p+="\n			"),__p+="\n\n			",(item.is_passed||item.passed_modify_to_verify||1==obj.source_type||11==item.status)&&(__p+="\n				<div class='essay-static-action more-action-list j_more_action' data-node=\"more_action\">更多操作\n					<div class ='more-action-list-div'>\n						<ul class='more-action-list-ul j_more_action_ul' data-node='more_action_ul'>\n							",__p+=11==item.status?'\n								<li>\n									<a href="javascript:;" class="essay-static-action j_essay_node_action"  data-node="essay_recovery" can-modify="'+(null==(__t=item.can_user_modify)?"":_.escape(__t))+'" is-top="'+(null==(__t=item.is_top_article)?"":_.escape(__t))+'" can-top="'+(null==(__t=item.group_id)?"":_.escape(__t))+"\"  ga='列表页－恢复到主要'>恢复到主页</a>\n								</li>\n							":'\n								<li>\n									<a href="javascript:;" class="essay-static-action j_essay_node_action"  data-node="essay_rollback" can-modify="'+(null==(__t=item.can_user_modify)?"":_.escape(__t))+'" is-top="'+(null==(__t=item.is_top_article)?"":_.escape(__t))+'" can-top="'+(null==(__t=item.group_id)?"":_.escape(__t))+"\" ga='列表页－从主页撤回'>从主页撤回</a>\n								</li>\n							",__p+='\n							<li>\n								<a href="javascript:;" class="essay-static-action essay-delete ',item.can_user_del||(__p+=" disable-delete "),__p+=' j_more_essay_delete"  data-node="essay_delete" can-delete="'+(null==(__t=item.can_user_del)?"":__t)+'" data-passed="true" ga=\'列表页－删除\'>',item.can_user_del&&(__p+=' <i class="essay-delete-icon"></i> '),__p+="删除</a>\n							</li>\n\n						</ul>\n					</div>\n				</div>\n			"),__p+='\n\n\n\n		</div>\n		<ul class="essay-dynamic sclearfix">\n			',item.is_passed||item.passed_modify_to_verify||1==obj.source_type||11==item.status?(__p+='\n			<li><span data-num="'+(null==(__t=item.impression_count)?"":_.escape(__t))+'">推荐：'+(null==(__t=item.impression_count2)?"":_.escape(__t))+'</span></li>\n			<li><span data-num="'+(null==(__t=item.go_detail_count)?"":_.escape(__t))+'">阅读：'+(null==(__t=item.go_detail_count2)?"":_.escape(__t))+'</span><span class="stip_hint" data-title="站内阅读：'+(null==(__t=item.go_detail_count-item.external_visit_count)?"":_.escape(__t))+"<br/> 站外阅读："+(null==(__t=item.external_visit_count)?"":_.escape(__t))+'"></span></li>\n			',item.has_video&&(__p+='\n				<li><span data-num="'+(null==(__t=item.play_effective_count)?"":_.escape(__t))+'">播放：'+(null==(__t=item.play_effective_count)?"":_.escape(__t))+"</span></li>\n			"),__p+='\n			<li><span data-num="'+(null==(__t=item.comment_count)?"":_.escape(__t))+'">评论：'+(null==(__t=item.comment_count2)?"":_.escape(__t))+'</span></li>\n			<li><span class="essay-repin" data-num="'+(null==(__t=item.share_count)?"":_.escape(__t))+'" data-action="1">转发：'+(null==(__t=item.share_count2)?"":_.escape(__t))+'</span></li>\n			<li><span href="javascript:;" class="essay-fav" data-num="'+(null==(__t=item.favorite_count)?"":_.escape(__t))+'" data-action="2">收藏：'+(null==(__t=item.favorite_count2)?"":_.escape(__t))+'</span></li>\n			<li class="share">\n				<div class="sns-share">\n					<ul class="sns-share-con sclearfix" data-node="sns_share" data-url="'+(null==(__t=item.article_url)?"":_.escape(__t))+'" data-desc="来自头条 www.toutiao.com" data-text="【'+(null==(__t=item.title)?"":_.escape(__t))+'】（我在 @头条号 发了一篇文章）" ',item.large_image_url&&(__p+='data-pic="'+(null==(__t=item.large_image_url)?"":_.escape(__t))+'"'),__p+='>\n						<li><a href="javascript:;" class="sns-weibo" data-type="tsina" data-node="" title="分享到新浪微博" ga=\'列表页－分享到新浪\'></a></li>\n						<li><a href="javascript:;" class="sns-qzone" data-type="qzone" data-node="" title="分享到QQ空间" ga=\'列表页－分享到QQ\'></a></li>\n						<li><a href="javascript:;" class="sns-renren" data-type="renren" data-node="" title="分享到人人网" ga=\'列表页－分享到人人\'></a></li>\n					</ul>\n					<div class="sns-share-tri">\n						<i></i>\n					</div>\n				</div>\n				<a href="javascript:;" class="essay-share"><i class="essay-share-icon"></i>分享</a>\n			</li>\n			'):(__p+="\n				",item.can_user_modify&&(__p+='\n				<li><a href="/edit_article/?pgc_id='+(null==(__t=item.id)?"":_.escape(__t))+'" class="essay-modify" data-node="essay_modify" data-passed="false"><i class="essay-modify-icon"></i>修改</a></li>\n				'),__p+="\n				",item.can_user_del&&11!=item.status&&(__p+='\n					<li><a href="javascript:;" class="essay-delete"  data-node="essay_delete" data-passed="false" ga=\'列表页－删除\' ',item.is_draft&&(__p+=" data-draft='true'"),__p+='><i class="essay-delete-icon"></i>删除</a></li>\n				'),__p+="\n				",item.can_user_complain&&(__p+='\n			<li><a href="/user_complain/?pgc_id='+(null==(__t=item.id)?"":_.escape(__t))+'" class="essay-complain"  target="_blank" ga=\'列表页－申诉\'><i class="essay-complain-icon"></i>申诉</a></li>\n				'),__p+="\n			"),__p+="\n		</ul>\n		",item.claim_origin&&(__p+='\n		<ul class="essay-dynamic sclearfix">\n			<li>疑似被转载次数：<a href="/article/get_dup_article/?pgc_id='+(null==(__t=item.id)?"":_.escape(__t))+'" class="slink" data-node="essay_dup"  ga=\'列表页－抄袭文章管理\'>'+(null==(__t=item.dup_num)?"":_.escape(__t))+"次</a></li>\n		</ul>\n		"),__p+="\n		",item.large_image_url&&(__p+='\n		<div class="essay-image">\n			<a href="'+(null==(__t=item.article_url)?"":_.escape(__t))+'" target="_blank"><img src="'+(null==(__t=item.large_image_url)?"":_.escape(__t))+'">',item.has_video&&(__p+='<i class="video-icon"></i>'),__p+="</a>\n			",item.can_modify_video_cover&&(__p+='\n			<div class="modify-vposter" data-node="modify_vposter" data-id="'+(null==(__t=item.id)?"":_.escape(__t))+'" ga="2视频封面-列表">修改视频封面</div>\n			'),__p+="\n		</div>\n		"),__p+="\n	</div>\n	";var group_id=item.group_id,cmt=data.cmt_info[group_id];if(cmt&&cmt.comments.length&&item.is_key_item){var comments=cmt.comments,has_more=cmt.has_more;__p+='\n	<div class="essay-comments">\n		<span class="essay-comments-tag">热门评论</span>\n		<ul class="essay-comments-con">\n			';for(var j=0;j<comments.length;j++){var cid=comments[j].id,cn=encodeURIComponent(comments[j].user_name),ct=encodeURIComponent(comments[j].text);__p+='\n			<li><div><a class="essay-comments-author" href="http://web.toutiao.com/user/'+(null==(__t=comments[j].user_id)?"":_.escape(__t))+'/updates/" target="_blank">'+(null==(__t=comments[j].user_name)?"":_.escape(__t)),comments[j].user_verified&&(__p+="<i>V</i>"),__p+='</a>:<span class="essay-comments-txt">'+(null==(__t=comments[j].text)?"":_.escape(__t))+"</span></div>",0==obj.source_type&&(__p+='<a href="'+(null==(__t=item.article_url)?"":_.escape(__t))+"?cid="+(null==(__t=cid)?"":_.escape(__t))+"&cn="+(null==(__t=cn)?"":_.escape(__t))+"&ct="+(null==(__t=ct)?"":_.escape(__t))+'#comments-anchor" class="essay-comments-reply" target="_blank" ga=\'列表页－回复评论\'>回复</a>'),__p+="</li>\n			"}__p+="\n		</ul>\n		",has_more&&0==obj.source_type&&(__p+='\n		<a class="essay-comments-more" href="'+(null==(__t=item.article_url)?"":_.escape(__t))+'#comments-anchor" target="_blank" ga=\'列表页－查看更多精彩评论\'>查看更多精彩评论</a>\n		'),__p+="\n	</div>\n	"}__p+="\n</div>\n"}__p+="\n"}return __p},LOAD_HEIGHT=750,INTERACTIVE_TEMPLATE='<div class="interactive-users"><ul class="interactive-users-con users-loading sclearfix"></ul><i></i></div>',USER_TEMPLATE='<li><a href="http://web.toutiao.com/user/{{user_id}}/updates/" target="_blank" title="{{screen_name}}的主页"><img src="{{avatar_url}}"></a></li>',MORE_TEMPLATE='<li><a  class="interactive-users-more" href="http://web.toutiao.com/a{{group_id}}/#comments-anchor" title="查看更多" target="_blank">...</a></li>',ANONYMOUS_TMP1='<li class="anonymous-users">和{{num}}位未登录用户</li>',ANONYMOUS_TMP2='<li class="anonymous-users">文章被{{num}}位未登录用户{{action}}</li>',server_error="服务异常，请稍后再试";module.exports=Pagelet.extend({el:"#pagelet-list",events:{"click $essay_repin":"onRepinClick","click $essay_fav":"onFavClick","click $list_all":"onAllClick","click $list_passed":"onPassedClick","click $list_unpassed":"onUnpassedClick","click $list_draft":"onDraftClick","click $list_hide":"onHideClick","click $essay_delete":"onDelete","click $essay_modify":"onModify","click $sns_share":"onSnsShare","click $essaySetTop":"onEssaySetTop","click $essayCancelTop":"onEssayCancelTop","click $modify_vposter":"onModifyVPoster","click $essay_recovery":"onRecovery","click $essay_rollback":"onRollback","click $essayPostNow":"onPostNow"},init:function(e){var t=this;this.$win=$(window),this.$doc=$(document),this.spec=e,this.media_type=e.media_type||0,this.loading=!1,this.firstPage=!0,this.hasmore=!0,this.scrollTimer="",this.count=e.count||10,this.source_type=e.source_type||0,this.status=e.status||"all",this.curMaxTime=e.from_time||0,this.curItemId=0,this.can_urgent_push=e.can_urgent_push||0,this.urgent_push_remain_times=e.urgent_push_remain_times||0,this.$push_modal=$("#push-modal"),this.$push_remain=$(".push-remain"),this.curPushId=0,this.top_group_id=+e.top_group_id||0,this.$win.on("scroll",$.proxy(this.onWinScroll,this)),this.$dom.essay_loadmore.show(),this.getArticleList(function(){$(function(){window.scrollTo(0,0)});var e=t.$win.scrollTop(),a=t.$doc.height(),s=t.$win.height();LOAD_HEIGHT>a-e-s&&t.getArticleList()})},render:function(e){var t=$(LIST_TEMPLATE(e));t.find(".stip_hint").hoverTip(),t.find(".j_essay_timer_icon").hoverTip(),this.$dom.essayBox.append(t)},getArticleList:function(e){if(!this.loading){this.loading=!0;var t={count:this.count,source_type:this.source_type,status:this.status,from_time:this.curMaxTime,item_id:this.curItemId,flag:this.firstPage?2:1};$.ajax({url:ESSAY_LIST_API,type:"GET",dataType:"json",context:this,data:t,success:function(t){if(this.$dom.essay_loadmore.hide(),this.loading=!1,t=t||{},"success"===t.message){var a=t.data.articles,s=a.length,i=t.data.last_time;if(0==s)return this.firstPage?this.$dom.essay_none.show():this.$dom.essay_nomore.show(),void(this.hasmore=!1);this.firstPage=!1,this.curMaxTime=i,this.curItemId=a[s-1].id,this.article_data_adjust(t),t.media_type=this.media_type,t.source_type=this.source_type,t.can_urgent_push=this.can_urgent_push,this.render(t),"function"==typeof e&&e()}},error:function(){this.$dom.essay_loadmore.hide(),this.loading=!1}})}},article_data_adjust:function(e){for(var t=e.data.articles,a=0;a<t.length;a++){var s=new Date(1e3*t[a].create_time),i=s.getFullYear(),_=s.getMonth()+1,n=s.getDate(),o=s.getHours(),l=s.getMinutes();t[a].create_time2=i+"-"+(_>9?_:"0"+_)+"-"+(n>9?n:"0"+n)+" "+(o>9?o:"0"+o)+":"+(l>9?l:"0"+l),t[a].impression_count2=this.convertNumberFormat(t[a].impression_count),t[a].go_detail_count2=this.convertNumberFormat(t[a].go_detail_count),t[a].comment_count2=this.convertNumberFormat(t[a].comment_count),t[a].share_count2=this.convertNumberFormat(t[a].share_count),t[a].favorite_count2=this.convertNumberFormat(t[a].favorite_count),t[a].play_effective_count=this.convertNumberFormat(t[a].play_effective_count)}},convertNumberFormat:function(e){var t=1e4;return"number"==typeof e?e>=t?(e/t).toFixed(1)+"万":e:void 0},resetStatus:function(e){return this.loading?void popalert("alert","当前页面正在加载文章数据，请稍后"):void("string"==typeof e&&""!=e&&($(".sort-type-list").each(function(t,a){$(a).attr("data-node")=="list_"+e?$(a).addClass("selected"):$(a).removeClass("selected")}),this.firstPage=!0,this.hasmore=!0,this.status=e,this.curMaxTime=0,this.$dom.essay_loadmore.show(),this.$dom.essay_none.hide(),this.$dom.essay_nomore.hide(),this.$dom.essayBox.html(""),this.getArticleList(function(){$(function(){window.scrollTo(0,0)})})))},getInteractiveUsers:function(e,t){var a=$(e.target),s=a.parent("li"),i=s.find(".interactive-users"),_=i.length?i.find(".interactive-users-con li"):[],n=a.data("action"),o=a.parents(".essay-item").attr("data-id"),l=a.data("num")||0,t=t,c=t+"-"+o,r=a.data(c);if(err="互动用户列表数据获取失败",0!=l){if(r)return i.hide(),void a.data(c,!1);if(_.length)return i.show(),void a.data(c,!0);if(0==i.length){s.prepend(INTERACTIVE_TEMPLATE),i=s.find(".interactive-users");var d={group_id:o,action:t};$.ajax({url:"//i.snssdk.com/api/2/data/action_users/",type:"GET",dataType:"jsonp",context:this,data:d,success:function(e){if(e=e||{},"success"!=e.message)return alert(err),a.data(c,!1),void i.remove();for(var t=0,s="",_=0;_<e.data.length&&10>_;_++,t++){var r=USER_TEMPLATE,d=e.data[_];r=r.replace("{{user_id}}",util.e(d.user_id)),r=r.replace("{{screen_name}}",util.e(d.screen_name)),r=r.replace("{{avatar_url}}",util.e(d.avatar_url)),s+=r}t>=10&&l>t&&(s+=MORE_TEMPLATE.replace("{{group_id}}",util.e(o)),t++);var p=i.find(".interactive-users-con"),u=0;if(t>0)u=46*t-10,10>t&&l>t&&(u+=170,s+=ANONYMOUS_TMP1.replace("{{num}}",util.e(l-t)));else{u=200;var m=ANONYMOUS_TMP2.replace("{{num}}",util.e(l-t));s+=m.replace("{{action}}",util.e(1==n?"转发":"收藏"))}var h=parseInt((u+22)/2);p.attr("style","width:"+u+"px;left:-"+h+"px;"),p.removeClass("users-loading"),p.html(s),a.data(c,!0),$(document).on("click",function(e){var t=$(e.target);t.is(a)||a.data(c)&&(a.data(c,!1),i.hide())})},error:function(){popalert("alert",err),a.data(c,!1),i.remove()}})}}},onSnsShare:function(e){var t=$(e.target),a=$(e.currentTarget),s=t.data("type");s&&bdshare(s,a.data())},onRepinClick:function(e){this.getInteractiveUsers(e,"share")},onFavClick:function(e){this.getInteractiveUsers(e,"favorite")},onAllClick:function(){this.resetStatus("all")},onHideClick:function(){this.resetStatus("hide")},onPassedClick:function(){this.resetStatus("passed")},onUnpassedClick:function(){this.resetStatus("unpassed")},onDraftClick:function(){this.resetStatus("draft")},onWinScroll:function(){if(this.hasmore){this.scrollTimer&&clearTimeout(this.scrollTimer);var e=this;this.scrollTimer=setTimeout(function(){var t=e.$win.scrollTop(),a=e.$doc.height(),s=e.$win.height();LOAD_HEIGHT>a-t-s&&(e.$dom.essay_loadmore.show(),e.getArticleList())},50)}},onModify:function(e){var t=$(e.target).closest(".essay-modify");if(window.gap&&window.gap("click","修改文章按钮点击"),t.data("passed")){e.preventDefault();var a=Dialog({btns:[{type:"ok",click:function(){a.remove(),window.location=t.prop("href")}},"cancel"],title:"温馨提示",content:"频繁修改会影响读者阅读效率和推荐效果，建议编辑完善后再发表。"}).show()}},onDelete:function(e){var t,a=$(e.target).closest(".essay-delete"),s=a.closest(".essay-item"),i=this.getData(e.target),_="删除的内容不可恢复，将占用当天发文数，且影响头条号指数。重复发表系统不再推荐，请谨慎删除。";if(window.gap&&window.gap("click","修改删除按钮点击"),t="a"!=e.target.nodeName.toLocaleLowerCase()?$(e.target).closest("a"):$(e.target),"true"!=t.attr("can-delete")&&t.hasClass("j_more_essay_delete")){_="如果需要删除已发表的文章，请先将该文章从主页撤回。";var n=Dialog({btns:[{type:"ok",click:function(){n.remove()}}],title:"暂时无法删除",content:_}).show()}else{t.attr("data-draft")&&(_="删除的内容不可恢复，确定删除？");var n=Dialog({btns:[{type:"ok",click:function(){n.remove(),Util.ajax("/delete_article/",i,function(e,t){return 0!=e?Stip.alert(t):void s.slideUp()})}},"cancel"],title:"删除确认",content:_}).show()}},onRecovery:function(e){{var t=$(e.target),a=e.target,s=this,i=this.getData(a);t.closest(".essay-item").find(".j_essay-status")}"a"!=a.nodeName.toLocaleLowerCase()&&(t=t.find("a")),Util.ajax("/unhide_article/",i,function(e,a){return 0!=e?Stip.alert(a):void("all"==s.status?s.resetStatus("all"):t.closest(".essay-item").slideUp())})},onRollback:function(e){{var t=$(e.target),a=e.target,s=this.getData(a),i=this;t.closest(".essay-item").find(".j_essay-status")}"a"!=a.nodeName.toLocaleLowerCase()&&(t=t.find("a"));var _=Dialog({btns:[{type:"ok",click:function(){Util.ajax("/hide_article/",s,function(e,a){return 0!=e?Stip.alert(a):("passed"==i.status?t.closest(".essay-item").slideUp():"all"==i.status&&i._rollBackRecordFix(t),void _.remove())})}},"cancel"],title:"确认撤回",content:"从主页撤回后，该内容可以正常访问，但不会在主页显示。"}).show()},_rollBackRecordFix:function(e){var t=e.closest(".essay-item"),a=t.find(".j_essay-status"),s=t.find("#essay-top"),i=t.find(".j_essay_node_action"),_=t.find(".essay-modify"),n=t.find(".essay-set-top"),o=t.find(".essay-cancel-top"),l=t.find(".essay-link"),c=t.find(".j_more_essay_delete");i.attr("data-node","essay_recovery"),i.html("恢复到主页"),a.html("已撤回"),c.prepend('<i class="essay-delete-icon"></i>'),c.removeClass("disable-delete"),c.attr("can-delete","true"),_.hide(),n.hide(),l.hide(),o.hide(),s.remove()},_recoveryRecordFix:function(e){var t=e.closest(".essay-item"),a=t.find(".j_essay-status"),s=t.find("#essay-top"),i=t.find(".j_essay_node_action"),_=t.find(".j_more_essay_delete");i.attr("data-node","essay_rollback"),i.html("从主页撤回"),a.html("已发表"),_.addClass("disable-delete"),_.attr("can-delete","false"),_.find("i").remove(),s.remove()},onEssaySetTop:function(e){var t=$(e.target),a=this.top_group_id,s=this,i=this.getData(e.target);i.create_time=t.data("tm"),a?popalert("confirm","同时只支持一篇文章置顶，确认后该文章将取代之前置顶的文章",function(){s.essaySetTopCallback(i)}):s.essaySetTopCallback(i)},essaySetTopCallback:function(e){$.ajax({url:"/set_top_artcile/",data:e,dataType:"json",type:"post"}).done(function(e){"success"==e.message?(window.scrollTo(0,0),document.location.reload()):popalert("alert",e.reason)}).fail(function(){popalert("alert",server_error)})},onEssayCancelTop:function(e){$.ajax({url:"/cancel_top_article/",data:this.getData(e.target),dataType:"json",type:"post"}).done(function(e){"success"==e.message?location.href=location.href:popalert("alert",e.reason)}).fail(function(){popalert("alert",server_error)})},onModifyVPoster:function(e){var t=$(e.target),a=t.data("id");videoposter().show({id:a,type:1,source:"列表",success:function(e,a){var s=t.parents(".essay-image"),i=s.find("img");i.attr("src",a)}})},onPostNow:function(e){var t=this,a="立即发表这篇文章？",s=$(e.target),i=s.closest(".essay-item").find(".j_essay-status"),_=Dialog({btns:[{type:"ok",click:function(){_.remove(),$.ajax({type:"POST",url:"/article/post_now_article/",data:t.getData(e.target),dataType:"json"}).done(function(e){"success"==e.message?(s.hide(),i.text("已发表")):popalert("alert",e.reason)}).fail(function(){popalert("alert",server_error)})}},"cancel"],title:"提示",content:a}).show()},getData:function(e){var t=$(e),a=t.closest(".essay-item"),s={};return s.id=a.data("idd"),s.item_id=a.data("iid"),s.group_id=a.data("gid"),s.pgc_id=a.data("pid"),s.source_type=this.source_type,s}})});
;define("pagelet/login/config.js",function(require,exports,module){var tpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="login-form-account">\n    <div class="form1_dt">'+(null==(__t=label)?"":_.escape(__t))+'</div>\n    <div class="form1_dd">\n        <input type="'+(null==(__t=obj.type||"text")?"":_.escape(__t))+'" ',obj.name&&(__p+=' name="'+(null==(__t=obj.name)?"":_.escape(__t))+'" '),__p+=' maxlength="50" class="signform_input">\n        <div class="signform_msg jmsg"></div>\n        <div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+"</div>\n    </div>\n</div>\n";return __p};return{email:{tpl:tpl},password:{tpl:tpl}}});
;define("pagelet/login/login.js",function(e){var a=e("pagelet/login/config.js"),i=e("common/util/util.js"),o=e("common/vali/vali.js"),l=e("common/stip/stip.js"),n=e("pagelet/signform/field.js");$(".jpagelet_login").each(function(){var e=$(this).nodes();e.remember.checkbox();var t=n.getEle("password",a.password),c=n.getEle("captcha"),s=n.getEle("email",$.extend({require:!0,name:"name_or_email",label:"邮箱",hint:""},a.email)),r=$.cookie("lemail");r?(s.jvali.val(r),t.jvali.focus()):s.jvali.focus(),t.jvali.css("display","inline-block"),c.onClick=function(){$.post("/auth/login_post/",{name_or_email:$.trim(s.jvali.val())}).done(function(e){c.render(e.data.captcha)})},e.close_btn&&e.close_btn.click(function(){$("#pagelet_login_pop").modal("hide")}),e.submit.click(function(){e.form.submit()}),e.fields.append(s.jbox.add(t.jbox).add(c.jbox));var m=o(s.jvali.add(t.jvali).add(c.jvali));e.form.submit($.loadWrap(function(a){a.preventDefault(),m(function(a,o,n){null==a?(n=$.so(n),i.ajax("/auth/login_post/",n,function(a,o,t){0===a?(e.remember.checkbox()&&$.cookie("lemail",n.name_or_email,{expires:30,path:"/"}),window.location=i.GET.redirect_url||"/"):(t.captcha&&c.render(t.captcha),l.alert(o))})):o.focus()})}))})});
;define("pagelet/login/login_pop.js",function(require,exports,module){var html=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="modal fade" id="pagelet_login_pop">\n    <div class="modal-dialog login jpagelet_login" gap="^登录框" id="pagelet_login">\n        <a href="javascript:;" class="close" data-node="close_btn"></a>\n        <div class="login_wrap">\n            <div class="login_title">登录</div>\n            <div class="sclearfix">\n                <form action="" data-node="form">\n                    <div data-node="fields">\n\n                    </div>\n                    <input type="submit" value="" style="display:none">\n                </form>\n                <div class="form1_dd">\n                    <div class="form1_checkbox login_remember" data-node="remember">\n                        一个月内免登录\n                    </div>\n                    <a href="/forget/" class="slink login_forget" ga="找回密码$">忘记密码？</a>\n                </div>\n            </div>\n            <div class="signform_btn login_submit" data-node="submit" ga="邮箱登录按钮$">登录</div>\n        </div>\n        <div class="shr"></div>\n        <div class="login_wrap">\n            <div class="login_title2">\n                其他方式登录\n            </div>\n            <div class="login_others">\n                <a href="javascript:void(Util.snsLogin(\'sina_weibo\'))" class="login_other" ga="登录_新浪微博$"><div class="login_other_img login_other_img_sw"></div><div class="login_other_text">新浪微博</div></a>\n                <a href="javascript:void(Util.snsLogin(\'qzone_sns\'))" class="login_other" ga="登录_QQ帐号$"><div class="login_other_img login_other_img_qq"></div><div class="login_other_text">QQ帐号</div></a>\n                <a href="javascript:void(Util.snsLogin(\'qq_weibo\'))" class="j_qq_weibo login_other" ga="登录_腾讯$"><div class="login_other_img login_other_img_tw"></div><div class="login_other_text">腾讯微博</div></a>\n            </div>\n        </div>\n    </div>\n</div>\n<div class="modal fade" id="pagelet_login_qq_weibo">\n    <div class="modal-dialog qq_weibo_notify">\n        <div class="modal-content">\n            <div class="modal-header">\n                <span>提示</span>\n            </div>\n            <div class="modal-body qq_weibo_letter">\n                <p class="letter">尊敬的头条号作者：</p>\n                <p class="letter">您好！</p>\n                <p>头条号暂无法通过新浪微博进行登录。请联系头条号官方微信(toutiaohao)或客服邮箱<a href="mailto:mp@toutiao.com">mp@toutiao.com</a>进行处理。</p>\n                <div class="qrcode">\n                    <img src="https://mp.toutiao.com/static/resource/pgc_web/static/style/image/pgcqrcode.4007c61.png" alt=""/>\n                </div>\n            </div>\n            <div class="modal-footer">\n                <div data-dismiss="modal" class="widget_btn">确认</div>\n            </div>\n        </div>\n    </div>\n</div>\n';return __p}();$(html).appendTo("body"),require("pagelet/login/login.js");var Login=function(){$("#pagelet_login_pop").modal()};return window.Login=Login,Login});
;define("pagelet/loginindex/author_list.js",function(t,o,p){p.exports=[{pic:"//p1.pstatp.com/large/2653/1704904947",author:"吴晓波频道",content:"著名财经作家吴晓波发布的自媒体，涵盖视频、专栏和测试。",url:"http://toutiao.com/m4144384138/"},{pic:"//p3.pstatp.com/large/1858/980050265",author:"袁腾飞",content:"知名历史老师袁腾飞，读历史即是读人心。",url:"http://toutiao.com/m3790837298/"},{pic:"//p1.pstatp.com/large/776/8141111946",author:"黄健翔谈",content:"著名主持人黄健翔“玩转”足球的自媒体阵地，图文故事辅以黄健翔的个人动态，构架起专属黄健翔的个人频道。",url:"http://toutiao.com/m3263000978/"},{pic:"//p2.pstatp.com/large/3678/5928289538",author:"蔡澜的花花世界",content:"《舌尖上的中国》系列总顾问、香港四大才子之一的蔡澜先生。",url:"http://toutiao.com/m4383445805/"},{pic:"//p2.pstatp.com/large/4306/2602403105",author:"央视新闻",content:"中央电视台新闻中心官方头条号，是央视重大新闻、突发事件、重点报道的发布平台。",url:"http://toutiao.com/m4492956276/"},{pic:"//p2.pstatp.com/thumb/1370/2077485985",author:"新华社发布",content:"新华社官方头条号，遍布180多个国家的3000多名新华社记者第一时间为你供稿，让你尽览全球新闻。",url:"http://toutiao.com/m3566555656/"},{pic:"//p2.pstatp.com/large/2401/1424722918",author:"北京发布",content:"北京市政府新闻办公室头条号，传递政府声音 ，提供服务资讯 ，倾听社情民意 ，回应社会关切。",url:"http://toutiao.com/m4052745437/"},{pic:"//p3.pstatp.com/large/8228/6474552799",author:"中国铁路",content:"中国铁路总公司官方头条号，为你定制权威铁路新闻、铁路文化、出行资讯，用心为你服务，助你愉快出行！",url:"//toutiao.com/m5510943119/"}]});
;define("pagelet/loginindex/countUp.js",function(t,a,e){e.exports=function(t,a,e,n,i,r){for(var o=0,s=["webkit","moz","ms","o"],u=0;u<s.length&&!window.requestAnimationFrame;++u)window.requestAnimationFrame=window[s[u]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[s[u]+"CancelAnimationFrame"]||window[s[u]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(t){var a=(new Date).getTime(),e=Math.max(0,16-(a-o)),n=window.setTimeout(function(){t(a+e)},e);return o=a+e,n}),window.cancelAnimationFrame||(window.cancelAnimationFrame=function(t){clearTimeout(t)}),this.options={useEasing:!0,useGrouping:!0,separator:",",decimal:"."};for(var m in r)r.hasOwnProperty(m)&&(this.options[m]=r[m]);""===this.options.separator&&(this.options.useGrouping=!1),this.options.prefix||(this.options.prefix=""),this.options.suffix||(this.options.suffix=""),this.d="string"==typeof t?document.getElementById(t):t,this.startVal=Number(a),this.endVal=Number(e),this.countDown=this.startVal>this.endVal,this.frameVal=this.startVal,this.decimals=Math.max(0,n||0),this.dec=Math.pow(10,this.decimals),this.duration=1e3*Number(i)||2e3;var l=this;this.version=function(){return"1.6.0"},this.printValue=function(t){var a=isNaN(t)?"--":l.formatNumber(t);"function"==typeof this.d._getBBox?this.d.attr({text:a}):this.d.innerHTML=a},this.easeOutExpo=function(t,a,e,n){return e*(-Math.pow(2,-10*t/n)+1)*1024/1023+a},this.count=function(t){l.startTime||(l.startTime=t),l.timestamp=t;var a=t-l.startTime;l.remaining=l.duration-a,l.frameVal=l.options.useEasing?l.countDown?l.startVal-l.easeOutExpo(a,0,l.startVal-l.endVal,l.duration):l.easeOutExpo(a,l.startVal,l.endVal-l.startVal,l.duration):l.countDown?l.startVal-(l.startVal-l.endVal)*(a/l.duration):l.startVal+(l.endVal-l.startVal)*(a/l.duration),l.frameVal=l.countDown?l.frameVal<l.endVal?l.endVal:l.frameVal:l.frameVal>l.endVal?l.endVal:l.frameVal,l.frameVal=Math.round(l.frameVal*l.dec)/l.dec,l.printValue(l.frameVal),a<l.duration?l.rAF=requestAnimationFrame(l.count):l.callback&&l.callback()},this.start=function(t){return l.callback=t,l.rAF=requestAnimationFrame(l.count),!1},this.pauseResume=function(){l.paused?(l.paused=!1,delete l.startTime,l.duration=l.remaining,l.startVal=l.frameVal,requestAnimationFrame(l.count)):(l.paused=!0,cancelAnimationFrame(l.rAF))},this.reset=function(){l.paused=!1,delete l.startTime,l.startVal=a,cancelAnimationFrame(l.rAF),l.printValue(l.startVal)},this.update=function(t){cancelAnimationFrame(l.rAF),l.paused=!1,delete l.startTime,l.startVal=l.frameVal,l.endVal=Number(t),l.countDown=l.startVal>l.endVal,l.rAF=requestAnimationFrame(l.count)},this.formatNumber=function(t){t=t.toFixed(l.decimals),t+="";var a,e,n,i;if(a=t.split("."),e=a[0],n=a.length>1?l.options.decimal+a[1]:"",i=/(\d+)(\d{3})/,l.options.useGrouping)for(;i.test(e);)e=e.replace(i,"$1"+l.options.separator+"$2");return l.options.prefix+e+n+l.options.suffix},l.printValue(l.startVal)}});
;define("pagelet/loginindex/feature_list.js",function(e,t,n){n.exports=[{type:"quiz",name:"测试",text:"测试、问答多种题型，与读者有趣互动"},{type:"video",name:"视频",text:"在线视频、本地视频，两种方式便捷上传"},{type:"img",name:"图文",text:"多种图文编辑格式，操作简易、轻松发布"},{type:"collection",name:"图集",text:"批量上传图片，随意调整顺序，幻灯片形式展示"}]});
;define("pagelet/loginindex/jquery.mousewheel.js",function(e,t,n){!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof t?n.exports=e:e(jQuery)}(function(e){function t(t){var s=t||window.event,a=h.call(arguments,1),u=0,f=0,d=0,c=0,g=0,m=0;if(t=e.event.fix(s),t.type="mousewheel","detail"in s&&(d=-1*s.detail),"wheelDelta"in s&&(d=s.wheelDelta),"wheelDeltaY"in s&&(d=s.wheelDeltaY),"wheelDeltaX"in s&&(f=-1*s.wheelDeltaX),"axis"in s&&s.axis===s.HORIZONTAL_AXIS&&(f=-1*d,d=0),u=0===d?f:d,"deltaY"in s&&(d=-1*s.deltaY,u=d),"deltaX"in s&&(f=s.deltaX,0===d&&(u=-1*f)),0!==d||0!==f){if(1===s.deltaMode){var w=e.data(this,"mousewheel-line-height");u*=w,d*=w,f*=w}else if(2===s.deltaMode){var v=e.data(this,"mousewheel-page-height");u*=v,d*=v,f*=v}if(c=Math.max(Math.abs(d),Math.abs(f)),(!l||l>c)&&(l=c,i(s,c)&&(l/=40)),i(s,c)&&(u/=40,f/=40,d/=40),u=Math[u>=1?"floor":"ceil"](u/l),f=Math[f>=1?"floor":"ceil"](f/l),d=Math[d>=1?"floor":"ceil"](d/l),r.settings.normalizeOffset&&this.getBoundingClientRect){var p=this.getBoundingClientRect();g=t.clientX-p.left,m=t.clientY-p.top}return t.deltaX=f,t.deltaY=d,t.deltaFactor=l,t.offsetX=g,t.offsetY=m,t.deltaMode=0,a.unshift(t,u,f,d),o&&clearTimeout(o),o=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){l=null}function i(e,t){return r.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var o,l,s=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],h=Array.prototype.slice;if(e.event.fixHooks)for(var u=s.length;u;)e.event.fixHooks[s[--u]]=e.event.mouseHooks;var r=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",r.getLineHeight(this)),e.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})})});
;define("pagelet/loginindex/loginindex.js",function(require,exports,module){var countUp=(require("pagelet/login/login_pop.js"),require("pagelet/loginindex/countUp.js")),featureTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="",_.each(obj,function(e){__p+='\n    <i class="'+(null==(__t=e.type)?"":__t)+'" data-text="'+(null==(__t=e.text)?"":__t)+'">\n        <span>'+(null==(__t=e.name)?"":__t)+"</span>\n    </i>\n"}),__p+="\n\n";return __p},standardWidth=1100,minHeight=700,authorList=require("pagelet/loginindex/author_list.js"),featureList=require("pagelet/loginindex/feature_list.js"),index=0,width=$(window).width(),height=$(window).height();!function(){Raphael.fn.addGuides=function(){this.ca.guide=function(e){return{guide:e}},this.ca.along=function(e){var t=this.attr("guide"),i=t.getTotalLength(),n=t.getPointAtLength(e*i),a={transform:"t"+n.x+" "+n.y};return a}}}();var isIe=function(e){return 8==e?/msie 8.0/i.test(navigator.userAgent):9==e?/msie 9.0/i.test(navigator.userAgent):"89"==e?/msie 8.0|9.0/i.test(navigator.userAgent):window.ActiveXObject||"ActiveXObject"in window?!0:void 0};module.exports=Pagelet.extend({el:".loginindex",events:{"mouseenter .slider-box .element":"sliderBoxMouseenter","click .slider-box .element":"sliderBoxClick","mouseenter .layer-6 .feature i":"featureHover","click .logo-jump":"logoJump","click .nav i":"navJump"},fixLayout:function(){$("#backtop").remove(),$("#wx-feedback").remove(),$(".sfoot_p").hide()},init:function(){var e=this;this.fixLayout(),this.render(),$(window).on("resize",function(){e.resizeFix()})},svgRender:function(){var e={stroke:"#f95e58","stroke-width":"10px",fill:"transparent","fill-opacity":0},t="http://p1.pstatp.com/origin/9515/5065988524";Raphael($(".layer-svg-2").get(0),450,214).path("M350,0 H0 V214 H450 V114").attr(e),Raphael($(".layer-svg-4").get(0),520,220).path("M520,40 L520,0 L0,0 L0,220 L420,220").attr(e),Raphael($(".layer-svg-5").get(0),730,230).path("M35,0 H0 V230 H35 M330,0 H730 V230 H330").attr(e),Raphael($(".layer-svg-6").get(0),670,250).path("M41,250 L0,250 L0,0 L335,0 M629,250 L670,250 L670,0 L335,0").attr(e);var i=Raphael($(".animate-svg-ball").get(0),625,362);i.addGuides(),this.svg2path=i.path("MM145,285C235,270,325,210,345,180").attr({"stroke-width":"0px",stroke:"#fff"}),this.svg2circle=i.circle(0,0,10).attr({stroke:"#ddf1ff","stroke-width":"5px",fill:"#38c6ff"}),this.svg2image=i.image(t,-90,-90,177,62),this.svg2text=i.text(10,-60,"0").attr({"font-size":"18px",fill:"#539fe0"})},ballAnimate:function(){if(!this.svg2path)return!1;var e=this.svg2path,t={guide:e,along:0};this.svg2text.attr(t).animate({along:1},1e3,"ease-out"),this.svg2image.attr(t).animate({along:1},1e3,"ease-out"),this.svg2circle.attr(t).animate({along:1},1e3,"ease-out")},render:function(){$("body").css("overflow","hidden"),this.calcStageSize(),this.scaleImg(),this.templateInit(),this.ieFix(),this.mousewheel(),this.navigate(),this.svgRender()},logoJump:function(){var e=this,t=this.$el.find(".stage");index=0,e.stageSlide(t,-index*e.height)},navJump:function(e){var t=$(e.currentTarget),i=this,n=this.$el.find(".stage");index=t.index(),i.stageSlide(n,-index*i.height)},navigate:function(){for(var e=this.$el.find(".layer").length,t=this.$el.find(".nav"),i=$("<i></i>"),n=0;e>n;n++)t.append(i.clone());$(".nav i").eq(0).addClass("first-dash-current")},resizeFix:function(){-(this.index-1)*this.height,this.$el.find(".stage");this.calcStageSize(),this.scaleImg()},mousewheel:function(){function e(e){var r=new Date;if(!(r.getTime()-n.getTime()>1200))return!1;if(n=new Date,i=-e.originalEvent.wheelDelta,Math.abs(i)>=40&&(i/=40),i>0){if(6==index)return!1;index++}else if(0>i){if(0==index)return!1;index--}t.stageSlide(a,-index*t.height)}{var t=this,i=0,n=new Date,a=this.$el.find(".stage");$(".layer").length}a.on("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(e){return $(e.target).hasClass("stage")?void t.layerSwitch(index):!1}),$("body").on("mousewheel",function(t){e(t)}),$("body").on("keydown",function(e){var i=e.keyCode;if(40==i){if(6==index)return!1;index++}if(38==i){if(0==index)return!1;index--}t.stageSlide(a,-index*t.height)})},stageSlide:function(e,t){var i=this;isIe("89")?e.animate({top:t},"500","swing",function(){i.layerSwitch(t/height)}):e.css({transform:"translateY("+t+"px)"})},layerSwitch:function(e){var e=Math.round(Math.abs(e||0)+1);return this.index==e?!1:(this.index=e,$(".layer-animation").removeClass("layer-animation"),$(".layer-"+e).addClass("layer-animation"),isIe("89")&&($(".layer").find(".article-content").hide(),$(".layer-"+e).find(".article-content").fadeIn()),2===e&&(this.count(),this.ballAnimate()),1===e?($(".nav i").eq(0).addClass("first-dash-current"),$(".nav i").removeClass("other-dash").removeClass("other-dash-current"),$(".stage-header").fadeOut(),$(".ripple").show()):($(".nav i").removeClass("first-dash-current"),$(".nav i").addClass("other-dash").removeClass("other-dash-current"),$(".nav i").eq(e-1).addClass("other-dash-current"),$(".stage-header").fadeIn(),$(".ripple").hide()),5===e&&this.$el.find(".slider-box .element").eq(0).mouseenter(),6===e&&this.$el.find(".feature .quiz").mouseenter(),void(7===e?($(".j-top-btn-group").hide(),$(".sfoot_p").show()):($(".sfoot_p").hide(),$(".j-top-btn-group").show())))},calcStageSize:function(e,t){var e=e||$(".stage"),t=t||$(".layer");this.width=$(window).width(),this.height=$(window).height(),e.width(this.width),t.height(this.height),minHeight>height&&this.$el.find(".phone").css("transform","scale(.6)"),1160>width&&this.$el.find(".layer-2 .article").css("margin-left","35px")},scaleImg:function(e){var t=$(window).width()/standardWidth,e=e||$(".scale");return t>=.9?!1:(t=.6>t?.6:t.toFixed(2),void e.each(function(){isIe(8)&&$(this).css({zoom:t,"margin-right":"-120px","margin-bottom":"-20px"}),$(this).css("transform","scale("+t+")")}))},count:function(){var e=new countUp($(".count-num").get(0),0,723245,0,1),t=new countUp(this.svg2text,0,623545,0,1);e.start(),t.start()},ieFix:function(){isIe(8)&&($(".iphone").css("top","150px"),$(window).off("mousewheel"),$(".layer-1 .ripple").hide(),$(".circle-inner").remove()),isIe()&&$(".animate-ball-svg").remove(),isIe("89")?($(".stage").css("position","absolute"),this.$el.find(".article-content").css("opacity",1),this.$el.find(".phone").css("opacity",1),this.$el.find(".slider-box element").css("opacity",1)):this.$el.find(".layer-3 .circle").css("top","-50px")},sliderBoxMouseenter:function(e){var t=$(e.currentTarget),i=this.$el.find(".layer-5 .phone");$(".enter-rotate").css("opacity",.6),$(".enter-rotate").removeClass("enter-rotate"),t.css("opacity",1),t.addClass("enter-rotate"),i.find("img").attr("src",t.data("image")),i.find("p").text(t.data("author")),i.find(".description p").text(t.data("description"))},sliderBoxClick:function(e){var t=$(e.currentTarget),i=t.data("url");window.open(i)},featureHover:function(e){var t=$(e.currentTarget),i=t.data("text"),n=this.$el.find(".feature-text");n.hide(),n.fadeIn("fast"),n.text(i),$(".feature-hover-current").removeClass("feature-hover-current"),t.addClass("feature-hover-current")},templateInit:function(e){var e=e||$(".slider-box"),t=$(".layer-6 .feature"),i=['<div class="element">',"<img />",'<i class="circle-inner circle"></i>','<i class="circle-inner"></i>',"</div>"].join(""),n=$(i);_.each(authorList,function(t){var i=n.clone();return t&&t.content?(i.data("description",t.content).data("author",t.author).data("image",t.pic).data("url",t.url),void e.find(".slider").append(i.find("img").attr("src",t.pic).end())):!1}),t.append(featureTemplate(featureList))}})});
;define("pagelet/menu/menu.js",function(){$(function(){function n(n){n>0?(e.text(n).show(),$("#invite-num")&&$("#invite-num").text(n).show()):e.hide()}var e=$(".new-invite-num");window.location.href.indexOf("/wenda/invite/")<0&&$.ajax({url:"//wenda.toutiao.com/wenda/web/invited/question/count/",dataType:"jsonp",data:{}}).done(function(e){new_invite_num=e.count,n(new_invite_num)})})});
;define("pagelet/menum/action.js",function(n){var e=n("common/ui/tab.js"),i=n("common/vali/vali.js"),t=n("common/popup/dialog.js");return function(n){function f(n,e){return"cant"===n?void m("cant"):"blank"===n?void m("blank"):(o=n.type,a=n.value,r=e,void m(a?o+"show":"action"))}function c(){k(function(n,e,i){n||(o="href",a=i[0].value.replace(/^(\w+\:\/\/)?(.*)$/,function(n,e,i){return(e||"http://")+i}),r({type:o,value:a}),m("hrefshow"))})}var r,o,a,u=n.find(".jhrefbtn"),l=n.find(".jhrefinput"),h=n.find(".jhrefmsg"),d=n.find(".jhrefsave"),v=n.find(".jhrefcancel"),p=n.find(".jhref"),s=n.find(".jhrefedit"),j=n.find(".jhrefdel"),m=e($(),n.find(".widget_tab_page"),function(n){"hrefshow"===n?p.prop("href",a).text(a):"hrefedit"===n&&(k("reset"),l.val(a||""))});u.click(function(){m("hrefedit")}),s.click(function(){m("hrefedit")}),j.click(function(){var n=t({btns:[{type:"ok",click:function(){o="",a="",r({type:"",value:""}),m("action"),n.remove()}},"cancel"],title:"删除确认",content:"删除后可重新设置菜单动作",type:"info"}).show()}),v.click(function(){a?"href"===o&&m("hrefshow"):m("action")});var k=i(l.data({vali_jmsg:h,vali_require:!0,vali_func:i.returnWrap(function(n){return i.url(n)})}));return d.click(c),m("blank"),f}});
;define("pagelet/menum/menum.js",function(require,exports,module){var menumright=require("pagelet/menum/action.js"),Util=require("common/util/util.js"),Vali=require("common/vali/vali.js"),Dialog=require("common/popup/dialog.js"),inputDialog=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="menum_input_dialog">\n    <div class="menum_input_dialog_title">请输入菜单名称</div>\n    <input type="text" name="name" class="signform_input menum_input_dialog_input" data-node="input" placeholder="菜单名称不多于4个汉字或8个字母">\n    <div class="sred menum_input_dialog_msg" data-node="msg"></div>\n</div>';return __p},previewTmpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";for(var i=0;i<obj.length;i++){var item=obj[i];__p+='\n<div class="profilemenu_title">'+(null==(__t=item.name)?"":_.escape(__t))+'</div>\n<div class="profilemenu_items">\n    ';for(var children=item.children,j=0;j<children.length;j++){var item=children[j];__p+='\n        <div class="profilemenu_item_wrap"><div class="profilemenu_item">'+(null==(__t=item.name)?"":_.escape(__t))+"</div></div>\n    "}__p+="\n</div>\n"}__p+=""}return __p},Stip=require("common/stip/stip.js");return function(pageData){var modified=!1;window.onbeforeunload=function(){return modified?"修改还未发布，如果离开页面，改动将不会生效。":void 0},$(function(){function ex(e,i){var t=e.find(".jitem").eq(0).siblings(".jitem").andSelf();if(e.is(jlist1[0])){for(var n=[],a=0;a<t.length;a++)ex(t.eq(a),n);return n}var m=e.data(),l={type:m.type,value:m.value,name:m.name,children:[]};if(0===t.length&&!l.value)throw e.findAndSelf(".jhead").eq(0).click(),new Error("菜单未设置动作，请检查后重试");i.push(l);for(var a=0;a<t.length;a++)ex(t.eq(a),l.children)}function im(e,i){for(var t=[],n=0;n<i.length;n++){var a=i[n],m=$(tmp1(a));t.push(m[0]),m.data({type:a.type,value:a.value,name:a.name});var l=m.find(".jbody");sortable(l);for(var o=a.children,s=0;s<o.length;s++){var d=o[s],r=$(tmp2(d));l.append(r),r.data({type:d.type,value:d.value,name:d.name})}}jlist1.append(t)}function sortable(e){e.sortable({items:">*",placeholder:"menum_item_placeholder",axis:"y",change:function(){modified=!0},forcePlaceholderSize:!0}),e.disableSelection()}function menuParse(e){for(var i=0;i<e.length;i++){var t=e[i],n=t.children;n&&0!==n.length||(t.children=[$.extend({},t)],t.name="")}return e}$("body").hoverTitle();var jmenum=$("#menum"),showRight=menumright($("#menumright")),nameDialog=function(){function e(){n(function(e,i,t){e||(a.hide(),l($.so(t).name))})}var i=$(inputDialog()),t=i.nodes();t.input.data({vali_jmsg:t.msg,vali_require:"请填写菜单名称",vali_func:Vali.returnWrap(function(e){return Vali.range(e,0,4,!0)&&"菜单名称不多于4个汉字或8个字母"})});var n=Vali(t.input),a=Dialog({btns:[{type:"ok",click:e},{type:"cancel",click:function(){a.hide()}}]}),m=a.jele.find(".spopup_dialog_body");m.append(i);var l;return function(e){l=e.success||$.noop,n("reset"),t.input.val(e.name||""),a.show(),t.input.focus()}}(),tmp1=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="menum_item jitem">\n    <div class="menum_item_title menum_item_title_1 jhead">\n        <span class="menum_item_text jtitle">'+(null==(__t=obj.name)?"":_.escape(__t))+'</span>\n        <div class="menum_item_btns">\n            <span class="menum_item_btn menum_item_btn_add jadd2" data-title="增加子菜单"></span>\n            <span class="menum_item_btn menum_item_btn_del jdel" data-title="删除"></span>\n            <span class="menum_item_btn menum_item_btn_edit jedit" data-title="修改名称"></span>\n        </div>\n    </div>\n    <div class="menum_item_body jbody">\n    </div>\n</div>';return __p},tmp2=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="menum_item_title menum_item_title_2 jitem jhead">\n    <span class="menum_item_text jtitle">'+(null==(__t=obj.name)?"":_.escape(__t))+'</span>\n    <div class="menum_item_btns">\n        <span class="menum_item_btn menum_item_btn_del jdel" data-title="删除"></span>\n        <span class="menum_item_btn menum_item_btn_edit jedit" data-title="修改名称"></span>\n    </div>\n</div>';return __p},jmenumleft=$("#menumleft"),jlist1=jmenumleft.find(".jlist1");jmenumleft.find(".jadd1").click(function(){return jlist1.children().length>=3?void Dialog({btns:["ok"],title:"一级菜单最多只能3个"}).show():void nameDialog({success:function(e){modified=!0;var i=$(tmp1({name:e})).data("name",e);jlist1.append(i),sortable(i.find(".jbody")),i.findAndSelf(".jhead").click()}})});var jLastSelect=$();jmenumleft.on("click",".jadd2",function(){var e=$(this).closest(".jitem");if(e.data("value"))return void Dialog({btns:["ok"],title:"已设置动作，无法新增子菜单"}).show();var i=e.find(".jbody").eq(0);return i.children().length>=5?void Dialog({btns:["ok"],title:"二级菜单最多只能5个"}).show():void nameDialog({success:function(e){modified=!0;var t=$(tmp2({name:e})).data("name",e);i.append(t),t.findAndSelf(".jhead").click()}})}).on("click",".jedit",function(){var e=$(this).closest(".jitem"),i=e.find(".jtitle").eq(0),t=e.data("name");nameDialog({name:t,success:function(t){modified=!0,i.text(t),e.data("name",t)}})}).on("click",".jdel",function(){var e=$(this).closest(".jitem"),i=Dialog({btns:[{type:"ok",click:function(){modified=!0,e.remove(),showRight("blank"),i.remove()}},"cancel"],title:"删除确认",content:"删除后该菜单下的设置将不会保留"}).show()}).on("click",".jhead",function(e){if(jLastSelect.is(this)||(jLastSelect.removeClass("selected"),jLastSelect=$(this).addClass("selected")),this===e.target){var i=$(this).closest(".jitem");i.find(".jbody").children().length?showRight("cant"):showRight(i.data(),function(e){modified=!0,i.data(e)})}}),jlist1.sortable({items:">*",placeholder:"menum_item_placeholder",axis:"y",change:function(){modified=!0},forcePlaceholderSize:!0}),jlist1.disableSelection(),jmenum.find(".jsubmit").click($.loadWrap(function(){try{var e=ex(jlist1);return Util.ajax("/service/save_custom_menu/",{data:JSON.stringify(e)},function(e,i){0===e?(modified=!1,Stip.popupTip({msg:"发布成功",status:!0})):Stip.popupTip({msg:i,status:!1})})}catch(i){return void Stip.popupTip({msg:i.message})}}));var jpreview=$("#preview"),jpreviewmenus=$("#preview_menus");jmenum.find(".jpreview").click(function(){try{var e=ex(jlist1)}catch(i){return void Stip.popupTip({msg:i.message})}jpreviewmenus.html(previewTmpl(menuParse(e))),jpreview.modal()}),im(jlist1,pageData.data)})}});
;define("pagelet/message/message.js",function(require,exports,module){var popalert=require("pagelet/popalert/popalert.js"),LIST_TEMPLATE=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";for(var i=0;i<data.length;i++){var item=data[i];__p+="\n	",item.content=_.escape(item.content),item.content=item.content.replace(/(http(?:s|)\:\/\/(?:www\.|mp\.|wenda\.|)toutiao\.com[A-Za-z0-9_./?=]+)/g,function(){return'<a class="message-link" target="_blank" href="'+RegExp.$1+'">'+RegExp.$1+"</a>"}),__p+="\n\n	",(2==item.type||42==item.type||43==item.type||71==item.type||72==item.type||6==item.type||84==item.type||4==item.type||5==item.type)&&(__p+='\n	<div class="sys-notice-cell">\n		',2==item.type&&(__p+='\n		<div class="sys-notice-bar user-bar">\n			<div class="sys-content">\n				<div class="sys-notice-user-avatar"><img class="sys-notice-img" src="',__p+=item.user.avatar_url?""+(null==(__t=item.user.avatar_url)?"":_.escape(__t)):"http://mat1.gtimg.com/www/mb/images/head_50.jpg",__p+='"></div>\n				<a class="sys-notice-user-name" href="http://web.toutiao.com/user/'+(null==(__t=item.user.user_id)?"":_.escape(__t))+'/" target="_blank">'+(null==(__t=item.user.screen_name)?"":_.escape(__t))+'</a>\n				<span class="sys-notice-msg">'+(null==(__t=item.content)?"":__t)+'</span>\n			</div>\n			<span class="sys-notice-time">'+(null==(__t=item.create_time)?"":_.escape(__t))+"</span>\n		</div>\n		"),__p+="\n		",(42==item.type||43==item.type||71==item.type||72==item.type||84==item.type)&&(__p+='\n		<div class="sys-notice-bar">\n			<div class="sys-content">\n				<i class="sys-notice-sysicon"></i>\n				<span class="sys-notice-msg">'+(null==(__t=item.content)?"":__t)+'</span>\n			</div>\n			<span class="sys-notice-time">'+(null==(__t=item.create_time)?"":_.escape(__t))+"</span>\n		</div>\n		"),__p+="\n\n		",(2==item.type||42==item.type)&&(__p+="\n\n		"),__p+="\n\n		",(4==item.type||6==item.type)&&(__p+='\n		<div class="sys-notice-bar user-bar">\n			<div class="sys-content">\n				<div class="sys-notice-user-avatar"><img class="sys-notice-img" src="',__p+=item.user.avatar_url?""+(null==(__t=item.user.avatar_url)?"":_.escape(__t)):"http://mat1.gtimg.com/www/mb/images/head_50.jpg",__p+='"></div>\n				<a class="sys-notice-user-name" href="http://web.toutiao.com/user/'+(null==(__t=item.user.user_id)?"":_.escape(__t))+'/" target="_blank">'+(null==(__t=item.user.screen_name)?"":_.escape(__t))+"</a>\n				"+(null==(__t=item.content)?"":_.escape(__t))+'\n				<a class="sys-msg-article-title" href="'+(null==(__t=item.group.url)?"":_.escape(__t))+'" target="_blank">《'+(null==(__t=item.group.title)?"":_.escape(__t))+'》</a>\n			</div>\n			<span class="sys-notice-time">'+(null==(__t=item.create_time)?"":_.escape(__t))+"</span>\n		</div>\n		"),__p+="\n\n		",5==item.type&&(__p+='\n		<div class="sys-notice-bar user-bar">\n			<div class="sys-content">\n				<div class="sys-notice-user-avatar"><img class="sys-notice-img" src="',__p+=item.user.avatar_url?""+(null==(__t=item.user.avatar_url)?"":_.escape(__t)):"http://mat1.gtimg.com/www/mb/images/head_50.jpg",__p+='"></div>\n				<a class="sys-notice-user-name" href="http://web.toutiao.com/user/'+(null==(__t=item.user.user_id)?"":_.escape(__t))+'/" target="_blank">'+(null==(__t=item.user.screen_name)?"":_.escape(__t))+"</a>"+(null==(__t=item.content)?"":_.escape(__t))+'<a class="sys-msg-article-title" href="'+(null==(__t=item.group.url)?"":_.escape(__t))+'" target="_blank">《'+(null==(__t=item.group.title)?"":_.escape(__t))+'》</a>\n			</div>\n			<span class="sys-notice-time">'+(null==(__t=item.create_time)?"":_.escape(__t))+"</span>\n		</div>\n		"),__p+="\n\n	</div>\n	"),__p+="\n"}__p+="\n\n"}return __p},LOAD_HEIGHT=700;module.exports=Pagelet.extend({el:"#pagelet-message",events:{},init:function(t){var e=this;this.$win=$(window),this.$doc=$(document),this.spec=t,this.loading=!1,this.hasmore=!0,this.scrollTimer="",this.count=t.count||10,this.status=t.status||"inform",this.curType="",this.max_cursor=t.max_cursor||0,this.from_pgc=t.from_pgc||1,this.$win.on("scroll",$.proxy(this.onWinScroll,this)),this.$dom.message_loadmore.show(),this.hashChange(),$(window).on("hashchange",$.proxy(this.hashChange,e))},render:function(t){this.$dom.messageBox.append(LIST_TEMPLATE(t))},getMessageList:function(t,e){if(!this.loading){this.curType!==t&&(this.max_cursor=0),this.curType=t,this.loading=!0;var s={count:this.count,status:this.status,max_cursor:this.max_cursor,from_pgc:this.from_pgc};$.ajax({url:"//toutiao.com/dongtai/notification/list/?include="+t,type:"GET",dataType:"jsonp",context:this,data:s,success:function(t){this.$dom.message_loadmore.hide(),this.loading=!1,t=t||{},"success"===t.message&&(this.hasmore=t.data.has_more,this.max_cursor=t.data.max_cursor,this.hasmore||this.$dom.message_nomore.show(),this.convertTimeFormat(t.data.data),this.render(t.data),"function"==typeof e&&e())},error:function(){this.$dom.message_loadmore.hide(),this.loading=!1}})}},convertTimeFormat:function(t){for(var e=0;e<t.length;e++){var s=new Date(1e3*t[e].create_time),i=s.getFullYear(),a=s.getMonth()+1,n=s.getDate(),r=s.getHours(),o=s.getMinutes();t[e].create_time=i+"-"+(a>9?a:"0"+a)+"-"+(n>9?n:"0"+n)+" "+(r>9?r:"0"+r)+":"+(o>9?o:"0"+o)}},onWinScroll:function(){if(this.hasmore){this.scrollTimer&&clearTimeout(this.scrollTimer);var t=location.hash;if("string"==typeof t&&0!=t.length){"#"==t.substr(0,1)&&(t=t.substr(1));var e=this.convertStatusToType(t),s=this;this.scrollTimer=setTimeout(function(){var t=s.$win.scrollTop(),i=s.$doc.height(),a=s.$win.height();LOAD_HEIGHT>i-t-a&&(s.$dom.message_loadmore.show(),s.getMessageList(e))},50)}}},resetStatus:function(t){if(this.loading)return void popalert("alert","当前页面正在加载文章数据，请稍后");if("string"==typeof t&&""!=t){$(".message-type-list").each(function(e,s){$(s).attr("data-node")=="list_"+t?$(s).addClass("selected"):$(s).removeClass("selected")}),this.hasmore=!0,this.status=t;var e=this.convertStatusToType(t);this.$dom.message_loadmore.show(),this.$dom.message_nomore.hide(),this.$dom.messageBox.html(""),this.getMessageList(e,function(){window.scrollTo(0,0)})}},convertStatusToType:function(t){var e,s={inform:"6,72,84",subscribe:"2",collect:"4",retransmit:"5"};return e=s[t]},hashChange:function(){var t=location.hash;if("string"==typeof t&&0!=t.length){"#"==t.substr(0,1)&&(t=t.substr(1));var e={inform:"inform",subscribe:"subscribe",collect:"collect",retransmit:"retransmit"};t in e&&this.resetStatus(t),this.loading=!1}}})});
;define("pagelet/mobile_register/mobile_register.js",function(e,i,t){var r=e("pagelet/mobile_register/mobile_inherit.js");t.exports=Pagelet.extend(r)});
;define("pagelet/privacy_validate/privacy_ajax.js",function(a){var e,c=a("common/util/util.js"),l=a("pagelet/privacy_validate/privacy.js");return function(a){e||(e=l.create({$el:$("body")})),a=$.extend({callback:$.noop,data:{}},a);var t=a.callback;a.callback=function(l,i,n,o){9999==l?e.show({mobile:o.mobile||"",callback:function(l,t){e.hide(),$.extend(a.data,{activate_code:l,picture_code:t||""}),c.ajax(a)}}):t.apply(null,arguments)},c.ajax(a)}});
;define("pagelet/money/bankcard/bankcard.js",function(n){var a=n("common/ui/tab.js"),e=n("common/vali/vali.js"),t=(n("common/util/util.js"),n("common/stip/stip.js")),i=n("pagelet/signform/field.js"),o=n("pagelet/privacy_validate/privacy_ajax.js");return function(n){function r(n){n.parseLocation=i.parseLocation,h.showbox_dl.html(v(n))}for(var c=[["input",{require:!0,label:"姓名",name:"pay_name"}],["identity_number",{require:!0,label:"身份证",name:"bank_identity_number"}],["input",{require:!0,label:"银行卡号",func:e.returnWrap(function(n){return e._int(n)&&"请输入正确的银行卡号"}),name:"bank_card_no"}],["input",{require:!0,label:"交易银行",name:"bank_name"}],["location",{name:"bank_location"}],["input",{require:!0,label:"开户支行",name:"bank_branch_name"}]],l=i(c,n.form),u={},b=[],m=0;m<n.bank_info.length;m++){var s=n.bank_info[m];u[s[0]]=s[1],b.push(s[0])}var d=_.findWhere(l,{name:"bank_branch_name"}),f=d.jbox.find(".jhint").addClass("sred"),p=_.findWhere(l,{name:"bank_name"});p.jvali.autocomplete({minLength:0,source:b}).focus(function(){$(this).trigger("input")}).blur(function(){$(this).trigger("change")}).change(function(){var n=$.trim($(this).val()),a=u[n];f.text(a?"若遗忘，可拨打"+n+"服务电话"+a+"查询":"")});var h=$("#bankcard").nodes(),k=a(h.editbtn.add(h.form_cancel),h.showbox.add(h.editbox)),v=window.wheei(h.showbox_tpl.html());r(n.form);var g=e($($.map(l,function(n){return n.jvali.toArray()})));h.form_btns_tr.before($($.map(l,function(n){return n.jbox.toArray()}))),h.form_ok.click(function(){g(function(n,a,e){return n?void t.alert(n):(e=$.so(e),$.extend(e,e.bank_location),delete e.bank_location,void o({url:"/bank_info/",data:e,callback:function(n,a,i,o){return 0!=n?void t.alert(a):(e.status=o.bank_message,e.bank_location=e.province+"/"+(e.city||""),r(e),k("show"),void t.alert("保存成功",!0))}}))})}),k("show")}});
;define("pagelet/money/billaccount/billaccount.js",function(t){function a(t){t.status_map=s;var a=$(_(t));r.summary_tpl.replaceWith(a);var o=a.nodes();o.draw.click(function(){t.withdraw_status.status_code?e.alert(t.withdraw_status.reject_reason):n.show()});var n=new i({title:"提现金额："+t.withdraw.can_withdraw+" 元",content:"帐户金额需大于100元才可申请提现。申请时间为每月1日到5日。我们将在提交申请后的20个工作日内安排打款，并代扣代缴个税。如遇节假日，打款时间顺延，具体到帐时间以银行为准。",btns:[{type:"ok",click:function(){n.hide(),c({url:"/api/pgc_accounting/",callback:function(t,a){return n.hide(),0!=t?void e.alert(a):void e.popupTip({msg:"申请提现成功",status:!0,duration:0,callback:function(){window.location.reload()}})}})}},{type:"cancel",click:function(){n.hide()}}]})}function o(t){function a(){var t=ko.mapping.fromJS($.olj({},o));return t.status_text=ko.computed(function(){return 0===this.pay_status()?this.pay_time()+" "+s[this.pay_status()]:s[this.pay_status()]},t),t}var o=["reason","withdraw_time","income_range","total_income_before_tax","tax","total_income_after_tax","pay_status","pay_time","income_range","total_income_before_tax","ad_before_tax","video_before_tax","praise_income","tax","total_income_after_tax","bank_user_name","bank_name","bank_card_no"];ko.applyBindings(ko.mapping.fromJS(t.detail_record||[],{create:function(t){var a=$.olj(t.data,o);return a.status_text=function(){return 0===this.pay_status?this.pay_time+" "+s[this.pay_status]:s[this.pay_status]}.call(a),a.show_note=function(t){ko.mapping.fromJS(t,n),r.note.modal()},a}}),r.log_tbody[0]);var n=a({});ko.applyBindings(n,r.note[0])}var n=t("common/util/util.js"),e=t("common/stip/stip.js"),i=t("common/popup/dialog.js"),c=t("pagelet/privacy_validate/privacy_ajax.js");$("body").hoverTitle();var r=$("#billaccount").nodes(),s=["提现成功","提现失败","被退回","待打款"],_=window.wheei(r.summary_tpl.html());$.holdReady(!0),n.ajax({method:"GET",url:"/media_income/data/withdraw/record/",callback:function(t,n,e){$.holdReady(!1),0==t&&(a(e),o(e))}})});
;define("pagelet/money/income/income.js",function(a){var e=a("common/util/util.js"),i=a("common/ui/daterange_pager.js"),t=a("common/pager/pager.js"),d=a("common/ui/tab.js");return function(a){var l=$("#income1").nodes();d(l.table_tabs.children().filter(".page_tab"),l.daily.add(l.praise))("daily"),$.holdReady(!1);var o=window.wheei(l.summary_tpl.html());e.ajax({method:"GET",url:"/media_income/data/toutiao_ad/abstract/",callback:function(i,t,d){if($.holdReady(!0),0==i){d.media=a.media;var s=$(o(d)),n=s.nodes();a.media.has_praise_permission?(n.praise_sw.checkbox(!!a.media.praise_status),n.praise_sw.change(function(){e.ajax("/media/set_praise_status/",{praise_status:n.praise_sw.checkbox()?1:0})})):n.praise_sw.remove(),l.summary_tpl.replaceWith(s)}}}),$.holdReady(!1);var s=window.wheei(l.daily_tpl.html());if(i($("<div/>").insertBefore(l.daily_table),$("<div/>").insertAfter(l.daily_table),function(i,t){e.ajax({method:"GET",data:i,url:"/media_income/data/toutiao_ad/detail/",callback:function(e,i,d){$.holdReady(!0),0==e&&(d.detail.media=a.media,l.daily_tbody.html(s(d.detail)),t({length:d.total_pagenum}))}})}),a.media.has_praise_permission){var n=window.wheei(l.praise_tpl.html());$.holdReady(!1),t({jele:$("<div/>").insertAfter(l.praise_table),cb:function(a,i){$.holdReady(!0),e.ajax({method:"GET",data:{pagenum:a},url:"/media_income/data/praise/detail/",callback:function(a,e,t){0==a&&(l.praise_tbody.html(n(t.list)),i({length:t.total_pagenum}))}})}})}else l.praise.hide(),l.praise_tab.hide()}});
;define("pagelet/money/self_sf/self_sf.js",function(a){var e=a("common/util/util.js"),t=$("#self_sf").nodes(),i=a("common/ui/daterange_pager.js"),n=ko.mapping.fromJS([],{key:function(a){return a.day},create:function(a){return $.olj(a.data,["day","impr","click","click_pct"])}});ko.applyBindings(n,t.daily_table[0]),i($("<div/>").insertBefore(t.daily_table),$("<div/>").insertAfter(t.daily_table),function(a,t){e.ajax({method:"GET",data:a,url:"/media_income/data/third_ad/detail/",callback:function(a,e,i){0==a&&(ko.mapping.fromJS(i.detail,n),t({length:i.total_pagenum}))}})})});
;define("pagelet/origin_article_delete/origin_article_delete.js",function(e,i,t){var l="/article/delete_dup_article/",n=window.listener,a=e("common/stip/stip.js");t.exports=Pagelet.extend({el:"#delete_article",events:{"click .j_sure":"onOkClick","click .j_cancel":"onCancelClick"},init:function(){this.plagiarismId=0,this.eventCenter()},eventCenter:function(){var e=this;n.on("delete_article_show","deletePlagiarismArticleDialog",function(i,t){e.plagiarismId=t.plagiarism_id,e.$el.find(".spopup_fixed").show()})},onOkClick:function(){var e=this;$.ajax({url:l,type:"POST",dataType:"json",data:{plagiarism_id:this.plagiarismId}}).done(function(i){i.message="success","success"===i.message&&(e.$el.find(".spopup_fixed").hide(),e.changeDeleteText(e.plagiarismId))}).fail(function(){a.popupTip({msg:"提交错误，请重试",status:!1})})},onCancelClick:function(){this.$el.find(".spopup_fixed").hide()},changeDeleteText:function(e){var i={plagiarism_id:e};n.trigger("delete_article_success","deleteArticle",i)}})});
;define("pagelet/origin_article_num/origin_article_num.js",function(i,t,n){var e=window.listener;n.exports=Pagelet.extend({el:"#origin_manage_article_detail",events:{"click $sign_now_article":"nowSignClick"},init:function(i){var t=this.convertTimeFormat(i.create_time);this.flag=i.has_sign_right_status,this.dataInit(t),this.signStatusCheck(this.flag)},convertTimeFormat:function(i){var t=new Date(1e3*i),n=t.getFullYear(),e=t.getMonth()+1,a=t.getDate(),s=t.getHours(),g=t.getMinutes(),o=t.getSeconds();return i=n+"/"+(e>9?e:"0"+e)+"/"+(a>9?a:"0"+a)+" "+(s>9?s:"0"+s)+":"+(g>9?g:"0"+g)+":"+(o>9?o:"0"+o)},assignText:function(i,t){this.$el.find(i).text(t)},dataInit:function(i){this.assignText(".j_article_time",i)},nowSignClick:function(){e.trigger("origin_manage_sign_modal_show","showModal")},signStatusCheck:function(i){var t=[".j_no_sign",".j_signing",".j_signed",".j_sign_fail"],n=this.$el.find(t[i]);n.show().siblings(".add_text").hide()}})});
;define("pagelet/origin_article_table/origin_article_table.js",function(require,exports,module){var plagiarismStatus=["疑似抄袭","确认抄袭","非抄袭","确认抄袭","不抄袭"],rightsStatus=["待维权","维权中","维权成功","维权失败"],plagiarismPlatform={weixin:"微信",toutiao:"头条号"},articleOperateStatus=[".confirm-plagiarism",".confirm-reprint",".reprint"],plagiarism_article_template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="<tr>\n	<td><span class='account-name' title='"+(null==(__t=plagiarism_account)?"":_.escape(__t))+"'>"+(null==(__t=plagiarism_account)?"":_.escape(__t))+"</span></td>\n	<td>"+(null==(__t=plagiarism_platform)?"":_.escape(__t))+'</td>\n	<td><span class="title" title="'+(null==(__t=plagiarism_title)?"":_.escape(__t))+'">'+(null==(__t=plagiarism_title)?"":_.escape(__t))+"</span></td>\n	<td>"+(null==(__t=plagiarism_status)?"":_.escape(__t))+"</td>\n	<td>"+(null==(__t=rights_status)?"":_.escape(__t))+"</td>\n	<td>\n		<span class='plagiarism td-text' data-node='plagiarism' plagiarism-id='"+(null==(__t=plagiarism_id)?"":_.escape(__t))+"'>确认抄袭</span>\n		<span class='reprint td-text' data-node='reprint' plagiarism-id='"+(null==(__t=plagiarism_id)?"":_.escape(__t))+"'>确认转载</span>\n		<span class='delete td-text' data-node='delete' plagiarism-id='"+(null==(__t=plagiarism_id)?"":_.escape(__t))+"'>举报删除</span>\n		<span class='delete_success td-text' data-node='delete_success'>「已删除」</span>\n		<span class='confirm-plagiarism td-text' data-node='confirm-plagiarism'>「已确认抄袭」</span>\n		<span class='confirm-reprint td-text' data-node='confirm-reprint'>「已授权转载」</span>\n		<span class=\"td-text no-right\" data-node='no-right'>无法维权<i id='right-hint' class=\"sign-hint-tip\" data-title='签约之前的原创文章无法进行维权'></i></span>\n	</td>\n</tr>\n";return __p},eventCenter=window.listener,urlList="/article/plagiarism_article_list/",urlPlagiarism="/article/confirm_plagiarism_post/",urlTransfer="/article/confirm_transfer_post/",pager=require("common/pager/pager.js"),stip=require("common/stip/stip.js");module.exports=Pagelet.extend({el:"#plagiarism_list",events:{"click $plagiarism":"onConfirmPlagiarismClick","click $reprint":"onConfirmReprintClick","click $delete":"onConfirmDeleteClick"},init:function(t){this.flag={},this.flag.article_create_time=t.create_time,this.flag.has_sign_right_status=t.has_sign_right_status,this.flag.right_knight_sign_modify_time=t.right_knight_sign_modify_time,this.eventCenter(),this.httpRequest(this.flag)},eventCenter:function(){eventCenter.on("delete_article_success","deleteArticle",function(t,i){var a=$("span[plagiarism-id="+i.plagiarism_id+"]")[2];$(a).hide().siblings(".delete_success").show()})},signStatusCheck:function(t,i,a,e,s,r){var n=a.find(".no-right"),l=a.find("#right-hint");1===t&&"weixin"===r?i.showWeixinOperate(a,e):1===t&&"toutiao"===r?i.showToutiaoOperate(a,s):0===t&&(this.showEle(n),l.hoverTip())},httpRequest:function(t){var i=this,a=20,e=location.search.substring(9);pager({jele:$(".pager-plagiarism"),cb:function(s,r){s-=1,$.ajax({type:"GET",url:urlList,dataType:"json",data:{page_no:s,count:a,item_id:e}}).done(function(e){if("success"===e.message){if(!e.data)return;var s,n=$("#article_detail_list"),l=e.data,p=Math.ceil(l.total_count/a);r({length:p}),s=i.dataProcess(l,t),n.html(s)}}).fail(function(){stip.popupTip({msg:"出现错误，请重试",status:!1})})}})},dataProcess:function(t,i){var a,e,s,r,n,l,p=this,_=t.plagiarism_article_stats_list,o=[],c=i.right_knight_sign_modify_time,g=i.article_create_time,d=i.has_sign_right_status;if(0===_.length)return o;l="0"===c||c>g&&"2"===d?0:1;for(var m=0;m<_.length;m++)a=_[m],s=a.plagiarism_status,n=a.plagiarism_platform,a.plagiarism_status=plagiarismStatus[a.plagiarism_status-1],r=a.rights_status,a.rights_status=rightsStatus[a.rights_status-1],a.plagiarism_platform=plagiarismPlatform[a.plagiarism_platform],e=$(plagiarism_article_template(a)),p.signStatusCheck(l,p,e,s,r,n),o.push(e);return o},showWeixinOperate:function(t,i){1===i||5===i?(this.showEle(t.find(".plagiarism")),this.showEle(t.find(".reprint"))):this.showEle(t.find(articleOperateStatus[i-2]))},showToutiaoOperate:function(t,i){this.showEle("3"===i?t.find(".delete_success"):t.find(".delete"))},showEle:function(t){t.show()},onConfirmPlagiarismClick:function(t){var i=$(t.target);i.hide();var a=i.parent();a.find(".reprint").hide(),a.find(".confirm-plagiarism").show();var e=i.attr("plagiarism-id");$.ajax({url:urlPlagiarism,type:"POST",dataType:"json",data:{plagiarism_id:e}}).done(function(t){"success"!==t.message.toLowerCase()}).fail(function(){stip.popupTip({msg:"提交错误，请重试",status:!1})})},onConfirmReprintClick:function(t){var i=$(t.target);i.hide();var a=i.parent();a.find(".plagiarism").hide(),a.find(".confirm-reprint").show();var e=i.attr("plagiarism-id");$.ajax({url:urlTransfer,type:"POST",dataType:"json",data:{plagiarism_id:e}}).done(function(t){"success"!==t.message.toLowerCase()}).fail(function(){stip.popupTip({msg:"提交错误，请重试",status:!1})})},onConfirmDeleteClick:function(t){var i=$(t.target),a=i.attr("plagiarism-id"),e={plagiarism_id:a};eventCenter.trigger("delete_article_show","deletePlagiarismArticleDialog",e)}})});
;define("pagelet/origin_manage/origin_manage.js",function(i,t,e){var s=(window.listener,window.comStorage);e.exports=Pagelet.extend({el:"#pagelet-origin",events:{"click .j_select_article_list":"onListClick","click .j_select_white_list":"onListClick"},init:function(){this.articleList=this.$el.find(".j_article_list"),this.whiteList=this.$el.find(".j_white_list"),this.getFirstLocalVal()},onListClick:function(i){var t=$(i.target);t.addClass("selected").siblings().removeClass("selected"),this.articleList.toggleClass("active",t.hasClass("j_select_article_list")),this.whiteList.toggleClass("active",t.hasClass("j_select_white_list"))},getFirstLocalVal:function(){var i=s.get("originManageFlag");"1"!==i&&($("#origin_manage_sign_modal").modal("show"),s.set("originManageFlag","1"))}})});
;define("pagelet/origin_manage_add_white_list/origin_manage_add_white_list.js",function(t,i,e){var n="/add_plagiarism_white/",a=window.listener,o=t("common/popup/dialog.js"),r=t("common/stip/stip.js");e.exports=Pagelet.extend({el:"#add_white_list",events:{"click .btn-ok":"btnOkClick","click .btn-cancel":"btnCancelClick","change #platform":"getPlatformVal","keyup #white-list-hint":"wordNumCheck","click .j_sign":"goSignClick","click .j_cancel":"onCancelClick"},init:function(){this.$platform=this.$el.find("#platform"),this.$idErronHint=this.$el.find("#id-error-id-hint"),this.$nameErronHint=this.$el.find("#id-error-name-hint"),this.$countName=this.$el.find("#countName"),this.$countId=this.$el.find("#countId"),this.$whiteListHint=this.$el.find("#white-list-hint"),this.$whiteListModal=this.$el.find("#add_white_list_modal"),this.$wordNumCheck=this.$el.find(".j-word-check"),this.platformVal=this.getPlatformVal(),this.eventCenter()},eventCenter:function(){var t=this;a.on("add_white_list_show","showWhiteList",function(i,e){var n=e.sign_status;switch(n){case"1":var a=o({btns:[{type:"ok",click:function(){a.remove()}}],title:"提示",content:"签约中的头条号作者暂时无法使用白名单功能"}).show();break;case"2":t.$whiteListModal.modal("show"),t.dataInit();break;case"0":case"3":t.$el.find(".spopup_fixed").show()}})},dataInit:function(){var t=this;this.platformVal="1",t.$platform.val("1"),t.clearInputValue(),t.hideElement(t.$idErronHint),t.hideElement(t.$nameErronHint),this.$countName.removeAttr("readonly").removeClass("selectPgc").attr("placeholder","必须填写"),this.$countId.removeAttr("placeholder"),this.$wordNumCheck.hide()},showElement:function(t){t.show()},hideElement:function(t){t.hide()},getInputValue:function(){var t=$.trim(this.$platform.val());return{platform:this.platformConvertToString(t),authorized_account:$.trim(this.$countName.val()),authorized_account_id:$.trim(this.$countId.val()),remarks:$.trim(this.$whiteListHint.val())}},platformConvertToString:function(t){return"1"===t?"weixin":"2"===t?"toutiao":void 0},getPlatformVal:function(){var t=$.trim(this.$platform.val());return this.platformVal=t,this.clearInputValue(),this.clearErrorHint(),"2"===t?(this.$countName.attr("readonly","true").addClass("selectPgc").removeAttr("placeholder"),this.$countId.attr("placeholder","只能填写数字"),this.$wordNumCheck.hide()):"1"===t&&(this.$countName.removeAttr("readonly").removeClass("selectPgc").attr("placeholder","必须填写"),this.$countId.removeAttr("placeholder"),this.$wordNumCheck.hide()),t},clearErrorHint:function(){this.hideElement(this.$idErronHint),this.hideElement(this.$nameErronHint)},clearInputValue:function(){this.$countName.val(""),this.$countId.val(""),this.$whiteListHint.val("")},pgcCheck:function(){var t=this.getInputValue();return this.$idErronHint.toggle(!this.countIdCheck()),"toutiao"===t.platform&&0!==t.authorized_account_id.length?!0:!1},weChatCheck:function(){var t=this,i=t.getInputValue();return t.$nameErronHint.toggle(!i.authorized_account),"weixin"===i.platform&&0!==i.authorized_account.length?!0:!1},countIdCheck:function(){var t=this.$countId.val(),i=/^\d+$/;return i.test(t)},countNameCheck:function(t){return 0==t.length?!1:!0},inputCheck:function(){return"1"===this.platformVal?this.weChatCheck():this.pgcCheck()&&this.countIdCheck()},wordNumCheck:function(t){var i=this.$wordNumCheck;i.show();var e=$(t.target);e.val().length>=50?i.addClass("red"):i.removeClass("red"),i.html(e.val().length+"/50")},btnCancelClick:function(){this.$whiteListModal.modal("hide"),this.$wordNumCheck.hide()},addMsgToList:function(t){var i=this.getInputValue();i.curTime=(new Date).getTime(),i.whiteId=t,a.trigger("add_white_list_success","addData",i)},btnOkClick:function(){var t=this;if(t.inputCheck()){var i=this.getInputValue();$.ajax({url:n,type:"POST",dataType:"json",data:i}).done(function(i){"success"===i.message&&(t.$whiteListModal.modal("hide"),t.addMsgToList(i.white_id))}).fail(function(){r.popupTip({msg:"提交错误，请重试",status:!1})})}},goSignClick:function(){a.trigger("origin_manage_sign_modal_show","showModal"),this.$el.find(".spopup_fixed").hide()},onCancelClick:function(){this.$el.find(".spopup_fixed").hide()}})});
;define("pagelet/origin_manage_articles_num/origin_manage_articles_num.js",function(i,n,g){var s=window.listener;g.exports=Pagelet.extend({el:"#origin_manage_article_num",events:{"click $sign_now":"nowSignClick","click $re_sign":"nowSignClick"},init:function(i){this.$el=$(this.el),this.signFlag=i.has_sign_right_status,this.signCheck(this.signFlag)},signCheck:function(i){var n=[".j_no_sign",".j_signing",".j_signed",".j_sign_fail"],g=this.$el.find(n[i]);g.show().siblings(".add_text").hide()},nowSignClick:function(){s.trigger("origin_manage_sign_modal_show","showModal")}})});
;define("pagelet/origin_manage_articles_table/origin_manage_articles_table.js",function(require,exports,module){{var originArticleTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="<tr>\n	<td>"+(null==(__t=create_time)?"":_.escape(__t))+'</td>\n	<td><span class="title" title="'+(null==(__t=title)?"":_.escape(__t))+'">'+(null==(__t=title)?"":_.escape(__t))+"</span></td>\n	<td>"+(null==(__t=suspect_plagiarism_count)?"":_.escape(__t))+"</td>\n	<td>"+(null==(__t=confirm_plagiarism_count)?"":_.escape(__t))+"</td>\n	<td>"+(null==(__t=succ_right_count)?"":_.escape(__t))+'</td>\n	<td><a href="/article/item_plagiarism_stats/?item_id='+(null==(__t=item_id)?"":_.escape(__t))+"\" tid='"+(null==(__t=item_id)?"":_.escape(__t))+"' target=\"_blank\" data-node='article_detail'>详情</a></td>\n</tr>\n\n";return __p};window.listener}url_list="/origin_article_list/",pager=require("common/pager/pager.js"),stip=require("common/stip/stip.js"),module.exports=Pagelet.extend({el:"#origin_article",events:{},init:function(){this.httpRequest()},httpRequest:function(){var t=this;pager({jele:$(".pager-articles"),cb:function(e,a){e-=1;var i=20;$.ajax({type:"GET",url:url_list,dataType:"json",data:{page_no:e,count:i}}).done(function(e){if("success"===e.message){if(!e.data)return;var _=e.data;total_pages=Math.ceil(_.total_count/i),a({length:total_pages});var r=$("#article_list");origin_article_stats_list=_.origin_article_stats_list;var n=t.dataProcess(origin_article_stats_list);r.html(n)}}).fail(function(){stip.popupTip({msg:"出现错误，请重试",status:!1})})}})},dataProcess:function(t){if(0===t.length)return"";for(var e,a,i=[],_=0;_<t.length;_++)e=t[_],e.create_time=this.convertTimeFormat(e.create_time),a=$(originArticleTemplate(e)),i.push(a);return i},convertTimeFormat:function(t){var e=new Date(1e3*t),a=e.getFullYear(),i=e.getMonth()+1,_=e.getDate();return t=a+"/"+(i>9?i:"0"+i)+"/"+(_>9?_:"0"+_)}})});
;define("pagelet/origin_manage_sign/origin_manage_sign.js",function(i,e,t){var r=window.listener,n=i("common/util/util.js"),a="/sign_up/",s=i("common/stip/stip.js");t.exports=Pagelet.extend({el:"#origin_manage_sign_modal",events:{"click $btn-exit":"btnExitClick","click $btn-submit":"btnSubmitClick","click .front-upload":"uploadFrontImage","click .reverse-upload":"uploadReverseImage"},init:function(){this.id_card_front_img_url="",this.id_card_behind_img_url="",this.file_front_name="",this.file_reverse_name="",this.upload_front=this.uploadFrontPicture(),this.upload_reverse=this.uploadReversePicture(),this.$name=this.$el.find(".name"),this.$address=this.$el.find(".address"),this.$nameErrorHint=this.$el.find("#name-hint"),this.$addressErrorHint=this.$el.find("#address-hint"),this.$frontPicErrorHint=this.$el.find("#front-pic-hint"),this.$reversePicErrorHint=this.$el.find("#reverse-pic-hint"),this.eventCenter()},eventCenter:function(){var i=this;r.on("origin_manage_sign_modal_show","showModal",function(){i.$el.modal("show")})},uploadFrontImage:function(){var i=this;i.upload_front.input.trigger("click")},uploadReverseImage:function(){var i=this;i.upload_reverse.input.trigger("click")},uploadFrontPicture:function(){var i=this,e=new Uploader({container:i.$el.find(".j-upload-image-f"),trigger:i.$el.find(".j-upload-image-f"),name:"upfile",action:"/tools/upload_picture/",accept:"image/*",change:function(e){i.file_front_name=e[0].name,n.loadingShow(),this.submit()},error:function(){n.loadingHide(),alert("上传失败")},success:function(e){n.loadingHide();try{"success"===e.state.toString().toLowerCase()?(i.id_card_front_img_url=e.url,$("#front_file_name").text(i.file_front_name).prev().hide()):alert("上传失败")}catch(t){alert("上传失败")}}});return e},uploadReversePicture:function(){var i=this,e=new Uploader({container:i.$el.find(".j-upload-image-r"),trigger:i.$el.find(".j-upload-image-r"),name:"upfile",action:"/tools/upload_picture/",accept:"image/*",change:function(e){i.file_reverse_name=e[0].name,n.loadingShow(),this.submit()},error:function(){n.loadingHide(),alert("上传失败")},success:function(e){n.loadingHide();try{"success"===e.state.toString().toLowerCase()?(i.id_card_behind_img_url=e.url,$("#reverse_file_name").text(i.file_reverse_name).prev().hide()):alert("上传失败")}catch(t){alert("上传失败")}}});return e},getInputValue:function(){return{author_name:$.trim(this.$name.val()),address:$.trim(this.$address.val()),id_card_front_img_url:this.id_card_front_img_url,id_card_behind_img_url:this.id_card_behind_img_url}},showElement:function(i){i.show()},hideElement:function(i){i.hide()},errorHint:function(){var i=$.trim(this.$name.val());this.$nameErrorHint.toggle(!i);var e=$.trim(this.$address.val());this.$addressErrorHint.toggle(!e),this.$frontPicErrorHint.toggle(!this.id_card_front_img_url),this.$reversePicErrorHint.toggle(!this.id_card_behind_img_url)},inputCheck:function(){return $.trim(this.$name.val())&&$.trim(this.$address.val())&&this.id_card_front_img_url&&this.id_card_behind_img_url?!0:!1},clearAllValue:function(){this.$name.val(""),this.$address.val(""),this.id_card_front_img_url="",this.id_card_behind_img_url="",this.hideElement(this.$nameErrorHint),this.hideElement(this.$addressErrorHint),this.hideElement(this.$frontPicErrorHint),this.hideElement(this.$reversePicErrorHint),$("#front_file_name").text("").hide().prev().show(),$("#reverse_file_name").text("").hide().prev().show()},btnExitClick:function(){var i=this;i.$el.modal("hide"),i.clearAllValue()},btnSubmitClick:function(){var i=this;if(this.errorHint(),i.inputCheck()){var e=i.getInputValue();$.ajax({url:a,type:"POST",dataType:"json",data:e}).done(function(e){"success"===e.message&&i.$el.modal("hide")}).fail(function(){s.popupTip({msg:"提交错误，请重试",status:!1})})}}})});
;define("pagelet/origin_manage_white_list/origin_manage_white_list.js",function(require,exports,module){var eventCenter=window.listener,url_list="/plagiarism_white_list/",url_delete="/delete_plagiarism_white/",white_list_template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="<tr>\n	<td>"+(null==(__t=account_type)?"":_.escape(__t))+"</td>\n	<td>"+(null==(__t=authorized_account)?"":_.escape(__t))+"</td>\n	<td>"+(null==(__t=authorized_account_id)?"":_.escape(__t))+"</td>\n	<td>"+(null==(__t=create_time)?"":_.escape(__t))+'</td>\n	<td><a href="javascript:void(0);" whiteId=\''+(null==(__t=white_id)?"":_.escape(__t))+"' data-node='del_white_id'>删除</a></td>\n</tr>\n\n";return __p},pager=require("common/pager/pager.js"),stip=require("common/stip/stip.js");module.exports=Pagelet.extend({el:"#white_list",events:{"click $add_white_list":"addWhiteListClick","click $del_white_id":"deleteWhiteListClick"},init:function(t){this.$el=$(this.el),this.sign_status=t.has_sign_right_status,this.httpRequest(),this.eventCenter()},convertSelectValToText:function(t){return"weixin"===t?"微信":"toutiao"===t?"头条号":void 0},eventCenter:function(){var t=this;eventCenter.on("add_white_list_success","addData",function(e,i){i.platform=t.convertSelectValToText(i.platform);var a="<tr><td>"+i.platform+"</td><td>"+i.authorized_account+"</td><td>"+i.authorized_account_id+"</td><td>"+t.convertTimeFormat(i.curTime)+'</td><td><a href="javascript:void(0);" whiteId='+i.whiteId+' data-node="del_white_id">删除</a></td></tr>';t.$el.find("#white_list_content").append(a)})},httpRequest:function(){var t=this;pager({jele:$(".pager-white"),cb:function(e,i){e-=1;var a=20;$.ajax({type:"GET",url:url_list,dataType:"json",data:{page_no:e,count:a}}).done(function(e){if("success"===e.message){if(!e.data)return;var n=e.data,r=Math.ceil(n.total_count/a);i({length:r});var s=$("#white_list_content"),_=n.plagiarism_white_list,o=t.dataProcess(_);s.html(o)}}).fail(function(){stip.popupTip({msg:"出现错误，请重试",status:!1})})}})},dataProcess:function(t){var e,i,a=[];if(0===t.length)return"";for(var n=0;n<t.length;n++)e=t[n],e.account_type=this.convertSelectValToText(e.account_type),0===e.authorized_account_id&&(e.authorized_account_id=""),e.create_time=this.convertTimeFormat(1e3*e.create_time),i=$(white_list_template(e)),a.push(i);return a},convertTimeFormat:function(t){var e=new Date(t),i=e.getFullYear(),a=e.getMonth()+1,n=e.getDate();return t=i+"/"+(a>9?a:"0"+a)+"/"+(n>9?n:"0"+n)},deleteWhiteListClick:function(t){var e=$(t.target),i=e.attr("whiteId"),a={white_id:i};$.ajax({url:url_delete,type:"POST",dataType:"json",data:a,success:function(t){"success"!==t.message},error:function(){stip.popupTip({msg:"出现错误，请重试",status:!1})}}),this.updataData(e)},updataData:function(t){t.text("已删除"),t.addClass("delete_style")},addWhiteListClick:function(){var t={sign_status:this.sign_status};eventCenter.trigger("add_white_list_show","showWhiteList",t)},nowSignClick:function(){eventCenter.trigger("origin_manage_sign_modal_show","showModal")}})});
;define("pagelet/original_tag/original_apply.js",function(t,i,s){var e=t("common/stip/stip.js");s.exports=Pagelet.extend({el:".origin-tag-wrap",events:{"click .j_debut_submit":"debutSubmit","click .debut-notify-dialog .ok":function(){location.href="/account_info/"}},init:function(t){this.spec=t;var i=this.spec.status;this.checkStatus()&&(this.formDisabled(),this.showDialog(),this.$el.find(".j-debut-message").text(this.getMessage(i)))},checkStatus:function(){var t=this.spec.status;return 1==t||2==t||4==t||5==t||6==t||7==t?!0:!1},getMessage:function(t){return 1==t?"等待审核":2==t?"您已经获得原创标签权限":4==t?"正在审核中":5==t?"只支持个人、媒体类型头条号申请原创标签":6==t?"该原创邀请链接已经被使用过":7==t?"邀请码不存在":void 0},formDisabled:function(){this.$el.find(".debut-form-body").find("input").attr("disabled","disabled"),this.$el.find(".j_debut_submit").addClass("disabled")},showDialog:function(){this.$el.find(".debut-notify-dialog").modal({show:!0,backdrop:"static"})},debutSubmit:function(){var t=this,i={},s=!0;return this.checkStatus()?!1:(this.$el.find(".debut-form-body").find("input").each(function(){$.trim($(this).val())&&(s=!1),i[$(this).data("name")]=$(this).val()}),i.other&&i.other.replace(/\u003b|\uff1b/g,";"),s?(e.popupTip({msg:"请至少填写一项"}),!1):(i.invite_code=t.spec.invite_code,void $.post("/apply_claim_origin_post/",i).always(function(t){t.message&&t.reason||(t.reason="请求失败，请稍后重试"),e.popupTip("success"===t.message?{msg:t.reason,status:!0,callback:function(){location.href="/account_info/"}}:{msg:t.reason})})))}})});
;define("pagelet/original_tag/tag.js",function(i,e,t){t.exports=function(){var e,t=i("common/stip/stip.js"),a=i("common/vali/vali.js"),n={isChecked:!1},o=$({}),r=$("#apply_create_label"),d=$(".apply_create_label_modal"),c=d.find(".apply_create_slide"),l=d.find(".nav_arrow"),u=c.find(".apply_create_yes_radio"),s=c.find(".apply_create_no_radio"),f=c.find(".origin_mp"),m=c.find(".origin_other"),g=$("#origin-todo"),h=$("#origin-done"),b=$("#origin-hint-detail"),p=$("#origin-mark"),v=!1,k=!0,x=!1,C="",y=function(){r.checkbox(),u.checkbox(),s.checkbox()};y(),o.on("spec.init",function(i,t){if(!t.claim_origin_permission)return!1;if(n.claim_origin=t.claim_origin,n.pgc_debut=t.pgc_debut,n.debut_url=t.debut_url,n.debut_mp=t.debut_mp,n.debut_author=t.debut_author,C=t.media_name,e=t.after_pass_modify,n.claim_origin&&(v=!0,r.checkbox(n.claim_origin),n.isChecked=v),n.pgc_debut||k?(u.checkbox(!0),m.removeClass("origin_active"),f.addClass("origin_active"),j()):(s.checkbox(!0),m.addClass("origin_active"),f.removeClass("origin_active"),$('[data-name="debut_url"]').val(n.debut_url),$('[data-name="debut_platform"]').val(n.debut_mp),$('[data-name="debut_other_author"]').val(n.debut_author)),n.claim_origin){$("#origin-todo").hide(),$("#origin-done").show(),e&&$("#origin-done").find(".origin-modify").hide();var a=!0,o="非首发";w(),n.pgc_debut?(a=!1,o="首发"):($('[data-name="debut_url"]').val(n.debut_url),$('[data-name="debut_platform"]').val(n.debut_mp),$('[data-name="debut_other_author"]').val(n.debut_author)),p.find(".origin-url").parent().toggle(a),p.find(".origin-first").text(o),p.find(".origin-url").text(n.debut_url),p.find(".origin-platform").text(n.debut_mp),p.find(".origin-author").text(n.debut_author)}}),r.change(function(){v?(o.trigger("cancel"),v=!1):(d.modal("show"),v=!0),n.isChecked=v});var w=function(){k?(k=!1,m.addClass("origin_active"),f.removeClass("origin_active")):(k=!0,m.removeClass("origin_active"),f.addClass("origin_active")),u.checkbox(k),s.checkbox(!k),u.hasClass("checked")&&j()},j=function(){$('[data-name="debut_mp"]').val("头条号").attr("disabled",!0).css({color:"#ccc"}),$('[data-name="debut_author"]').val(C).attr("disabled",!0).css({color:"#ccc"})},q=function(){var i=".left";l.find(".left").hasClass("cur")&&(i=".right"),l.find(".cur").removeClass("cur"),l.find(i).addClass("cur")};u.change(function(){w()}),s.change(function(){w()}),d.on("click",".apply_create_close",function(){d.modal("hide")}),d.on("click",".cancel",function(){d.modal("hide")}).on("hide.bs.modal",function(){x||(r.checkbox(!1),r.change()),x=!1}).on("click",".next",function(){c.eq(0).animate({"margin-left":"-800px"}),q()}).on("click",".pre",function(){c.eq(0).animate({"margin-left":"0px"}),q()}).on("click",".ok",function(){var i,e="success",o="请填写",r=c.find("[data-name=debut_platform]").val(),l=c.find("[data-name=debut_other_author]").val();if(c.find(".origin_active").each(function(){var r=$(this).find("input");if(i=r.val(),"debut_url"==r.data("name")){var d=a.url(i);if(!$.trim(i))return t.alert(o+r.siblings("label").text()),e="fail",!1;if(d)return t.alert(d),e="fail",!1}return i?void(n[r.data("name")]=i):(t.alert(o+r.siblings("label").text()),e="fail",!1)}),"fail"==e)n={};else{n.pgc_debut=k,n.debut_mp=k?n.debut_mp:r,n.debut_author=k?n.debut_author:l,x=!0,d.modal("hide"),g.hide(),h.show();var _,s=!0;u.hasClass("checked")?(_="首发",n.debut_url="",s=!1):(_="非首发",s=!0),p.find(".origin-url").parent().toggle(s),p.find(".origin-first").text(_),p.find(".origin-url").text(n.debut_url),p.find(".origin-platform").text(n.debut_mp),p.find(".origin-author").text(n.debut_author)}}),h.on("click",".origin_ready",function(){e||(g.show(),h.hide(),x=!1,_.each(_.keys(n),function(i){n[i]=null}))}),h.on("click",".origin-modify",function(){d.modal("show")});var T;return p.on("mouseleave",".origin-hint",function(){T=setTimeout(function(){b.hide()},300)}),b.on("mouseleave",function(){$(this).hide()}).on("mouseenter",function(){T&&clearTimeout(T)}),{debutData:n,$debutEvent:o}}()});
;define("pagelet/password/password.js",function(o){return function(s){var a=o("common/util/util.js"),t=o("common/stip/stip.js"),i=o("common/vali/vali.js"),e=o("pagelet/signform/field.js"),n=$("#pagelet_password").nodes(),p=e.getEle("password2",{name:"password"});n.start.after(p.jbox);var c=i(p.jvali);n.submit.click($.loadDone(function(o){c(function(i,e,n){i?(o(),$("body").animate({scrollTop:e.offset().top-10},200,function(){e.focus()})):(n=$.so(n),n.verify_code=s.verify_code,n.email=s.email,a.ajax("/reset_password_post/",n,function(s,a){o(),t.popupTip(0===s?{status:!0,msg:a,callback:function(){window.location="/"}}:{status:!1,msg:a})}))})})),n.resend.click($.loadWrap(function(){return a.ajax("/forget_password/",{email:s.email},function(o,s){t.popupTip({status:0===o,msg:s})})}))}});
;define("pagelet/pureVideo/video-v2.js",function(e,o,i){function t(e,o){window.console&&"function"==typeof window.console.log&&(o&&console.log(">>>>> "+o+" start >>>>>"),console.log(e),o&&console.log("<<<<< "+o+" end <<<<<"))}function s(e,o,i,s){var a="{}";return $.ajax({type:s||"POST",async:o,url:"/video/video_api/",data:{json_data:JSON.stringify(e)},dataType:"json"}).done(function(e){"success"==e.message?a=e.data:!i&&g("alert","服务异常："+e.reason+" 请稍后重试"),t(e,"exec_api")}).fail(function(){F().error("抱歉，服务异常，请稍后再试",$.getNginxLogId(arguments)),!i&&g("alert","抱歉，服务异常，请稍后再试"),t("error : exec_api fail")}),a}function a(e){return e=e.toLowerCase(),J.indexOf(e)>-1?!0:!1}function d(e){if(e){var o=e.name,i=e.size||0,d=/.*\.([^.]+)$/.exec(o),r=d?d[1]:"",l=k?"chunk_upload_info":"get_upload_info",n={api:l},v=k?md5(o+"-"+i):"";if(!a(r))return void g("alert","选择的文件不在系统支持的格式范围之内，目前接受如下视频格式："+J);if(i>D)return void g("alert","视频不能超过2G大小");if(k){var u=window.localStorage.getItem(v);if(u){var c={api:"chunk_upload_index",ref_id:u},p=JSON.parse(s(c,!1,!0));if(t(p,"chunk_upload_index"),0==p.code){var m=p.bytes,f=p.url;if(m>=0)return{upload_url:f,vid:u,vname:o,uploadedBytes:m,resumable:!0,v_md5:v}}}}var _=JSON.parse(s(n,!1));if(t(_,"upload_init"),0==_.code){var b=_.upload_url,h=_.upload_id;return b=b.replace(/^http(s)?:\/\//i,Q?"https://":"http://"),k&&window.localStorage.setItem(v,h),{upload_url:b,vid:h,vname:o,uploadedBytes:-1,resumable:!1,v_md5:v}}return _.message&&g("alert",_.message),null}}function r(e){var o={api:"meta",ref_id:e?e:Z.vid},i=JSON.parse(s(o,!1,!0)),a=!1,d="",l=!1;if(t(i,"get_transcoding_status"),0==i.code){var n=i.data,v=n.status,d=n.video_name||"";if("10"==v)a=!0,Z.status="success",Z.vposter=$(".video-poster").attr("src")==h?n.img:$(".video-poster").attr("src"),X.html(""),P.addClass("video-success").removeClass("video-processing").removeClass("video-fail"),Y.text("视频上传成功，处理完毕");else if("30"==v)a=!0,Z.status="transcoding",P.is(".video-processing")||(P.addClass("video-processing").removeClass("video-success").removeClass("video-fail"),Y.text("视频上传成功，处理中...")),O=setTimeout(r,N);else{Z.status="fail",F().error("视频处理失败"+JSON.stringify(Z)),P.addClass("video-fail").removeClass("video-processing").removeClass("video-success");var u="20"==v?"视频上传成功，处理失败":"视频处理失败";Y.text(u)}}else i.code?(Z.status="error",!e&&x>0?(t("失败重试倒数第："+x+"次"),x--,O=setTimeout(r,N)):(Z.status="fail",P.addClass("video-fail").removeClass("video-processing").removeClass("video-success"),Y.text(i.message))):(l=!0,O=setTimeout(r,N),F().warming("视频状态查询失败视频数据:"+JSON.stringify(Z)+"返回的数据:"+JSON.stringify(i)),t("转码查询 未返回有效ret"));l||(a?(E.submit_video.vid=Z.vid,E.submit_video.vu=Z.vu,E.submit_video.vname=d,E.submit_video.vposter=Z.vposter):(E.submit_video.vid=0,E.submit_video.vu="",E.submit_video.vname="",E.submit_video.vposter=""))}function l(e){e&&(V.addClass("poster-cell"),H.html('<img class="video-poster" src="'+_.e(e)+'">'),$('<button type="button" class="new-btn modify-poster" ga="2视频封面-纯视频">设置视频封面</button>').click(function(){R.show({id:Z.vid,type:2,source:"纯视频",success:function(e,o){X.find("img").attr("src",o),H.find("img").attr("src",o),Z.vposter=o,E.submit_video.vposter=o},video_status:Z.status,not_cover_save:!0})}).appendTo(H))}function n(e){"object"==typeof e&&e.vposter&&(X.html(""),P.addClass("video-success").removeClass("video-processing").removeClass("video-fail"),Y.text("视频上传成功，处理完毕"),q.text(e.vname),l(e.vposter))}function v(e,o){if(e>0){o>e&&(o=e);var i=(o/e*100).toFixed(2),t=(e/w).toFixed(2)+"MB",s=(o/w).toFixed(2)+"MB",a=M.data("loaded")||0;o>a&&(M.data("loaded",o).text(s+"/"+t),K.get(0).style.width=i+"%")}}function u(){var e={api:"upload_progress",ref_id:Z.vid},o=JSON.parse(s(e,!1,!0));t(o,"video_upload_progress");try{if(0==o.code){var i=o.data.total_size,a=o.data.upload_size;v(i,a)}}catch(d){}}function c(){C&&(R.clearData(),C.abort(),C=null,A.addClass("hide"),I.removeClass("hide").addClass("video-reupload"),y&&clearInterval(y),K.get(0).style.width="0%",M.data("loaded",0))}function p(e){E=e;var o=E.submit_video.vid;o&&(G.removeClass("hide"),I.addClass("hide"),z.removeClass("hide"),R.updateCover(),Z.vid=E.submit_video.vid,Z.vu=E.submit_video.vu,Z.vname=E.submit_video.vname,Z.vposter=E.submit_video.vposter,Z.vposter?(n(Z),Z.status="success"):r(o)),W.on("click",function(){C&&g("confirm","确认取消上传？",c)}),$("#retry_video_file").click(function(e){var o=Z.status;("success"==o||"transcoding"==o)&&(window.confirm("重新上传时，当前视频信息会被丢弃，确认？")||(R.clearData(),e.preventDefault()))}),$("#retry_video_file,#video_file").fileupload({singleFileUploads:!0,autoUpload:!1,redirectParamName:"redirect_url",redirect:(Q?"https://":"http://")+"mp.toutiao.com/cdiframe_result/?%s",maxChunkSize:k?S:0,maxRetries:3,retryTimeout:500}).bind("fileuploadadd",function(e,o){var i=null;if($.each(o.files,function(e,o){i=d(o)}),i){if(Z.vid){var s=Z.status;("success"==s||"transcoding"==s)&&E.vids_to_del.push(Z.vid)}E.submit_video.vid=0,E.submit_video.vu="",E.submit_video.vname="",E.submit_video.vposter="",E.submit_video.uploading=!0,Z.vid=i.vid,Z.vu=i.vid,Z.vname=i.vname,Z.md5=i.v_md5,Z.vposter="",Z.status="",Z.ts=+new Date,U=0,x=2,O&&clearTimeout(O),y&&clearInterval(y),I.addClass("hide"),z.addClass("hide"),A.removeClass("hide").focus(),G.removeClass("hide"),M.data("loaded",0),L.text(Z.vname),M.text(""),X.html(""),l(h),i.resumable&&(o.uploadedBytes=i.uploadedBytes),o.url=i.upload_url,C=o.submit(),T||(y=setInterval(u,1e3)),t(i,"fileuploadadd"),F().notice("添加一个视频")}}).bind("fileuploadprogress",function(e,o){T&&v(o.total,o.loaded)}).bind("fileuploaddone",function(e,o){F().notice("视频传输完成"),E.submit_video.uploading=!1,y&&clearInterval(y);var i=null;try{T?(i=JSON.parse(o.result),t("XhrFileUploadSupport")):(i=JSON.parse($("body",o.result).text()),t("no XhrFileUploadSupport"))}catch(s){}if(i){if(0==i.code)R.updateCover(),Z.status="transcoding",P.addClass("video-processing").removeClass("video-fail").removeClass("video-success"),Y.text("视频上传成功，处理中..."),O=setTimeout(r,1e3),B=Z.vid,k&&Z.md5&&window.localStorage.removeItem(Z.md5);else{if(f(this,o,Z))return void(E.submit_video.uploading=!0);P.addClass("video-fail").removeClass("video-processing").removeClass("video-success"),Y.text("视频上传失败.")}A.addClass("hide"),z.removeClass("hide"),q.text(Z.vname),K.get(0).style.width="0%",m(i.code,Z,o,j.END_AUTO)}else g("alert","抱歉，上传错误，请稍后重试"),m(j.NO_CODE,Z,o,j.END_AUTO);C=null,t(o,"fileuploaddone")}).bind("fileuploadfail",function(e,o){return B&&B==Z.vid?!1:void("abort"!==o.errorThrown&&f(this,o,Z)||(E.submit_video.uploading=!1,y&&clearInterval(y),g("alert","视频上传失败"),"abort"!==o.errorThrown?m(j.UNKNOW_ERROR_CODE,Z,o,j.END_AUTO):m(j.UNKNOW_ERROR_CODE,Z,o,j.END_BY_ABORT),F().error("视频上传失败，当前视频信息:"+JSON.stringify(Z)+"服务端返回的信息:"+JSON.stringify(o)),t(o,"error : fileuploadfail")))})}function m(e,o,i,t){var a=i.files[0],d={ref_id:o.vid,f:o.vname,e:e,fs:a.size||0,ufs:i.uploadedBytes||0,r:k?1:0,et:t,ts:o.ts,te:+new Date,ua:navigator.userAgent,mid:E.media_id},r={api:"upload_error",ref_id:o.vid,error_info:JSON.stringify(d)};s(r,!0,!0)}function f(e,o,i){if(k){var a=$(e).data("blueimp-fileupload")||$(e).data("fileupload");if(o.uploadedBytes<o.files[0].size&&U<a.options.maxRetries){U+=1;var d={api:"chunk_upload_index",ref_id:i.vid},r=JSON.parse(s(d,!1,!0));if(0==r.code){var l=r.bytes;if(l>=0)return o.uploadedBytes=l,o.data=null,C=o.submit(),t("自动重传："+U+"次."),!0}}}return!1}var _=e("common/util/util.js"),g=e("pagelet/popalert/popalert.js"),b=e("common/videoposter/videoposter.js"),h="http://p1.pstatp.com/large/9777/4010962160",C=null,y=0,O=0,x=2,N=1e4,w=1048576,S=10*w,D=2048*w,T=$.support.xhrFileUpload||$.support.xhrFormDataFileUpload,k=$.support.blobSlice&&"object"==typeof window.localStorage,E=null,J="wmv|avi|dat|asf|rm|rmvb|ram|mpg|mpeg|3gp|mov|mp4|m4v|dvix|dv|mkv|flv|vob|qt|cpk|fli|flc|mod|ts|webm|m2ts",B="",R=b(),U=0,j={UNKNOW_ERROR_CODE:-2,NO_CODE:-1,END_BY_ABORT:1,END_AUTO:0},F=function(){return layoutLogger?layoutLogger:{error:$.noop,notice:$.noop,warming:$.noop}},I=$("#video-select"),A=$("#video-uploading"),z=$("#video-uploaded"),L=$("#video-name"),K=$("#progressbar-inner"),W=$("#video-cancel"),M=$("#video-data"),P=$("#video-feedback"),X=$("#video-feedback-icon"),Y=$("#video-feedback-text"),q=$("#video-feedback-name"),G=$("#edit-con"),V=$("#poster-cell"),H=$("#poster-con"),Q="https:"===location.protocol,Z={vid:0,vu:"",vname:"",vposter:"",status:"",md5:"",ts:0};i.exports={init:p,exec_api:s}});
;define("pagelet/pureVideo/pureVideo.js",function(require,exports,module){var Stip=require("common/stip/stip.js"),video=require("pagelet/pureVideo/video-v2.js"),selectTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+='<select class="form-control channel-select j_channel_dom" name="tag" index="'+(null==(__t=index)?"":__t)+'">\n	',1==index&&(__p+="\n	<option value=''>请选择</option>\n	"),__p+="\n	";for(var key in collection)__p+="\n	<option value='"+(null==(__t=key)?"":__t)+"' ",tag_name&&tag_name==key&&(__p+=" selected "),__p+=" > "+(null==(__t=collection[key])?"":__t)+"</option>\n	";__p+="\n</select>"}return __p},debut=require("pagelet/original_tag/tag.js"),NewFuncIcon=require("pagelet/tabNewGuide/tabNewGuide.js");module.exports=Pagelet.extend({el:"#pagelet-pureVideo",events:{"click .origin-hint":"onOriginHintClick"},init:function(e){e.vids_to_del=[],e.submit_video={vid:e.vid||0,vu:e.vu||"",vname:e.vname||"",vposter:e.vposter||"",uploading:!1};var t=this;this.spec=e,this.media_id=e.media_id,this.pgc_id=e.pgc_id,this.submit_lock=!1,this.after_pass_modify=e.after_pass_modify?1:0,this.$title=$("#title"),this.$abstract=$("#abstract"),this.video_category=e.video_category,this.tag_name=e.tag_name,this.article_category=e.article_category,video.init(e),this.tagInit(),this.bind_click_event(),this.basic_utils(),debut.$debutEvent.trigger("spec.init",e),this.debutData=debut.debutData,$.get("/remaining_article_num_post/",function(e){var t;t=2===e.data.level?10:e.data.post_num+e.data.remaining,t=Math.min(10,t),t>1&&$("#videobatch_count").html('（新版功能上线啦，支持<a href="/video/video_batch/" class="slink">批量发表视频</a>，可同时上传'+t+"个视频）")});var i=new NewFuncIcon("tab_new_page",t.el);i.newIconDisplay(),$("#origin-apply-hint").text("（声明原创可更有效的保护原创作者利益，视频可获得数倍广告收益）")},remaining_article_limit:function(){var e={},t=this.media_id;if($.ajax({url:"/remaining_article_num_post/",data:{media_id:t,after_pass_modify:this.after_pass_modify},async:!1,success:function(t){e=t},error:function(){}}),e.data){var i=e.data;if(i.used_up){var a="";return a=2==i.is_experience?'您已被禁言。如有疑问请联系客服 <a href="mailto:mp@toutiao.com">mp@toutiao.com</a>':0==i.post_num?"暂不可发表，请存草稿。":"您的帐号已超出每天 "+i.post_num+' 篇的发表上限，请存草稿明天再发。如有疑问请联系客服 <a href="mailto:mp@toutiao.com">mp@toutiao.com</a>',$("#limit_warning").show().html(a),!1}}return!0},checkVideo:function(){var e=$(this.el),t=e.find("[index=1]").val();return t?!0:!1},form_valid_check:function(){var e=$.trim($("#title").val()).length,t=5,i=30,a=$.trim($("#abstract").val()).length,n=2e4,o=this.spec.submit_video.vid?!0:!1,s="http://p1.pstatp.com/large/9777/4010962160"==$(".video-poster").attr("src")?!0:!1,c="";return 0==e?c="标题不能为空":t>e||e>i?c="标题长度应该在"+t+"-"+i+"字之间":a>n?c="视频简介不能超过 "+n+" 字":o?s?c="请设置视频封面":this.checkVideo()||(c="请选择视频分类"):c="请先上传有效视频",c?(fixedAlert(c),!1):!0},word_count_check:function(){$("#abstract").keyup(function(){var e=$(this),t=parseInt(e.attr("maxlength"))||0;if(t){var i=$.trim(this.value),a=i.length,n=this.id,o=t-a;0>o&&(o=0),$(".for-"+n).text("还可以输入"+o+"字"),this.value=i,a>t&&(this.value=i.slice(0,t))}})},article_post:function(e){var t,i=this,a=$(this.el);if(!this.submit_lock){this.submit_lock=!0;var n=$.trim($("#title").val()),o=$.trim($("#abstract").val())||"",s=$("#channel_tags option:selected").val()||"",c=e?0:1,l=this.pgc_id,r=$(".gg-show").is(".selected")?1:0,d=this.spec.submit_video.vid,_=this.spec.submit_video.vu,v=this.spec.submit_video.vname,u=this.spec.submit_video.vposter,h=this.spec.vids_to_del,p=this.after_pass_modify,f=1,g="",m={},b=this.debutData.isChecked?1:0,y=this.debutData.pgc_debut?1:0,x=this.debutData.debut_url||"",k=this.debutData.debut_mp||"",w=this.debutData.debut_author||"";d&&(m.sp="toutiao",m.vid=d,m.vu=_,m.vname=v,m.vposter=u,g="<p>{!-- PGC_VIDEO:"+JSON.stringify(m)+" --}</p>");var D=$("#fb"),S=D.text(),j="提交中...";e&&(D=$("#cg"),S=D.text(),j="保存中..."),D.attr("disabled","disabled").text(j),a.find("[index=1]").val()&&(t=a.find("[index=1]").val()),a.find("[index=2]").val()&&(t=t+"/"+a.find("[index=2]").val()),a.find("[index=3]").val()&&(t=t+"/"+a.find("[index=3]").val());var A={title:n,"abstract":o,tag:s,save:c,pgc_id:l,video_vid:d,video_vu:_,video_vname:v,video_vposter:u,vids_to_del:JSON.stringify(h),article_type:f,content:g,after_pass_modify:p,show_ads:r,article_category:t};$.extend(A,{claim_origin:b,pgc_debut:y,debut_url:x,debut_mp:k,debut_author:w}),this.spec_type&&(A.spectype_goodvoice=1),$.ajax({type:"POST",url:"/edit_article_post/",data:A}).done(function(e){var t=t?t:{};if("保存成功"==e.message||"提交成功"==e.message){window.onbeforeunload=function(){};for(var i=0;i<h.length;i++)t.api="delete",t.ref_id=h[i],video.exec_api(t,!0);Stip.popupTip({msg:e.message,status:!0,duration:0,callback:function(){window.location="/articles/"}})}else Stip.alert(e.message)}).fail(function(e,t,i){Stip.alert("服务异常，请稍后再试，异常状态："+e.status+","+t+","+i)}).always(function(){i.submit_lock=!1,D.removeAttr("disabled").text(S)})}},bind_click_event:function(){var e=this;$("#fb").click(function(){e.form_valid_check()&&e.article_post(!1)}),$("#cg").click(function(){e.form_valid_check()&&e.article_post(!0)}),$(".qx").click(function(){location.href="/"}),$(".gg-radio").click(function(){var e=$(this),t=e.data("type"),i=e.is(".selected");if(!e.is(".disabled"))switch(t){case"show":i?e.removeClass("selected"):e.addClass("selected")}})},tagInit:function(){this.selectDataParse(),this.initSelect(),this.selectEventInit()},selectDataParse:function(){var e=this.video_category?this.video_category:{};e.video_category_level1&&(this.video_category1=e.video_category_level1),e.video_category_level2&&(this.video_category2=e.video_category_level2),e.video_category_level3&&(this.video_category3=e.video_category_level3)},initSelect:function(){var e,t=this.article_category?this.article_category:"",i=[],a=$(this.el),n=a.find(".j_channel_select");t&&(i=t.split("/")),this.video_category1&&(e=this.video_category1,this.buildSelect(e,i[0],1),i[0]||n.find("select").val("")),this.video_category2&&i[1]&&(e=this.video_category2,e=e[i[0]],this.buildSelect(e,i[1],2)),this.video_category3&&i[2]&&(e=this.video_category3,e=e[i[0]],e=e&&e[i[1]],this.buildSelect(e,i[2],3))},selectEventInit:function(){var e,t,i,a,n,o,s=$(this.el),c=s.find(".j_channel_select"),l=this;c.on("change",".j_channel_dom",function(){i=c.find(".j_channel_dom"),e=parseInt($(this).attr("index")),t=$(this).val(),o=l["video_category"+(e+1)],o&&(1==e?(n=o[t],l.removeSelect(2),l.video_category2&&l.video_category2[t]&&l.buildSelect(n,"",e+1)):2==e&&(a=s.find("[index=1]").val(),o&&o[a]&&o[a][t]?(o=o[a][t],l.buildSelect(o,"",3)):l.removeSelect(3)))})},getDictonary:function(e,t){for(var i in t)if(i=e)return t[i]},removeSelect:function(e){var t=$(this.el);2==e&&(t.find("[index="+e+"]").remove(),t.find("[index="+(e+1)+"]").remove()),3==e&&t.find("[index=3]").remove()},buildSelect:function(e,t,i){var a,n=$(this.el),o=n.find(".j_channel_select"),s=$("[index="+i+"]"),c=selectTemplate({collection:e,tag_name:t,index:i});s.length&&s.remove(),a=o.find(".j_channel_dom"),a.length?a.eq(a.length-1).after(c):o.prepend(c)},basic_utils:function(){var e=this;window.onbeforeunload=function(){var t=$("#edit-con").is(".hide");if(!t){var i=$.trim(e.$title.val()).length,a=$.trim(e.$abstract.val()).length;if(i>0||a>0||e.spec.submit_video.vid)return"你的内容尚未保存，确认离开？";if(e.spec.submit_video.uploading)return"当前视频尚未上传完毕，确认离开？"}},$fixedAlertDiv=$(".alert"),$fixedAlertDiv.length&&($fixedAlertDiv.affix({offset:{top:$fixedAlertDiv.offset().top}}),fixedAlert=function(e){e&&e.length&&($fixedAlertDiv.find("span").text(e).end().height(40),setTimeout(function(){$fixedAlertDiv.height(0)},4e3))})},onOriginHintClick:function(){$("#origin-hint-detail").show().text("非原创视频恶意声明原创，将受到平台严厉惩罚。").css({color:"#9e9e9e"})}})});
;define("pagelet/pureVideoForBeautifulVoice/pureVideoForBeautifulVoice.js",function(e,o,t){var p=e("pagelet/pureVideo/pureVideo.js"),i=p;i.prototype=$.extend(i.prototype,{spec_type:"goodvoice"});var r=i.prototype.init;i.prototype.init=function(){r.apply(this,arguments)},t.exports=i});
;define("pagelet/quiz/model.js",function(i,e,a){var n=i("common/util/util.js");a.exports=function(){var i="/edit_article_post/",e="/quiz/item/preview/";return{publish:function(e,a,o,t,d,l){var u={pgc_id:o||n.GET.pgc_id,save:e,tag:t,show_ads:d,subsidy:l,article_type:2,gov_media_id:0,quiz_item:a};n.loadingShow(),$.ajax({type:"POST",url:i,data:u,dataType:"json"}).done(function(i){alert(i.message),("保存成功"==i.message||"提交成功"==i.message)&&(window.onbeforeunload=null,location.href="/articles/?source_type=0")}).fail(function(i,e,a){alert("服务器异常，请稍后再试，异常状态："+i.status+","+e+","+a)}).always(function(){n.loadingHide()})},preview:function(i){var a={quiz_item:i};n.loadingShow(),n.ajax(e,a,function(i,e,a){if(0===i){var o="出错啦～！请重试";a&&(o=a),$(".quiz-preview").find(".content").html(o).end().modal(),window.loadQuiz&&window.loadQuiz()}else alert(e);n.loadingHide()})}}}});
;define("pagelet/quiz/viewModel.js",function(e,o,t){t.exports=function(o,t){function i(e,o,t){var n={};return n=_.isFunction(o)?new o:o,_.each(e,function(e,o){""!==e&&(o in t?t[o].ctor?(n[o].removeAll(),_.each(e,function(e){n[o].push(t[o].child?i(e,t[o].ctor,t[o].child):i(e,t[o].ctor,{}))})):t[o].child&&(n[o]=i(e,n[o],t[o].child)):o in n&&_.isFunction(n[o].peek)?n[o](e):o in n&&_.isObject(n[o])&&i(e,n[o],{}))}),n}function n(e){_.each(e(),function(e,o){e.num(o+1)})}function s(e){var o={ignore:["tabCheckStatus","questionCache","isCollapsed","isNeedFresh","errors","cacheArticleImage","questionChoiceLength","tags","tag_name","show_ads_option","mediaType","show_ads","has_toutiao_subsidy_permission","subsidy","showSubsidy","emptyImage","chooseRightAnswer"]},t=ko.mapping.toJSON(e,o);return t=t.replace(new RegExp(g.image,"g"),"")}function a(){var e=this;e.num=ko.observable(0),e.title=ko.observable(""),e.image=ko.observable(g.image),e.explicate=ko.observable("")}function r(){function e(e){e.length>0?this.choice(e):o.choice.push(p.call(o,o))}var o=this;o.isNeedFresh=!0,o.questionCache={};var s=[],r=[];o.type=ko.observable(0),o.num=ko.observable(1),o.question={title:ko.observable(""),image:ko.observable(g.image)},o.question.title.extend({required:{message:"问题("+o.num()+")标题为空"}}),o.uploadImage=function(){this.question.image&&t.uploadImage(this.question.image)},o.expand=function(e,t){var i=$(t.target).closest(".question-item");i.find(".question-wrap").show(),i.find(".option-summary").hide(),i.find(".option-edit").hide(),i.find(".cancel").show(),o.questionCache=ko.mapping.toJSON(o,{}),o.isNeedFresh=!1},o.cancel=function(e,t){var n=JSON.parse(o.questionCache),s={choice:{ctor:u}};i(n,o,s),o.collapse("",t)},o.collapse=function(e,t,i){var n;return 0==o.question.title().length?!1:(n=i?$(i):$(t.target).closest(".question-item"),n.find(".question-wrap").hide(),n.find(".option-summary").show(),n.find(".option-edit").show(),void(o.isNeedFresh=!0))},o.addOption=function(){var e=o.choice().length;o.choice.push(p.call(o,o).num(e+1))},o.removeOption=function(e){o.choice.remove(e),o.choice().length<1&&o.addOption(),n(o.choice)},o.choice=ko.observableArray([]),o.addComment=function(){o.answer.push(new a)},o.removeComment=function(e){o.answer.remove(e)},o.answer=ko.observableArray([]),ko.computed(function(){1==this.type()?(s=this.choice.removeAll(),e.call(this,r)):(r=this.choice.removeAll(),e.call(this,s))},o)}function u(e){var o=this;o.num=ko.observable(1),o.title=ko.observable(""),o.image=ko.observable(g.image),o.answer_num=ko.observable(b),o.chooseRightAnswer=function(){o.answer_num(0==o.answer_num()?1:0)},o.uploadImage=function(){this.image&&t.uploadImage(this.image)};var i=e?e.num():1;o.title.extend({required:{message:function(){return"问题("+i+")选项("+o.num()+")标题、选项图片至少填写一项"},onlyIf:function(){return o.image()==g.image?!0:!1}}})}function c(){var e=this;this.answer_format={p1:ko.observable(""),p2:ko.observable("")},this.addResult=function(){var o=e.data().length;e.data.push(p.call(e).num(o+1))},this.removeResult=function(o){e.data.remove(o),n(e.data)},this.data=ko.observableArray([p.call(e)])}function l(){var e=this;e.num=ko.observable(1),e.title=ko.observable(""),e.image=ko.observable(g.image),e.range_from=ko.observable("0"),e.range_to=ko.observable("0"),e.explicate=ko.observable("");var o={digit:{message:"结果("+e.num()+")命中区间请填写数字",params:!0},required:{message:"结果("+e.num()+")命中区间不能为空",onlyIf:function(){return 0==h.type()&&h.question().length>0&&1==h.question()[0].type()?!0:!1}}};this.range_to.extend(o)}var m=e("pagelet/quiz/model.js")(),h={},d=$({}),b=1,g={image:"https://p.pstatp.com/origin/6329/4231483611"};ko.validation.rules.mustLess={validator:function(e,o){return o>=e}},ko.validation.registerExtenders();var p=function(e,o,t){var i,o=o||this,n=o.constructor.ClassName,s={Question:u,Answer:l};return!t&&s.hasOwnProperty(n)&&(i=new s[n](e,o)),i};ko.bindingHandlers.collapse={init:function(e,o,t,i){var n=ko.utils.unwrapObservable(i.question.title);n.length>0&&i.isNeedFresh&&i.collapse("","",e)}},r.ClassName="Question",c.ClassName="Answer";var v=function(){function e(e){e.length>0?this.question(e):i.question.push(new r)}var i=this;i.owner="",i.quiz_id=o.quiz_id||"",i.emptyImage=g.image,i.title=ko.observable(""),i.status=ko.observable(0),i.image=ko.observable(g.image),i.quiz_cover_image={},i.abstract=ko.observable(""),i.tags=ko.observableArray([]),i.tag_name=ko.observable(""),i.show_ads_option=ko.observable(0),i.show_ads=ko.observable(1),i.mediaType=ko.observable(0),i.subsidy=ko.observable(0),i.has_toutiao_subsidy_permission=ko.observable(0),i.type=ko.observable(0),i.question=ko.observableArray(),i.tabCheckStatus=ko.observable(0),h=i,i.answer=new c;var a=[],u=[];i.questionChoiceLength=ko.pureComputed(function(){return i.question().length>0&&0==i.type()?i.question()[0].choice().length:1}),i.showGg=function(){i.show_ads(1==i.show_ads()?0:1)},i.showSubsidy=function(){i.subsidy(1==i.subsidy()?0:1)},i.title.extend({minLength:{params:5,message:"文章标题不能少于5个字"},required:{message:"文章标题、图片、正文，至少一项不为空",onlyIf:function(){return 0==i.abstract().length&&i.image()==g.image?!0:!1}}}),i.abstract.extend({minLength:{params:5,message:"文章正文不能少于5个字"}}),d.bind("ko.computed",function(){i.question().length>0&&(1==i.type()?u=i.question.removeAll():a=i.question.removeAll()),ko.computed(function(){b=2==i.type()?0:1,1==i.type()?(a=i.question.removeAll(),e.call(i,u)):(u=i.question.removeAll(),e.call(i,a))},i)}),i.uploadImage=function(){this.image&&(t.uploadImage(this.image),t.cacheArticleImage(this))},i.addQuestion=function(){var e=i.question().length;i.question.push((new r).num(e+1))},this.removeQuestion=function(e){i.question.remove(e),n(i.question)},i.submit=function(){return i.status(1),i.errors().length>0?(alert(i.errors()[0]),!1):void m.publish(1,s(i),o.pgc_id,i.tag_name(),i.show_ads(),i.subsidy())},i.saveDraft=function(){i.status(0),m.publish(0,s(i),o.pgc_id,i.tag_name(),i.show_ads(),i.subsidy())},i.preview=function(){i.status(0),m.preview(s(i))},i.displayQuestionMode=function(){return"question-template"},i.displayResultMode=function(){return"result-template"}};return function(e,o){var t,n={question:{ctor:r,child:{choice:{ctor:u},answer:{ctor:a}}},answer:{child:{data:{ctor:l}}}};return t=o.pgc_id?i(o,new v,n):new v,d.trigger("ko.computed"),e.onbeforeunload=function(){var e=!1;return $("input[type=text],textarea").each(function(o,t){return $.trim($(t).val()).length>0?(e=!0,!1):void 0}),e||$(".quiz-form img").each(function(o,t){return $(t).attr("src")!=g.image?(e=!0,!1):void 0}),e?"当前有已编写的内容，确认离开？":void 0},t.tags(o.tags),t.show_ads_option(o.show_ads_option),t.mediaType(o.mediaType),t.tag_name(o.tag_name),t.subsidy(Number(o.subsidy)),t.show_ads(Number(o.ads_option_checked)),t.has_toutiao_subsidy_permission(o.has_toutiao_subsidy_permission),t}(window,o)}});
;define("pagelet/quiz/quiz.js",function(e,i,t){var a=(e("pagelet/signform/field.js"),e("common/vali/vali.js"),e("common/stip/stip.js"),e("pagelet/tabNewGuide/tabNewGuide.js"));t.exports=Pagelet.extend({el:".pagelet-quiz",events:{"click .quiz-submit .qx":"cancel"},init:function(i){var t=this;data=$.extend(i,i.quiz_item),delete data.quiz_item,this.upload=this.addUpload(),t.viewModel=e("pagelet/quiz/viewModel.js")(data,t),t.knockoutInit(),this.render();var n=new a("tab_new_quiz",t.el);n.checkCookie(),n.setCookie(),n.newIconDisplay()},cancel:function(){location.href=location.origin},render:function(){},uploadImage:function(e){var i=this;i.image=e,i.upload.input.trigger("click")},cacheArticleImage:function(e){var i=this;i.cacheImageInfo=e},addUpload:function(){var e=this,i=new Uploader({container:e.$el.find(".j-upload"),trigger:e.$el.find(".j-upload"),name:"upfile",action:"/tools/upload_picture/",accept:"image/*",change:function(){Util.loadingShow(),this.submit()},error:function(){Util.loadingHide(),alert("上传失败")},success:function(i){Util.loadingHide();try{"success"===i.state.toString().toLowerCase()?(e.image(i.url),e.cacheImageInfo&&e.cacheImageInfo.quiz_cover_image&&(e.cacheImageInfo.quiz_cover_image=i)):alert("上传失败")}catch(t){alert("上传失败")}}});return i},knockoutInit:function(){"undefined"!=typeof ko&&(ko.validation.rules.pattern.message="Invalid.",ko.validation.init({registerExtenders:!0,messagesOnModified:!0,insertMessages:!1,parseInputAttributes:!0,messageTemplate:null},!0),this.viewModel.errors=ko.validation.group(this.viewModel,{deep:!0,live:!0}),ko.applyBindings(this.viewModel,document.getElementById("pagelet-quiz")))}})});
;define("pagelet/rss/rss.js",function(t,s,a){var e=/^((https|http|ftp|rtsp|mms):\/\/)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,r=t("common/util/util.js"),F={1:"RSS摘要",9:"RSS全文",3:"网页列表"};a.exports=Pagelet.extend({el:"#pagelet-rss",events:{},init:function(){this.rss_init()},add_rss:function(){var t=$(".rss-tbl tbody"),s=t.children("tr").length,a=s&&t.children("tr:last-child").is(".editing");if(0==s||!a){var e=$("#rss_tmpl .editing");e.find(".rss-sno").html(s+1),t.append(e.prop("outerHTML")),$(".rss").find(".new_rss").focus()}},rss_save:function(t,s,a,e){return/^http:\/\//.test(s)||(s="http://"+s),$.post("/add_crawl_seed_post/",{type:t,url:s}).done(function(u){if("success"==u.message){var d=u.id;if(!e){var i='<a class="rss-url" href="'+r.e(s)+'" target="_blank" title="'+r.e(s)+'">'+r.e(s)+"</a>";a.find(".rss-addr").html(i),a.attr("data-type",t),a.removeClass("editing"),a.find(".rss-type").text(F[t]),a.find(".rss-draft").remove()}var n='<div class="rss_check rss_checking">检测中<i title=""></i></div>';a.attr("data-id",d).attr("data-status",100),a.find(".rss-status").html(n),a.find(".rss-modify").hide()}else alert(u.data)})},delete_rss:function(t){if(confirm("确认删除该链接？")){var s=t.parents("tr"),a=s.attr("data-id");return $.post("/delete_crawl_seed_post/",{seed_id:a}).done(function(t){"success"==t.message&&(s.nextAll("tr").each(function(t,s){var a=$(s).children("td:first-child"),e=a.text();a.text(e-1)}),s.remove())})}},recheck_rss:function(t){var s=t.find(".rss-url").attr("href"),a=t.attr("data-type");this.rss_save(a,s,t,!0)},robot_check:function(){var t=this,s=[];return $(".rss-tbl .rss-cell").each(function(t,a){var e=$(a).attr("data-status");e>=100&&103>=e&&s.push($(a).attr("data-id"))}),s.length?$.ajax({type:"GET",async:!0,url:"/api/rss_status_check/?"+Date.now(),data:{req_info:JSON.stringify({id_list:s})},dataType:"json"}).done(function(s){var a=s.data;a.length&&t.update_check_status(a)}).fail(function(){}):void 0},update_check_status:function(t){if(!(!t instanceof Array||0==t.length))for(var s=0;s<t.length;s++){var a=t[s].id,e=t[s].status,F=$('[data-id ="'+a+'"]');switch(F.attr("data-status",e),!0){case 104==e:case 105==e:case 106==e:F.find(".rss-status").html('<div class="rss_check rss_fail">检测失败<i title="" data-toggle="tooltip" data-placement="top" data-original-title="'+r.e(t[s].confirm_reason)+'"></i></div>'),F.find(".rss-modify").show();break;case 100==e:case 101==e:case 102==e:case 103==e:break;case 1==e:F.find(".rss-status").html('<div class="rss_check rss_checking">审核中</div>')}}},rss_init:function(){function t(){s.robot_check()}var s=this;$("#add_rss").click(function(){s.add_rss()}),$(".rss").on("click",".rss_recheck",function(){s.recheck_rss($(this).parents("tr"))}),$(".rss").on("click",".rss_del",$.loadWrap(function(){return s.delete_rss($(this))})),$(".rss").on("click",".rss_abort",function(){$(this).parents("tr").remove()}),$(".rss").on("click",".rss_save",$.loadWrap(function(){var t=$(this).closest("tr"),a=$.trim(t.find(".new_rss").val()),r=t.find("select").val();if(a.length){if(e.test(a))return s.rss_save(r,a,t,!1);alert("请提供合法的地址")}})),setInterval(t,3e3),$(".rss").tooltip({selector:"[data-toggle=tooltip]",container:"body"})}})});
;define("pagelet/selfservice/selfservice.js",function(e,t,s){s.exports=Pagelet.extend({el:"#pagelet-selfservice",events:{},init:function(){var e=$("#qa-nav-cursor"),t=$(".qa-nav-item"),s=$(".qa-question"),a=$(".qa-question-item"),i=($(".qa-hot"),$(".qa-question-status"));e.css("left",t.eq(0).position().left),t.click(function(){var s=$(this),n=(s.data("type"),s.position().left);e.css("left",n),t.each(function(e,t){var a=$(t),i=a.data("type"),n=$(".qa-box-"+i);s.is(a)?(a.addClass("cur"),n.removeClass("hide")):(a.removeClass("cur"),n.addClass("hide"))}),a.removeClass("on"),i.text("展开")});var n=location.hash.match("[#]?(.*)")[1];$('[data-type="'+n+'"]').click(),s.click(function(){var e=$(this),t=e.parent(),s=e.find(".qa-question-status"),a=s.text(),i="展开"===a?"收起":"展开";s.text(i),t.toggleClass("on")})}})});
;define("pagelet/signform/type.js",function(){return function(e){var i;return 1==e?i=[["name"],["desc"],["avatar_uri"],["notes",{name:"other_evidence_notes"}],["company_name",{label:"组织名称",hint:"请与组织机构代码证名称一致，并注明原媒体名称"}],["license_uri"],["authorize_uri"],["website",{noconfirm:!0,hint:"如需接入该网站（域名）下的内容，请务必填写此项",require:!1}],["address",{label:"媒体地址"}],["location"],["media"],["real_name",{label:"媒体联络人"}],["position"],["identity_number",{label:"联络人身份证号码"}],["identity_uri",{label:"联络人身份证照片"}],["mobile",{label:"联络人电话"}],["email"]]:2==e?i=[["name"],["desc"],["avatar_uri"],["notes"],["location"],["media"],["real_name"],["identity_number"],["identity_uri"],["qualification_uri"],["mobile"],["email"],["qq"]]:3==e?i=[["name"],["desc"],["avatar_uri"],["location"],["gov_type"],["company_name",{label:"机构名称"}],["authorize_uri",{hint:"",url:"http://s0.pstatp.com/site/image/pgc/%E4%BB%8A%E6%97%A5%E5%A4%B4%E6%9D%A1%E6%94%BF%E5%BA%9C%E5%85%A5%E9%A9%BB%E5%85%AC%E5%87%BD1505.doc"}],["address",{label:"机构地址"}],["website",{label:"网站(可选)",noconfirm:!0,require:!1}],["real_name"],["position"],["identity_number"],["identity_uri"],["mobile"],["email"]]:4==e?i=[["name"],["desc"],["avatar_uri"],["company_name"],["authorize_uri"],["website"],["address"],["location"],["media"],["real_name"],["position"],["identity_number"],["identity_uri"],["mobile"],["email"]]:5==e?i=[["media"],["name",{hint:"2-10个字，需与企业相关，包含但不限于商标名称、产品、服务名称，请勿带有“公司”、“集团”、“旗舰店”等字样"}],["desc",{hint:"10-30个字，需要有明确的企业相关介绍，包括但不限于产品、服务的介绍。要求内容完整通顺，无特殊符号。请勿带有网址、电话、QQ、微信"}],["avatar_uri",{hint:"请勿使用侵犯他人版权及非企业所拥有的注册商标、logo等<br/>请勿使用二维码，最大5M，200x200像素"}],["company_name",{hint:"请与营业执照的名称保持一致"}],["license_uri",{label:"企业营业执照扫描件",hint:"企业营业执照信息清晰<br/>最大2M"}],["authorize_uri"],["website",{hint:"请使用企业官方网站",require_check:!1}],["address"],["location"],["real_name"],["position"],["identity_number"],["identity_uri"],["mobile"],["email"]]:6==e?i=[["name"],["desc"],["avatar_uri"],["company_name",{label:"组织名称"}],["license_uri"],["authorize_uri"],["website",{label:"网站(可选)",require:!1,noconfirm:!0}],["address",{label:"组织地址"}],["location"],["media"],["real_name",{label:"组织联络人"}],["position"],["identity_number",{label:"联络人身份证号码"}],["identity_uri",{label:"联络人身份证照片"}],["qualification_uri"],["mobile",{label:"联络人电话"}],["email"]]:7==e&&(i=[["name"],["desc"],["avatar_uri"],["company_name",{label:"组织名称",hint:"请与组织机构代码证名称一致，并注明原媒体名称"}],["license_uri"],["authorize_uri"],["website",{noconfirm:!0,hint:"如需接入该网站（域名）下的内容，请务必填写此项",require:!1}],["address",{label:"媒体地址"}],["location"],["media"],["real_name",{label:"媒体联络人"}],["position"],["identity_number",{label:"联络人身份证号码"}],["identity_uri",{label:"联络人身份证照片"}],["mobile",{label:"联络人电话"}],["email"]]),i}});
;define("pagelet/settings/settings.js",function(require,exports,module){var Util=require("common/util/util.js"),Stip=require("common/stip/stip.js"),Vali=require("common/vali/vali.js"),typefields=require("pagelet/signform/type.js"),fieldFactory=require("pagelet/signform/field.js"),Dialog=require("common/popup/dialog.js"),showtrtpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<tr class="signform_item">\n    <td class="signform_dt">'+(null==(__t=name)?"":_.escape(__t))+"</td>\n    <td>\n","领域"===name?(__p+='\n    <div class="settings_text">'+(null==(__t=value[0])?"":_.escape(__t)),value[1]&&(__p+="/"+(null==(__t=value[1])?"":_.escape(__t))),__p+="</div>\n  ",value[2]&&value[2].length&&(__p+='\n      <div class="settings_text">专业擅长：'+(null==(__t=value[2].join(" "))?"":_.escape(__t))+"</div>\n  "),__p+="\n"):__p+='\n        <div class="settings_text">\n            '+(null==(__t=value)?"":_.escape(__t))+"\n        </div>\n",__p+="\n    </td>\n</tr>";return __p},editfield=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div>\n    <div class="settings_text jshow">\n        <div class="settings_edit jbtn"></div>\n        <div class="settings_content jcontent">\n            '+(null==(__t=obj.text)?"":_.escape(__t))+"\n            ",obj.verifing&&(__p+='\n                <span class="sred">（待审核）</span>\n            '),__p+='\n        </div>\n    </div>\n    <div class="settings_input jinput">\n\n    </div>\n</div>';return __p};return function(e){function t(e){var t=e.jvali,n=e.jbox,i=$(editfield({text:a[e.name],verified:a[e.name+"_verified"]}));t.after(i),i.find(".jinput").append(t),i.find(".jbtn").click(function(){n.addClass("editing"),t.focus()})}function n(e,t){if(g)return e();var n=Dialog({title:"修改确认",content:$.safeMark("1.每30天只有一次修改帐号信息的资格<br/>2.修改后的帐号信息，如审核未通过则需等到30天后才可以继续申请修改"),type:"info",btns:[{type:"ok",click:function(){g=!0,n.remove(),e()}},{type:"cancel",click:function(){t(),n.remove()}}]}).show()}var i=$("#pagelet_settings").nodes(),a=e.form,r=a.mediaType,o=e.ext,s=function(){for(var e=[{key:"dot_name",name:"联系人"},{key:"mobile",name:"联系电话"},{key:"category_name",name:"领域"},{key:"location_name",name:"所在地"},{key:"website",name:"网站"},{key:"company_name",name:"机构/公司名称"},{key:"address",name:"公司机构地址"}],t="",n=0;n<e.length;n++){var i=e[n],a=o[i.key];a&&(t+=showtrtpl({name:i.name,value:a}))}return t}(),l=function(){var e={name:1,authorize_uri:2,desc:3,avatar_uri:4,email:5},t=[],n=typefields(r);for(var i in n){var o=n[i];if(e[o[0]]){if("authorize_uri"===o[0]){var s=o[1]||{};s.require=!1,o[1]=s}t.push(o)}}return t=t.sort(function(t,n){return e[t[0]]-e[n[0]]>0?1:-1}),fieldFactory(t,a)}(),_={};for(var u in l){var c=l[u];_[c.name]=c}if(_.authorize_uri){var p=_.authorize_uri.jbox;setTimeout(function(){p.hide()},1);var d=_.name.jvali;d.change(function(){p.toggle($.trim(d.val())!==a.name)});var f=_.authorize_uri.jvali,v=f.data("vali_func");f.data("vali_func",function(e){$.trim(d.val())===a.name?e(null,""):v.call(this,e)})}t(_.name),t(_.desc),t(_.email),i.start.after($.map(l,function(e){return e.jbox.toArray()})),_.email.jbox.eq(0).before(s);var m=Vali($($.map(l,function(e){return e.jvali.toArray()}))),g=!1;i.submit.click($.loadDone(function(t){m(function(i,a,r){if(i){t();var o=a.closest("tr");o.hasClass("editing")||o.find(".jbtn").click(),a.focus(),$("body").animate({scrollTop:a.offset().top-10},200)}else n(function(){r=$.so(r),r.media_type=e.form.mediaType,r.weixin=e.form.weixin,r.weixin_verify_link=e.form.weixin_verify_link,r.avatar_url=r.avatar_uri,Util.ajax("/edit_media_account_post/",r,function(e,n){t(),0===e?Stip.popupTip({msg:"修改成功",status:!0,callback:function(){window.location.reload()}}):Stip.alert(n)})},function(){t()})})})),i.page.is(".disabled")&&i.page.find(":input").prop("disabled",!0)}});
;define("pagelet/sign_email/sign_email.js",function(o){var m=o("common/stip/stip.js");$(function(){$("#resend").click(function(o){o.preventDefault(),$.ajax({url:"/resend_user_verify_email/",success:function(o){m.popupTip(0==o.code?{msg:"成功发送激活邮件",status:!0}:{msg:"激活邮件发送失败",status:!1})},error:function(){m.popupTip({msg:"网络错误，请稍后重试",status:!1})}})}),function(){var o={"qq.com":"mail.qq.com","gmail.com":"mail.google.com","sina.com":"mail.sina.com.cn","163.com":"mail.163.com","126.com":"mail.126.com","yeah.net":"www.yeah.net","sohu.com":"mail.sohu.com","tom.com":"mail.tom.com","sogou.com":"mail.sogou.com","139.com":"mail.10086.cn","hotmail.com":"www.hotmail.com","live.com":"login.live.com","live.cn":"login.live.cn","live.com.cn":"login.live.com.cn","189.com":"webmail16.189.cn/webmail/","yahoo.com.cn":"mail.cn.yahoo.com","yahoo.cn":"mail.cn.yahoo.com","eyou.com":"www.eyou.com","21cn.com":"mail.21cn.com","188.com":"www.188.com","foxmail.com":"mail.qq.com/cgi-bin/loginpage?t=fox_loginpage"},m=$("#jump"),c=m.data("href");c=c.slice(c.indexOf("@")+1);var i=o[c];i?m.prop("href","http://"+i):m.hide()}()})});
;define("pagelet/signbasic/config.js",function(require,exports,module){var tpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="login-form-account">\n    <div class="form1_dt">'+(null==(__t=label)?"":_.escape(__t))+'</div>\n    <div class="form1_dd">\n        <input type="'+(null==(__t=obj.type||"text")?"":_.escape(__t))+'" ',obj.name&&(__p+=' name="'+(null==(__t=obj.name)?"":_.escape(__t))+'" '),__p+=' maxlength="50" class="signform_input">\n        <div class="signform_msg jmsg"></div>\n        <div class="signform_hint">'+(null==(__t=obj.hint)?"":_.escape(__t))+"</div>\n    </div>\n</div>\n";return __p};return{email:{tpl:tpl},password2:{name:"password",tpl:tpl}}});
;define("pagelet/signbasic/signbasic.js",function(e){$(function(){var i=e("pagelet/signbasic/config.js"),a=e("common/vali/vali.js"),t=e("common/util/util.js"),n=e("common/stip/stip.js"),o=e("pagelet/signform/field.js"),c=$("#pagelet_signbasic").nodes(),l=o.getEle("password2",i.password2),s=o.getEle("email",$.extend({require:"请输入正确的邮箱地址",hint:"请填写本人常用邮箱，该邮箱将作为登录帐号",label:"邮箱"},i.email)),r=o.getEle("captcha");r.onClick=function(){t.ajax("/email_register_post/",{email:$.trim(s.jvali.val())},function(e,i,a){a.captcha&&r.render(a.captcha)})},c.fields.append(s.jbox.add(l.jbox).add(r.jbox));var d=a(s.jvali.add(l.jvali).add(r.jvali));c.agree.checkbox(),c.submit.click(function(){c.form.submit()}),c.form.submit($.loadDone(function(e,i){i.preventDefault(),d(function(i,a,o){if(i)e(),a.focus();else{if(!c.agree.checkbox())return e(),n.alert("请同意用户协议");t.ajax("/email_register_post/",o,function(i,a,t){e(),0===i?window.location="/mobile_register/":(t.captcha&&r.render(t.captcha),n.alert(a))})}})}))})});
;define("pagelet/signexpress/type.js",function(e){var i=e("pagelet/signform/type.js"),t={email:!1,notes:!1,other_evidence_notes:!1,license_uri:!1,address:!1,location:!1,position:!1,website:!1,qq:!1,identity_uri:!1},r={1:{website:!0},3:{authorize_uri:!1,website:!0},5:{authorize_uri:!1},7:{website:!0}};return function(e){var s=i(e),n=[];n.push(["email",{label:"登录邮箱",hint:"请填写本人常用邮箱，该邮箱将作为登录帐号",require:"请输入正确的邮箱地址"}]),n.push(["password2",{name:"password"}]);for(var a=$.extend({},t,r[e]),o=0;o<s.length;o++){var u,p=s[o];u=p[1]?p[1].name||p[0]:p[0],a[u]===!1||n.push(p)}return n}});
;define("pagelet/signexpress/signexpress.js",function(e){var a=e("common/util/util.js"),n=e("common/vali/vali.js"),t=e("common/stip/stip.js"),i=e("pagelet/signform/field.js"),r=e("pagelet/signexpress/type.js");return function(e){var o=$("#pagelet_signexpress").nodes(),s=e.media_type,u=r(s);e.weixin_invite&&u.push(["weixin",{name:"weixin_source"}]);var l=i(u);o.start.after($.map(l,function(e){return e.jbox.toArray()}));var c=$($.map(l,function(e){return e.jvali.toArray()}));o.agree.checkbox();var v=n(c);o.submit.click($.loadDone(function(n,i){i.preventDefault(),v(function(i,r,s){if(i)n(),$("body").animate({scrollTop:r.offset().top-10},200,function(){r.focus()});else{if(!o.agree.checkbox())return n(),alert("请同意用户协议");var u={};u.media_type=e.media_type,u.invite_code=e.invite_code,u.website_grant_auth_status=window.website_grant_auth_status;for(var l in s){var c=s[l];"avatar_uri"===c.name?u.avatar_url=c.value:"location"===c.name?($.extend(u,c.value),c.value=null):"media"===c.name&&(s=s.concat(c.value),c.value=null)}for(var l in u)s.push({name:l,value:u[l]});a.ajax("/greenway_post/",s,function(e,a){n(),0===e?window.location="/":t.alert(a)})}})}))}});
;define("pagelet/signform/signform.js",function(a){var i=a("common/ui/tab.js"),e=a("common/util/util.js"),n=a("common/stip/stip.js"),t=a("common/vali/vali.js"),r=a("pagelet/signform/type.js"),o=a("pagelet/signform/field.js");return function(a){7==a.mediaType&&(a.mediaType=1),$("body").hoverTitle();var l=a.mediaType,s=a.form,u=$("#pagelet_signform").nodes(),c=o(r(l),s);u.start.after($.map(c,function(a){return a.jbox.toArray()})),function(){if(1==l){var a=$('<tr class="signform_item require"><td class="signform_dt signform_media_type">媒体属性</td><td class="signform_checkline"><div><div class="form1_checkbox" data-tab="1">群媒体</div><span class="signform_linetip">以公司形式专注于生产的小型创作团体</span></div></div><div><div class="form1_checkbox" data-tab="7">新闻机构</div><span class="signform_linetip">报纸、杂志、电台、电视台、门户网站等新闻单位。包括大媒体下属品牌或者子栏目</span></div></td></tr>');u.start.after(a);var e=_.findWhere(c,{name:"other_evidence_notes"}),n=e.jvali,t=e.jbox,r={vali_require:n.data("vali_require"),vali_func:n.data("vali_func")},o=i(a.find("[data-tab]"),$(),function(a){l=a,1==l?(t.show(),n.data(r)):(t.hide(),n.data("vali_require",null).data("vali_func",function(a){a(null,"")}))});o(1)}}(),u.agree.checkbox();var f=$($.map(c,function(a){return a.jvali.toArray()})),v=t(f);u.submit.click($.loadDone(function(a,i){i.preventDefault(),v(function(i,t,r){if(i)a(),$("body").animate({scrollTop:t.offset().top-10},200,function(){t.focus()});else{if(!u.agree.checkbox())return a(),n.alert("请同意用户协议");var o={};o.media_type=l,o.website_grant_auth_status=window.website_grant_auth_status,o.weixin=s.weixin,o.weixin_verify_link=s.weixin_verify_link;for(var c in r){var f=r[c];"avatar_uri"===f.name?o.avatar_url=f.value:"qualification_uri"===f.name?f.value=JSON.stringify($.map(f.value,function(a){return a.web_uri})):"location"===f.name?($.extend(o,f.value),f.value=null):"media"===f.name&&(r=r.concat(f.value),f.value=null)}for(var c in o)r.push({name:c,value:o[c]});e.ajax("/pgc/new_media_account_post/",r,function(i,e){0===i?window.location="/":(a(),n.alert(e))})}})}))}});
;define("pagelet/signstep/signstep.js",function(){});
;define("pagelet/signtype/signtype.js",function(){});
;define("pagelet/sort/sort.js",function(e,t,n){n.exports=Pagelet.extend({el:"#pagelet-sort",events:{},init:function(){}})});
;define("pagelet/spread/apply.js",function(t){var n=t("common/sstep/sstep.whe"),e=t("common/util/util.js"),o=t("common/stip/stip.js"),i=t("common/vali/vali.js"),a=t("pagelet/signform/field.js"),r=t("common/ui/tab.js"),c=t("common/popup/dialog.js");return function(t){t.is_bind_mobile||c({title:"提示",content:"需要绑定手机号才能继续申请",btns:[{type:"ok",text:"绑定",click:function(){window.location="/settings/"}},{type:"cancel",click:function(){window.history.back()}}]}).show();var s={agreement:0,form:1},m=r($(),$("#spread_apply_content [data-tab]"),function(t){$("#spread_apply_step").html(n({step:s[t],arr:["确认协议","完善材料"]}))});setTimeout(function(){m("agreement")},1),$("#agreement_submit").click(function(){m("form")}),function(){var t=a([["input",{name:"name",label:"姓名"}],["identity_number",{label:"身份证号"}],["input",{name:"address",label:"现居住地址"}]]);$("#form_start").after($.map(t,function(t){return t.jbox.toArray()}));var n=i($($.map(t,function(t){return t.jvali[0]})));$("#form_back").click(function(){m("agreement")}),$("#form_submit").click($.loadDone(function(t){n(function(n,i,a){return n?(t(),void o.alert(n)):void e.ajax("/spread/confirm/",a,function(n,e){return t(),0!=n?o.alert(e):void o.popupTip({msg:"开通成功",status:!0,duration:0,callback:function(){window.location="/spread/overview/"}})})})}))}()}});
;define("pagelet/spread/recharge.js",function(n){var o=n("common/popup/dialog.js"),e=n("common/popup/input.whe"),t=n("common/vali/vali.js");return function(){var n=o({title:"充值",content:"充值是立即到帐的，请按照计划投放金额来充值。只有放弃该功能时才能退回帐户余额",btns:[{type:"ok",click:function(){c(function(o,e,t){o||(window.open("//ad.toutiao.com/pgc/recharge/?"+$.param(t)),n.remove(),a.show())})}},"cancel"]}),i=t.simple({tpl:e,name:"amt",label:"充值金额",require:"请填写金额",hint:"请填写金额",func:t.returnWrap(t._int)}),c=t(i.jvali);n.jele.find(".spopup_dialog_body").append(i.jbox),n.show();var a=o({title:"提示",content:"请在新开页面完成充值后选择：",btns:[{type:"ok",text:"充值成功",click:function(){window.location.reload()}},{type:"cancel",text:"充值失败",click:function(){window.location.reload()}}]})}});
;define("pagelet/spread/basic.js",function(t){var e=t("common/util/util.js"),a=(t("common/stip/stip.js"),t("pagelet/daterange/daterange.js")),n=t("common/popup/dialog.js"),i=t("pagelet/spread/recharge.js");return function(){function t(){e.ajax("/spread/transactions/",r,function(t,e,a){return 0!=t?void n({title:"提示",content:e,btns:["ok"]}).show():void d.list.html(o(a))})}var d=$("#spread_basic").nodes(),o=wheei(d.tpl.html());d.invoice_btn.click($.loadWrap(function(){d.invoice_btn.hasClass("disabled")||e.ajax("/spread/invoice/",{},function(t,e){return 0!=t?void n({title:"提示",content:e,btns:["ok"]}).show():(d.invoice_value.text("0"),d.invoice_btn.addClass("disabled"),void n({title:"提示",content:"开票成功",btns:["ok"]}).show())})})),d.recharge.click(i);var s=new Date;s.d("-1");var r={start_date:s.clone().d("-6").format("date"),end_date:s.format("date"),pagenum:1};a({start_date:r.start_date,end_date:r.end_date,relative:-1,onchange:function(e){r.start_date=e.start_date,r.end_date=e.end_date,r.pagenum=1,t()}}).trigger()}});
;define("pagelet/spread/invoice.js",function(e){var i=e("pagelet/signform/field.js"),n=e("common/vali/vali.js"),t=e("common/util/util.js"),o=e("common/stip/stip.js");return function(e){function a(){l.fields.html(s(r))}var r=e.form,l=$("#spread_invoice").nodes(),s=wheei(l.tpl.html());l.editbtn.click(function(){l.show.hide(),l.edit.show(),_.each(c,function(e){i.setValue(e.jvali,r[e.name])})}),a(r);var c=i([["input",{name:"name",label:"姓名"}],["identity_number",{label:"身份证号"}],["mobile"],["input",{name:"address",label:"地址"}]]);l.form_start.after($($.map(c,function(e){return e.jbox.toArray()})));var d=n($($.map(c,function(e){return("name"===e.name||"identity_number"===e.name)&&e.jvali.prop("disbled",!0),e.jvali.toArray()})));l.cancel.click(function(){l.edit.hide(),l.show.show()}),l.save.click($.loadDone(function(e){d(function(i,n,s){return i?e():void t.ajax("/spread/save_invoice_info/",s,function(i,n){return e(),0!=i?void o.alert(n):(r=$.so(s),a(),l.edit.hide(),void l.show.show())})})}))}});
;define("pagelet/spread/summary.js",function(a){return function(){var e=a("common/pager/pager.js"),t=a("common/util/util.js"),s=(a("common/stip/stip.js"),a("common/popup/popup.js")),n=a("pagelet/spread/recharge.js"),c=$("#spread_summary").nodes(),l=wheei(c.tpl.html());c.recharge.click(n),c.ad_stats.hoverTitle(),e({jele:c.pager,cb:function(a,e){t.ajax("/spread/ad_stats/",{pagenum:a},function(a,n,o){if(0==a){c.ad_stats.html(l(o));var r=c.ad_stats.nodes();r.sw.each(function(){var a=$(this);a.checkbox(),a.on("change",function(){var e=a.checkbox(),n=a.closest("tr").data("id");t.ajax({url:"/spread/update_ad_status/",method:"GET",data:{ad_id:n,opt:e?"enable":"disable"},callback:function(t,n){0!=t&&(a.checkbox(!e),s.alert(n))}})})}),e({length:o.total_pagenum})}})}});var o=$("#spread_summary_release").nodes(),r=wheei(o.tpl.html());c.release.click(function(){o.dialog.modal()}),e({jele:o.pager,cb:function(a,e){t.ajax("/spread/select_article/",{pagenum:a},function(a,t,s){0==a&&(o.list.html(r(s.article_list)),e({length:s.total_pagenum}))})}})}});
;define("pagelet/subscriber/subscriber.js",function(e,t,n){var a=e("common/util/util.js"),i=e("pagelet/daterange/daterange.js");n.exports=Pagelet.extend({el:"#pagelet-subscriber",events:{},init:function(e){i({start_date:e.start_date,end_date:e.end_date,onchange:function(e){window.location="?"+$.param($.extend({},a.GET,e,{}))}})}})});
;define("pagelet/subsidy/subsidy.js",function(e,t,n){var a=e("common/util/util.js"),d=e("pagelet/daterange/daterange.js");n.exports=Pagelet.extend({el:"#pagelet-subsidy",events:{},init:function(e){d({start_date:e.start_date,end_date:e.end_date,onchange:function(e){window.location="?"+$.param($.extend({},a.GET,e,{}))}})}})});
;define("pagelet/video_report/video_report.js",function(t,e,i){var a=t("common/util/util.js"),n=t("pagelet/daterange/daterange.js");i.exports=Pagelet.extend({el:"#pagelet-video_report",init:function(t){this.start_date=t.start_date,this.end_date=t.end_date,this.year=t.year-0,this.month=t.month-1,this.day=t.day-0,this.income_list=t.income_list,this.$ad_trend_con=$("#ad-trend-con"),n({start_date:t.start_date,end_date:t.end_date,relative:-1,onchange:function(t){window.location="?"+$.param($.extend({},a.GET,t,{}))}}),this.hightchart()},hightchart:function(){var t=[],e=["#FF6F6F","#669CFF","#ff001a","#ffad00","#22c2af","#ae5d9d"];t[0]={pointInterval:864e5,pointStart:Date.parseCN(this.start_date).t(),name:"播放",data:this.income_list},this.$ad_trend_con.highcharts({chart:{height:350},title:{text:null},xAxis:{type:"datetime",dateTimeLabelFormats:{day:"%m/%e"}},colors:e,yAxis:{title:{text:""},min:0,minTickInterval:null,plotLines:[{value:0,width:1,color:"#808080"}],allowDecimals:!1,tickPixelInterval:30,gridLineWidth:0},legend:{layout:"vertical",align:"right",verticalAlign:"middle",borderWidth:0},plotOptions:{spline:{lineWidth:1.5,states:{hover:{lineWidth:2}}},series:{marker:{radius:3,symbol:"circle"}}},tooltip:{xDateFormat:"%Y-%m-%d",shared:!0},series:t})}})});
;define("pagelet/videobatch/file.js",function(i){function e(i,e,n){var o=$.Deferred();o.file_id=e.id,o.id=n.upload_id,o.name=e.name;var t=$.noop,d={UploadProgress:function(i,e){e.id===o.file_id&&o.notify(e)},FileUploaded:function(i,e){e.id===o.file_id&&o.resolve(e)},Error:function(i,e){e.file&&e.file.id===o.file_id&&o.reject({type:"err",message:"网络错误"})}};for(var r in d)i.bind(r,d[r]);return o.abort=function(){o.reject({type:"cancel"})},o.destory=function(){window.vids_to_del.push(o.id);for(var e in d)i.unbind(e,d[e]);t(),i.removeFile(o.file_id)},o.fail(o.destory),setTimeout(function(){o.notify(e)},0),o}i("common/util/async.js"),i("common/util/util.js");return e});
;define("pagelet/videobatch/form.js",function(e){var a=e("common/util/omap.js"),t=e("common/vali/vali.js"),n=e("pagelet/signform/field.js");return function(){var e=n.getEle("input",{name:"title",label:"标题",require:"请填写标题",func:t.returnWrap(function(e){return t.range(e,5,30)})}),r=n.getEle("text",{name:"abstract",label:"视频简介(选填)",require:!1,func:t.returnWrap(function(e){return t.range(e,0,140)})}),l=n.getEle("row",{label:"设置"}),o=n.getEle("checkbox",{name:"show_ads",label:"展示广告"});l.jdd.append(o.jbox),o.jbox=$();var i=n.getEle("tag",{name:"article_category",label:"分类",data:window.pageData.video_category}),m=n.getEle("vposter",{source:"批量上传视频"}),u=new a;return u.set(e.name,e),u.set(r.name,r),u.set(l.name,l),u.set(o.name,o),u.set(i.name,i),u.set(m.name,m),u}});
;define("pagelet/videobatch/uploader.js",function(e){function i(e){t.ajax("/video/video_api/",{json_data:'{"api":"chunk_upload_info"}'},function(i,t,o){0==i?e(null,$.parseJSON(o)):e(t)})}var t=e("common/util/util.js"),o=e("common/ui/toastr.js"),n=e("pagelet/videobatch/file.js");return function(e){var t,r,s=$('<div class="upbtn1"><div class="upbtn1_btn"></div></div>').appendTo("body");s.mouseleave(function(){r.removeClass("hover"),$(this).css({width:"",height:"",top:"",left:"",zIndex:""})});var a=new plupload.Uploader($.extend({browse_button:s.children()[0],runtimes:"flash",max_retries:3,url:"loooook_preinit_UploadFile",chunk_size:"1mb",file_data_name:"video_file",filters:{max_file_size:"2gb",mime_types:[{title:"Video files",extensions:"wmv,avi,dat,asf,rm,rmvb,ram,mpg,mpeg,3gp,mov,mp4,m4v,dvix,dv,mkv,flv,vob,qt,cpk,fli,flc,mod,ts,webm,m2ts"}]},flash_swf_url:"//mp.toutiao.com/static/resource/pgc_ueditor/plupload_moxie.swf",preinit:{UploadFile:function(e,i){e.setOption("url",i.url)}},init:{Error:function(e,i){"Init error"===i.message&&$("head").trigger("flasherr")},FilesAdded:function(e,r){var s=t;_.each(r,function(t){t.url||(e.files.splice(_.indexOf(e.files,t),1),i(function(i,r){return i?(t.destory(),o.warning(i)):(t.url=r.upload_url,e.addFile(t),e.start(),void s(n(e,t,r)))}))})}}},e));return a.init(),function(e,i){e.mouseenter(function(){var e=$(this);if(!e.is(".disabled")){t=i,r=e,e.addClass("hover");var o=e.offset();o.width=e.outerWidth(),o.height=e.outerHeight(),o.zIndex=99,s.css(o)}})}}});
;define("pagelet/videobatch/item.js",function(e){var t=e("common/vali/vali.js"),i=(e("common/util/util.js"),e("common/util/async.js")),a=e("pagelet/videobatch/videobatch_tpl.whe"),o=e("pagelet/videobatch/form.js"),n=e("pagelet/videobatch/uploader.js"),s=n({multi_selection:!1});return function(){function e(e){u.file=e,m.jvali.val(e.name.replace(/\.[^.]+$/,"")).change(),c.name.text(e.name),e.progress(function(e,t){c.progress.css("width",e.percent+"%");var i;i=t?"文件上传成功，"+t.message:"已上传："+plupload.formatSize(e.loaded)+"/"+plupload.formatSize(e.size),c.count.text(i)}),e.done(function(){c.tip.text("视频上传成功"),n("uploaded")}),e.fail(function(e){"cancel"!==e.type&&(c.tip.text(e.message||"视频上传失败"),n("fail"))}),n("uploading")}function n(e){u.status=e,c.sc.prop("class","videobatch_card_"+e),"blank"===e?(_.reset(),_.jbox.hide()):"uploading"===e?(_.id=u.file.id,_.video_status="transcoding",_.jbox.show()):"uploaded"===e&&(_.video_status="done"),u.status_change(u)}function l(e){return"submited"===u.status?e():void i.map([p,f],function(e,t){e(function(e,i,a){e?t({msg:e,jerr:i}):t(null,a)})},function(t,i){if(t)return e(t.msg);var a=$.so(i[0].concat(i[1]));a.show_ads||(a.show_ads=0);var o={sp:"toutiao",vid:a.video_vid,vu:a.video_vid,vname:a.title,vposter:a.vposter},s=window.vids_to_del;window.vids_to_del=[],$.post("/edit_article_post/",$.extend(a,{from:"videobatch",vids_to_del:JSON.stringify(s),content:"<p>{!-- PGC_VIDEO:"+JSON.stringify(o)+" --}</p>",video_vu:a.video_vid,video_vposter:a.vposter,save:1,article_type:1})).always(function(t){return"保存成功"!=t.message&&"提交成功"!=t.message?(window.vids_to_del=s,e(t.message||"网络错误")):(c.tip.text("视频发布成功"),n("submited"),void e())})})}function d(){c.file.data({vali_name:"video_vid",vali_require:"请上传视频",vali_func:function(e){"blank"===u.status?e():"fail"===u.status?e("上传失败:"+u.file.name):"uploading"===u.status?e("正在上传:"+u.file.name):e(null,u.file.id)},vali_effect:$.noop});var e=o(),i=e.get("vposter"),a=e.get("title");c.table.append($.map(e.values(),function(e){return e.jbox.toArray()}));var n=$($.map(e.values(),function(e){return e.jvali.toArray()}));return[t(c.file),t(n),a,i]}var u={status_change:$.noop,status:"blank"},r=$(a()),c=r.nodes(),v=d(),p=v[0],f=v[1],m=v[2],_=v[3];return c.cancel.click(function(){u.file.abort(),u.file=null,n("blank")}),s(c.uploadbtn,function(t){u.file&&u.file.destory(),e(t)}),u.autoVali=f,u.bindFile=e,u.jele=r,u.submit=l,u}});
;define("pagelet/videobatch/videobatch.js",function(e){function t(e){return-1===h?void m.toggleClass("disabled",!1):(h=e,m.toggleClass("disabled",0===h),void d.remain.text("还能添加"+h+"个视频"))}function o(){var e=f.count();if(0===e)return d.launch.show(),void d.main.hide();d.launch.hide(),d.main.show();var t=f.filter(function(e,t){return"uploaded"===t.status}).count();d.summary_submit.toggleClass("disabled",t!==e),d.summary_progress.css("width",100*t/e+"%"),d.summary_count.text("已上传："+t+"/"+e+"个视频"),d.summary_auto.hasClass("checked")&&t===e&&(d.summary_auto.removeClass("checked"),d.summary_submit.click())}var s=e("common/util/util.js"),a=e("common/util/omap.js"),n=e("common/util/async.js"),i=e("common/ui/toastr.js"),u=e("common/popup/dialog.js"),c=e("pagelet/videobatch/uploader.js"),l=e("pagelet/videobatch/item.js");window.vids_to_del=[];var r=c({multi_selection:!0}),d=$("#videobatch").nodes();$("head").on("flasherr",function(){d.flasherr.show(),d.launch.hide()});var m=d.launch_submit.add(d.add),h=0;m.toggleClass("disabled",!0),$.get("/remaining_article_num_post/").always(function(e){return"success"!==e.message?u({title:"网络错误，请刷新页面重试",btns:[{type:"ok",click:function(){window.location.reload()}}]}).show():(h=2===e.data.level?10:e.data.remaining,h=Math.min(h,10),0===h&&u({title:"今日发文数已达到上限",btns:[{type:"ok",click:function(){window.history.back()}}]}).show(),void t(h))}),d.summary_auto.click(function(){return d.summary_auto.hasClass("checked")?void d.summary_auto.removeClass("checked"):void n.map(f.keys(),function(e,t){e.autoVali(function(e,o){e?t({msg:e,jerr:o}):t()})},function(e){e?(i.warning(e.msg),$(window).scrollTop(e.jerr.offset().top-50)):(d.summary_auto.addClass("checked"),o())})});var f=new a;r(d.launch_submit.add(d.add),function(e){if(0===h)return i.error("本次发文数已达到上限,["+e.name+"]上传失败"),void e.abort();var s=l(e);f.set(s),s.jele.insertBefore(d.bottom),s.status_change=function(e){"blank"===e.status&&t(h+1),("submited"===e.status||"blank"===e.status)&&(e.jele.remove(),f.remove(e)),o()},s.bindFile(e),d.summary_auto.removeClass("checked"),t(h-1)}),d.summary_submit.click($.loadDone(function(e){function t(e){e?(i.push(e.message),a||(a=e.jele)):c++,i.length+c===n&&o()}function o(){if(e(),window.ga("send","event","click","PC　批量上传视频","",c),i=_.map(i,function(e){return s.e(e)}),i.length)$(window).scrollTop(a.offset().top+50),u({title:i.length+"个发布失败，"+c+"个发布成功",content:$.safeMark(i.join("<br/>")),btns:["ok"]}).show();else{var t=u({title:"全部发布成功",btns:[{type:"ok",click:function(){window.location="/articles/?source_type=0"}}]});t.show()}}if(d.summary_submit.hasClass("disabled"))return e();var a,n=f.count(),i=[],c=0;f.forEach(function(e,o){o.submit(function(e){e?t({message:e,jele:o.jele}):t()})})})),window.onbeforeunload=function(){return 0!==f.count()?"当前视频尚未发布完毕，确认离开？":void 0}});
;define("pagelet/weixin/weixin.js",function(require,exports,module){var Stip=require("common/stip/stip.js"),Vali=require("common/vali/vali.js");return function(pageData){function parseStatus(t){return{"-1":"",1:"审核中",3:"未通过",2:"已开始抓取",5:"已通过"}[t]}function render(t){t.parseStatus=parseStatus;var a=$(tmpl(t));return a.data("data",t),a.find(".stip_hint").hoverTip(),a}var jtable=$("#weixins"),tmpl=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="tr sclearfix">\n    <div class="td td1">\n        <div class="ordertable_display sddd">\n            '+(null==(__t=obj.name)?"":_.escape(__t))+'\n        </div>\n        <div class="ordertable_edit">\n            <input class="weixin_input" type="text" name="name">\n        </div>\n    </div>\n    <div class="td td2">\n        <div class="ordertable_display sddd">\n            <a href="'+(null==(__t=obj.url)?"":_.escape(__t))+'" target="_blank" class="slink">'+(null==(__t=obj.url)?"":_.escape(__t))+'</a>\n        </div>\n        <div class="ordertable_edit">\n            <input class="weixin_input" type="text" name="url">\n        </div>\n    </div>\n    <div class="td td3">'+(null==(__t=parseStatus(obj.status))?"":_.escape(__t)),3===obj.status&&(__p+='<span class="stip_hint" data-title="'+(null==(__t=obj.confirm_reason)?"":_.escape(__t))+'"></span>'),__p+='</div>\n    <div class="td td4">\n        <div class="ordertable_display">\n            ',__p+=3===obj.status?'\n                <a href="" class="slink ordertable_btn_edit">修改</a><span class="ordertable_btn_split"></span><a href="" class="slink ordertable_btn_del">删除</a><span class="ordertable_btn_split"></span><a href="" class="slink ordertable_btn_apply">提交</a>\n            ':5===obj.status?'\n                <a href="" class="slink ordertable_btn_enable">开启抓取</a>\n            ':2===obj.status?'\n                <a href="" class="slink ordertable_btn_disable">关闭抓取</a>\n            ':"\n            ",__p+='\n        </div>\n        <div class="ordertable_edit">\n            <a href="" class="slink ordertable_btn_save">提交</a><span class="ordertable_btn_split"></span><a href="" class="slink ordertable_btn_cancel">取消</a>\n        </div>\n    </div>\n</div>';return __p};$("#weixintable_btn_add").click(function(t){t.preventDefault();var a={name:"",url:"",status:-1};jtable.append(render(a).addClass("edit"))}),jtable.on("click",".ordertable_btn_edit",function(t){t.preventDefault();{var a=$(this).closest(".tr"),e=a.data("data");a.children()}a.find(":input").each(function(){$(this).val(e[this.name])}),a.addClass("edit")}).on("click",".ordertable_btn_cancel",function(t){t.preventDefault();var a=$(this).closest(".tr"),e=a.data("data");e.id?a.replaceWith(render(e)):a.remove()}).on("click",".ordertable_btn_save",$.loadWrap(function(t){t.preventDefault();var a=$(this).closest(".tr"),e=a.data("data"),s=a.find(":input").so();if(s.name=$.trim(s.name),s.url=$.trim(s.url),!s.name)return alert("请输入公众号");if(!s.url||Vali.url(s.url))return alert("请输入正确的授权抓取链接");for(var n=a.siblings(),r=0;r<n.length;r++){var i=n.eq(r).data("data");if(i.name===s.name)return alert("该微信公众号已存在，请勿重复提交")}return s.id=e.id,$.post("/add_weixin_source_post/",s).always(function(t){"success"===t.message?(e.name=s.name,e.url=s.url,e.id=t.id,e.status=t.status,a.replaceWith(render(e))):Stip.popupTip({msg:t.data||"网络错误"})})})).on("click",".ordertable_btn_apply",$.loadWrap(function(t){t.preventDefault();var a=$(this).closest(".tr"),e=a.data("data");return $.post("/add_weixin_source_post/",e).always(function(t){"success"===t.message?(e.status=t.status,a.replaceWith(render(e))):Stip.popupTip({msg:t.data||"网络错误"})})})).on("click",".ordertable_btn_disable",$.loadWrap(function(t){t.preventDefault();var a=$(this).closest(".tr"),e=a.data("data");return $.post("/toggle_weixin_source_post/",{id:e.id}).always(function(t){"success"===t.message?(e.status=5,a.replaceWith(render(e))):Stip.popupTip({msg:t.data||"网络错误"})})})).on("click",".ordertable_btn_enable",$.loadWrap(function(t){t.preventDefault();var a=$(this).closest(".tr"),e=a.data("data");return $.post("/toggle_weixin_source_post/",{id:e.id}).always(function(t){"success"===t.message?(e.status=2,a.replaceWith(render(e))):Stip.popupTip({msg:t.data||"网络错误"})})})).on("click",".ordertable_btn_del",$.loadWrap(function(t){t.preventDefault();var a=$(this).closest(".tr"),e=a.data("data");if(confirm("确认删除？")){if(e.id)return $.post("/delete_weixin_source_post/",{id:e.id}).always(function(t){"success"===t.message?a.remove():Stip.popupTip({msg:t.data||"网络错误"})});a.remove()}}));for(var i=0;i<pageData.length;i++)jtable.append(render(pageData[i]))}});
;define("pagelet/wenda/wenda.js",function(require,exports,module){var template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";for(var item in data){__p+='\n    <div class="question">\n        <div data-qid="'+(null==(__t=data[item].question.qid)?"":_.escape(__t))+'" class="question-item">\n            ',data[item].question.tag_name&&(__p+='\n                <a class="question-name">【'+(null==(__t=data[item].question.tag_name)?"":__t)+"】</a>\n            "),__p+='\n            <h1 class="question-name">'+(null==(__t=data[item].question.title)?"":_.escape(__t))+"</h1>\n            ",data[item].is_answered&&(__p+='\n                <i class="question-status"><span>已回答</span></i>\n            '),__p+="\n            ",data[item].is_new&&(__p+='\n                <i class="question-status-new"><span>NEW</span></i>\n            '),__p+='\n            <div class="question-text">\n                '+(null==(__t=data[item].question.content.text)?"":__t)+'\n            </div>\n            <div class="question-bottom">\n                <a data-node="answer" target="_blank" class="btn btn-default answer-btn" href="http://wenda.toutiao.com/?enter_qid='+(null==(__t=data[item].question.qid)?"":_.escape(__t))+'&from=pgc">我来回答</a>\n                ';var total=data[item].question.normal_ans_count+data[item].question.nice_ans_count;__p+="\n                ",__p+=0==total?"\n                    <span>暂无回答</span>\n                ":"\n                    <span>共"+(null==(__t=total)?"":_.escape(__t))+"人回答</span>\n                ",__p+="\n                ",0!=data[item].question.normal_ans_count&&(__p+='\n                    <span data-node="show_all" class="answer-show-all" data-qid="'+(null==(__t=data[item].question.qid)?"":_.escape(__t))+'">\n                        查看更多<i></i>\n                    </span>\n                    <span data-node="hide_all"class="j-toggle toggle-btn">收起\n                        <i></i>\n                    </span>\n                '),__p+='\n            </div>\n            <div class="answer-items">\n                ';for(var ans_item in data[item].ans_list)__p+='\n                    <div class="answer-items essence"> \n                        <div data-node="answer-item" data-ansid="'+(null==(__t=data[item].ans_list[ans_item].ansid)?"":_.escape(__t))+'" class="answer-item"> \n                            <div class="answer-user"> \n                                <img class="answer-user-avatar" src="'+(null==(__t=data[item].ans_list[ans_item].user.avatar_url)?"":_.escape(__t))+'" alt="" /> \n                                <span class="answer-user-name">'+(null==(__t=data[item].ans_list[ans_item].user.uname)?"":_.escape(__t))+'</span> \n                                <span class="answer-user-name">'+(null==(__t=data[item].ans_list[ans_item].user.user_intro)?"":_.escape(__t))+'</span> \n                                <div> \n                                    <span class="answer-date right-spacing">'+(null==(__t=data[item].ans_list[ans_item].show_time)?"":_.escape(__t))+'</span> \n                                </div> \n                            </div> \n                            <div class="answer-text">\n                                <div class="answer-text-abstract">\n                                    '+(null==(__t=data[item].ans_list[ans_item].content_abstract.text)?"":_.escape(__t))+"\n                                    ",data[item].ans_list[ans_item].content_abstract.text.length>110&&(__p+='\n                                        <a class="j-expand" data-node="j_expand">...展开</a>\n                                    '),__p+='\n                                    <img src="'+(null==(__t=data[item].ans_list[ans_item].content_abstract.image_url)?"":_.escape(__t))+'"/>\n                                </div>\n                                ',data[item].ans_list[ans_item].content_abstract.text.length>110&&(__p+='\n                                    <div class="answer-text-real">\n                                        '+(null==(__t=data[item].ans_list[ans_item].content)?"":__t)+"\n                                    </div>\n                                "),__p+="\n                            </div>\n                        </div> \n                    </div> \n                ";__p+="\n            </div>\n        </div>\n    </div>\n"}__p+="\n"}return __p},answer_template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+='<div class="answers"> \n    ';for(var item in data.data.ans_list)__p+='\n        <div class="answer-items"> \n            <div data-node="answer-item" data-ansid="'+(null==(__t=data.data.ans_list[item].ansid)?"":_.escape(__t))+'" class="answer-item"> \n                <div class="answer-user"> \n                    <img class="answer-user-avatar" src="'+(null==(__t=data.data.ans_list[item].user.avatar_url)?"":_.escape(__t))+'" alt="" /> \n                    <span class="answer-user-name">'+(null==(__t=data.data.ans_list[item].user.uname)?"":_.escape(__t))+'</span> \n                    <span class="answer-user-name">'+(null==(__t=data.data.ans_list[item].user.user_intro)?"":_.escape(__t))+'</span> \n                    <div> \n                        <span class="answer-date right-spacing">'+(null==(__t=data.data.ans_list[item].show_time)?"":_.escape(__t))+'</span> \n                    </div> \n                </div> \n                <div class="answer-text"> \n                    <div class="answer-text-abstract">\n                        '+(null==(__t=data.data.ans_list[item].content_abstract.text)?"":_.escape(__t))+"\n                        ",data.data.ans_list[item].content_abstract.text.length>110&&(__p+='\n                            <a class="j-expand" data-node="j_expand">...展开</a>\n                        '),__p+='\n                        <img src="'+(null==(__t=data.data.ans_list[item].content_abstract.image_url)?"":_.escape(__t))+'"/>\n                    </div>\n                    ',data.data.ans_list[item].content_abstract.text.length>110&&(__p+='\n                        <div class="answer-text-real">\n                            '+(null==(__t=data.data.ans_list[item].content)?"":__t)+"\n                        </div>\n                    "),__p+="\n                </div> \n            </div> \n        </div> \n    ";__p+="   \n</div>\n"}return __p};module.exports=Pagelet.extend({el:"#pagelet-wenda",offset:{},first_time:{},events:{"click $refresh_questions":"getHotQuestions","click $show_all":"showAnswerMore","click $hide_all":"hideAnswerMore","click $j_expand":"expand"},init:function(t){this.num=t.num?t.num:5,this._cache(),this.getHotQuestions()},_cache:function(){this.$wenda=this.$el.find(".wenda-question-wrapper")},getHotQuestions:function(){this.$wenda.empty();var t={num:this.num},a=this,n={},e="";$.ajax({url:"//wenda.toutiao.com/wenda/web/feed/brow/",type:"GET",dataType:"jsonp",data:t,success:function(t){a.updateOffset(t.data.feed_question),n.data=t.data.feed_question,e=template(n),a.$dom.wenda_question_wrapper.append(e)}})},updateOffset:function(t){for(var a,n=0;n<t.length;n++)a=t[n].question.qid,this.offset[a]=t[n].ans_list.length,this.first_time[a]=0},showAnswerMore:function(t){var a=$(t.target);a.is("span")||(a=a.parent());var n=a.attr("data-qid"),e=this,s={},_={},i="";0==this.first_time[n]?(this.first_time[n]=1,s.qid=n,s.count=20,s.offset=this.offset[n],$.ajax({url:"//wenda.toutiao.com/wenda/web/question/loadmore/",type:"GET",dataType:"jsonp",data:s,success:function(t){e.offset[n]=t.offset,_.data=t,i=answer_template(_),a.closest(".question-item").append(i),a.hide(),a.next().show()}})):(a.hide(),a.next().show(),a.parent().nextAll(".answer-items").show(),a.parent().nextAll(".answers").show())},hideAnswerMore:function(t){var a=$(t.target);a.is("span")||(a=a.parent()),a.hide(),a.prev().show(),a.parent().nextAll(".answer-items").hide(),a.parent().nextAll(".answers").hide()},expand:function(t){var a=$(t.target).parent();a.next().show(),a.hide()}})});
;define("pagelet/wenda/wenda_invite.js",function(require,exports,module){var template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+="";for(var item in data){__p+='\n    <div class="question">\n        <div data-qid="'+(null==(__t=data[item].question.qid)?"":_.escape(__t))+'" class="question-item">\n            ',data[item].question.tag_name&&(__p+='\n                <a class="question-name">【'+(null==(__t=data[item].question.tag_name)?"":__t)+"】</a>\n            "),__p+='\n            <h1 class="question-name">'+(null==(__t=data[item].question.title)?"":_.escape(__t))+"</h1>\n            ",data[item].is_answered&&(__p+='\n                <i class="question-status"><span>已回答</span></i>\n            '),__p+="\n            ",data[item].is_new&&(__p+='\n                <i class="question-status-new"><span>NEW</span></i>\n            '),__p+='\n            <div class="question-text">\n                '+(null==(__t=data[item].question.content.text)?"":__t)+'\n            </div>\n            <div class="question-bottom">\n                <a data-node="answer" target="_blank" class="btn btn-default answer-btn" href="http://wenda.toutiao.com/?enter_qid='+(null==(__t=data[item].question.qid)?"":_.escape(__t))+'&from=pgc">我来回答</a>\n                ';var total=data[item].question.normal_ans_count+data[item].question.nice_ans_count;__p+="\n                ",__p+=0==total?"\n                    <span>暂无回答</span>\n                ":"\n                    <span>共"+(null==(__t=total)?"":_.escape(__t))+"人回答</span>\n                ",__p+="\n                ",0!=data[item].question.normal_ans_count&&(__p+='\n                    <span data-node="show_all" class="answer-show-all" data-qid="'+(null==(__t=data[item].question.qid)?"":_.escape(__t))+'">\n                        查看更多<i></i>\n                    </span>\n                    <span data-node="hide_all"class="j-toggle toggle-btn">收起\n                        <i></i>\n                    </span>\n                '),__p+='\n            </div>\n            <div class="answer-items">\n                ';for(var ans_item in data[item].ans_list)__p+='\n                    <div class="answer-items essence"> \n                        <div data-node="answer-item" data-ansid="'+(null==(__t=data[item].ans_list[ans_item].ansid)?"":_.escape(__t))+'" class="answer-item"> \n                            <div class="answer-user"> \n                                <img class="answer-user-avatar" src="'+(null==(__t=data[item].ans_list[ans_item].user.avatar_url)?"":_.escape(__t))+'" alt="" /> \n                                <span class="answer-user-name">'+(null==(__t=data[item].ans_list[ans_item].user.uname)?"":_.escape(__t))+'</span> \n                                <span class="answer-user-name">'+(null==(__t=data[item].ans_list[ans_item].user.user_intro)?"":_.escape(__t))+'</span> \n                                <div> \n                                    <span class="answer-date right-spacing">'+(null==(__t=data[item].ans_list[ans_item].show_time)?"":_.escape(__t))+'</span> \n                                </div> \n                            </div> \n                            <div class="answer-text">\n                                <div class="answer-text-abstract">\n                                    '+(null==(__t=data[item].ans_list[ans_item].content_abstract.text)?"":_.escape(__t))+"\n                                    ",data[item].ans_list[ans_item].content_abstract.text.length>110&&(__p+='\n                                        <a class="j-expand" data-node="j_expand">...展开</a>\n                                    '),__p+='\n                                    <img src="'+(null==(__t=data[item].ans_list[ans_item].content_abstract.image_url)?"":_.escape(__t))+'"/>\n                                </div>\n                                ',data[item].ans_list[ans_item].content_abstract.text.length>110&&(__p+='\n                                    <div class="answer-text-real">\n                                        '+(null==(__t=data[item].ans_list[ans_item].content)?"":__t)+"\n                                    </div>\n                                "),__p+="\n                            </div>\n                        </div> \n                    </div> \n                ";__p+="\n            </div>\n        </div>\n    </div>\n"}__p+="\n"}return __p},answer_template=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{}){__p+='<div class="answers"> \n    ';for(var item in data.data.ans_list)__p+='\n        <div class="answer-items"> \n            <div data-node="answer-item" data-ansid="'+(null==(__t=data.data.ans_list[item].ansid)?"":_.escape(__t))+'" class="answer-item"> \n                <div class="answer-user"> \n                    <img class="answer-user-avatar" src="'+(null==(__t=data.data.ans_list[item].user.avatar_url)?"":_.escape(__t))+'" alt="" /> \n                    <span class="answer-user-name">'+(null==(__t=data.data.ans_list[item].user.uname)?"":_.escape(__t))+'</span> \n                    <span class="answer-user-name">'+(null==(__t=data.data.ans_list[item].user.user_intro)?"":_.escape(__t))+'</span> \n                    <div> \n                        <span class="answer-date right-spacing">'+(null==(__t=data.data.ans_list[item].show_time)?"":_.escape(__t))+'</span> \n                    </div> \n                </div> \n                <div class="answer-text"> \n                    <div class="answer-text-abstract">\n                        '+(null==(__t=data.data.ans_list[item].content_abstract.text)?"":_.escape(__t))+"\n                        ",data.data.ans_list[item].content_abstract.text.length>110&&(__p+='\n                            <a class="j-expand" data-node="j_expand">...展开</a>\n                        '),__p+='\n                        <img src="'+(null==(__t=data.data.ans_list[item].content_abstract.image_url)?"":_.escape(__t))+'"/>\n                    </div>\n                    ',data.data.ans_list[item].content_abstract.text.length>110&&(__p+='\n                        <div class="answer-text-real">\n                            '+(null==(__t=data.data.ans_list[item].content)?"":__t)+"\n                        </div>\n                    "),__p+="\n                </div> \n            </div> \n        </div> \n    ";__p+="   \n</div>\n"}return __p};module.exports=Pagelet.extend({el:"#pagelet-wenda—invite",current_page:1,offset:{},first_time:{},events:{"keypress $current_page":"toPage","click $prev_page":"prevPage","click $next_page":"nextPage","click $show_all":"showAnswerMore","click $hide_all":"hideAnswerMore","click $j_expand":"expand"},_cache:function(){this.$cur=this.$el.find("#current_page"),this.$tot=this.$el.find("#total_page"),this.$wenda=this.$el.find(".wenda-question-wrapper")},init:function(){this._cache(),this.refresh_page(0)},toPage:function(){if("13"==event.keyCode){var t=this.$cur.val(),a="^\\d+$",e=new RegExp(a);null==t.match(e)?(alert("请输入正确页码！"),this.$cur.val(this.current_page+"")):t>this.total_page||0>=t?(alert("请输入正确页码！"),this.$cur.val(this.current_page+"")):this.refresh_page(t)}},refresh_page:function(t){this.$wenda.empty();var a={page:t},e=this,n={},s="";$.ajax({url:"//wenda.toutiao.com/wenda/web/invited/question/brow/",type:"GET",dataType:"jsonp",data:a,success:function(t){e.$cur.attr("value",t.current_page),e.$tot.html(t.total_page),e.updateOffset(t.invited_question),e.current_page=t.current_page,e.total_page=t.total_page,n.data=t.invited_question,s=template(n),e.$dom.wenda_question_wrapper.append(s)}})},prevPage:function(){this.current_page>1&&this.refresh_page(this.current_page-1)},nextPage:function(){this.current_page<this.total_page&&this.refresh_page(this.current_page+1)},updateOffset:function(t){for(var a,e=0;e<t.length;e++)a=t[e].question.qid,this.offset[a]=t[e].ans_list.length,this.first_time[a]=0},showAnswerMore:function(t){var a=$(t.target);a.is("span")||(a=a.parent());var e=a.attr("data-qid"),n=this,s={},_={},i="";0==this.first_time[e]?(this.first_time[e]=1,s.qid=e,s.count=20,s.offset=this.offset[e],$.ajax({url:"//wenda.toutiao.com/wenda/web/question/loadmore/",type:"GET",dataType:"jsonp",data:s,success:function(t){n.offset[e]=t.offset,_.data=t,i=answer_template(_),a.closest(".question-item").append(i),a.hide(),a.next().show()}})):(a.hide(),a.next().show(),a.parent().nextAll(".answer-items").show(),a.parent().nextAll(".answers").show())},hideAnswerMore:function(t){var a=$(t.target);a.is("span")||(a=a.parent()),a.hide(),a.prev().show(),a.parent().nextAll(".answer-items").hide(),a.parent().nextAll(".answers").hide()},expand:function(t){var a=$(t.target).parent();a.next().show(),a.hide()}})});
;define("pagelet/write/article.js",function(require,exports,module){function nodeTrim(e){e.each(function(){var e=$(this),t=$.trim(e.html());e.html(t)})}function removeSingleColumnTable(e){var t=$("<div></div>");if(e.find("tr").each(function(e,i){var a=$(i).children();return 1!=a.length?(t=null,!1):void $("<p></p>").html(a.html()).appendTo(t)}),t){var i=t.html().replace(/<p><\/p>/gi,"").replace(/<p><p>/gi,"<p>").replace(/<\/p><\/p>/gi,"</p>");return e.after(i),e.remove(),!0}return!1}function purify(e){{var t=$("<div></div>").html(e);t.find("p")}t.find("h2, h3, h4, h5, h6").each(function(){$(this).wrapInner("<strong></strong>").find("strong").unwrap()}),t.find("img,strong").each(function(){var e=$(this);e.parents("p").length||e.wrap("<p></p>")}),t.find("p img").each(function(){var e=$(this);this.getAttribute("src")||e.remove(),e.next().length&&e.after("<br>"),e.prev().length&&e.before("<br>")});t.html();return t.find("table").each(function(){var e=$(this);e.parents("p").length||e.wrap("<p></p>"),removeSingleColumnTable(e)||e.text().length>20&&(e.addClass("border"),e.find("th,td").each(function(e,t){var i=$(t),a=i.html();a=a.replace(/<\/?p>/g,""),i.html(a)}))}),nodeTrim(t.find("strong,span,a,td,th")),nodeTrim(t.find("p,li")),t.html()}function vote_htmlcode_adjust(e){var t=$("<div></div>").html(e);return t.find(".mp-vote").each(function(e,t){var i=$(t).attr("data-voteid"),a={};a.id=i,$(t).replaceWith("{!-- PGC_VOTE:"+JSON.stringify(a)+" --}")}),t.html()}function video_htmlcode_adjust(e){var t=$("<div></div>").html(e);return t.find(".online-video").each(function(e,t){var i=$(t),a={};a.sp="youku",a.vid=i.data("id"),a.web_uri=i.data("uri"),i.replaceWith("{!-- PGC_VIDEO:"+JSON.stringify(a)+" --}")}),t.find(".local-video").each(function(e,t){var i=$(t),a=spec_bridge.submit_video.vid,r=spec_bridge.submit_video.vu,n=spec_bridge.submit_video.vname,o=spec_bridge.submit_video.vposter,d={};a&&(d.sp="toutiao",d.vid=a,d.vu=r,d.vname=n,d.vposter=o,i.replaceWith("{!-- PGC_VIDEO:"+JSON.stringify(d)+" --}"))}),t.html()}function is_local_video_inserted(e){if(e){var t=ueditor_instance.document,i=t.getElementById("local-video-"+e);return!!i}}function gallery_htmlcode_adjust(e){var t=$("<div></div>").html(e);return t.find(".mp-gallery").each(function(e,t){var i=t.id,a=i.replace("gallery-",""),r={};r.list=global_gallery[a],$(t).replaceWith("{!-- PGC_GALLERY:"+JSON.stringify(r)+" --}")}),t.html()}function remove_remote_image_error_placeholder(e){var t=$("<div></div>").html(e);return t.find(".remoteImageErrorPlaceholder").each(function(e,t){$(t).remove()}),t.html()}function get_content_with_rank(e){var t="",i=[];t=e?ueditor_instance.getContent():ueditor_instance.getAllHtml();try{i=ueditor_instance.document.getElementsByClassName("mp-ranking")}catch(a){}if(i.length){void 0==window.frames.ranking_iframe&&$("body").append('<iframe id="ranking_iframe" name="ranking_iframe" style="display:none;"></iframe>');var r=window.frames.ranking_iframe;r.document.open(),r.document.write(t),$(r.document.body).prepend('<link href="http://s2.pstatp.com/css/toutiao/mp_ranking.css" rel="stylesheet">');for(var n=i.length-1;n>=0;n--){var o=i[n],d=o.id,l=o.contentDocument.getElementsByClassName("ranking-con")[0].outerHTML;$(r.document.body).find("#"+d).replaceWith(l)}t=e?r.document.body.innerHTML:r.document.documentElement.outerHTML}return t}function check_govid(e){var t=$("#gov-tip"),i=$("#gov_media_id").val(),a=!1,r="";return i?($.ajax({type:"POST",url:"/verify_media_name/",data:{gov_media_id:i},dataType:"json",async:e}).done(function(e){"success"==e.message?(r=e.data,a=!0):r=e.reason,t.text(r).show()}).fail(function(){r="服务器异常，请稍后再试",t.text(r).show()}),e?void 0:a?window.confirm("您所发表的文章将发表至政府号“"+r+"”，请确认内容、帐号名称均准确无误"):(popalert("alert",r),!1)):void t.hide()}function form_check(){var e=$.trim($("#title").val()).length,t=$.trim(ueditor_instance.getContentTxt()).length,i="",a=5,r=30,n=5e5;return 0==e?i="标题不能为空":a>e||e>r?i="标题长度应该在"+a+"-"+r+"字之间":ue.hasContents()?t>n?i="正文不能超过"+n+"字":set_videoposter_check()?cover_valid_check()?checkPushInfo()?checkVideo()?checkVideoUploadSuccess()||(i="对不起，视频上传没有完成"):i="请选择视频分类":i="对不起推送的标题或者内容不能为空":i="请完成封面图设置":i="请设置视频封面":i="正文不能为空",i?(fixedAlert(i),!1):!0}function timer_valid_check(e){var t=$("body").find(".gg-timer-radio"),i=$("body").find(".j_timepicker").val();if(t.length&&t.hasClass("selected")){var a="获取时间失败",r="定时发布时间范围错误，请重新设定时间";$.ajax({type:"GET",url:"/article/get_server_time/"}).done(function(t){if("success"!==t.message)return void fixedAlert(a);if(t.data){var n=new Date(1e3*t.data.server_time),o=compare_timer_time(i,n);return o?void e():void fixedAlert(r)}}).fail(function(){fixedAlert(a)})}else e()}function compare_timer_time(e,t){var i=t.clone(),a=i.h(i.h()+2).format(),r=i.h(i.h()+22).format(),n=new Date(e),o=new Date(a),d=new Date(r);return o>n||n>d?!1:!0}function set_videoposter_check(){var e=$(".front-cover-type .selected").data("type"),t=$(".video-feedback-status img"),i="http://p.pstatp.com/large/9820/3808334921";return"auto"==e?0==t.length||t.attr("src")!=i&&t.attr("src")?!0:!1:!0}function cover_valid_check(){var e=$(".front-cover-radio.selected").data("type"),t=$(".front-cover-img img"),i=$(".front-cover-single img"),a=t.length;if("auto"==e)return!0;if(0==a)return!1;if("single"==e&&0==i.length)return!1;for(var r=ueditor_instance.document.getElementsByTagName("img"),n=[],o=r.length-1;o>=0;o--){var d=r[o].src;if(/\/large\//.test(d)){var l=d.split("/large/");n.push(l[1])}}for(var o=0;a>o;o++){for(var s=t[o].getAttribute("_origin_uri"),c=!1,_=0;_<n.length;_++)n[_]===s&&(c=!0);c||$(t[o]).remove()}var u=$(".front-cover-img img"),v=$(".front-cover-single img");return"single"==e&&0==v.length?!1:"multi"==e&&3!=u.length?!1:!0}function article_post(e,t){if(!submit_lock){submit_lock=!0;var i=$.trim($("#title").val()),a=$.trim($("#abstract").val())||"",r=ueditor_instance.getContent(),t=t||"",n=$.trim($("#author-names").val()),o=$("#channel_tags option:selected").val()||"",d=e?0:1,l=spec_bridge.pgc_id,s=spec_bridge.submit_video.vid,c=spec_bridge.submit_video.vu,_=spec_bridge.submit_video.vname,u=spec_bridge.submit_video.vposter,v=spec_bridge.vids_to_del,m=$(".gg-show").is(".selected")?1:0,p=$(".gg-push").is(".selected")?1:0,g=$(".gg-subsidy").is(".selected")?1:0,f=0,h=$("#self_recommand").checkbox()?1:0,b=$(".front-cover-radio.selected").data("type"),y=$(".front-cover-img img"),w=$(".front-cover-single img"),k=[],x=null,j=spec_bridge.pgc_gov_proxy||0,T=2,E=spec_bridge.after_pass_modify?1:0,A=debut.debutData.isChecked?1:0,C=debut.debutData.pgc_debut?1:0,D=debut.debutData.debut_url||"",P=debut.debutData.debut_mp||"",S=$(".gg-push-client").length&&($(".gg-push-client").hasClass("selected")?"1":"0"),O=$(".gg-timer-radio").length&&$(".gg-timer-radio").hasClass("selected")?1:0,I=debut.debutData.debut_author||"",N=doubleTitle.is_abtest,V=doubleTitle.slave_item_id||"",q=$(".j_media_select");if("1"==q.attr("has-media")&&s){for(var H=q.find("select"),W=[],L=0;L<H.length;L++)W.push(H.eq(L).val());W=W.join("/")}if(N&&!doubleTitle.validate())return!1;if($(".gg-spread").length&&(T=$(".gg-spread").is(".selected")?1:0),$.cookie("lasttag",o,{expires:30,path:"/"}),"single"==b)x={uri:w[0].getAttribute("_src"),origin_uri:w[0].getAttribute("_origin_uri")},k.push(x);else if("multi"==b)for(var M=y.length,L=0;M>L;L++)x={uri:y[L].getAttribute("_src"),origin_uri:y[L].getAttribute("_origin_uri")},k.push(x);!e&&j&&(f=$("#gov_media_id").val()),e&&(p=0),"ranker"==spec_bridge.author_type&&(r=get_content_with_rank(!0)),r=t+r,r=purify(r),r=vote_htmlcode_adjust(r),r=video_htmlcode_adjust(r),r=gallery_htmlcode_adjust(r),r=remove_remote_image_error_placeholder(r);var R=$(".fb"),G=R.text(),J="提交中...";e&&(R=$(".cg"),G=R.text(),J="保存中..."),R.attr("disabled","disabled").text(J);var B={title:i,"abstract":a,content:r,authors:n,tag:o,self_appoint:h,save:d,pgc_id:l,show_ads:m,video_vid:s,video_vu:c,video_vname:_,video_vposter:u,vids_to_del:JSON.stringify(v),force_ads:T,after_pass_modify:E,urgent_push:p,gov_media_id:f,subsidy:g,pgc_feed_covers:JSON.stringify(k),article_category:W};S&&(B.push_status=S,B.push_android_title=$(".j_push_android_title").val(),B.push_android_summary=$(".j_push_android_textarea").val(),B.push_ios_summary=$(".j_push_ios_title").val()),O&&(B.timer_status=O,B.timer_time=$(".j_timepicker").val()),$.extend(B,{claim_origin:A,pgc_debut:C,debut_url:D,debut_mp:P,debut_author:I}),$.extend(B,{slave_title:doubleTitle.slave_title,is_abtest:N,slave_item_id:V}),$.ajax({type:"POST",async:!0,url:"/edit_article_post/",data:B,dataType:"json"}).done(function(t){if(fixedAlert(t.message),"保存成功"==t.message||"提交成功"==t.message){window.onbeforeunload=function(){},window.localStorage&&window.localStorage.getItem(spec_bridge.localStorageName)&&window.localStorage.removeItem(spec_bridge.localStorageName);var i=t.data||{};i.is_ad_article&&!e?i.ad_id?setTimeout(function(){location.href="http://ad.toutiao.com/ad/"+i.ad_id+"/"},1e3):setTimeout(function(){location.href="http://ad.toutiao.com/ad/create_article/?from_pgc_groupid="+t.msg.group_id},1e3):setTimeout(function(){location.href="/articles/"},1e3);for(var a=0;a<v.length;a++){var r={};r.api="delete",r.ref_id=v[a],video_controler.exec_api(r,!0,!0)}}else submit_lock=!1}).fail(function(e,t,i){submit_lock=!1,fixedAlert("服务器异常，请稍后再试，异常状态："+e.status+","+t+","+i)}).always(function(){R.removeAttr("disabled").text(G)})}}function handle_video(e){var t=spec_bridge.submit_video.vid,i=spec_bridge.submit_video.vu||"",a=spec_bridge.submit_video.vname;t&&!is_local_video_inserted(t)?popalert("confirm","视频未添加到正文中，是否默认显示在正文顶部？",function(){var r={};r.sp="toutiao",r.vid=t,r.vu=i,r.vname=a,r.vposter=spec_bridge.submit_video.vposter,contentHeader="<p>{!-- PGC_VIDEO:"+JSON.stringify(r)+" --}</p>",article_post(e,contentHeader)}):article_post(e)}function setCookie(e,t){$.cookie(e,t,{expires:100,path:"/"})}function realview(e){var t=$.trim($("#title").val());if(0==t.length)return void fixedAlert("请输入文章标题");var i={media_id:spec_bridge.media_id,avatar:spec_bridge.avatar,media_name:spec_bridge.media_name,description:spec_bridge.description,title:t,time:get_time(),authors:$.trim($("#author-names").val()),show_ads:$(".gg-show").is(".selected")},a=PREVIEW_HEADER_TEMPLATE(i),r=PREVIEW_FOOTER_TEMPLATE(i);void 0==window.frames.realview_iframe&&$("body").append('<div id="realview" class="modal fade"  tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"><iframe id="realview_iframe" name="realview_iframe"  scrolling="yes" frameborder="0"></iframe></div></div></div>');var n=window.frames.realview_iframe;n.document.open(),n.document.write(e),n.document.close(),$(n.document.body).attr("id","preview"),adjust_gallery_preview($(n.document.body)),$(n.document.body).prepend(a),$(n.document.body).append(r),$(n.document.body).on("click","a",function(e){e.preventDefault()}),$("#realview").modal()}function adjust_gallery_preview(e){e.find(".mp-gallery").each(function(e,t){for(var i=$(t).attr("id"),a=i.replace("gallery-",""),r=global_gallery[a],n="",e=0;e<r.length;e++)n+='<p><img src="'+util.e(r[e].url)+'"></p>',r[e].desc&&(n+="<p>"+util.e(r[e].desc)+"</p>");n&&$(t).replaceWith(n)})}function get_time(){var e=new Date,t=e.getMonth()+1,i=e.getDate(),a=e.getHours(),r=e.getMinutes();return(10>t?"0"+t:t)+"-"+(10>i?"0"+i:i)+" "+(10>a?"0"+a:a)+":"+(10>r?"0"+r:r)}{var PREVIEW_HEADER_TEMPLATE=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div class="bar pgc_bar_top">\n	<a href="http://www.toutiao.com/m'+(null==(__t=media_id)?"":_.escape(__t))+'/" target="_blank">\n		<div class="avatar">\n			<img src="'+(null==(__t=avatar)?"":_.escape(__t))+'" class="avatar">\n		</div>\n		<span class="name">'+(null==(__t=media_name)?"":_.escape(__t))+'</span>\n	</a>\n</div>\n<header class="__pgc_mobile__">\n	<div class="title">'+(null==(__t=title)?"":_.escape(__t))+'</div>\n	<div>\n		<span class="time" style="padding-left:0;">'+(null==(__t=time)?"":_.escape(__t))+"</span>\n 	</div>\n</header>";return __p},PREVIEW_FOOTER_TEMPLATE=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+='<div id="profile">\n	<a href="http://www.toutiao.com/m'+(null==(__t=media_id)?"":_.escape(__t))+'/" target="_blank">\n		<table>\n			<tbody>\n				<tr>\n					<td width="70">\n						<div class="profile_avatar">\n							<img src="'+(null==(__t=avatar)?"":_.escape(__t))+'">\n						</div>\n					</td>\n					<td>\n						<div class="profile_info">'+(null==(__t=media_name)?"":_.escape(__t))+'</div>\n						<div class="profile_desc">'+(null==(__t=description)?"":_.escape(__t))+'</div>\n					</td>\n				</tr>\n			</tbody>\n		</table>\n	</a>\n</div>\n<div  class="preview_float  ',show_ads&&(__p+="with_ad"),__p+='" >\n	<img src="https://p.pstatp.com/origin/6328/4512646596">\n</div>';return __p},util=require("common/util/util.js"),popalert=require("pagelet/popalert/popalert.js"),video_controler=null,spec_bridge=null,ueditor_instance=null,submit_lock=!1,debut=($({}),require("common/stip/stip.js"),require("common/vali/vali.js"),require("pagelet/original_tag/tag.js")),doubleTitle=require("pagelet/double_title/title.js")(debut);require("common/select/select.js")}$fixedAlertDiv=$(".alert"),$fixedAlertDiv.length&&($fixedAlertDiv.affix({offset:{top:$fixedAlertDiv.offset().top}}),fixedAlert=function(e,t){e.length&&($fixedAlertDiv.find("span").html(e).end().height(40),setTimeout(function(){$fixedAlertDiv.height(0)},t||4e3))}),$("#origin-mark").on("click",".origin-hint",function(){$("#origin-hint-detail").show()});var checkPushInfo=function(){var e,t,i,a=$("body").find(".gg-push"),r=$("#push-msg-modal");return a.length&&a.hasClass("selected")?(e=r.find(".j_push_android_title"),t=r.find(".j_push_android_textarea"),i=r.find(".j_push_ios_title"),e.val()&&t.val()&&i.val()?!0:!1):!0},checkVideoUploadSuccess=function(){var e=$(".j_media_select"),t=$("#video-uploading");return"1"==e.attr("has-media")&&"block"==t.css("display")?!1:!0},checkVideo=function(){for(var e=$(".j_media_select"),t=e.find("select"),i=[],a=0;a<t.length;a++)t.eq(a).val()&&i.push(t.eq(a).val());return"1"==e.attr("has-media")?i.length>0?!0:!1:!0};$(".fb").click(function(){var e=!1,t=$("#gov_media_id").val();timer_valid_check(function(){form_check()&&(t?check_govid(!1):!0)&&handle_video(e)})}),$(".cg").click(function(){var e=!0;form_check()&&handle_video(e)}),$(".yl").click(function(){var e=ueditor_instance.getAllHtml();"ranker"==spec_bridge.author_type&&(e=get_content_with_rank(!1)),realview(e)});var cookie_name="_yl",cookie_val="y";$(".understand").click(function(){$("#preview_modal").modal("hide"),handle_video(!1)}),$(".modal_preview").click(function(){$("#preview_modal").modal("hide"),$(".yl").trigger("click")}),$("#preview_chkbox").click(function(){this.checked?setCookie(cookie_name,cookie_val):setCookie(cookie_name,null)}),$("#gov_media_id").focusout(function(){check_govid(!0)}),$(".gg-radio").click(function(){var e=$(this),t=e.data("type"),i=e.is(".selected"),a=$(".gg-spread-tip"),r=$(".channel-cell");if(!e.is(".disabled"))switch(t){case"show":case"spread":i?(e.removeClass("selected"),"spread"==t&&(a.hide(),r.show())):(e.addClass("selected"),"spread"==t&&(a.show(),r.hide(),$("#channel_tags").val("")));break;case"push":var n=e.data("remain");if(0>=n)return;i?e.removeClass("selected"):e.addClass("selected");break;case"subsidy":i?e.removeClass("selected"):e.addClass("selected")}}),module.exports=function(e){spec_bridge=e,video_controler=spec_bridge.video_controler,ueditor_instance=spec_bridge.ue||ue,debut.$debutEvent.trigger("spec.init",e)}});
;define("pagelet/write/article_link.js",function(require,exports,module){var inputDialog=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="menum_input_dialog">\n    <div class="menum_input_dialog_title">文章地址：</div>\n    <input type="text" name="url" class="signform_input menum_input_dialog_input" data-node="input" placeholder="支持头条网站内的文章链接">\n    <div class="sred menum_input_dialog_msg" data-node="msg"></div>\n    <div class="menum_input_dialog_hint">\n    	请勿添加与正文无关的链接\n    	<a class="slink" href="http://toutiao.com/a5198053041/" target="_blank">使用规范</a>\n    </div>\n</div>';return __p},Vali=require("common/vali/vali.js"),Util=require("common/util/util.js"),Dialog=require("common/popup/dialog.js"),dialog=function(){function i(){e(function(i,n,t){i||(a.hide(),u($.so(t).url))})}var n=$(inputDialog()),t=n.nodes();t.input.placeholder(),t.input.data({vali_jmsg:t.msg,vali_require:"请填写文章链接",vali_name:"url",vali_func:function(i){var n=$.trim(this.val());return n?void Util.ajax("/article/get_title_by_url/",{url:n},function(n,t,e){0===n?i(null,{href:e.url,textValue:e.title}):i(t)}):i("请输入头条网站内的文章链接")}});var e=Vali(t.input),a=Dialog({btns:[{type:"ok",click:i},{type:"cancel",click:function(){a.hide()}}]}),l=a.jele.find(".spopup_dialog_body");l.append(n);var u;return function(i){u=i.success||$.noop,e("reset"),t.input.val(i.name||""),a.show()}}();ue.addListener("for_article_link",function(){dialog({success:function(i){ue.execCommand("link",i)}})})});
;define("pagelet/write/author.js",function(e,t,a){function r(e){var t=e.attr("data-id"),a=e.find(".author-name").text();if(t)for(var r=0;r<f.length;r++)f[r]==t&&f.splice(r,1);else for(var r=0;r<p.length;r++)p[r]==a&&p.splice(r,1);m--,e.remove(),h.show()[0].focus(),n()}function i(e){if(m==A)return void alert("最多"+A+"位作者");if($.isPlainObject(e)&&-1==$.inArray(e.id,f)){f.push(e.id);var t=e}else if("string"==typeof e&&-1==$.inArray(e,p)){p.push(e);var t=[{value:e,id:""}]}else{if(!$.isArray(e)||!e.length)return;for(var t=[],a=0;a<e.length;a++)-1==$.inArray(e[a],p)&&(p.push(e[a]),t.push({value:e[a],id:""}))}var r=s(t);$(".authors-selected").append(r),n(),++m==A&&h.hide()}function n(){var e=$(".authors-control").width()-$(".authors-selected").width()-10;h.val("").css({width:e+"px"}),d.val(p.join(",")),v.val(f.join(","))}function s(e){for(var t="",a=0;a<e.length;a++){var r=e[a],i="";i+=u.replace("{{id}}",o.e(r.id)),t+=i.replace("{{name}}",o.e(r.value))}return t}{var o=e("common/util/util.js"),u='<div class="authors-selected-item" data-id="{{id}}"><span class="author-name">{{name}}</span><i class="author-remove"></i></div>',l={BACKSPACE:8,ENTER:13,NUMPAD_ENTER:108,SPACE:32,TAB:9},c=$(".authors-control"),h=$("#authors"),v=($(".authors-selected"),$("#author-ids")),d=$("#author-names"),f=[],p=[],m=0,A=3;c.width()}c.on("click",".author-remove",function(){return r($(this).parent()),!1}),$("#authors").on("keydown",function(e){switch(e.keyCode){case l.BACKSPACE:var t=this.value;if(!t.length){var a=$(".authors-selected-item:last");r(a),e.preventDefault()}break;case l.ENTER:case l.NUMPAD_ENTER:case l.SPACE:case l.TAB:var t=$.trim(h.val());t&&i(t),e.preventDefault()}}).on("keyup",function(e){switch(e.keyCode){case l.SPACE:this.value=$.trim(this.value),e.preventDefault()}}).on("blur",function(){var e=$.trim(h.val());e&&i(e)}),a.exports=function(e){i(e.split(","))}});
;define("pagelet/write/cover.js",function(i,e,t){function r(){var i=$.trim($("#title").val()),e=$.trim($('input[name="authors"]').val()),t=$(".front-cover-radio").filter(".selected").data("type"),r=$(".front-cover-upload").find("img"),o=$(".front-cover-single").find("img"),n=r.length;if(0==i.length)return void fixedAlert("请输入文章标题");var a=$("#cover-review-tmpl").children().clone(),c=a.find(".cover-imgs");if(0==n)c.attr("style","display:none;");else switch(t){case"single":o.length?(a.addClass("with-single-img"),c.html('<li class="cover-imgs-0"><img src="'+l.e(o[0].src)+'"></li>')):c.attr("style","display:none;");break;case"multi":if(3>n)return void fixedAlert("请先选取3幅封面图后再预览");for(var d=0;3>d;d++)c.append('<li class="cover-imgs-'+d+'"><img src="'+l.e(r[d].src)+'"></li>')}a.find(".cover-title").text(i),a.find(".cover-author").text(e),void 0==window.frames.realview_iframe&&$("body").append('<div id="realview" class="modal fade"  tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"><iframe id="realview_iframe" name="realview_iframe"  scrolling="yes" frameborder="0"></iframe></div></div></div>');var s=window.frames.realview_iframe;s.document.open(),s.document.write(a.prop("outerHTML")),$(s.document.body).prepend('<style>*{margin:0;padding:0;}ul{list-style:none;}img{border:none;vertical-align:middle;}body{padding:0 10px;font-family:"Microsoft YaHei",simsun,Arial;}.cover-review{position:relative;margin-top:10px;}.cover-review.with-single-img{padding-right:100px;min-height:63px}.cover-title{font-size:17px;font-weight:bold;line-height:1.2em;color:#464646}.with-single-img .cover-title{min-height:2.3em}.cover-imgs{width:100%;overflow:hidden;margin-top:5px}.with-single-img .cover-imgs{position:absolute;top:0;right:0;width:90px;height:63px;margin-top:0}.cover-imgs li{float:left;width:33.33333%;text-align:center;overflow:hidden}.with-single-img .cover-imgs li{float:none;width:100%;height:100%;text-align:center !important}.cover-imgs li:first-child{text-align:left}.cover-imgs li:last-child{text-align:right}.cover-imgs li.cover-imgs-3{text-align:right}.cover-imgs li img{width:94px;max-width:100%;height:66px;vertical-align:middle}.with-single-img .cover-imgs li img{width:100%;height:100%}.cover-info{font-size:11px;color:#999;margin-top:10px;line-height:1em}.cover-info li{display:inline-block}.with-single-img .cover-time{display:none}.cover-author{margin-right:5px}.cover-action{float:right;width:17px;height:12px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABEAAAAMCAYAAACEJVa/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAKTWlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVN3WJP3Fj7f92UPVkLY8LGXbIEAIiOsCMgQWaIQkgBhhBASQMWFiApWFBURnEhVxILVCkidiOKgKLhnQYqIWotVXDjuH9yntX167+3t+9f7vOec5/zOec8PgBESJpHmomoAOVKFPDrYH49PSMTJvYACFUjgBCAQ5svCZwXFAADwA3l4fnSwP/wBr28AAgBw1S4kEsfh/4O6UCZXACCRAOAiEucLAZBSAMguVMgUAMgYALBTs2QKAJQAAGx5fEIiAKoNAOz0ST4FANipk9wXANiiHKkIAI0BAJkoRyQCQLsAYFWBUiwCwMIAoKxAIi4EwK4BgFm2MkcCgL0FAHaOWJAPQGAAgJlCLMwAIDgCAEMeE80DIEwDoDDSv+CpX3CFuEgBAMDLlc2XS9IzFLiV0Bp38vDg4iHiwmyxQmEXKRBmCeQinJebIxNI5wNMzgwAABr50cH+OD+Q5+bk4eZm52zv9MWi/mvwbyI+IfHf/ryMAgQAEE7P79pf5eXWA3DHAbB1v2upWwDaVgBo3/ldM9sJoFoK0Hr5i3k4/EAenqFQyDwdHAoLC+0lYqG9MOOLPv8z4W/gi372/EAe/tt68ABxmkCZrcCjg/1xYW52rlKO58sEQjFu9+cj/seFf/2OKdHiNLFcLBWK8ViJuFAiTcd5uVKRRCHJleIS6X8y8R+W/QmTdw0ArIZPwE62B7XLbMB+7gECiw5Y0nYAQH7zLYwaC5EAEGc0Mnn3AACTv/mPQCsBAM2XpOMAALzoGFyolBdMxggAAESggSqwQQcMwRSswA6cwR28wBcCYQZEQAwkwDwQQgbkgBwKoRiWQRlUwDrYBLWwAxqgEZrhELTBMTgN5+ASXIHrcBcGYBiewhi8hgkEQcgIE2EhOogRYo7YIs4IF5mOBCJhSDSSgKQg6YgUUSLFyHKkAqlCapFdSCPyLXIUOY1cQPqQ28ggMor8irxHMZSBslED1AJ1QLmoHxqKxqBz0XQ0D12AlqJr0Rq0Hj2AtqKn0UvodXQAfYqOY4DRMQ5mjNlhXIyHRWCJWBomxxZj5Vg1Vo81Yx1YN3YVG8CeYe8IJAKLgBPsCF6EEMJsgpCQR1hMWEOoJewjtBK6CFcJg4Qxwicik6hPtCV6EvnEeGI6sZBYRqwm7iEeIZ4lXicOE1+TSCQOyZLkTgohJZAySQtJa0jbSC2kU6Q+0hBpnEwm65Btyd7kCLKArCCXkbeQD5BPkvvJw+S3FDrFiOJMCaIkUqSUEko1ZT/lBKWfMkKZoKpRzame1AiqiDqfWkltoHZQL1OHqRM0dZolzZsWQ8ukLaPV0JppZ2n3aC/pdLoJ3YMeRZfQl9Jr6Afp5+mD9HcMDYYNg8dIYigZaxl7GacYtxkvmUymBdOXmchUMNcyG5lnmA+Yb1VYKvYqfBWRyhKVOpVWlX6V56pUVXNVP9V5qgtUq1UPq15WfaZGVbNQ46kJ1Bar1akdVbupNq7OUndSj1DPUV+jvl/9gvpjDbKGhUaghkijVGO3xhmNIRbGMmXxWELWclYD6yxrmE1iW7L57Ex2Bfsbdi97TFNDc6pmrGaRZp3mcc0BDsax4PA52ZxKziHODc57LQMtPy2x1mqtZq1+rTfaetq+2mLtcu0W7eva73VwnUCdLJ31Om0693UJuja6UbqFutt1z+o+02PreekJ9cr1Dund0Uf1bfSj9Rfq79bv0R83MDQINpAZbDE4Y/DMkGPoa5hpuNHwhOGoEctoupHEaKPRSaMnuCbuh2fjNXgXPmasbxxirDTeZdxrPGFiaTLbpMSkxeS+Kc2Ua5pmutG003TMzMgs3KzYrMnsjjnVnGueYb7ZvNv8jYWlRZzFSos2i8eW2pZ8ywWWTZb3rJhWPlZ5VvVW16xJ1lzrLOtt1ldsUBtXmwybOpvLtqitm63Edptt3xTiFI8p0in1U27aMez87ArsmuwG7Tn2YfYl9m32zx3MHBId1jt0O3xydHXMdmxwvOuk4TTDqcSpw+lXZxtnoXOd8zUXpkuQyxKXdpcXU22niqdun3rLleUa7rrStdP1o5u7m9yt2W3U3cw9xX2r+00umxvJXcM970H08PdY4nHM452nm6fC85DnL152Xlle+70eT7OcJp7WMG3I28Rb4L3Le2A6Pj1l+s7pAz7GPgKfep+Hvqa+It89viN+1n6Zfgf8nvs7+sv9j/i/4XnyFvFOBWABwQHlAb2BGoGzA2sDHwSZBKUHNQWNBbsGLww+FUIMCQ1ZH3KTb8AX8hv5YzPcZyya0RXKCJ0VWhv6MMwmTB7WEY6GzwjfEH5vpvlM6cy2CIjgR2yIuB9pGZkX+X0UKSoyqi7qUbRTdHF09yzWrORZ+2e9jvGPqYy5O9tqtnJ2Z6xqbFJsY+ybuIC4qriBeIf4RfGXEnQTJAntieTE2MQ9ieNzAudsmjOc5JpUlnRjruXcorkX5unOy553PFk1WZB8OIWYEpeyP+WDIEJQLxhP5aduTR0T8oSbhU9FvqKNolGxt7hKPJLmnVaV9jjdO31D+miGT0Z1xjMJT1IreZEZkrkj801WRNberM/ZcdktOZSclJyjUg1plrQr1zC3KLdPZisrkw3keeZtyhuTh8r35CP5c/PbFWyFTNGjtFKuUA4WTC+oK3hbGFt4uEi9SFrUM99m/ur5IwuCFny9kLBQuLCz2Lh4WfHgIr9FuxYji1MXdy4xXVK6ZHhp8NJ9y2jLspb9UOJYUlXyannc8o5Sg9KlpUMrglc0lamUycturvRauWMVYZVkVe9ql9VbVn8qF5VfrHCsqK74sEa45uJXTl/VfPV5bdra3kq3yu3rSOuk626s91m/r0q9akHV0IbwDa0b8Y3lG19tSt50oXpq9Y7NtM3KzQM1YTXtW8y2rNvyoTaj9nqdf13LVv2tq7e+2Sba1r/dd3vzDoMdFTve75TsvLUreFdrvUV99W7S7oLdjxpiG7q/5n7duEd3T8Wej3ulewf2Re/ranRvbNyvv7+yCW1SNo0eSDpw5ZuAb9qb7Zp3tXBaKg7CQeXBJ9+mfHvjUOihzsPcw83fmX+39QjrSHkr0jq/dawto22gPaG97+iMo50dXh1Hvrf/fu8x42N1xzWPV56gnSg98fnkgpPjp2Snnp1OPz3Umdx590z8mWtdUV29Z0PPnj8XdO5Mt1/3yfPe549d8Lxw9CL3Ytslt0utPa49R35w/eFIr1tv62X3y+1XPK509E3rO9Hv03/6asDVc9f41y5dn3m978bsG7duJt0cuCW69fh29u0XdwruTNxdeo94r/y+2v3qB/oP6n+0/rFlwG3g+GDAYM/DWQ/vDgmHnv6U/9OH4dJHzEfVI0YjjY+dHx8bDRq98mTOk+GnsqcTz8p+Vv9563Or59/94vtLz1j82PAL+YvPv655qfNy76uprzrHI8cfvM55PfGm/K3O233vuO+638e9H5ko/ED+UPPR+mPHp9BP9z7nfP78L/eE8/sl0p8zAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAD0SURBVHjajNIxSgNRFIXhbx5pUkiM2IQYEbKF7EL3IFpFyAa0sJDgBgzEKpsQVzB19qAY7SIYYcpoc4VhcJj83Tv3vse5590sz3PBFY7xia16fnCIN8yhhYQ7FHjAh2b6OMcUtwkX2OB+xwfgPfo3uEwYYlZpOgqrWZwzPIZeZoZhigyKSvEbZ1iG9SVOQy9TYJ1qQvzCIMZbhf1B6FW2qWS57ieayFJNoRMO+pFDP760819zwj7aFX0PTxjFKCM8h16mjW7CKyaV4iqW7y+vLcahl5ngJWGBA1yjt+Oe9HAT9xZZae3HOMG6Ye1b6MYEc/gdAOwrORz08d+/AAAAAElFTkSuQmCC);background-size:17px;cursor:pointer}.cover-time{float:right;margin-right:5px}</style>'),s.document.close(),$("#realview").modal()}function o(i){if(parseInt(i.w,10)>0){var e=h.tellSelect();m={x:Math.round(e.x),y:Math.round(e.y),w:Math.round(e.w),h:Math.round(e.h)}}}function n(i,e){var t=A.find("img");e?(C=!0,i.addClass("cover-loading"),t.length&&t.css("opacity",0)):(C=!1,i.removeClass("cover-loading"),t.length&&t.css("opacity",1))}function a(){h&&h.destroy(),b.html('<img id="cover-jcrop">'),u.modal("hide")}var l=i("common/util/util.js"),c=$(".front-cover-radio"),d=$(".front-cover-main"),s=$(".front-cover-multi"),g=$("#front-cover-preview"),v=$(".front-cover-cur");c.click(function(){var i=$(this),e=i.data("type"),t=i.is(".selected"),r=$(".front-cover-type").position().left,o=i.position().left;t||(c.each(function(e,t){i.is($(t))||$(t).removeClass("selected")}),i.addClass("selected"),"auto"!=e?("single"==e?s.hide():s.show(),d.show(),v.animate({left:o-r+50},"fast")):d.hide())}),g.click(function(){r()});var m,h,A=null,p=$("#cover-select-modal"),f=$(".cover-select-submit"),u=$("#cover-crop-modal"),w=$(".cover-crop-submit"),x=$(".cover-crop-cancel"),y=($(".cover-select-cancel"),$(".cover-select-items")),M=$(".front-cover-img"),b=$(".cover-crop-main"),C=!1,B=172/120;M.click(function(){if(C)return void alert("当前封面裁切正在处理中，请稍后");var i=$(this),e=ue.document.getElementsByTagName("img"),t=e.length,r=0,o=$("<div></div>");A=i;for(var n=0;t>n;n++){var a=$("<li></li>"),c=e[n].src;if(/\/large\//.test(c)){r++;var d=c.replace(/\/large\//,"/origin/"),s=c.split("/large/");a.append('<img src="'+l.e(d)+'" _origin_uri="'+l.e(s[1])+'">'),a.append('<div class="cover-img-hover"></div>'),o.append(a)}}0==r?alert("您的文章正文中无可用图片，请先上传"):(y.html(o.html()),p.modal())}),y.on("click","li",function(){var i=$(this),e=i.is(".selected");e?i.removeClass("selected"):(y.find("li").each(function(e,t){var r=$(t);r.is(".selected")&&!i.is(r)&&r.removeClass("selected")}),i.addClass("selected"))}),f.click(function(){var i=y.find("li.selected img");return 0==i.length?void alert("您未选择图片"):(p.modal("hide"),u.modal(),void $("#cover-jcrop").attr("src",i[0].src).attr("_origin_uri",i[0].getAttribute("_origin_uri")).Jcrop({bgColor:"#000",bgOpacity:.6,aspectRatio:B,minSize:[172,120],onChange:o,onSelect:o,boxWidth:490,boxHeight:270},function(){var i=this.getBounds();width=Math.round(i[0]),height=Math.round(i[1]),h=this,size_w=0,size_h=0,pos_x=0,pos_y=0,width>=Math.floor(height*B)?(pos_x=(width-height*B)/2,size_h=height,size_w=Math.round(size_h*B)):(pos_y=(height-width/B)/2,size_w=width,size_h=Math.round(size_w/B)),this.setSelect([pos_x,pos_y,size_w,size_h]);var e=this.tellSelect();m={x:Math.round(e.x),y:Math.round(e.y),w:Math.round(e.w),h:Math.round(e.h)}}))}),w.click(function(){n(A,!0);var i=$("#cover-jcrop"),e=i.attr("_origin_uri");m.image_url=i.attr("src");var t=m.image_url.split("/origin/");return t[1]!==e?void alert("图片有问题，不能用来设置封面图"):($.ajax({type:"GET",url:"/crop_photo/",data:m,dataType:"json"}).done(function(i){if(i.new_url){var t=A.find("img"),r=new Image;r.onload=function(){if(t.length)t.attr("src",i.new_url).attr("_src",i.new_uri).attr("_origin_uri",e);else{var r=$("<img>");r.attr("src",i.new_url).attr("_src",i.new_uri).attr("_origin_uri",e),A.prepend(r)}n(A,!1)},r.onerror=function(){n(A,!1)},r.src=i.new_url}else n(A,!1),alert("图像裁切失败，请稍后重试")}).fail(function(){n(A,!1),alert("服务异常，请稍后重试")}),void a())}),x.click(function(){p.modal(),a()}),t.exports=function(){}});
;define("pagelet/write/gallery.js",function(e,a,t){function l(){alert("组图上传功能基于flash插件，在您的浏览器中未检测到相应的flash插件。")}function i(e,a){var t="不会被添加到上传队列中";switch(a){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:alert("您一次上传的图片个数超过了上传队列最大限制，请确保每次批量上传图片数量少于 "+Q.queueSizeLimit+"个");break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:alert("文件："+e.name+" 超出了文件大小限制（"+Q.fileSizeLimit+"），"+t);break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:alert("文件："+e.name+" 是空文件，"+t);break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:alert("文件："+e.name+" 不在允许的图片类型范围（"+Q.fileTypeExts+"），"+t)}}function r(e){var a=M.replace(/{fileID}/g,e.id),t=$(a);t.find(".gallery-desc").attr("placeholder","图片说明（不超过"+D+"字）"),t.find(".gallery-del").attr("data-instanceid",e.instanceID),R.append(t)}function n(e){e.filesQueued&&(b.addClass("gallery-no-empty"),p(),R.scrollTop(1e4))}function o(e,a){var t=$("#gallery-"+e.id),l=t.find(".gallery-img"),i=new Image;a=JSON.parse(a),"SUCCESS"==a.state?(i.setAttribute("data-uri",a.original),i.setAttribute("data-width",a.width),i.setAttribute("data-height",a.height),i.onload=function(){var a=i.width,t=i.height,r=f(a,t);i.setAttribute("style",r),l.prepend(i),l.removeClass("gallery-img-loading"),s(e.id)},i.onerror=function(){g(e,!1)},i.src=a.url):g(e,!1)}function d(e){e.remove(),p()}function g(e,a){var t=(e.id,null),l=null;a?(l=$("#"+e.id).parents(".gallery-img"),alert("图片 "+e.name+"更新失败，请重新上传"),l.removeClass("gallery-img-loading")):(t=$("#gallery-"+e.id),alert("图片 "+e.name+"上传失败，请重新上传"),d(t))}function s(e){var a=$.extend({},Q);a.multi=!1,a.width=102,a.height=78,a.onSelect=c,a.onUploadStart=u,a.onUploadSuccess=h,$("#gallery-modify-"+e).uploadify(a)}function c(e){var a=e.instanceID,t=$("#"+a).parents("li"),l=t.find(".gallery-del");l.attr("data-instanceid",a),l.attr("data-fileid",e.id)}function u(e){var a=$("#"+e.id).parents(".gallery-img");a.addClass("gallery-img-loading")}function h(e,a){var t=$("#"+e.id).parents(".gallery-img"),l=new Image,a=JSON.parse(a);"SUCCESS"==a.state?(l.onload=function(){var e=l.width,i=l.height,r=f(e,i);t.removeClass("gallery-img-loading"),t.find("img").attr("src",a.url).attr("data-uri",a.original).attr("data-width",a.width).attr("data-height",a.height).attr("style",r)},l.onerror=function(){g(e,!0)},l.src=a.url):g(e,!0)}function f(e,a){var t=102,l=78,i=0,r=0,n=0,o="";if(!e||!a)return"";if(e>=a){if(i=t/e,r=t,n=parseInt(a*i),l>n){var d=parseInt((l-n)/2);o="height:auto;padding-top:"+d+"px;"}}else if(i=l/a,n=l,adjust_width=parseInt(e*i),t>adjust_width){{parseInt((t-adjust_width)/2)}o="width:auto;"}return o}function m(){var e=$.extend({},Q);e.width=574,e.height=280,e.onSelect=r,e.onDialogClose=n,e.onUploadSuccess=o,x.uploadify(e);var a=$.extend({},e);a.width=90,a.height=16,L.uploadify(a),S.click(function(){R.children().length&&(b.addClass("gallery-sorting"),R.sortable({placeholder:"ui-state-highlight",disabled:!1,handle:".gallery-sort-icon"}),R.disableSelection())}),C.click(function(){b.removeClass("gallery-sorting"),R.sortable({disabled:!0}),p()}),I.click(function(){b.removeClass("gallery-sorting"),R.sortable({disabled:!0}),R.sortable("cancel")}),R.on("click",".gallery-del",function(){var e=$(this).data("instanceid")||"",a=$(this).data("fileid")||"";e&&a?($("#"+e).uploadify("cancel",a),$(this).parents("li").remove()):$(this).parents("li").remove(),0==R.children().length?(b.removeClass("gallery-no-empty"),k.html("")):p()}),R.on("focusout",".gallery-desc",function(){$(this).is(".new")&&this.value.length&&$(this).removeClass("new")}),R.on("keypress",".gallery-desc",function(e){return this.value.length>D?void e.preventDefault():void 0}),U.click(function(){var e=R.find(".gallery-item"),a=e.length,t=R.find(".gallery-img-loading");if(0!=a){if(3>a)return void k.html("图集至少添加三张图片");if(t.length)return void k.html("请等待所有图片上传完毕后提交");k.html("");var l=[];if(e.each(function(e,a){var t=$(a).find(".gallery-img img"),i=$(a).find(".gallery-desc"),r={};r.uri=t.attr("data-uri"),r.url=t.attr("src"),r.width=parseInt(t.attr("data-width")),r.height=parseInt(t.attr("data-height")),r.desc=i.val(),l.push(r)}),l.length){var i=b.data("index"),r={};-1==i?(T++,r.type="new",r.id=T,global_gallery[T]=l):(r.type="update",r.id=i,global_gallery[i]=l),r.data=l,b.modal("hide"),E(r)}}})}function p(){for(var e=R.children(),a=e.length,t=0;a>t;t++)$(e[t]).find(".gallery-no").html(t+1)}function y(e){global_gallery={},T=-1;for(var a=e.gallery_info||[],t=0;t<a.length;t++)T++,global_gallery[T]=a[t].list}function v(e){var a=global_gallery[e];if(a){b.modal();for(var t=0;t<a.length;t++){var l=M.replace(/{fileID}/g,t),i=$(l);i.find(".gallery-no").html(t+1),i.find(".gallery-img").removeClass("gallery-img-loading").prepend('<img src="'+_.e(a[t].url)+'" data-uri="'+_.e(a[t].uri)+'" data-width="'+a[t].width+'" data-height="'+a[t].height+'" >'),i.find(".gallery-desc").val(a[t].desc).removeClass("new").attr("placeholder","图片说明（不超过"+_.e(D)+"字）"),R.append(i),s(t)}}}function E(e){var a="/gallery_iframe/?index="+e.id+"&url="+e.data[0].url;if("new"==e.type){var t=$("<iframe></iframe>");t.attr("id","gallery-"+e.id),t.attr("class","mp-gallery"),t.attr("src",a),t.attr("scrolling","no"),t.attr("frameborder",0),t.attr("width",0),t.attr("height",0),t.attr("style","display:block;margin:0 auto;"),ue.execCommand("inserthtml","<p>"+t.prop("outerHTML")+"</p>")}else ue.document.getElementById("gallery-"+e.id).src=a}function w(e){R.html(""),e?(b.addClass("gallery-no-empty"),b.data("index",e),v(e)):(b.removeClass("gallery-no-empty"),b.data("index",-1),b.modal())}var _=e("common/util/util.js"),b=$("#gallery-modal"),S=($(".gallery-new"),$(".gallery-sort"),$(".sort-trigger")),C=$(".sort-done"),I=$(".sort-cancel"),U=$(".gallery-submit"),x=$("#gallery-new-trigger"),L=$("#gallery-more-trigger"),R=($(".gallery-del"),$("#gallery-items")),k=$(".gallery-edit-tip"),D=$(".gallery-desc").attr("maxlength")||200,T=-1,j="/tools/upload_picture/",F="/static/uploadify/uploadify.swf",O="upfile",M=$("#gallery-item-tpl").children().prop("outerHTML"),Q={swf:F,uploader:j,fileObjName:O,buttonText:"+添加图片",fileSizeLimit:"5MB",fileTypeExts:"*.gif; *.jpg; *.jpeg; *.png",method:"post",multi:!0,uploadLimit:999,queueSizeLimit:30,overrideEvents:["onUploadProgress","onDialogClose"],removeCompleted:!0,preventCaching:!1,removeTimeout:1,onFallback:l,onSelectError:i};window.global_gallery={},t.exports=function(e){window.create_groupimages=w,window.create_gallery=w,y(e),m()}});
;define("pagelet/write/rank.js",function(a,n,t){function r(a){d(a)}function d(a){$("#rank-modal").modal(),a?e(a):i()}function i(){$("#rank-header").html("添加排行榜");var a=$("#rank-append-tpl").children().clone(),n=$("#rank-header-tpl").children().clone();a.find(".rank-delete").remove(),$(".rank-con").html(n),$(".rank-con").append(a),$("#rank-modal").data("iframeid","")}function e(a){$("#rank-header").html("更新排行榜"),$("#rank-modal").data("iframeid",a.id);var n=a.data,t=$("<div></div>"),r=$("#rank-header-tpl").children().clone();r.find("#rank-main-header").attr("value",a.header),r.find("#rank-main-period").attr("value",a.period),t.append(r);for(var d=0;d<n.length;d++){var i=$("#rank-append-tpl").children().clone(),e=i.find(".rank-atom-unfold"),l=i.find(".rank-atom-fold"),o=d+1;if(i.attr("data-fold-status",1),i.attr("data-rank-no",o),e.find(".rank-no").html(o),e.find(".rank-avatar-img").attr("src",n[d].avatar),e.find(".rank-avatar-file").attr("id","rank-avatar-file-"+o),e.find(".rank-main-title").attr("value",n[d].t_1),e.find(".rank-left-title").attr("value",n[d].t_2),e.find(".rank-right-title").attr("value",n[d].t_3),e.find(".rank-link").attr("value",n[d].href),e.hide(),l.find(".rank-fold-no").html(o),l.find(".rank-fold-img").attr("src",n[d].avatar),l.find(".rank-fold-main-up").html(n[d].t_1),""==n[d].t_3)l.find(".rank-fold-main-down").html(n[d].t_2);else{var f='<div class="rank-fold-name">'+k.e(n[d].t_2)+"</div>";f=f+'<div class="rank-fold-other">阅读: <span class="rank-fold-num">'+k.e(n[d].t_3)+"</span></div>",l.find(".rank-fold-main-down").html(f)}l.show(),t.append(i)}$(".rank-con").html(t.html())}function l(a){var n=$(a),t=n.attr("id"),r=n.val(),d=n.parent().find("img"),i=d.parent(),e="图片上传失败，为您恢复到上传前状态";r&&(i.addClass("rank-upload-loading"),d.hide(),$.ajaxFileUpload({url:"/upload_photo/?type=json",secureuri:!1,fileElementId:t,dataType:"json",success:function(a){if("success"==a.message){var n=a.web_url,t=new Image;t.src=n,t.onload=function(){d.attr("src",n).attr("style","height:100%"),o(d,i)},t.onerror=function(){o(d,i),alert(e)}}else o(d,i),alert(e)},error:function(){o(d,i),alert(e)}}))}function o(a,n){a.show(),n.removeClass("rank-upload-loading")}function f(a){var n=a.find(".rank-atom-unfold"),t=n.find(".rank-avatar-img").attr("src"),r=$.trim(n.find(".rank-main-title").val()),d=$.trim(n.find(".rank-left-title").val()),i=$.trim(n.find(".rank-link").val());return t&&r&&d&&i&&m.test(i)?!0:!1}function u(a){var n=a.attr("data-rank-no"),t=a.find(".rank-atom-unfold"),r=a.find(".rank-atom-fold"),d=t.find(".rank-avatar-img").attr("src"),i=$.trim(t.find(".rank-main-title").val()),e=$.trim(t.find(".rank-left-title").val()),l=$.trim(t.find(".rank-right-title").val()),o=$.trim(t.find(".rank-link").val());if(r.find(".rank-fold-no").html(n),r.find(".rank-fold-img").attr("src",d),r.find(".rank-fold-main-up").text(i),""==l)r.find(".rank-fold-main-down").text(e);else{var f='<div class="rank-fold-other">阅读:<span class="rank-fold-num">'+k.e(l)+"</span></div>";f=f+'<div class="rank-fold-name rank-txt-overflow">'+k.e(e)+"</div>",r.find(".rank-fold-main-down").html(f)}return/^http:\/\//.test(o)||(o="http://"+o),r.find(".rank-fold-link").attr("href",o),a.attr("data-fold-status",1),t.slideUp("fast"),r.show(),!0}function F(a){var n="rank-avatar-file-",t=0,r=a;$("#rank-btn-submit").click(function(){var a=!0,n=[],d=0,i=$.trim($("#rank-main-header").val()),e=$.trim($("#rank-main-period").val());if(!i.length||!e.length)return void alert("资料不完整");if($(".rank-con .rank-atom").each(function(t,r){if(!f($(r)))return a=!1,!1;d++;var i={};i.avatar=$(r).find(".rank-avatar-img").attr("src"),i.t_1=$.trim($(r).find(".rank-main-title").val()),i.t_2=$.trim($(r).find(".rank-left-title").val()),i.t_3=$.trim($(r).find(".rank-right-title").val()),i.href=$.trim($(r).find(".rank-link").val()),i.no=d,/^http:\/\//.test(i.href)||(i.href="http://"+i.href),n.push(i)}),!a)return void alert("您创建的排行榜存在格式不正确，请检查");if(0==n.length)return void alert("请先创建排行榜");var l=$("#rank-modal").data("iframeid"),o={data:n,header:i,period:e};if(l){o.id=l;var u=r.document.getElementById(l);u.contentWindow.postMessage(o,"*")}else{t++;var F=$("<iframe></iframe>"),l="mp-ranking-"+t;o.id=l,F.attr("id",l),F.attr("class","mp-ranking"),F.attr("src","/tmp_rank_iframe/?query="+JSON.stringify(o)),F.attr("scrolling","no"),F.attr("frameborder",0),F.attr("width",0),F.attr("height",0);var k=F[0].outerHTML;r.execCommand("inserthtml","<p>"+k+"</p>")}$("#rank-modal").modal("hide")}),$("#rank-append").click(function(){var a=$(".rank-con"),t=a.find(".rank-atom").last(),r=t.length?t.attr("data-fold-status"):0,d=t.length?parseInt(t.attr("data-rank-no")):0;if(t.length&&0==r){if(!f(t))return void alert("当前榜单不完整，或格式非法，请调整后再添加新的排行");u(t)}var i=$("#rank-append-tpl").children().clone();d+=1,i.attr("data-rank-no",d),i.find(".rank-no").html(d),i.find(".rank-avatar-file").attr("id",n+d),a.append(i)}),$("#rank-modal").on("click",".rank-fold",function(){var a=$(this).parents(".rank-atom");return f(a)?void u(a):void alert("当前榜单不完整，或格式非法，请修改")}),$("#rank-modal").on("click",".rank-unfold",function(){var a=$(this).parents(".rank-atom"),n=a.children(".rank-atom-unfold"),t=a.children(".rank-atom-fold");a.attr("data-fold-status",0),n.slideDown("fast"),t.hide()}),$("#rank-modal").on("click",".rank-upload",function(){var a=$(this).parent().find(".rank-avatar-file");a.trigger("click"),a.one("change",function(){l(this)})}),$("#rank-modal").on("click",".rank-delete",function(){for(var a=$(this).parents(".rank-atom"),t=a.nextAll(),r=0;r<t.length;r++){var d=$(t[r]),i=parseInt(d.attr("data-rank-no"))-1;d.attr("data-rank-no",i),d.find(".rank-avatar-file").attr("id",n+i),d.find(".rank-fold-no").html(i),d.find(".rank-no").html(i)}a.remove()}),$("#rank-btn-cancel").click(function(){$("#rank-modal").modal("hide")})}var k=a("common/util/util.js"),m=/^((https|http|ftp|rtsp|mms):\/\/)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i;window.create_rank=d,window.mp_rank_modify=r,t.exports=function(a){F(a.ue)}});
;define("pagelet/write/telephone.js",function(require,exports,module){var inputDialog=function(obj){{var __p="";Array.prototype.join}with(obj||{})__p+='<div class="menum_input_dialog">\n    <div class="menum_input_dialog_title">电话号码：</div>\n    <input type="text" name="url" class="signform_input menum_input_dialog_input" data-node="input" placeholder="请输入手机号码">\n    <div class="sred menum_input_dialog_msg" data-node="msg"></div>\n    <div class="menum_input_dialog_hint">\n        请输入有效的电话号码\n    </div>\n</div>';return __p},Dialog=(require("common/vali/vali.js"),require("common/util/util.js"),require("common/popup/dialog.js")),telephone={showDialog:function(){telephone.$input&&(telephone.$input.val(""),telephone.$input.removeClass("error")),telephone.$dialog.show()},hideDilog:function(){telephone.$dialog&&telephone.$dialog.hide()},submit:function(){var e=telephone.$input.val(),n="";return telephone.checkPhoneNum(e)?(n='<a target="_blank" href="tel:'+e+'"><i class="tele-ic"></i>'+e+"</a>",ue.execCommand("inserthtml",n),void telephone.$dialog.hide()):(telephone.$input.addClass("error"),!1)},checkPhoneNum:function(e){return/^(\d{3,4}-)?(\d{7,8})(-\d{1,4})?$|(^1\d{10}$)/.test(e)?!0:!1},render:function(){telephone.$dialog=Dialog({btns:[{type:"ok",click:telephone.submit},{type:"cancel",click:function(){telephone.$dialog.hide()}}]}),telephone.$inputDialog=$(inputDialog());var e=telephone.$dialog.jele.find(".spopup_dialog_body");e.append(telephone.$inputDialog),telephone.$input=telephone.$inputDialog.find('[data-node="input"]')},event:function(){ue.addListener("for_telephone",function(){telephone.showDialog()}),telephone.$input.on("blur",function(){telephone.checkPhoneNum(telephone.$input.val())&&telephone.$input.removeClass("error")})},init:function(){this.render(),this.event()}};telephone.init()});
;define("pagelet/write/video-v2.js",function(e,t,i){function a(e,t){window.console&&"function"==typeof window.console.log&&(t&&console.log(">>>>> "+t+" start >>>>>"),console.log(e),t&&console.log("<<<<< "+t+" end <<<<<"))}function o(e,t,i,o){var d="{}";return $.ajax({type:o||"POST",async:t,url:"/video/video_api/",data:{json_data:JSON.stringify(e)},dataType:"json"}).done(function(e){"success"==e.message?d=e.data:!i&&E("alert","服务异常："+e.reason+" 请稍后重试"),a(e,"exec_api")}).fail(function(){!i&&E("alert","抱歉，服务异常，请稍后再试"),a("error : exec_api fail")}),d}function d(e){return e=e.toLowerCase(),K.indexOf(e)>-1?!0:!1}function r(e){if(e){ft("media");var t=e.name,i=e.size||0,r=/.*\.([^.]+)$/.exec(t),s=r?r[1]:"",l=I?"chunk_upload_info":"get_upload_info",u={api:l},n=I?md5(t+"-"+i):"";if(!d(s))return void E("alert","选择的文件不在系统支持的格式范围之内，目前接受如下视频格式："+K);if(i>U)return void E("alert","视频不能超过2G大小");if(I){var v=window.localStorage.getItem(n);if(v){var c={api:"chunk_upload_index",ref_id:v},m=JSON.parse(o(c,!1,!0));if(a(m,"chunk_upload_index"),0==m.code){var p=m.bytes,f=m.url;if(p>=0)return{upload_url:f,vid:v,vname:t,uploadedBytes:p,resumable:!0,v_md5:n}}}}var F=JSON.parse(o(u,!1));if(a(F,"upload_init"),0==F.code){var _=F.upload_url,h=F.upload_id;return _=_.replace(/^http(s)?:\/\//i,ct?"https://":"http://"),I&&window.localStorage.setItem(n,h),{upload_url:_,vid:h,vname:t,uploadedBytes:-1,resumable:!1,v_md5:n}}return F.message&&E("alert",F.message),null}}function s(e){if(e.length){ot.text(e).addClass("error"),Z.html(ut),at.text("取消"),tt.addClass("hide");try{var t=l();t&&$(t).remove()}catch(i){}mt={vid:0,vu:"",vname:"",vposter:"",status:"",md5:""}}}function l(e){var t=pt.document,i=t.getElementById("local-video-"+(e?e:mt.vid));return i}function u(e){var t={api:"meta",ref_id:e?e:mt.vid},i=JSON.parse(o(t,!1,!0)),d=!1,r="",n=!1;if(a(i,"get_transcoding_status"),0==i.code){var v=i.data,c=v.status,r=v.video_name||"";if("10"==c){d=!0,mt.status="success";var m="http://i.snssdk.com/video/playcode/1/toutiao/"+v.video_id,p=nt.replace(/#href#/,C.e(m));p=p.replace(/#img#/,C.e(mt.vposter)),Z.html(p);try{var f=l(),F="/video_iframe/?type=local&subtype=self&vid="+mt.vid+"&img="+mt.vposter+"&name="+r;f&&f.setAttribute("src",F)}catch(_){}ot.text(st).removeClass("error")}else if("30"==c){d=!0,mt.status="transcoding";var h=lt.replace(/#img#/,C.e(mt.vposter));Z.html(h),ot.text(st+"（处理中不影响文章发表）").removeClass("error"),z=setTimeout(u,j)}else mt.status="fail",s("视频处理失败")}else i.code?(mt.status="error",!e&&S>0?(a("失败重试倒数第："+S+"次"),S--,z=setTimeout(u,j)):(mt.status="fail",s(i.message))):(n=!0,z=setTimeout(u,j),a("转码查询 未返回有效ret"));n||(d?(H.submit_video.vid=mt.vid,H.submit_video.vu=mt.vu,H.submit_video.vname=r,H.submit_video.vposter=mt.vposter):(H.submit_video.vid=0,H.submit_video.vu="",H.submit_video.vname="",H.submit_video.vposter=""))}function n(e,t){if(e>0){t>e&&(t=e);var i=(t/e*100).toFixed(2),a=(e/B).toFixed(2)+"MB",o=(t/B).toFixed(2)+"MB",d=i+"%",r=V.data("loaded")||0;t>r&&(V.data("loaded",t).text(o+"/"+a+" "+d),q.get(0).style.width=d)}}function v(){var e={api:"upload_progress",ref_id:mt.vid},t=JSON.parse(o(e,!1,!0));a(t,"letv_upload_progress");try{if(0==t.code){var i=t.data.total_size,d=t.data.upload_size;n(i,d)}}catch(r){}}function c(e){if("delete"==e||"reupload"==e){var t=mt.status;("success"==t||"transcoding"==t)&&H.vids_to_del.push(mt.vid);try{var i=l();i&&$(i).remove()}catch(a){}}W=0,S=2,z&&clearTimeout(z),A&&clearInterval(A),mt={vid:0,vu:"",vname:"",vposter:"",status:"",md5:""},H.submit_video={vid:0,vu:"",vname:"",vposter:"",uploading:!1},("delete"==e||"cancel"==e)&&L.addClass("hide"),Y.text(""),V.data("loaded",0).text(""),q.get(0).style.width="0%",Z.html(""),et.text(""),at.text("添加到正文"),ot.text(st).removeClass("error"),P.removeClass("hide"),X.addClass("hide"),tt.removeClass("hide")}function m(){T&&(T.abort(),T=null,c("cancel"),ft("article"))}function p(){c("delete"),ft("article")}function f(e){if("object"==typeof e&&e.vposter){var t="http://i.snssdk.com/video/playcode/1/toutiao/"+e.vid,i=nt.replace(/#href#/,C.e(t));i=i.replace(/#img#/,C.e(e.vposter)),Z.html(i);try{pt.ready(function(){var t=l();if(t){var i=$(t),a="/video_iframe/?type=local&subtype=self&vid="+e.vid+"&img="+e.vposter+"&name="+e.vname;i.attr("data-vposter",e.vposter).attr("src",a)}})}catch(a){}}}function F(e){H=e;var t=H.submit_video.vid;if(t)if(mt.vid=H.submit_video.vid,mt.vu=H.submit_video.vu,mt.vname=H.submit_video.vname,mt.vposter=H.submit_video.vposter,mt.vposter)f(mt),mt.status="success";else try{pt.ready(function(){u(t)})}catch(i){setTimeout(function(){u(t)},1e3)}Q.on("click",function(){T&&E("confirm","确认取消上传？",m)}),tt.on("click",function(){E("confirm","确认删除该视频？",p)}),$("#retry_video_file").click(function(e){var t=mt.status;("success"==t||"transcoding"==t)&&(window.confirm("重新上传时，当前视频信息会被丢弃，确认？")||e.preventDefault())}),at.on("click",function(){var e=mt.status;if("success"==e||"transcoding"==e){if(l())return void E("alert","当前视频 “"+mt.vname+"” 已经添加到正文中，请勿重复添加");var t=vt.replace(/#vid#/g,mt.vid);t=t.replace(/#vu#/g,mt.vu),t=t.replace(/#url#/g,mt.vposter),t=t.replace(/#name#/g,mt.vname),pt.execCommand("inserthtml","<p>"+t+"</p>")}else c("cancel")}),it.on("click",function(){k().show({id:mt.vid,type:2,source:"普通",success:function(e,t){mt.vposter=t,H.submit_video.vposter=t,$("#video-feedback-status").find("img").attr("src",t);try{var i=l();if(i){var a=$(i),o="/video_iframe/?type=local&subtype=self&vid="+mt.vid+"&img="+t+"&name="+mt.vname;a.attr("data-vposter",t).attr("src",o)}}catch(d){}},video_status:mt.status})}),$("#retry_video_file,#video_file").fileupload({singleFileUploads:!0,autoUpload:!1,redirectParamName:"redirect_url",redirect:(ct?"https://":"http://")+"mp.toutiao.com/cdiframe_result/?%s",maxChunkSize:I?R:0,maxRetries:3,retryTimeout:500}).bind("fileuploadadd",function(e,t){var i=null;$.each(t.files,function(e,t){i=r(t)}),i&&(c("reupload"),mt.vid=i.vid,mt.vu=i.vid,mt.vname=i.vname,mt.md5=i.v_md5,mt.ts=+new Date,H.submit_video.uploading=!0,Ft.modal("hide"),L.removeClass("hide"),P.removeClass("hide"),Y.text(mt.vname),i.resumable&&(t.uploadedBytes=i.uploadedBytes),t.url=i.upload_url,T=t.submit(),J||(A=setInterval(v,1e3)),setTimeout(function(){var e=null,t=window.innerHeight||document.documentElement.clientHeight;try{e=L.get(0).getBoundingClientRect();var i=e.top,a=e.bottom,o=a-i;if(i>t-o){var d=$(document).scrollTop()+a-t;window.scrollTo(0,d)}}catch(r){}},300),a(i,"fileuploadadd"))}).bind("fileuploadprogress",function(e,t){J&&n(t.total,t.loaded)}).bind("fileuploaddone",function(e,t){H.submit_video.uploading=!1,A&&clearInterval(A);var i=null;try{J?(a("XhrFileUploadSupport"),i=JSON.parse(t.result)):(a("no XhrFileUploadSupport"),i=JSON.parse($("body",t.result).text()))}catch(o){}if(i){if(0==i.code){mt.status="transcoding",mt.vposter=N;var d=lt.replace(/#img#/,C.e(mt.vposter));Z.html(d),ot.text(st+"（处理中不影响文章发表）").removeClass("error"),z=setTimeout(u,1e3),M=mt.vid,I&&mt.md5&&window.localStorage.removeItem(mt.md5)}else{if(h(this,t,mt))return void(H.submit_video.uploading=!0);Z.html(ut),ot.text("视频上传失败.").addClass("error")}P.addClass("hide"),X.removeClass("hide"),et.text(mt.vname),q.get(0).style.width="0%",_(i.code,mt,t,G.END_AUTO)}else E("alert","抱歉，上传错误，请稍后重试"),_(G.NO_CODE,mt,t,G.END_AUTO);T=null,a(t,"fileuploaddone")}).bind("fileuploadfail",function(e,t){return M&&M==mt.vid?!1:void("abort"!==t.errorThrown&&h(this,t,mt)||(H.submit_video.uploading=!1,A&&clearInterval(A),E("alert","视频上传失败"),"abort"!==t.errorThrown?_(G.UNKNOW_ERROR_CODE,mt,t,G.END_AUTO):_(G.UNKNOW_ERROR_CODE,mt,t,G.END_BY_ABORT),a(t,"error : fileuploadfail")))})}function _(e,t,i,a){var d=i.files[0],r={ref_id:t.vid,f:t.vname,e:e,fs:d.size||0,ufs:i.uploadedBytes||0,r:I?1:0,et:a,ts:t.ts,te:+new Date,ua:navigator.userAgent,mid:H.media_id},s={api:"upload_error",ref_id:t.vid,error_info:JSON.stringify(r)};o(s,!0,!0)}function h(e,t,i){if(I){var d=$(e).data("blueimp-fileupload")||$(e).data("fileupload");if(t.uploadedBytes<t.files[0].size&&W<d.options.maxRetries){W+=1;var r={api:"chunk_upload_index",ref_id:i.vid},s=JSON.parse(o(r,!1,!0));if(0==s.code){var l=s.bytes;if(l>=0)return t.uploadedBytes=l,t.data=null,T=t.submit(),a("自动重传："+W+"次."),!0}}}return!1}function g(){var e=$.trim(gt.val()),t="";return 0!=e.length&&xt.test(e)||(t="请输入有效的视频地址",ht.text(t)),t.length?!1:!0}function y(e){if(e.length){var t=$(e);t.attr("width","450"),t.attr("height","253"),pt&&(pt.execCommand("inserthtml","<p>"+t.prop("outerHTML")+"</p>"),Ft.modal("hide"))}}function b(e){gt.data("reset",!1);var t="视频获取失败",i=g();if(i){if(!e&&Dt)return void y(Dt);var a=$.trim(gt.val());ht.text("视频信息获取中..."),$.ajax({type:"GET",async:!1,url:"/api/video/cover_info/",data:{url:a},dataType:"json"}).done(function(i){if("success"==i.message){var a=i.data,o=a.vid,d=a.web_url,r=a.web_uri;Dt=wt.replace(/#vid#/g,C.e(o)),Dt=Dt.replace(/#uri#/g,C.e(r)),Dt=Dt.replace(/#url#/g,C.e(d)),e&&(bt.html(Dt).show(),ht.text(""))}else{var s=i.reason?i.reason:t;ht.text(s),e&&bt.hide()}}).fail(function(){ht.text(t),e&&bt.hide()}),!e&&y(Dt)}}function D(){var e="本地视频仅支持1个，你已选择1个本地视频";$t.click(function(){b(!1)}),yt.click(function(){b(!0)}),gt.on("keyup change",function(){gt.data("reset")||(ht.text(""),bt.html("").hide(),Dt="",gt.data("reset",!0))}),_t.click(function(){var t=$(this),i=t.is(".cur"),a=t.data("type"),o=$("."+a+"-con"),d=mt.vid?!0:!1;if(!i){if("local-video"==a&&d)return void E("alert",e);t.addClass("cur"),o.removeClass("hide"),_t.each(function(e,t){var i=$(t),o=i.data("type"),d=$("."+o+"-con");o!=a&&(i.removeClass("cur"),d.addClass("hide"))})}}),$("#video_file").click(function(t){mt.vid&&(E("alert",e),t.preventDefault())})}function w(){var e=mt.vid?!0:!1;_t.each(function(t,i){var a=$(i),o=a.data("type"),d=$("."+o+"-con");e&&("local-video"==o?(a.removeClass("cur"),d.addClass("hide")):(a.addClass("cur"),d.removeClass("hide")))}),ht.text(""),gt.val(""),bt.html("").hide(),Dt="",Ft.modal()}function x(e){var t=e.article_category;t?(ft("media"),t=t.split("/")):ft("article"),new O(Ct(e),t,$(".j_media_select")),pt=e.ue,F(e),D(),window.upload_video=function(){window.ga("send","event","发表文章[pc]","点插入视频"),w()}}var C=e("common/util/util.js"),E=e("pagelet/popalert/popalert.js"),O=e("common/select/select.js"),k=e("common/videoposter/videoposter.js"),N="http://p.pstatp.com/large/9820/3808334921",T=null,A=0,z=0,S=2,j=1e4,B=1048576,R=10*B,U=2048*B,J=$.support.xhrFileUpload||$.support.xhrFormDataFileUpload,I=$.support.blobSlice&&"object"==typeof window.localStorage,H=null,K="wmv|avi|dat|asf|rm|rmvb|ram|mpg|mpeg|3gp|mov|mp4|m4v|dvix|dv|mkv|flv|vob|qt|cpk|fli|flc|mod|ts|webm|m2ts",M="",W=0,G={UNKNOW_ERROR_CODE:-2,NO_CODE:-1,END_BY_ABORT:1,END_AUTO:0},L=$("#video-card"),P=$("#video-uploading"),X=$("#video-uploaded"),Y=$("#video-name"),q=$("#progressbar-inner"),Q=$("#video-cancel"),V=$("#video-data"),Z=$("#video-feedback-status"),et=$("#video-feedback-name"),tt=$("#video-delete"),it=$("#video-modify-poster"),at=$("#video-feedback-btn"),ot=$("#video-card-tip"),dt=$(".j_class_select"),rt=$(".j_media_select"),st="请将上传的视频添加到正文所需位置",lt='<div class="video-processing"><img src="#img#" width="100%" height="100%"></div>',ut='<div class="video-fail"></div>',nt='<a class="video-success" href="#href#" target="_blank"><i></i><img src="#img#" width="100%" height="100%"></a>',vt='<iframe class="local-video" id="local-video-#vid#" data-id="#vid#" data-vu="#vu#" data-vname="#name#" data-vposter="#url#" src="/video_iframe/?type=local&subtype=self&vid=#vid#&vu=#vu#&img=#url#&name=#name#" width="450px" height="253px" frameborder="0" scrolling="no" style="display:block;margin:0 auto;max-width:100%;"></iframe>',ct="https:"===location.protocol,mt={vid:0,vu:"",vname:"",vposter:"",status:"",md5:"",ts:0},pt=null,ft=function(e){"media"==e?(dt.hide(),rt.show(),rt.attr("has-media","1")):(dt.show(),rt.hide(),rt.removeAttr("has-media"))},Ft=$("#video-modal"),_t=$(".video-tag"),ht=$("#online-url-tip"),gt=$("#online-url"),yt=$("#online-preview-btn"),bt=$("#online-preview-box"),$t=$("#online-video-submit"),Dt="",wt='<iframe class="online-video" data-id="#vid#" data-uri="#uri#" src="/video_iframe/?vid=#vid#&img=#url#" width="100%" height="100%" frameborder="0" scrolling="no" style="display:block;margin:0 auto;"></iframe>',xt=/^((https|http|ftp|rtsp|mms):\/\/)?(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,Ct=function(e){var t=e.video_category.video_category_level1,i=e.video_category.video_category_level2,a=e.video_category.video_category_level3,o={};for(var d in t)if(o[d]={},o[d].value=t[d],i[d]){o[d].child={};for(var r in i[d])if(o[d].child[r]={},o[d].child[r].value=i[d][r],a[d]&&a[d][r]){o[d].child[r].child={};for(var s in a[d][r])o[d].child[r].child[s]={},o[d].child[r].child[s].value=a[d][r][s]}}return o};i.exports={init:x,exec_api:o}});
;define("pagelet/write/vote.js",function(e,t,o){function a(e,t){var o=f.document.getElementById("mp-vote-"+e);o.height=t,o.width="450"}function i(e){window.ga("send","event","发表文章[pc]","点插入投票"),$("#vote-modal").modal(),$("#vote-form").find("label.error").remove();var t="添加投票";e?($("#vote-form").data("mp_vote_id",e),t="更新投票",$("#vote-header").html(t),$(".vote-pulldata").show().addClass("vote-pulling").html(""),$("#vote-main").hide(),old_vote_info=d(e),0==old_vote_info.status?($("#vote-btn-submit").html(t),$(".vote-pulldata").hide(),$("#vote-main").show(),v(old_vote_info.data)):$(".vote-pulldata").removeClass("vote-pulling").html(old_vote_info.message)):($("#vote-form").data("mp_vote_id",""),$(".vote-pulldata").hide(),$("#vote-main").show(),$("#vote-header").html(t),$("#vote-title").val(""),$(".vote-radio-single").addClass("vote-radio-checked"),$(".vote-radio-multi").removeClass("vote-radio-checked"),$(".vote-options .vote-cell").each(function(e,t){if(2>e){var o=e+1;$(".vote-item",t).val("").attr("data-val",o).attr("id","vote-itemid-"+o)}else $(t).remove()}),$("#vote-expire-time").val(""),$("#vote-btn-submit").html(t))}function r(e){var t=$.trim($("#vote-title").val()),o="after_vote",a=!1,i=$.trim($("#vote-expire-time").val()),r=1,v=1,d=!1,m=[],s=$(".vote-radio-checked").attr("data-vote-type"),c=0,p="/vote/item/add/",u=e?!0:!1;if($(".vote-options .vote-item").each(function(e,t){var o=$(t).attr("data-val"),a=$.trim($(t).val()),i="";m.push({text:a,image_uri:i,value:""+o})}),m.length<2)return void alert("每个有效投票至少需要2个选项");"m"==s&&(v=m.length),i=n(i,!0);var f={title:t,option:m,max_checked:v,min_checked:r,custom_input:d,expire_time:i,display_stat:o,require_login:a};if(u){p="/vote/item/update/";var h=f;f={id:e,vote_item:h}}if($.ajax({type:"POST",url:p,data:JSON.stringify(f),contentType:"application/json",dataType:"json",async:!1}).done(function(t){if("ok"==t.result)c=u?e:t.id;else{var o="投票创建失败，原因：";u&&(o="投票更新失败，原因："),alert(o+t.result)}}).fail(function(){alert("抱歉，服务器异常，请稍后重试")}),0!=c){var g={id:c,type:u?"update":"new"};return l(g),!0}}function n(e,t){var o=e.split(/\s+/),a=o[0],i=o[1],r=a.split("-"),n=i.split(":"),v=r[0]-0,l=r[1]-1,d=r[2]-0,m=n[0]-0,s=n[1]-0,c=new Date(v,l,d,m,s).getTime();return t?parseInt(c/1e3):c}function v(e){var t=e.title,o=e.expire_time,a=e.option,i=1==e.max_checked?"s":"m",r=new Date(1e3*o),n=r.getFullYear(),v=r.getMonth()+1,l=r.getDate(),d=r.getHours(),m=r.getMinutes(),s=n+"-"+(10>v?"0"+v:v)+"-"+(10>l?"0"+l:l)+" "+(10>d?"0"+d:d)+":"+(10>m?"0"+m:m);$("#vote-title").val(t),"s"==i?($(".vote-radio-single").addClass("vote-radio-checked"),$(".vote-radio-multi").removeClass("vote-radio-checked")):($(".vote-radio-single").removeClass("vote-radio-checked"),$(".vote-radio-multi").addClass("vote-radio-checked"));for(var p=$("<div>"),u=0;u<a.length;u++){var f=$("#vote-append-tpl").children().clone();f.find(".vote-item").attr("value",c.e(a[u].text)).attr("data-val",c.e(a[u].value)).attr("id","vote-itemid-"+c.e(a[u].value)),2>u&&(0==u&&f.find(".vote-lebal").html("选项"),f.find(".vote-delete").remove()),p.append(f)}$(".vote-options").html(p.html()),$("#vote-expire-time").val(s)}function l(e){$("#vote-btn-cancel").click();var t="/vote/item/get/?voteid="+e.id;if("new"==e.type){var o=$("<iframe></iframe>");o.attr("id","mp-vote-"+e.id),o.attr("data-voteid",e.id),o.attr("class","mp-vote"),o.attr("src",t),o.attr("scrolling","no"),o.attr("frameborder",0),o.attr("width",0),o.attr("height",0),o.attr("style","display:block;margin:0 auto;"),f.execCommand("inserthtml","<p>"+o.prop("outerHTML")+"</p>")}else f.document.getElementById("mp-vote-"+e.id).src=t}function d(e){var t={status:0,message:"",data:null},o={id_list:[e]};return $.ajax({type:"POST",url:"/vote/item/get/",data:JSON.stringify(o),contentType:"application/json",dataType:"json",async:!1}).done(function(o){if("ok"==o.result){var a=o.vote_items;t.data=a[e]}else t.status=1,t.message=o.result}).fail(function(){t.status=1,t.message="服务器异常，请稍后重试"}),t}function m(){if(!s())return alert("投票截止时间只能在当前时间之后"),!1;var e=$("#vote-form").data("mp_vote_id");return r(e),!0}function s(){var e=$.trim($("#vote-expire-time").val()),t=(new Date).valueOf(),o=t-u+p;return e=n(e),e>o}e("common/util/formcheck.js");var c=e("common/util/util.js");"function"!=typeof Array.prototype.indexOf&&(Array.prototype.indexOf=function(e){for(var t=0,o=this;t<o.length;t++)if(o[t]==e)return t;return-1});var p,u,f;o.exports=function(e){p=1e3*e.systime,f=e.ue,u=(new Date).valueOf(),window.mp_vote_iframe_height_adjust=a,window.create_vote=i,$("#vote-form").form_check(m),$("#vote-expire-time").datetimepicker({format:"yyyy-mm-dd hh:ii",autoclose:!0,minView:0,maxView:4}),$(".vote-type-label").click(function(){var e=this;$(".vote-type-label").each(function(t,o){o==e?$(".vote-radio",o).addClass("vote-radio-checked"):$(".vote-radio",o).removeClass("vote-radio-checked")})}),$("#vote-append-item").click(function(){var e=$("#vote-append-tpl").children().clone(),t=parseInt($(".vote-options .vote-item").last().attr("data-val"));isNaN(t)&&(t=0),e.find(".vote-item").attr("data-val",t+1).attr("id","vote-itemid-"+(t+1)),e.appendTo($(".vote-options"))}),$(".vote-options").on("click",".vote-delete",function(){$(this).parents(".vote-cell").remove()}),$("#vote-btn-cancel").click(function(){$("#vote-modal").modal("hide")})}});
;define("pagelet/write/write.js",function(require,exports,module){require("common/stip/stip.js");var util=require("common/util/util.js");require("pagelet/write/article_link.js");var Stip=require("common/stip/stip.js"),Dialog=require("common/popup/dialog.js"),pushTemplate=function(obj){{var __t,__p="";Array.prototype.join}with(obj||{})__p+="<div class=\"modal cover-modal push-msg-modal in\" id=\"push-msg-modal\">\n	<div class='modal-dialog-wrapper'>\n		<div class='modal-dialog'>\n			<div class='modal-content'>\n				<div class='modal-header push_title'>填写弹窗信息</div>\n				<div class='modal-body'>\n					<div class ='edit-cell push-cell'>\n						<div class ='edit-main'>\n							<div class='edit-label'>Android</div>\n							<div class='edit-input'>\n								<input type='text' class='push_input form-control j_push_android_title' maxlength='15' value='"+(null==(__t=push_android_title)?"":_.escape(__t))+"' placeholder='弹窗标题'>\n							</div>\n							<div class='j_check_label right_label'></div>\n						</div>\n						<div class ='edit-main'>\n							<div class='edit-label'></div>\n							<div class='edit-input'>\n								<textarea class='j_push_android_textarea push_input form-control push_content' maxlength='45' placeholder='弹窗文案'>"+(null==(__t=push_android_summary)?"":_.escape(__t))+"</textarea>\n							</div>\n							<div class='j_check_label right_label'></div>\n						</div>\n					</div>\n					<div class ='edit-cell push-cell'>\n						<div class ='edit-main'>\n							<div class='edit-label'>iOS</div>\n							<div class='edit-input'>\n								<textarea class='j_push_ios_title push_input form-control push_content' maxlength='42' placeholder='弹窗文案'>"+(null==(__t=push_ios_summary)?"":_.escape(__t))+'</textarea>\n							</div>\n							<div class=\'j_check_label right_label\'></div>\n						</div>\n					</div>\n				</div>\n				<div class =\'modal-footer\'>\n					<div class=\'push_dialog_btns\'>\n						<button type="button" class="push_btn j_push" ga="推送确定$">保存</button>\n						<button type="button" class="push_btn close_btn j_close" ga="推送关闭$">取消</button>\n					</div>\n				</div>\n			</div>\n		</div>\n	</div>\n</div>\n<div class=\'modal-backdrop in j_push_back_modal\'>\n</div>';return __p},edit_article=require("pagelet/write/article.js"),create_vote=require("pagelet/write/vote.js"),create_rank=require("pagelet/write/rank.js"),create_video=require("pagelet/write/video-v2.js"),create_gallery=require("pagelet/write/gallery.js"),create_cover=require("pagelet/write/cover.js"),NewFuncIcon=(require("pagelet/write/telephone.js"),require("pagelet/tabNewGuide/tabNewGuide.js")),jautosave=$();ue.ready(function(){jautosave=$("#myautosave")});!function(){var e=$("#self_recommand");e.checkbox();var t=Dialog({title:"自荐上头条",content:$.safeMark('<p>选择自荐上头条，需承诺如下：</p><p>1、本文描述的事实真实可靠，不含虚假消息。</p><p>2、内容标题相符，不是抄袭拼凑，标题党。</p><p>3、不涉及任何商业目的，不是软文、黑稿。</p><br/><p class="sred">如文章被读者投诉，会影响后续文章的推荐效果。</p>'),btns:[{type:"ok",click:function(){e.checkbox(!0),t.remove(),t=null}},{type:"cancel",click:function(){e.checkbox(!1),t.hide()}}]});e.change(function(){t&&t.show()})}(),module.exports=Pagelet.extend({el:"#pagelet-write",events:{},init:function(e){function t(){jautosave.removeClass("on"),clearTimeout(s),s=setTimeout(function(){i.autosave(),jautosave.addClass("on")},2e3)}ue.ready(function(){$("#edit_body [title]").each(function(){var e=$(this),t=e.attr("title");e.attr("ga","按钮_"+t),e.removeAttr("title"),e.attr("data-title",t)}),$("#edit_body").hoverTitle()}),e.vids_to_del=[],e.submit_video={vid:e.vid||0,vu:e.vu||"",vname:e.vname||"",vposter:e.vposter||"",uploading:!1},e.video_controler=create_video;var i=this;this.$mp_title=$("#title"),this.$mp_show_ads=$(".gg-show"),this.$mp_force_ads=$(".gg-spread"),this.$mp_push=$(".gg-push"),this.$mp_tag_name=$("#channel_tags"),this.$mp_subsidy=$(".gg-subsidy"),this.$cover_radio=$(".front-cover-radio"),this.$timer_radio=$(i.el).find(".gg-timer-radio"),this.$cover_img_con=$(".front-cover-img"),this.$cover_separator="#mp-cover-img#",this.pgc_id=e.pgc_id,this.media_id=e.media_id,this.localStorageName="mpdraft",this.triggerStore=!1,e.localStorageName=this.localStorageName,this.saveInterval=9e4,this.localStorage="object"==typeof localStorage,this.infoformat_modal=$("#infoformat-modal"),this.infoformat_storage="infoformat",this.pgc_feed_covers=e.pgc_feed_covers||[],this.remain_push_num=e.remain_push_num,this.push_article_permission=e.push_article_permission,this.push_android_title=e.push_android_title,this.push_android_summary=e.push_android_summary,this.push_ios_summary=e.push_ios_summary,this.push_verify_users=e.push_verify_users,this.push_status=e.push_status,this.timer_permission=e.timer_permission,this.timer_status=e.timer_status,e.after_pass_modify=e.after_pass_modify?!0:!1,this.$mp_tag_name.val(e.tag_name||$.cookie("lasttag")||e.media_tag||"news"),edit_article(e),create_vote(e),create_rank(e),create_gallery(e),create_cover(e),create_video.init(e),this.cover_writeback();var s,a=this.loadLocalStorage()||e.content;ue.ready(function(){var e=baidu.editor.utils,t=UE.htmlparser(a);e.each(t.getNodesByTagName("li"),function(e){e.setAttr("class","")}),e.each(t.getNodesByTagName("ol"),function(e){e.setAttr("class"," list-paddingleft-2")}),e.each(t.getNodesByTagName("ul"),function(e){e.setAttr("class"," list-paddingleft-2")}),ue.setContent(t.toHtml())}),ue.ready(function(){setTimeout(function(){ue.addListener("contentchange",t)},1e4)}),setInterval(t,this.saveInterval),$(".qx").click(function(){$(document).data("abort_draft",!0),location.href="/"}),window.onbeforeunload=function(){if(e.submit_video.uploading)return"当前视频尚未上传完毕，确认离开？";if($(document).data("abort_draft")){if(i.clearLocalStorage(),$(document).data("abort_draft",!1),ue.getContentLength())return"你的文章尚未发表，或存草稿。"}else{var t=$.trim(i.$mp_title.val()).length,s=0;try{s=ue.getContentLength()}catch(a){}if(t||s||e.submit_video.vid)return i.autosave(),"已自动保存"+i.getTime()+"时的内容。";i.clearLocalStorage()}},$(document).on("click",".abort-autosave",function(){i.clearLocalStorage(),window.onbeforeunload=null,location.reload()}),this.localStorage&&!window.localStorage.getItem(this.infoformat_storage)&&this.infoformat_modal.modal(),$(".infoformat-submit").click(function(){i.infoformat_modal.modal("hide"),window.localStorage.setItem(i.infoformat_storage,1)}),$(".front-cover em").hoverTip(),this._pushArticleInit();var o=new NewFuncIcon("tab_new_page",i.el);o.newIconDisplay(),this._timerArticleInit()},_timerArticleInit:function(){this.timer_permission&&($body=$("body"),this.$timer=$body.find(".gg-timer"),this.$timerTip=$body.find(".j_timer_tip"),this.$timePicker=$body.find(".j_timer_datetimepicker"),this.$timeInput=$body.find(".j_timepicker"),this.$timerTip.hoverTip(),this._timerBtnEvent(),this.timer_status&&this._timePickerInit())},_timerBtnEvent:function(){var e=this;$("body").on("click",".gg-timer-radio",function(){var t=this;if($(this).hasClass("selected"))var i=Dialog({btns:[{type:"ok",click:function(){i.remove(),$(t).removeClass("selected"),e._hideTimePicker()}},"cancel"],title:"提示",content:"取消定时发布?"}).show();else e._timePickerInit(),$(this).addClass("selected")})},_timePickerInit:function(){this._getServerTime()},_getServerTime:function(){var e="获取时间失败",t=this;$.ajax({type:"GET",url:"/article/get_server_time/"}).done(function(i){if("success"!==i.message)return t._ajaxFeedback(e),void t.$timer_radio.removeClass("selected");if(i.data){var s=new Date(1e3*i.data.server_time);t._showTimePicker(s)}}).fail(function(){t._ajaxFeedback(e),t.$timer_radio.removeClass("selected")})},_showTimePicker:function(e){var t=e.clone(),i=t.h(t.h()+2).format(),s=t.h(t.h()+10).format(),a=t.h(t.h()+12).format();this.$timeInput.datetimepicker({format:"yyyy-mm-dd hh:ii",weekStart:1,autoclose:!0,maxView:2,startDate:i,endDate:a}),this.$timePicker.addClass("active"),this.$timeInput.val(s)},_hideTimePicker:function(){this.$timePicker.removeClass("active")},_ajaxFeedback:function(e){Stip.popupTip({msg:e,status:!1})},_pushArticleInit:function(){"1"==this.push_article_permission&&(this._pushButtonEvent(),this._pushTemplateInit(),"1"==this.push_status&&$(this.el).find(".j_push_num").hide())},_pushTemplateInit:function(){var e={push_android_title:this.push_android_title,push_android_summary:this.push_android_summary,push_ios_summary:this.push_ios_summary,push_verify_users:this.push_verify_users},t=pushTemplate(e),i=$("body");i.append(t),this.pushModal=i.find("#push-msg-modal"),this.dropBack=i.find(".j_push_back_modal"),this.dropBack.hide(),this.$androidTitle=this.pushModal.find(".j_push_android_title"),this.$androidContent=this.pushModal.find(".j_push_android_textarea"),this.$iosTitle=this.pushModal.find(".j_push_ios_title"),this._dialogEvent(),this._modifyPushEvent(),this._keyPressEvent()},_pushTemplateShow:function(){this.templateData={push_android_title:this.$androidTitle.val(),push_android_summary:this.$androidContent.val(),push_ios_title:this.$iosTitle.val()},this.dropBack.show(),this.pushModal.show()},_pushTemplateHide:function(){this.dropBack.hide(),this.pushModal.hide()},_pushButtonEvent:function(){var e=this,t=$(e.el).find(".j_modify_push"),i=$(e.el).find(".j_push_num");$("body").on("click",".gg-push-client",function(){e.isCreatPush=!0;var s=this;if($(this).hasClass("selected"))var a=Dialog({btns:[{type:"ok",click:function(){e._clearPushData(),a.remove(),$(s).toggleClass("selected"),e.isCreatPush=!1,t.hide(),i.show()}},"cancel"],title:"提示",content:"确认取消弹窗申请?"}).show();else $(this).toggleClass("selected"),e._pushTemplateShow(),t.show(),i.hide()})},_modifyPushEvent:function(){var e=this;$("body").on("click",".j_modify_push",function(){e._pushTemplateShow(),e.isCreatPush=!1})},_keyPressEvent:function(){var e,t={j_push_ios_title:42,j_push_android_title:15,j_push_android_textarea:45};this.pushModal.on("keyup",".push_input",function(){for(var i in t)$(this).hasClass(i)&&(e=$(this).closest(".edit-main").find(".j_check_label"),$(this).val().length>=t[i]?e.addClass("red"):e.removeClass("red"),e.html($(this).val().length+"/"+t[i]))})},_clearPushData:function(){var e=this.$androidTitle,t=this.$androidContent,i=this.$iosTitle;e.length&&e.val(""),t.length&&t.val(""),i.length&&i.val(""),this.pushModal.find(".j_check_label").html("")},_checkPushContent:function(){var e=this.$androidTitle.val(),t=this.$androidContent.val(),i=this.$iosTitle.val();return e&&t&&i?!0:!1},_dialogEvent:function(){var e=this,t=$("body").find(".gg-push-client"),i=$(e.el).find(".j_modify_push"),s=$(e.el).find(".j_push_num");this.pushModal.find(".j_push").bind("click",function(){e._checkPushContent()?e._pushTemplateHide():alert("推送的标题或者内容不能为空")}),this.pushModal.find(".j_close").bind("click",function(){e._pushTemplateHide(),e._clearPushData(),e.isCreatPush&&(t.removeClass("selected"),i.hide(),s.show(),e.isCreatPush=!1),e._resetTemplate()})},_resetTemplate:function(){var e=this.templateData;e&&(this.$androidTitle.val(e.push_android_title),this.$androidContent.val(e.push_android_summary),this.$iosTitle.val(e.push_ios_title))},cover_writeback:function(){var e=this,t="auto",i=this.pgc_feed_covers.length;1==i?t="single":3==i&&(t="multi"),this.$cover_radio.filter('[data-type="'+t+'"]').trigger("click"),i>0&&this.$cover_img_con.each(function(t,s){var a="";return e.pgc_feed_covers[t]&&(a='<img src="'+util.e(e.pgc_feed_covers[t].url)+'" _src="'+util.e(e.pgc_feed_covers[t].uri)+'" _origin_uri="'+util.e(e.pgc_feed_covers[t].origin_uri)+'">'),$(s).prepend(a),1==i?!1:void 0})},autosave:function(){if(this.localStorage){var e=this,t={},i=this.getTime();t.mid=this.media_id,t.id=this.pgc_id,t.title=$.trim(this.$mp_title.val()),t.content=ue.getContent(),t.show_ads=this.$mp_show_ads.is(".selected")?1:0,t.force_ads=this.$mp_force_ads.is(".selected")?1:0,t.subsidy=this.$mp_subsidy.is(".selected")?1:0,t.tag_name=this.$mp_tag_name.val()||"",t.time=i,t.cover_type=this.$cover_radio.filter(".selected").data("type")||"";var s="";this.$cover_img_con.each(function(t,i){return 2>t?void(s+=$(i).html()+e.$cover_separator):(s+=$(i).html(),!1)}),t.cover_imgs=s,window.localStorage.setItem(this.localStorageName,JSON.stringify(t))}},getTime:function(){var e=new Date,t=e.getMonth()+1,i=e.getDate(),s=e.getHours(),a=e.getMinutes(),o=e.getSeconds(),r=e.getFullYear()+"-"+(t>9?t:"0"+t)+"-"+(i>9?i:"0"+i)+" "+(s>9?s:"0"+s)+":"+(a>9?a:"0"+a)+":"+(o>9?o:"0"+o);return r},clearLocalStorage:function(){this.localStorage&&window.localStorage.getItem(this.localStorageName)&&window.localStorage.removeItem(this.localStorageName)},loadLocalStorage:function(){if(this.localStorage){var e=window.localStorage.getItem(this.localStorageName);if(e){if(e=JSON.parse(e),this.media_id!=e.mid)return void this.clearLocalStorage();if(this.pgc_id&&this.pgc_id!=e.id)return;if(!this.pgc_id&&e.id)return;if(this.$mp_title.val(e.title),e.show_ads?this.$mp_show_ads.addClass("selected"):this.$mp_show_ads.removeClass("selected"),e.force_ads?this.$mp_force_ads.addClass("selected"):this.$mp_force_ads.removeClass("selected"),e.subsidy?this.$mp_subsidy.addClass("selected"):this.$mp_subsidy.removeClass("selected"),e.tag_name&&this.$mp_tag_name.val(e.tag_name),e.cover_type&&this.$cover_radio.filter('[data-type="'+e.cover_type+'"]').trigger("click"),e.cover_imgs){var t=e.cover_imgs.split(this.$cover_separator);this.$cover_img_con.each(function(e,i){$(i).html(t[e])})}return fixedAlert('已载入上次的草稿 <span class="abort-autosave slink">撤销</span>',1e4),e.content}}}})});
;define("pagelet/signform/spec/images.whe",function(){return function(s){var e="",i=(wheei.safeParse,wheei.safeEncode);return e+='<div class="signform_images"><div class="signform_images_label">',e+=i(s.label),e+='</div><div class="signform_hint">',e+=i(s.hint),e+='</div><div class="signform_images_box" data-node="box"></div><label class="widget_btn_cancel snoshadow signform_images_btn" data-node="btn"></label><div class="signform_msg" data-node="msg"></div></div>'}});
;define("pagelet/signform/spec/checkbox.whe",function(){return function(e){var c="",n=(wheei.safeParse,wheei.safeEncode);return c+='<div class="form1_checkbox">',c+=n(e.label),c+="</div>"}});
;define("pagelet/signform/spec/row.whe",function(){return function(e){var t="",n=(wheei.safeParse,wheei.safeEncode);return t+='<tr class="signform_item"><td class="signform_dt">',t+=n(e.label),t+='</td><td data-node="dd"></td></tr>'}});
;define("pagelet/signform/tag/tag.whe",function(){return function(n){var e="",a=(wheei.safeParse,wheei.safeEncode);return e+='<tr class="signform_item"><td class="signform_dt">',e+=a(n.label),e+='</td><td><span data-node="con"></span><span class="signform_inlinemsg" data-node="msg"></span></td></tr>'}});
;define("pagelet/signform/vposter/vposter.whe",function(){return function(s){var e="",t=(wheei.safeParse,wheei.safeEncode);return e+='<tr class="signform_item"><td class="signform_dt">',e+=t(s.label),e+='</td><td><div class="vposter_con" data-node="btn"><img class="vposter_img" data-node="img"><div class="vposter_tip">设置视频封面</div></div><span class="signform_inlinemsg" data-node="msg"></span></td></tr>'}});
;define("pagelet/signform/weixin/tpl.whe",function(){return function(t){var e="",i=(wheei.safeParse,wheei.safeEncode);return e+='<tr class="signform_item"><td class="signform_dt">',e+=i(t.label),e+='</td><td><div><div class="form1_checkbox signform_weixin_checkbox">同意接入微信内容源（将公众号群发后的文章，自动同步至头条号）</div></div><textarea class="form1_text"></textarea></td></tr><tr class="signform_sub"><td></td><td><div class="form1_msg jmsg"></div><div class="signform_hint">',e+=i(t.hint),e+="</div></td></tr>"}});
;define("pagelet/signform/simple/input2.whe",function(){return function(e){var i="",n=(wheei.safeParse,wheei.safeEncode);return i+='<div class="form2_item ',e.require&&(i+=" require "),i+='"><div class="form2_dt">',i+=n(e.label),i+='</div><div class="form2_dd"><input type="',i+=n(e.type||"text"),i+='" class="form1_input" ',e.name&&(i+=' name="',i+=n(e.name),i+='" '),i+=" ",e.hint&&(i+=' placeholder="',i+=n(e.hint),i+='" '),i+=' ><div class="form1_msg jmsg"></div></div></div>'}});
;define("pagelet/signform/simple/text2.whe",function(){return function(e){var i="",r=(wheei.safeParse,wheei.safeEncode);return i+='<div class="form2_item ',e.require&&(i+=" require "),i+='"><div class="form2_dt">',i+=r(e.label),i+='</div><div class="form2_dd"><textarea name="',i+=r(name),i+='" class="form1_text" ',e.hint&&(i+=' placeholder="',i+=r(e.hint),i+='" '),i+='></textarea><div class="form1_msg jmsg"></div></div></div>'}});
;define("pagelet/videobatch/videobatch_tpl.whe",function(){return function(){{var d="";wheei.safeParse,wheei.safeEncode}return d+='<div class="videobatch_card"><div data-node="sc"><div data-node="file"><div class="videobatch_uploader_init" data-tab="init"><div class="videobatch_uploader_init_btn widget_btn" data-node="uploadbtn">上传视频</div><div class="videobatch_uploader_init_text">支持绝大多数视频文件格式，大小不超过2G，较大的视频请压缩后上传</div></div><div class="videobatch_uploader_stat"><div class="videobatch_uploader_stat_icon"></div><div class="videobatch_uploader_stat_tip" data-node="tip"></div><div class="videobatch_uploader_stat_title_box"><div class="videobatch_uploader_stat_title sddd" data-node="name"></div><span class="videobatch_uploader_stat_resubmit slink" data-node="uploadbtn">重新上传</span></div></div><div class="videobatch_uploader_doing" data-tab="doing"><div class="videobatch_uploader_doing_title" data-node="name"></div><div class="videobatch_uploader_doing_progress sclearfix"><div class="videobatch_uploader_doing_cancel" data-node="cancel"></div><div class="videobatch_uploader_doing_progress_clear"><div class="progress1"><div class="progress1_progress" data-node="progress"></div></div></div></div><div class="videobatch_uploader_doing_count" data-node="count"></div></div></div>',d+='<div class="videobatch_form" data-node="form"><table class="videobatch_form_table" data-node="table"></table></div></div></div>'}});