_.Module.define({path:"user/widget/tbSpam",requires:[],sub:{initial:function(){$("body").append($("#tb_spam_notice_html").html())}}});_.Module.define({path:"user/widget/myTieba",requires:["common/widget/wallet_dialog","common/widget/Card","common/widget/tcharge_dialog"],sub:{config:{url:{dolike:"/f/like/commit/add",undolike:"/f/like/commit/delete",closetip:"/f/like/commit/notice/delete"}},initial:function(e){var i=this;i.user=PageData.user,i.forum=PageData.forum,i.balvInfo=e.balvInfo,i.style=e.style||"",i.isBySys=e.isBySys||!0,i.scoreTip=null,i.daysTofree=0,i.block_bubble=null,i.product=e.product||null},init:function(){var e=this;e.user.forbidden?e.daysTofree=e.user.forbidden.days_to_free:e.user.balv&&(e.daysTofree=e.user.balv.days_tofree),-1!=$.inArray(e.product,["frs","pb"])&&(_.Module.use("ueglibs/widget/Ban",[],function(i){e.BanLib=i}),this.user.is_login&&e.showOfflineCard()),this.user.is_login&&(this.bindEvents(),$(".user_profile .sign_highlight").length>0&&this.show_orange_tip(),this.showNewpropsTip()),this.dolikeEvent()},showOfflineCard:function(){var e=this,i=1*new Date;i>1408032e6||$.tb.Storage.get("balv_tdou_update")>i||(this.offline_card=this.use("common/widget/Card",{content:'',clazz:"doupiao_offline",arrow_dir:"left",card_css:{width:172,"z-index":1010,left:198,top:9},arrow_pos:{left:-7,top:20},wrap:$(".user_profile"),card_leave_display:!0}),this.offline_card._j_card.on("click",".j_close",function(){$.tb.Storage.set("balv_tdou_update",i+864e5),e.offline_card._j_card.remove()}).on("click",".j_link",function(){$.tb.Storage.set("balv_tdou_update",i+864e5),e.offline_card._j_card.remove()}),this.offline_card.showCard())},bindEvents:function(){var e=this;$("#user_info").on("click",".j_score_num",function(i){i.preventDefault(),e.getInstance("common/widget/wallet_dialog").show()}),$(".userliked_ban_content").on("click.bawuAppealLink",".j_appealLink",function(){$.stats.track("balvAppealLink","uegCount","bawuAppeal","click")}),$(".userlike_blacked").bind("mouseover",function(){e.show_black_tip($(this))}),$(".userlike_prisoned").bind("mouseover",function(){e.daysTofree>0&&e.daysTofree<360?e.show_shortblock_tip($(this),e.daysTofree,e.isBySys?"系统":"吧主",e.isBySys?"system":"bawu"):e.show_block_tip($(this))}),$("body").delegate(".tbmall_tip_close","click",function(){return $("#tbmall_tip_card").remove(),e.tbmallTip=null,$.cookie("close_tbmall_tip","1",{expires:365}),!1}),$("#j_tcharge_dialog").on("click",function(){e.use("common/widget/tcharge_dialog")}),(this.user.balv&&this.user.balv.has_liked||this.user.is_like)&&(PageData.is_ipad?$("a.p_balv_btnmanager").show():$(".balv_mod").hover(function(){$(".p_balv_btnmanager").show()},function(){$(".p_balv_btnmanager").hide()}))},dolikeEvent:function(){var e=this;$(".balv_dolike_comforum,.balv_dolike_star").bind("click",function(){return e.user.is_login?e.user.balv&&e.user.balv.is_block||e.user.forbidden&&e.user.forbidden.isForbid?e.showAlert(e.BanLib.render("balvLike")):e.user.balv&&e.user.balv.is_black||e.user.is_black?e.showAlert("你被吧主加入本吧黑名单,暂时不能进行操作"):e.dolike():_.Module.use("common/widget/LoginDialog",["","ilike"]),!1})},showAlert:function(e){var i='
'+e+"
";$.dialog.open(i,{title:"操作失败",width:380})},howtojoin:function(){$.dialog.alert("
点击右侧上方“
即可加入本吧,点亮头衔,从初级粉丝开始成长!
",{title:"如何加入",width:325})},dolike:function(){var e=this;if(this.user.is_login&&this.user.no_un)return TbCom.process("User","buildUnameFrame","填写用户名","有用户名才能点亮“我关注”,赶快给自己起一个吧~"),!1;var i={fid:this.forum.forum_id,fname:this.forum.forum_name,uid:this.user.name_url,ie:"gbk",tbs:PageData.tbs};$.post(this.config.url.dolike,i,function(i){if(i&&0==i.no)_.Module.use("ucenter/widget/LikeTip",["",!1,{index:i.data.ret.index,like_no:i.like_no}]);else{var t="";t=8==i.no||9==i.no?e.BanLib.render("balvLike"):220==i.no?"你被吧主加入黑名单,暂时不能进行操作":221==i.no?"你已like了本吧,请不要重复操作":"抱歉,异常错误,建议刷新页面重试一下",e.showAlert(t)}},"json")},undolike:function(){var e={fid:this.forum.forum_id,fname:this.forum.name_url,uid:this.user.name_url,ie:"utf-8",tbs:PageData.tbs};$.tb.post(this.config.url.undolike,e,function(e){e&&0==e.no&&$.tb.location.reload(!0)})},show_shortblock_tip:function(e){this.block_render(e,this.BanLib.render("balvAside"))},show_block_tip:function(e){this.block_render(e,this.BanLib.render("balvAside"))},show_black_tip:function(e){var i=new Array;i.push("
"),i.push("你已被吧主拉入黑名单,
你在本吧的头衔和权限也被收回。"),i.push("
"),this.block_render(e,i.join(""))},show_lvup_tip:function(e,i){var t=this,o=new Array;if(o.push("
"),o.push("
升级啦!你已拥有本吧"+e+"级头衔!
"),o.push('
'+i+"
"),"加油~继续攒经验!"==i)o.push("查看升级秘笈");else{var s='Stats.sendRequest("fr=tb0_forum&st_mod=frs&st_type=balvupguide&lv='+e+'")';o.push("现在去试试~~")}o.push("
");var l=o.join(""),n={content:l,arrow_dir:"up",bubble_css:{top:4,right:-5,width:232,"z-index":9999},arrow_pos:{left:209},attr:"lvup_tip_table",wrap:$("#userlike_info_tip"),closeBtn:!0},r=new UiBubbleTipBase(n);r.j_bubble.find(".j_content").css("padding","2px").addClass("lvup_tip_table"),r.showBubble(),r.bind("onclose",function(){t.close_lvup_tip()},!0),this.user.is_block||setTimeout(function(){r.closeBubble(),t.close_lvup_tip()},8e3)},block_render:function(e,i){if(!this.block_bubble){var t=this,o={content:i,arrow_dir:"up",bubble_css:{top:36,right:4,width:232,"z-index":9999},arrow_pos:{left:209},attr:"",wrap:e,closeBtn:!0};this.block_bubble=new UiBubbleTipBase(o),this.block_bubble.j_bubble.find(".j_content").css("padding","2px"),this.block_bubble.showBubble(),this.block_bubble.bind("onclose",function(){t.block_bubble.closeBubble(),t.block_bubble=null});{setTimeout(function(){t.block_bubble&&(t.block_bubble.closeBubble(),t.block_bubble=null)},5e3)}}},close_lvup_tip:function(){var e={fid:this.forum.forum_id,fname:this.forum.name_url,uid:this.user.name_url,ie:"utf-8",tbs:PageData.tbs,type:2};$.tb.post(this.config.url.closetip,e,function(e){e&&0==e.no})},show_orange_tip:function(){if("false"!=$.cookie("close_sign_tip_o")){$.cookie("close_sign_tip_o",!0,{expires:14});var e={content:"连续签到30天ID即可高亮展示,一起闪耀吧!",arrow_dir:"down",bubble_css:{top:3,right:25,width:145,"z-index":9999},arrow_pos:{left:88},attr:" ",wrap:$(".user_profile .user_name"),closeBtn:!0},i=new UiBubbleTipBase(e);i.j_bubble.find(".j_body").css("padding-right","3px"),i.showBubble(),i.bind("onclose",function(){$.cookie("close_sign_tip_o",!1,{expires:14})},!0);{setTimeout(function(){$(".j_wrap .j_close").click()},8e3)}}},showNewpropsTip:function(){var e=$.cookie("NEWS_PROPS_NOTICE"),i=this.user.global&&this.user.global.tbmall_newprops||"";(!e&&i>0||e&&i>e)&&this.buildNewpropsTip()},buildNewpropsTip:function(){var e=this,i={content:'有新道具上线哦~',arrow_dir:"up",arrow_pos:{left:40},bubble_css:{top:-35,left:100,width:100},wrap:$("#j_profile_pop"),closeBtn:!0},t=new UiBubbleTipBase(i),o="";t.bind("onclose",function(){t.closeBubble(),o=e.user.global&&e.user.global.tbmall_newprops||"",$.cookie("NEWS_PROPS_NOTICE",o,{expires:30,path:"/"})}),t.showBubble(),t.j_bubble.find(".j_newprops_tip").on("click",function(){$.post("/tbmall/post/addpropstoucenter",null,function(){}),t.closeBubble(),o=e.user.global&&e.user.global.tbmall_newprops||"",$.cookie("NEWS_PROPS_NOTICE",o,{expires:30,path:"/"})})},hasLevel:function(){var e=Math.floor((new Date).getTime()/1e3);return this.user.Parr_props&&this.user.Parr_props.level&&this.user.Parr_props.level.end_time>e}}});_.Module.define({path:"encourage/widget/encourageEntry",sub:{initial:function(){this._root=$("#encourage_entry"),this._stats()},_stats:function(){this._root.on("click","a",function(){var t=$(this).data("log");$.stats.track(t,"用户激励右侧入口")})}}});_.Module.define({path:"comforum/widget/HistoryGame",sub:{initial:function(){this._bindEvents(),this._showTrack()},_showTrack:function(){var t="";"frs"===PageData.product?t="FRS页":"pb"===PageData.product&&(t="PB页");var a=$(".game_content .game_h .game_link");if(a.length>0){var e=[];a.each(function(){e.push($(this).tbattr("title"))}),$.stats.track(t+"_我的游戏","PC端商业化游戏统计",PageData.product||"","展现",{obj_name:e.join(","),obj_type:"我的游戏"})}var n=$(".game_content .game_s .game_link");if(n.length>0){var i=[];n.each(function(){i.push($(this).tbattr("title"))}),$.stats.track(t+"_推荐游戏","PC端商业化游戏统计",PageData.product||"","展现",{obj_name:i.join(","),obj_type:"推荐游戏"})}},_bindEvents:function(){var t="",a=$(".game_tab"),e=$(".game_content");"frs"===PageData.product?t="FRS页":"pb"===PageData.product&&(t="PB页"),a.on("click","li",function(){var n=$(this).data("game"),i="game_h"==n?"我的游戏":"推荐游戏";a.children("li").removeClass("sel"),$(this).addClass("sel"),e.children("ul").removeClass("sel").end().children("ul."+n).addClass("sel"),$.stats.track(t+"_"+i+"_tab","PC端商业化游戏统计",PageData.product||"","点击",{obj_type:i})}),e.on("click",".j_stats",function(){var a=$(this).data("category"),e="h"==a?"我的游戏":"推荐游戏",n=$(this).find("img").tbattr("src"),i=$(this).tbattr("title");"undefined"==typeof n&&(n=""),$.stats.track(t+"_"+e,"PC端商业化游戏统计",PageData.product||"","点击",{obj_url:n,obj_name:i,obj_type:e})}),$("#game_login_btn").on("click",function(){return PageData.user.is_login||_.Module.use("common/widget/LoginDialog",[],function(){}),!1}),$(".j_privilege_btn").on("click",function(){$.stats.track("游戏特权","游戏特权","","点击",{obj_type:"游戏特权",obj_name:"游戏特权",obj_url:"-"})})}}});_.Module.define({path:"encourage/widget/scoreGain",requires:["common/widget/Card","encourage/widget/scoreOnlineTime","encourage/widget/scoreRandEgg","encourage/widget/scoreCustomEgg","encourage/widget/scoreProvideEgg","encourage/widget/scoreMonthIcon"],sub:{NEW_DEAD_LINE:13962816e5,URL:{postHeartBeat:"/tbscore/timebeat",fetchGift:"/tbscore/fetchtg",openGift:"/tbscore/opengift",aquireScore:"/tbmall/eggs/eggslist",findScore:"/tbmall/eggs/searcheggs",provideScore:"/tbmall/eggs/userSendPrivateEgg",myAquireScore:"/tbmall/eggs/mygeteggs",myProvideScore:"/tbmall/eggs/mysendeggs",initEggAndDynamic:"/tbmall/eggs/feedlist",initVIPEgg:"/tbscore/eggsvip",openVIPScore:"/tbmall/eggs/userGetVipEgg",openCustomScore:"/tbmall/eggs/userGetPrivateEgg",followUser:"/home/post/follow"},initial:function(e){this.tbs=PageData.tbs||"0",this.fr=PageData.product||"frs",this.forum_id=PageData.forum.forum_id||0,this.controlCenter=$("#tbmall_score_control_center"),this.opt=$.extend(e,{controlCenter:this.controlCenter}),this.scoreEncWrap=$(".score_encourage"),this.bindEvents(),this.scoreEncourage(),this.randEgg=this.use("encourage/widget/scoreRandEgg",this.opt),this.customEgg=this.use("encourage/widget/scoreCustomEgg",this.opt),this.provideEgg=this.use("encourage/widget/scoreProvideEgg",this.opt),this.animateEgg=this.use("encourage/widget/scoreAnimation",this.opt),this.monthIcon=this.use("encourage/widget/scoreMonthIcon")},showOfflineCard:function(){var e=this,t=(new Date).getTime();$.tb.Storage.get("score_doupiao_offline")>t-864e5||(this.offline_card=this.use("common/widget/Card",{content:'',clazz:"doupiao_offline",arrow_dir:"down",card_css:{width:170,"z-index":1e3,left:12,top:-35},wrap:$(".online_time"),card_leave_display:!0}),this.offline_card._j_card.on("click",".j_close",function(){$.tb.Storage.set("score_doupiao_offline",t),e.offline_card._j_card.remove()}).on("click",".j_link",function(){$.tb.Storage.set("score_doupiao_offline",t+1296e6),e.offline_card._j_card.remove()}),this.offline_card.showCard())},scoreEncourage:function(){var e=this;this.scoreEncWrap.on("click",".provide_score_btn a.score_btn",function(){{var t=e.opt.wrapper.find(".score_slide");e.opt.wrapper.find(".score_list")}t.hasClass("score_slide_down")||t.trigger("click"),e.controlCenter.off("score.finishEggAndDynamic").one("score.finishEggAndDynamic",function(){var t=e.opt.wrapper.find(".score_provide .provide_score_btn a.score_btn");t.trigger("click")});var o=e.opt.wrapper.find(".score_provide .provide_score_btn a.score_btn");return o.trigger("click"),!1})},bindEvents:function(){var e=this,t=this.opt.wrapper.find(".score_slide"),o=this.opt.wrapper.find(".score_wrapper");t.on("click",function(){o.slideToggle(),e.scoreEncWrap.slideToggle(),$(this).toggleClass("score_slide_down")}).one("click",function(t,o){o||e.customEgg.initScore("aquireScore"),e.provideEgg.initList()}),e.controlCenter.bind("score.openScore",function(t,o,i){e.openGift(o,i)}).bind("score.openVIPScore",function(t,o,i){e.openVIPScore(o,i)}).bind("score.openCustomScore",function(t,o,i){e.openCustomScore(o,i)}).bind("score.heartBeat",function(t,o){e.heartBeatHandler(o)}).bind("score.fetchScore",function(){e.fetchGift()}).bind("score.aquireScore",function(t,o,i){e.updateScore(o,i)}).bind("score.findScore",function(t,o,i){e.updateScore(o,i)}).bind("score.provideScore",function(t,o){e.provideScore(o)}).bind("score.myAquireScore",function(t,o,i){e.updateScore(o,i)}).bind("score.myProvideScore",function(t,o,i){e.updateScore(o,i)}).bind("score.initEggAndDynamic",function(t,o){e.initEggAndDynamic(o)}).bind("score.initVIPEgg",function(t,o){e.initVIPEgg(o)}).bind("score.followUser",function(t,o,i){e.followUser(o,i)})},heartBeatHandler:function(e){var t,o,i="noGift",r=e.data.gift_info;this.onlineTime.timeBarInit(e.data.time_stat);for(t in r)if(o=r[t],2==o.gift_type){var n=e.data.eggs_style;this.randEgg.initRandGift(o,n)}else 1==o.gift_type&&(i=o);this.onlineTime.timeGiftInit(i,e.data.time_stat)},posterTextInit:function(e){window.repeat_has_score=e.data.time_stat.repeat_has_score},postHeartBeat:function(){var e=this;e.reqCtrl("postHeartBeat",function(t){0==t.no&&e.posterTextInit(t)})},fetchGift:function(){var e=this;e.reqCtrl("fetchGift",function(t){0==t.no&&e.heartBeatHandler(t)})},openGift:function(e,t){var o=this;o.reqCtrl("openGift",e,function(i){0!=i.no&&$.isEmptyObject(i.data.gift_got)?("time"===e.type&&o.onlineTime.showTips("overTime"),o.heartBeatHandler(i)):("time"===e.type?o.onlineTime.addScore(i,e,t):o.animateEgg.startAnimate(i,t),$.cookie("monthicon_tip")||o.monthIcon.showMonthIconTip())})},provideScore:function(e){var t=this;t.reqCtrl("provideScore",e,function(e){t.provideEgg.handleRes(e.no),t.provideEgg.handleTip(e)})},openVIPScore:function(e,t){var o=this;return PageData.user&&PageData.user.Parr_props&&PageData.user.Parr_props.level&&2==PageData.user.Parr_props.level.props_id&&1e3*PageData.user.Parr_props.level.end_time>(new Date).getTime()?void o.reqCtrl("openVIPScore",e,function(i){if("2270012"==i.no)o.randEgg.authError(t);else{var r=new Date;r.setDate(r.getDate()+1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),"vip1"==e.vip_type?$.cookie("has_vip1_egg",1,{expires:r}):$.cookie("has_vip2_egg",1,{expires:r}),o.animateEgg.startAnimate(i,t)}}):void o.randEgg.authError(t)},openCustomScore:function(e,t,o){var i=this;$.extend(e,o),i.reqCtrl("openCustomScore",e,function(o){"2270012"==o.no?i.customEgg.authError(t):40==o.no?i._validVCode(o,function(o){i.openCustomScore(e,t,o)},function(){}):(i.animateEgg.startAnimate(o,t),i.customEgg.closeOpened(t))})},_validVCode:function(e,t,o){_.Module.use("common/component/CaptchaDialog",{message:e.data.vcode.str_reason,vCode:e.data.vcode.captcha_vcode_str,vCodeType:e.data.vcode.captcha_code_type,exceptionalAccount:1==e.data.vcode.userstatevcode,forumName:PageData.forum.forum_name,forumId:PageData.forum.forum_id,title:"领彩蛋",forumName:PageData.forum.forum_name,forumId:PageData.forum.forum_id,checkUrl:"/tbmall/vcode/checkvcode?tbs="+PageData.tbs,vCodeUrl:"/tbmall/vcode/getvcode",paramsCallback:function(){return{app:"getEgg",tbs:PageData.tbs,forum_id:PageData.forum.forum_id}}},function(e){e.bind("onclose",function(){return e.hide(),o(),!1}),e.bind("onaccept",function(){var o={};o.vcode=e.getInputValue(),o.vcode_md5=e.getVCode(),"function"==typeof t&&t(o)}),e.show()})},updateScore:function(e,t){var o=this;o.reqCtrl(e,t,function(t){0==t.no?o.customEgg.updateList(e,t.data):o.customEgg.handError()})},initEggAndDynamic:function(e){var t=this;t.reqCtrl(e,function(e){0==e.no&&t.provideEgg.initEggAndDynamic(e.data)})},initVIPEgg:function(e){var t=this;t.reqCtrl(e,function(e){0==e.no&&t.randEgg.getVIPEgg(e.data)})},followUser:function(e,t){var o=this;o.reqCtrl(e,t,function(e){o.customEgg.followError(e.no)})},reqCtrl:function(e,t,o){var i,r,n=this,a=n.URL[e],c={tbs:n.tbs,fr:n.fr,forum_id:n.forum_id,ie:"utf8"};arguments.length>2?(r=o,i="provideScore"==e?t+"&tbs="+PageData.tbs+"&forum_id="+PageData.forum.forum_id:$.extend(c,t)):(r=t,i=c),$.post(a,i,function(e){"function"==typeof r&&r(e)})}}}); ;_.Module.define({path:"encourage/widget/scoreOnlineTime",requires:[],sub:{timeGiftHTML:['
','','','
','","
"].join(""),blockRanges:{0:0,1:600,2:1800,3:3e3},currentDomLen:68,tips:["点击领取奖励","保持在线可获得一袋豆票"],initial:function(t){this.timeGiftWrapper=t.wrapper.find(".online_time"),this.scoreIncre=t.scoreIncre,this.controlCenter=t.controlCenter,this.timeKeeper=$(this.timeGiftHTML).appendTo(this.timeGiftWrapper),this.giftTips=null,this.timeInterval=null,this.criticalLen=0,this.timeRange=0,this.timeStep=0,this.activeRange=0,this.currentLen=null,this.activeLen=this.timeKeeper.find(".active_len"),this.timeGift=this.timeKeeper.find(".time_gift"),this.bindEvents()},bindEvents:function(){var t=this,i={};this.timeKeeper.delegate(".unopen_gift","click",function(){i={type:"time",gift_key:$(this).getData().gift_key},t.controlCenter.trigger("score.openScore",[i,$(this).addClass("bomb_gift")])}),$("body").delegate(".time_gift_tip_close","click",function(){return $("#time_gift_tip_card .all_gift_got").length>0&&$.cookie("all_time_gift_got","close"),$("#time_gift_tip_card").remove(),t.giftTips=null,!1})},timeGiftInit:function(t,i){var e=this,s=i.time_has_score,n=i.interval_type,a=i.time_len;this.timeGift.tbattr({"class":"time_gift",style:""}),s!==!1&&4!=n&&("noGift"==t?(this.activeRange=this.currentDomLen*(i.now_time-i.interval_begin_time)/a,this.currentLen.append(this.timeGift.addClass("next_gift").tbattr("title",this.tips[1])),this.timeEnd-this.timeRange<=this.criticalLen&&(this.activeRange=this.currentDomLen*(a-this.criticalLen)/a),this.activeLen.width(parseInt(this.activeRange)),this.timeInterval=setInterval(function(){return e.timeCounter()},1e3)):(this.activeLen.width(this.currentDomLen),this.currentLen.append(this.timeGift.addClass("unopen_gift").bindData(t).tbattr("title",this.tips[0]))))},timeBarInit:function(t){this.timeKeeper.show();var i=this.timeKeeper.find(".time_bar"),e=this.timeKeeper.find(".time_bar li").removeClass(),s=t.time_len,n=t.now_time-t.interval_begin_time,a=t.time_has_score,r=t.interval_type;if(clearInterval(this.timeInterval),this.timeKeeper.find(".time_keeper_tip").hide(),this.timeInterval=null,4==r)return e.addClass("allpass"),i.addClass("allGiftGot"),this.activeLen.width(0),this.timeKeeper.find(".time_keeper_tip").show(),void this.showTips("allGiftGot");if(a===!1)return e.addClass("allunpass"),i.addClass("overScore"),this.activeLen.width(0),void this.showTips("overScore");for(var l=0;4>l;l++)r>l?e.eq(l).addClass("pass_len"):l==r?this.currentLen=e.eq(l).addClass("curren_len").append(this.activeLen):e.eq(l).addClass("unpass_len");this.timeEnd=this.blockRanges[r]+s,this.criticalLen=t.critical_len,this.timeRange=this.blockRanges[r]+n,this.timeRange=this.timeEnd-this.timeRange>this.criticalLen?this.timeRange:this.timeEnd-this.criticalLen,this.timeStep=this.currentDomLen/s},timeCounter:function(){if(this.timeRange>=this.timeEnd)clearInterval(this.timeInterval),this.timeInterval=null,this.controlCenter.trigger("score.fetchScore");else{this.timeRange+=1;var t=this.timeEnd-this.timeRange;t<=this.criticalLen&&this.timeGift.addClass("red_to_grey"),this.activeRange+=this.timeStep,this.activeLen.width(parseInt(this.activeRange))}},addScore:function(t,i,e){var s={type:"time",len:6,pos:["0 30px","0 -90px","0 -120px","0 -150px","0 -180px","0 -210px","0 30px"]};e.bindData(t.data.gift_got),this.burstAnimate(t,s,e,0)},burstAnimate:function(t,i,e,s){var n=this;setTimeout(function(){e.css("backgroundPosition",i.pos[s]),s+'+s+"豆票").css({top:e.top+5,left:e.left}).appendTo("body").animate({top:"-=100",left:"+=50",opacity:.4},2e3,function(){$(this).remove()})},showTips:function(t){var i=this,e={overScore:'
您的【豆票】已达到上限!豆票上限说明
',overTime:'
礼包已经过期,下次请尽快领取!(礼包彩蛋当日有效。)
',allGiftGot:'
今日在线活跃奖励已经领取完成
'};i.giftTips&&(i.giftTips.closeCard(),i.giftTips=null),"allGiftGot"!=t&&(i.giftTips=i.use("common/widget/Card",{wrap:i.timeKeeper,content:e[t],card_css:{width:180,height:50,top:-28,left:6,zIndex:9999},card_leave_display:/^(overScore|allGiftGot)$/.test(t)?!0:!1,attr:"id = 'time_gift_tip_card'"}),i.giftTips.showCard())}}}); ;_.Module.define({path:"encourage/widget/scoreRandEgg",requires:["encourage/widget/scoreAnimation","common/widget/JoinVipDialog"],sub:{randGiftHTML:['','',""].join(""),giftGuide:!1,initial:function(e){this.fr=PageData.product,this.wrapperDom=e.wrapper,this.slideDom=e.wrapper.find(".score_slide"),this.eggDom=e.wrapper.find(".score_show"),this.controlCenter=e.controlCenter,this.randGift=$(this.randGiftHTML),this.initEggBlock(),this.initVIPEgg(),this.bindEvents()},initEggBlock:function(){var e=['

枚福利彩蛋 【快来抢】

',""].join("");this.eggDom.append(e)},bindEvents:function(){var e=this,i={};e.randGift.one("click",function(){i={type:"rand",gift_key:$(this).getData().gift_key},e.controlCenter.trigger("score.openScore",[i,$(this)]),e.slideDom.trigger("click")}),e.wrapperDom.on("click",".j_VIP_score",function(){return e.slideDom.hasClass("score_slide_down")||e.slideDom.trigger("click"),i=$(this).getData(),i.vip_type=$(this).data("vip"),e.controlCenter.trigger("score.openVIPScore",[i,$(this)]),!1}).on("mouseleave",".j_VIP_score",function(){return e.vip_card&&e.vip_card.closeCard({type:"delayClose",time:200}),e.vip_card=null,!1}).on("click",".j_score_open",function(){e.slideDom.hasClass("score_slide_down")||e.slideDom.trigger("click")})},initRandGift:function(e,i){if(null!=this.randGift){var t=this.eggDom.find(".block_middle"),n=$.extend({},e,i);this.randGift.find("img").tbattr("src",n.image),this.randGift.bindData(n).appendTo(t)}},initVIPEgg:function(){this.controlCenter.trigger("score.initVIPEgg",["initVIPEgg"])},getVIPEgg:function(e){var i=0,t="",n=null,o=this.eggDom.find(".score_total_left");delete e.vip1;for(t in e)if(n=e[t])if("left_number"!=t){if(i>1)return;++i}else o.html(n)},authError:function(e){var i=e.data("vip");if(i&&"vip2"===i){var t=new Date;t.setDate(t.getDate()+1),t.setHours(0),t.setMinutes(0),t.setSeconds(0),$.cookie("has_vip2_egg",1,{expires:t})}_.Module.use("encourage/widget/scoreAnimation",[{wrapperDom:this.wrapperDom,controlCenter:this.controlCenter}],function(i){i.startAnimate({},e)}),_.Module.use("common/widget/JoinVipDialog",[],function(e){e.getMemberDialog()})}}}); ;_.Module.define({path:"encourage/widget/scoreCustomEgg",requires:["common/component/JsPager"],sub:{initial:function(e){this.fr=PageData.product,this.scoreWrapper=e.wrapper.find(".score_wrapper"),this.slideDom=e.wrapper.find(".score_slide"),this.scoreTab=e.wrapper.find(".score_tab"),this.scoreList=e.wrapper.find(".score_list"),this.scorePager=e.wrapper.find(".score_pager"),this.scoreProvide=e.wrapper.find(".score_provide"),this.guideDom=e.wrapper.find(".score_guide"),this.eggBlockDom=e.wrapper.find(".score_show .egg_block"),this.controlCenter=e.controlCenter,this.pager=null,this.bindEvents()},bindEvents:function(){var e=this;$("#tbmall_score_region").on("click",".tbmall_score_op, .tip_to_find",function(){e.slideDom.hasClass("score_slide_down")||e.slideDom.trigger("click",[!0]),e.eggBlockDom.slideUp(),e.initScore("findScore",!0)}),this.scoreTab.on("click",".find_score_tab .tab_btn",function(){e.initScore("findScore")}).on("click",".find_score_tab .tab_close",function(){e.eggBlockDom.slideDown(),e.initScore("aquireScore")}).on("click",".my_score_tab li",function(){var i=$(this).tbattr("data-type"),t=$(this).closest(".my_score_tab").find("li");t.removeClass("sel"),$(this).addClass("sel"),e.initScore(i)}),this.scoreList.on("click",".aquire_score_item .info_btn",function(){if(!$(this).hasClass("info_btn_disable")){e.scoreList.find(".item_info").slideUp();var i=$(this).closest(".aquire_score_item"),t=i.find(".item_info"),r=i.find(".item_detail");e.scoreList.find(".item_detail").not(r).slideUp(),t.slideUp(),r.slideDown(),e.scoreProvide.slideUp()}return!1}).on("click",".aquire_score_item .detail_close",function(){var i=$(this).closest(".aquire_score_item"),t=i.find(".item_info"),r=i.find(".item_detail");e.scoreList.find(".item_info").not(t).slideDown(),t.slideDown(),r.slideUp(),e.scoreProvide.slideDown()}).on("click",".my_provide_item .info_btn",function(){e.scoreList.find(".item_info").slideDown();var i=$(this).closest(".my_provide_item"),t=i.find(".item_detail");t.slideDown(),e.scoreList.find(".item_detail").not(t).slideUp()}).on("click",".j_custom_score",function(){return opt=$(this).getData(),e.controlCenter.trigger("score.openCustomScore",[opt,$(this)]),!1}).on("click",".j_user_attention",function(){e.followUser($(this))}),this.guideDom.on("click",".j_my_score",function(){return e.initScore("myProvideScore"),e.scoreProvide.find(".provide_score_btn").tbattr("class","aquire_score_btn"),!1}),this.scoreProvide.on("click",".aquire_score_btn a",function(){e.eggBlockDom.slideDown(),e.initScore("aquireScore"),$(this).parent(".aquire_score_btn").tbattr("class","provide_score_btn")})},initScore:function(e,i){var t=1;return this.scorePager.empty(),this.pager=null,this.initTab(e),i?void this.scoreList.empty():void this.getList(e,{pn:t})},initTab:function(e){var i={aquireScore:"",findScore:['
','

消耗 50 T豆在全吧找福利彩蛋

','

','',"
"].join(""),myProvideScore:['
','","

彩蛋额度","领取次数","领取人","

","
"].join(""),myAquireScore:['
','","

发福利的人","领取的吧","领取额度","

","
"].join("")};"aquireScore"==e?this.scoreTab.slideUp().html(i[e]):this.scoreTab.html(i[e]).slideDown()},aquireScore:function(e){for(var i=0,t=e.length,r=null,a="",s={},n=['
','
','
','

',"#{user_name}的福利

",'

福利总额#{total_score}T豆

',"
",'',"
",'
','
','','用户头像',"",'
','

',"#{user_name}的福利

",'

','关注Ta',"

","
","
",'
','','',"","
",'
','

领取条件:','',"#{forum_name}吧 LV#{level}以上

",'

福利总额:#{total_score} T豆

',"
",'',"
","
"].join("");t>i&&5!==i;i++)r=e[i],s={data:$.tb.dataField(r),image:r.image,user_data:$.tb.dataField({un:r.user_name}),user_name:$.tb.subByte(r.user_name,12),user_name_enty:r.user_name,user_link:"/home/main/?ie=utf8&un="+r.user_name+"&fr="+this.fr,user_portrait:r.portrait,left_num:r.left_number,forum_data:$.tb.dataField({forum_name:r.cond_forum_name,forum_link:"/f?kw="+r.cond_forum_name,level:r.cond_user_level}),forum_name:$.tb.subByte(r.cond_forum_name,12),forum_name_enty:r.cond_forum_name,forum_link:"/f?kw="+r.cond_forum_name,level:r.cond_user_level,score_data:$.tb.dataField(r),score_image:r.image,info_disable:r.get_status?"info_btn_disable":"",total_score:r.score},a+=$.tb.format(n,s);return a},findScore:function(e){for(var i=0,t=e.length,r=null,a="",s={},n=['
','
','吧头像','
','

',"#{forum_name}

",'

还剩个#{left_num}

',"
",'',"
","
"].join("");t>i&&5!==i;++i)r=e[i],s={image:r.portrait,forum_name:$.tb.subByte(r.forum_name,14),forum_name_enty:r.forum_name,forum_link:"/f?kw="+r.forum_name,left_num:r.left_num},a+=$.tb.format(n,s);return a},myProvideScore:function(e){for(var i=0,t=e.length,r=null,a="",s={},n=['
','
','#{info_val}','#{info_num}次','',"
",'
',"#{details}","
","
"].join("");t>i&&5!==i;i++)r=e[i],s={image:r.image,info_val:$.tb.subByte(r.score,6),info_val_enty:r.score,info_num:r.number,details:this.initInfo(r.user_list)},a+=$.tb.format(n,s);return a},initInfo:function(e){var i="",t=0,r=0,a=null,s={},n=['

#{user_name}领取了#{get_score}T豆

'].join("");if($.isArray(e))for(r=e.length;r>t;++t)a=e[t],s={user_name:$.tb.subByte(a.user_name,12),user_name_enty:a.user_name,get_score:a.get_score},i+=$.tb.format(n,s);return i},myAquireScore:function(e){for(var i=0,t=e.length,r=null,a="",s={},n=['
','#{from_user_name}','#{forum_name}吧',"#{get_score}T豆","
"].join("");t>i&&10!==i;i++)r=e[i],s={forum_name:r.forum_name,from_user_name:r.from_user_name,get_score:r.get_score},a+=$.tb.format(n,s);return a},updateList:function(e,i){if(!i.list||0===i.list.length)return void this.handError("emptyData");var t=this;null==this.pager&&parseInt(i.count)>0&&(this.pager=t.use("common/component/JsPager",{container:t.scorePager,current:1,amount:10,total:Math.ceil(i.count/5)||0,template:{head:"",tail:""},classname:{wrapper:"tbui_js_pager",current:"current grey_border",normal:"",prev:"prev",next:"next",head:"head",tail:"tail",status:"status",prev_disable:"prev_disable",next_disable:"next_disable",head_disable:"head_disable",tail_disable:"tail_disable"}}),this.pager.bind("pageChange",function(i,r){t.getList(e,{pn:r}),t.pager.initial({current:r}),t.scoreProvide.slideDown()}));var r=this[e](i.list);this.scoreList.empty().html(r)},getList:function(e,i){var t=this;t.controlCenter.trigger("score."+e,[e,i])},closeOpened:function(e){var i=e.closest(".aquire_score_item"),t=i.find(".item_info"),r=i.find(".item_detail");r.slideUp(),t.slideDown().find(".info_btn").addClass("info_btn_disable")},followUser:function(e){var i=this,t=e.getData();i.controlCenter.trigger("score.followUser",["followUser",t])},followError:function(e){var i={0:"关注成功",1130036:"此用户禁止被关注","else":"服务器打了个盹,刷新一下吧"},t=e in i?i[e]:i["else"],r=new $.dialog({html:'

'+t+"

",width:300,height:30});r.bind("onclose",function(){})},handError:function(e){var i={emptyData:'本吧没有福利彩蛋
开始寻找彩蛋!',"else":"服务器打了个盹,刷新一下吧!"},t=e in i?i[e]:i["else"];this.scoreList.html('

'+t+"

")},authError:function(e){var i=e.closest(".item_detail").find(".detail_condition"),t=i.find(".j_limit_error"),r=i.find(".j_limit_total"),a=0,s=(t.html(),t.getData()),n='需要在'+s.forum_name+"吧达到"+s.level+"级以上";t.html(n).addClass("limit_center"),r.remove();var o=setInterval(function(){4==a?(t.addClass("limit_error"),clearInterval(o),o=null):(t.toggleClass("limit_error"),++a)},200)}}}); ;_.Module.define({path:"encourage/widget/scoreProvideEgg",requires:[],sub:{initial:function(e){this.fr=e.fr,this.visibleNum=3,this.scoreNum=0,this.wrapperDom=e.wrapper,this.provideDom=e.wrapper.find(".score_provide"),this.dynamicDom=e.wrapper.find(".score_dynamic"),this.guideDom=e.wrapper.find(".score_guide"),this.eggBlockDom=e.wrapper.find(".egg_block"),this.scoreWrapper=e.wrapper.find(".score_wrapper"),this.controlCenter=e.controlCenter,this.scoreStyles="",this.scoreForums="",this.provideFlag=!0,this.tipDom=null,this.selEgg=null,this.initGuide()},bindEvents:function(){var e=this,i=this.provideDom,o=i.find(".provide_score_btn"),s=i.find(".provide_score_item"),r=this.scoreWrapper.find(".score_list"),t=this.scoreWrapper.find(".score_pager");this.tipDom=s.find(".provide_tip"),i.on("click",".provide_score_btn a.score_btn",function(){return o.slideUp(),s.slideDown(),r.slideUp(),t.slideUp(),e.eggBlockDom.slideUp(),e.dynamicDom.slideUp(),e.initCarouse(),!1}).on("click",".provide_close",function(){s.slideUp(),o.slideDown(),r.slideDown(),t.slideDown(),e.eggBlockDom.slideDown(),e.dynamicDom.slideDown()}).on("submit","form.score_form",function(i){return i.preventDefault(),e.provideScore($(this)),!1}).on("keyup",".score_total",function(){e.checkProvide($(this))}).on("focus",".score_total, .egg_total",function(){var i=$(this);$(this).hasClass("score_total")||(i=$(this).closest(".score_form").find(".score_total")),e.checkProvide(i)}).on("click",".score_to_charge",function(){_.Module.use("common/widget/TchargeDialog")})},initList:function(){var e=this;e.controlCenter.trigger("score.initEggAndDynamic",["initEggAndDynamic"])},initEggAndDynamic:function(e){var i=this;$.isArray(e.feed_list)&&this.initDynamic(e.feed_list),$.isArray(e.egg_list)&&this.initScore(e.egg_list),$.isArray(e.forum_list)&&this.initForum(e.forum_list),this.initProvide(),this.bindEvents(),i.controlCenter.trigger("score.finishEggAndDynamic")},initProvide:function(){var e="",i={},o=['
','','彩蛋达人','福利红吧',"
",'
','
#{forum_name}吧发福利
','
#{score_info}
','
','

T豆总量:T豆

','

彩蛋数:

',"

","领取条件:",'','','","

",'

将消耗21000T豆
(每日扣除1000T豆福利余额)

','

',"
",'',"
"].join("");i={forum_id:PageData.forum.forum_id,forum_name:PageData.forum.forum_name,forum_link:"/f?kw="+PageData.forum.forum_name,forum_info:this.scoreForums||"",score_info:this.scoreStyles||""},e+=$.tb.format(o,i),this.provideDom.append(e)},initForum:function(e){var i=0,o=e.length,s=[];if(o>0)for(;o>i;++i)s.push('");else s.push('");this.scoreForums=s.join("")},initScore:function(e){var i=0,o=e.length,s=null,r="",t="";for(this.scoreNum=o;o>i;++i)s=e[i],r+=["
  • ",'','',"","
  • "].join("");t=['",'','',"",'','',"",'
    '].join(""),this.scoreStyles=t},initCarouse:function(){this.selEgg=null;var e=this,i=this.provideDom.find(".score_info");i.find(".info_carousel").jCarouselLite({btnNext:i.find(".info_next"),btnPrev:i.find(".info_prev"),visible:this.visibleNum,circular:!0,afterEnd:function(i){e.selEgg=$(i[1])}}),_.Module.use("common/widget/Placeholder",["#tbmall_score_control_center .score_provide .score_total","20000"],function(){}),_.Module.use("common/widget/Placeholder",["#tbmall_score_control_center .score_provide .egg_total","150"],function(){})},initDynamic:function(e){for(var i=0,o="",s=e.length,r=null,t=null,a=['

    ','','',"","抢了",'','',"","的彩蛋获得","#{get_score}","T豆","

    "].join("");s>i&&!(i>10);++i)r=e[i],t={user_link:"/home/main/?ie=utf8&un="+r.user_name,user_name:r.user_name,user_portrait:r.portrait,user_data:$.tb.dataField({un:r.user_name}),from_user_link:"/home/main/?ie=utf8&un="+r.from_user_name,from_user_name:r.from_user_name,from_user_portrait:r.from_portrait,from_user_data:$.tb.dataField({un:r.from_user_name}),get_score:r.get_score},o+=$.tb.format(a,t);this.dynamicDom.append('
    '+o+"
    "),1>s&&this.dynamicDom.hide();{var n=this.dynamicDom.find(".dynamic_wrapper");setInterval(function(){n.find(".dynamic_item").first().slideUp(function(){$(this).appendTo(n).show()})},3e3)}},initGuide:function(){},provideScore:function(e){if(this.provideFlag&&this.formValid()){var i="";if(this.selEgg)i=this.selEgg.getData().sid;else{var o=this.provideDom.find(".info_carousel li"),s=this.scoreNum-this.visibleNum+1;i=o.eq(s).getData().sid}e.find("input.score_id").val(i),this.controlCenter.trigger("score.provideScore",[e.serialize()]),self.provideFlag=!1}},formValid:function(){var e=this.provideDom.find(".provide_score_item"),i=e.find(".score_total").val(),o=e.find(".egg_total").val();return this.scoreValid(i)&&this.eggValid(o,i)},scoreValid:function(e){var i=PageData.user.Parr_scores?PageData.user.Parr_scores.scores_money+PageData.user.Parr_scores.scores_other:0;return/^\d+$/.test(e)?1e4>e?(this.handleRes(111e4),!1):e>i?(this.handleRes(2270005),!1):!0:(this.handleRes(1001),!1)},eggValid:function(e,i){var o=parseInt(i/100-50);return/^\d+$/.test(e)?10>e?(this.handleRes(1110002),!1):e>o?(this.handleRes(1110003,o),!1):!0:(this.handleRes(1001),!1)},checkProvide:function(e){var i=e.val(),o=parseInt(i)+1e3;this.tipDom&&this.tipDom.html(/^\d+$/.test(i)?"将消耗"+o+"T豆
    (每日扣除1000T豆福利余额)":"")},handleRes:function(e,i){this.provideFlag=!0;var i=i&&!isNaN(parseInt(i))?parseInt(i):0,o={0:"提交成功!",1001:"请输入数字",1110000:"T豆数不能小于10000",1110001:"您在吧内等级不能小于1或大于7",1110002:"彩蛋数不能小于10",1110003:"所发T豆的彩蛋数不能多于"+i,2270005:'您的T豆余额不足,去充值>>',2251009:"发放的吧不存在","else":"服务器打了个盹,刷新试试吧"},s=e in o?o[e]:o["else"];this.tipDom&&this.tipDom.html(s)},handleTip:function(e){if(0==e.no&&e.data&&e.data.get_icon){var i=$('

    恭喜你获得了

    【福利印记】
    ');$("body").append(i),i.on("click",".score_alert_close",function(){return i.remove(),$.tb.location.reload(),!1})}else if(0==e.no){setTimeout(function(){$.tb.location.reload()},1e3)}}}}); ;_.Module.define({path:"encourage/widget/scoreAnimation",requires:[],sub:{initial:function(e){this.wrapperDom=e.wrapper,this.controlCenter=e.controlCenter,this.bindEvents()},bindEvents:function(){$("body").on("click",".score_close_gif",function(){$(this).closest(".score_open_gif").remove()})},startAnimate:function(e,o){var t="custom",n=null;if(e.data){var r=e.data.gift_got;r?(n={props_num:r.gift_score,props_name:""},t="rand"):n=e.data}else n={props_num:"0",props_name:""};n=$.extend(o.getData(),n||{props_num:"0",props_name:""},!0),o.bindData(n),o.fadeOut(),this._addScore(t,o,e)},_addScore:function(e,o,t){var n={len:5,pos:["0 -66px","0 -132px","0 -198px","0 -264px","0 0"]};this._showGif(o),this._burstAnimate(e,n,o,0,t)},_burstAnimate:function(e,o,t,n,r){var s=this;setTimeout(function(){t.css("backgroundPosition",o.pos[n]),n','','',"",'',""].join(""),i={link:s,gif:r};o=$.tb.format(a,i),$(o).css({top:n.top-48,left:n.left-48}).appendTo("body").fadeIn(2e3)}},_scoreAnimate:function(e,o){var t=e.getData().props_name||"",n=e.getData().props_num||0,r="",s=t?"prop":"egg",a=o||"",i=['
    #{scoreShow}
    '].join(""),c=e.offset();r="prop"==s?t+"×"+n:"+"+n+("rand"==a?"豆票":""),r={scoreShow:r,scoreStyle:s,scoreType:a},fly_dom=$($.tb.format(i,r)),fly_dom.css({top:c.top+26,left:c.left+20}).appendTo("body"),fly_dom.animate({top:"-=100",left:"+=50",opacity:.4},3e3,function(){$(this).remove(),e.remove(),e=null})}}}); ;_.Module.define({path:"encourage/widget/scoreBuy",requires:[],sub:{URL:{provideScore:"/tbmall/eggs/userSendPrivateEgg",checkScore:"/tbmall/checkorder"},callBack:null,initial:function(){this._dialog=null,this._bindEvents()},buyScore:function(e,a){"function"==typeof a&&(this.callBack=a),this._getOrderId(e),this._chargingDialog()},_bindEvents:function(){$("body").delegate(".j_charge_success_btn","click",function(){self._closeDialog(self._dialog),self._confirmChargeState()}).delegate(".j_charge_fail_btn","click",function(){self._closeDialog(self._dialog),$.tb.location.setHref(h)})},_getOrderId:function(e){var a=this,s=e+"&tbs="+PageData.tbs+"&forum_id="+PageData.forum.forum_id;$.ajax({type:"POST",url:a.URL.provideScore,dataType:"json",data:s,success:function(e){switch(e.no){case 0:"88888888"==e.data.order_id?(a._closeDialog(a._dialog),a._closeBubble(a._bubble),a._bubble=a._showBubble("已成功充值 "+e.data.scores+"T豆",1500,"canClose"),windowOpen&&windowOpen.close()):(a._order_id=e.data.order_id,window.open(e.data.dubi_url))}}})},_confirmChargeState:function(){var e=this,a=6;this._bubble=this._showBubble("正在验证支付中,请稍候"+a+"秒...");var s=setInterval(function(){if(a--,e._bubble.html("正在验证支付中,请稍候"+a+"秒..."),a%2==0){var l={ie:"utf-8",tbs:PageData.tbs,order_id:e._order_id};$.ajax({type:"POST",url:e.URL.checkScore,dataType:"json",dataType:"json",data:l,success:function(l){switch(l.no){case 0:1e4==l.data.result_code&&(e._closeBubble(e._bubble),e._bubble=e._showBubble("已成功充值 "+l.data.scores+"T豆",1500,"canClose",function(){$.tb.location.setHref($.tb.location.getHref().replace("&showsend=1","").replace("&showmask=1",""))}),clearInterval(s)),0>=a&&(e._closeBubble(e._bubble),e._bubble=e._showBubble("抱歉,T豆没有充值成功",1500,"canClose"),clearInterval(s));break;case 1:case 2:default:0>=a&&(e._closeBubble(e._bubble),e._bubble=e._showBubble("抱歉,T豆没有充值成功",1500,"canClose"),clearInterval(s))}},error:function(){e._bubble.html("

    未知错误

    "),clearInterval(s)}})}0>=a&&clearInterval(s)},1e3)},_showBubble:function(e,a,s,l){var n=$("
    ");return n.append(e),$("body").append(n),n.css({left:$(window).width()/2-n.width()/2,top:$(window).height()/2}),$(window).resize(function(){n.css({left:$(window).width()/2-n.width()/2,top:$(window).height()/2})}),"function"==typeof l&&l(),s&&n.click(function(){$(this).remove()}),a?void this._closeBubble(n,a):n},_closeBubble:function(e,a){a&&a>0?setTimeout(function(){e&&e.fadeOut("normal",function(){e.remove()})},a):e&&e.fadeOut("normal",function(){e.remove()})},_chargingDialog:function(){var e="

    请在新打开的页面上完成支付

    支付完成前    请勿关闭窗口

    ";this._showDialog("充值T豆",e,500)},_showDialog:function(e,a,s){this._dialog=new $.dialog({html:a,title:e,width:s,draggable:!1,closeable:!0})},_closeDialog:function(e){e&&e.close(),e=null}}}); ;_.Module.define({path:"encourage/widget/scoreMonthIcon",requires:[],sub:{initial:function(){},showMonthIconTip:function(){function t(t){return t>9?t:"0"+t.toString()}var n=PageUnit.load("score_gain_txt"),e=PageUnit.load("score_gain_button"),i=PageUnit.load("score_gain_title"),o=PageUnit.load("score_gain_link"),a=PageUnit.load("score_gain_constellation");if(n){var l=new Date(Env.server_time),r=l.getFullYear(),_=t(l.getMonth()+2),c=new $.dialog({html:'

    '+n+'

    '+e+'不再提醒

    ',title:i,width:400,show:!1});"1"!=a&&PageData.user.tbmall_month_icon&&PageData.user.tbmall_month_icon[r+""+_]||c.show(),$.cookie("monthicon_tip","1",{path:"/",expires:1/6}),$(c.getElement()).on("click","#month_icon_tip",function(){c.close()}).on("click",".j_dont_remind",function(t){t.preventDefault(),$.cookie("monthicon_tip","1",{path:"/",expires:1}),c.close()})}}}});var Observe=Observe||{};!function(n,t,e){"use strict";var r="function"==typeof define,o="undefined"!=typeof module&&module.exports;r?define(t):o?module.exports=t():e[n]=t()}("observe",function(){var n=[],t=[],e=function(n){function t(){e(),a=n}function e(){o(c.generic,function(t){t(n,a)})}function r(n,t){o(c.create,function(e){e(n,t)})}function i(n,t,e){o(c.update,function(t){t(n,old_item,e)})}function u(n,t){o(c["delete"],function(e){e(n,t)})}function f(){var e=a.length,o=n.length;if(e!==o||$.json.encode(a)!==$.json.encode(n))for(var f=Math.max(o,e),c=f;c>=0;c--){var p=a[c],s=n[c];c>e-1?r(s,c):c>o-1?u(p,c):s!==p&&i(s,p,c)}t()}var a=[],c={generic:[],create:[],update:[],"delete":[]};return n.pop=function(){f();var n=Array.prototype.pop.call(this,arguments),e=this.length;return u(n,e),t(),n},n.push=function(){f();var n=arguments[0],e=Array.prototype.push.apply(this,arguments);return r(n,e-1),t(),e},n.splice=function(n){f();for(var e=Array.prototype.slice.call(arguments,2),i=Array.prototype.splice.apply(this,arguments),a=i.length-1;a>=0;a--)u(i[a],n+a);return o(e,function(t,e){r(t,n+e)}),t(),i},{bind:function(n,t){if("undefined"==typeof c[n])throw"type is not allow";c[n].push(t)},unbind:function(){}}},r=function(n,t){return Object.prototype.toString.call(n)==="[object "+t+"]"},o=function(n,t){for(var e,r=0,o=n.length;o>r&&(e=t.call(n[r],n[r],r),e!==!1);r++);},i=function(n,t){var e=0;if(Array.prototype.indexOf)return n.indexOf(t);for(;ei;i++)e[i].scale_home.toString().length>5&&(e[i].scale_home=e[i].scale_home.toPrecision(4)),e[i].scale_away.toString().length>5&&(e[i].scale_away=e[i].scale_away.toPrecision(4));return e},_formatTime:function(t){if(0>t)return"00:00:00";var e=new Date(1e3*t),i=function(t){return 10>t?"0"+t:t},n=i(Math.floor(t/3600))+":"+i(e.getUTCMinutes())+":"+i(e.getUTCSeconds());return n},_bindEvents:function(){var t=this;t._container.on("keydown",".j_quick_ipt",function(e){return t._lotteryHelper.numberKeyOnly(e)}).on("change",".j_quick_ipt",function(){var t=$(this).val();t||$(this).val(1)}).on("keyup",".j_quick_ipt",function(){var t=$(this).val();t&&(t=t.replace(/\D/g,"")),0===parseInt(t,10)&&(t=1),$(this).val(t)}),Observe.observe(t._selected,"create",function(e){var i=t._container.find(".lottery_basket_"+e),n=t._container.find(".j_quick_tz");i.addClass("lottery_select"),t._bubble&&t._bubble.hideBubble(),t._setBtnTips(),n.toggleClass("disable",0===t._selected.length)}),Observe.observe(t._selected,"delete",function(e){var i=t._container.find(".lottery_basket_"+e),n=t._container.find(".j_quick_tz");i.removeClass("lottery_select"),t._setBtnTips(),n.toggleClass("disable",0===t._selected.length)}),t._container.on("click",".j_lottery_select",function(){var e=$(this).data("rel");$(this).hasClass("lottery_select")?t._selected.splice($.inArray(e,t._selected),1):t._selected.push(e)}),t._container.on("click",".j_quick_tz",function(){return $(this).hasClass("disable")?(t._bubble||(t._bubble=t._showBubble({content:"至少选择一种比赛结果",wrap:t._container.find(".j_lottery_bubble")})),void t._bubble.showBubble()):void window.open(t._buildUrl())}),t._container.on("click",".j_quick_refresh",function(){t._index++,t._selected.length=0,t._index===t._singleLottery.length&&(t._index=0);var e=t._singleLottery[t._index];e.format_lotttery_end=t._formatTime(e.lottery_end_time-Math.floor((new Date).getTime()/1e3));var i=$.tb.format(t._tpl1,e),n=$.tb.format(t._tpl2,e);t._container.find(".j_quick_rpl1").replaceWith(i),t._container.find(".j_quick_rpl2").replaceWith(n),t._selected.push(3);var o=t._container.find(".j_bottom_tip");o.length&&o.remove(),clearInterval(t._t),t._t=t._countTime()})},_setBtnTips:function(){var t=this._singleLottery[this._index],e=this._container.find(".j_quick_tz"),i=e.children("span");1===this._selected.length?(3==this._selected[0]&&i.text("支持"+t.home+" 立即投注"),0==this._selected[0]&&i.text("支持"+t.away+" 立即投注")):i.text("眼光不错 立即投注")},_tpl1:['"].join(""),_tpl2:['
    ','
    主胜#{scale_home}
    ','
    客胜#{scale_away}
    ',"
    "].join(""),_buildUrl:function(){var t=this,e="http://tieba.lecai.com/user/cooperator/baidu/bet_confirm.php?lottery_type=70",i="7001:7002%",n=parseInt($(".j_quick_ipt").val(),10);return i+=t._singleLottery[t._index].match_num+"("+t._selected.join(";")+")",e+"&content="+encodeURIComponent(i)+"&multiple="+n},_countTime:function(){var t=this,e=t._container.find(".j_lottery_deadline"),i=parseInt(e.data("end"))-Math.floor((new Date).getTime()/1e3),n=function(t){return 10>t?"0"+t:t},o=setInterval(function(){var l,_;return 0>=i?(t._container.find(".j_quick_tz").addClass("disable"),$(t._bottomTip("本场比赛投注已截止")).insertAfter(t._container.find(".j_quick_options")),t._singleLottery[t._index].isEnd=!0,void clearInterval(o)):(i-=1,l=new Date(1e3*i),_=n(Math.floor(i/3600))+":"+n(l.getUTCMinutes())+":"+n(l.getUTCSeconds()),void e.text(_))},1e3);return o},_bottomTip:function(t){var e='
    '+t+"
    ";return e},_showBubble:function(t){var e={content:'
    '+t.content+"
    ",arrow_dir:"down",bubble_css:{top:-20,right:10,width:t.width||150},arrow_pos:{right:0},attr:" id='tb_message_tip_n' ",wrap:t.wrap,closeBtn:!1,level:1,arrowReq:!0},i=new UiBubbleTipBase(e);return i},_stats:function(){var t=this;t._container.on("click",function(e){var i=e.target||e.srcElement,n=$(i).data("log");n&&$.stats.track(n,"竞彩蓝球",t._page,"click")})}}});_.Module.define({path:"comforum/widget/LotteryHelper",sub:{initial:function(){},permute:function(r,n){for(var t=1,e=0;n>e;e++)t*=r-e;return parseInt(t,10)},combine:function(r,n){var t=this,e=t.permute(r,n);return e/=t.permute(n,n),parseInt(e,10)},fullCombination:function(r,n){for(var t=[],e=r.length,o=[],a=0;n>=a;a++)o.push(a-1);for(var u=n,i=!0;-1==o[0];){if(i){for(var f=[],a=1;n>=a;a++)f.push(r[o[a]]);t.push(f),i=!1}o[u]++,o[u]!=e?n>u?(u++,o[u]=o[u-1]):u==n&&(i=!0):(o[u]=0,u--)}return t},fullCombinationDantuo:function(r,n,t){var e=this,o=0;n&&(o=n.length);var a=t.length;if(r>o+a)return!1;for(var u=r-o,i=e.fullCombination(t,u),f=0,h=i.length;h>f;f++)i[f]=i[f].concat(n);return i},countCombinationDantuo:function(r,n,t){var e=this;n="undefined"==typeof n?0:n;var o=r-n;return e.combine(t,o)},arrayFullCombination:function(r){for(var n=this,t=function(r,n){for(var t=r,e=[];n.length>0;){for(var o=0;of;f++)e[f]=r[f].length,i*=e[f],o[f]=0;for(var f=0;i>f;f++)a[f]=[];for(var h=0;;){for(var f=0;t>f;f++)a[h][f]=o[f]+1,u[f]=r[f][a[h][f]-1];if(n.arrayIsNoRepeat(u))return!0;h++;for(var f=t-1;f>=0&&o[f]==e[f]-1;f--)o[f]=0;if(0>f)break;o[f]++}return!1},generateRandom:function(r,n,t){if(t>n-r)return[];for(var e=[],o=0;t>o;){var a=Math.round(Math.random()*(n-1)+r);-1===$.inArray(a,e)&&(e.push(a),o++)}return e},numberKeyOnly:function(r){var n=r.which,t=!1;return r.shiftKey&&(9==n&&(t=!0),t=!1),(57>=n&&n>=48||37==n||39==n||8==n||9==n||46==n||105>=n&&n>=96||229==n)&&(t=!0),t}}});var Observe=Observe||{};!function(n,t,e){"use strict";var r="function"==typeof define,o="undefined"!=typeof module&&module.exports;r?define(t):o?module.exports=t():e[n]=t()}("observe",function(){var n=[],t=[],e=function(n){function t(){e(),a=n}function e(){o(c.generic,function(t){t(n,a)})}function r(n,t){o(c.create,function(e){e(n,t)})}function i(n,t,e){o(c.update,function(t){t(n,old_item,e)})}function u(n,t){o(c["delete"],function(e){e(n,t)})}function f(){var e=a.length,o=n.length;if(e!==o||$.json.encode(a)!==$.json.encode(n))for(var f=Math.max(o,e),c=f;c>=0;c--){var p=a[c],s=n[c];c>e-1?r(s,c):c>o-1?u(p,c):s!==p&&i(s,p,c)}t()}var a=[],c={generic:[],create:[],update:[],"delete":[]};return n.pop=function(){f();var n=Array.prototype.pop.call(this,arguments),e=this.length;return u(n,e),t(),n},n.push=function(){f();var n=arguments[0],e=Array.prototype.push.apply(this,arguments);return r(n,e-1),t(),e},n.splice=function(n){f();for(var e=Array.prototype.slice.call(arguments,2),i=Array.prototype.splice.apply(this,arguments),a=i.length-1;a>=0;a--)u(i[a],n+a);return o(e,function(t,e){r(t,n+e)}),t(),i},{bind:function(n,t){if("undefined"==typeof c[n])throw"type is not allow";c[n].push(t)},unbind:function(){}}},r=function(n,t){return Object.prototype.toString.call(n)==="[object "+t+"]"},o=function(n,t){for(var e,r=0,o=n.length;o>r&&(e=t.call(n[r],n[r],r),e!==!1);r++);},i=function(n,t){var e=0;if(Array.prototype.indexOf)return n.indexOf(t);for(;ei;i++)e[i].scale_home.toString().length>5&&(e[i].scale_home=e[i].scale_home.toPrecision(4)),e[i].scale_away.toString().length>5&&(e[i].scale_away=e[i].scale_away.toPrecision(4)),e[i].scale_equal.toString().length>5&&(e[i].scale_equal=e[i].scale_equal.toPrecision(4));return e},_formatTime:function(t){if(0>t)return"00:00:00";var e=new Date(1e3*t),i=function(t){return 10>t?"0"+t:t},n=i(Math.floor(t/3600))+":"+i(e.getUTCMinutes())+":"+i(e.getUTCSeconds());return n},_bindEvents:function(){var t=this;t._container.on("keydown",".j_quick_ipt",function(e){return t._lotteryHelper.numberKeyOnly(e)}).on("change",".j_quick_ipt",function(){var t=$(this).val();t||$(this).val(1)}).on("keyup",".j_quick_ipt",function(){var t=$(this).val();t&&(t=t.replace(/\D/g,"")),0===parseInt(t,10)&&(t=1),$(this).val(t)}),Observe.observe(t._selected,"create",function(e){var i=t._container.find(".lottery_icon_btn_"+e),n=t._container.find(".j_quick_tz");i.addClass("select"),t._bubble&&t._bubble.hideBubble(),t._setBtnTips(),n.toggleClass("disable",0===t._selected.length)}),Observe.observe(t._selected,"delete",function(e){var i=t._container.find(".lottery_icon_btn_"+e),n=t._container.find(".j_quick_tz");i.removeClass("select"),t._setBtnTips(),n.toggleClass("disable",0===t._selected.length)}),t._container.on("click",".j_lottery_select",function(){var e=$(this).data("rel");$(this).hasClass("select")?t._selected.splice($.inArray(e,t._selected),1):t._selected.push(e)}),t._container.on("click",".j_quick_tz",function(){return $(this).hasClass("disable")?(t._bubble||(t._bubble=t._showBubble({content:"至少选择一种比赛结果",wrap:t._container.find(".j_lottery_bubble")})),void t._bubble.showBubble()):void window.open(t._buildUrl())}),t._container.on("click",".j_quick_refresh",function(){t._index++,t._selected.length=0,t._index===t._singleLottery.length&&(t._index=0);var e=t._singleLottery[t._index];e.format_lotttery_end=t._formatTime(e.lottery_end_time-Math.floor((new Date).getTime()/1e3));var i=$.tb.format(t._tpl1,e),n=$.tb.format(t._tpl2,e);t._container.find(".j_quick_rpl1").replaceWith(i),t._container.find(".j_quick_rpl2").replaceWith(n),t._selected.push(3);var o=t._container.find(".j_bottom_tip");o.length&&o.remove(),clearInterval(t._t),t._t=t._countTime()})},_setBtnTips:function(){var t=this._singleLottery[this._index],e=this._container.find(".j_quick_tz"),i=e.children("span");1===this._selected.length?(3==this._selected[0]&&i.text("支持"+t.home+" 立即投注"),1==this._selected[0]&&i.text("眼光不错 立即投注"),0==this._selected[0]&&i.text("支持"+t.away+" 立即投注")):i.text("眼光不错 立即投注")},_tpl1:['"].join(""),_tpl2:['
    ','
    主胜#{scale_home}
    ','
    平局#{scale_equal}
    ','
    客胜#{scale_away}
    ',"
    "].join(""),_buildUrl:function(){var t=this,e="http://tieba.lecai.com/user/cooperator/baidu/bet_confirm.php?lottery_type=85",i="8501:8502%",n=parseInt($(".j_quick_ipt").val(),10);return i+=t._singleLottery[t._index].match_num+"("+t._selected.join(";")+")",e+"&content="+encodeURIComponent(i)+"&multiple="+n},_countTime:function(){var t=this,e=t._container.find(".j_lottery_deadline"),i=parseInt(e.data("end"))-Math.floor((new Date).getTime()/1e3),n=function(t){return 10>t?"0"+t:t},o=setInterval(function(){var _,l;return 0>=i?(t._container.find(".j_quick_tz").addClass("disable"),$(t._bottomTip("本场比赛投注已截止")).insertAfter(t._container.find(".j_quick_options")),t._singleLottery[t._index].isEnd=!0,void clearInterval(o)):(i-=1,_=new Date(1e3*i),l=n(Math.floor(i/3600))+":"+n(_.getUTCMinutes())+":"+n(_.getUTCSeconds()),void e.text(l))},1e3);return o},_bottomTip:function(t){var e='
    '+t+"
    ";return e},_showBubble:function(t){var e={content:'
    '+t.content+"
    ",arrow_dir:"down",bubble_css:{top:-20,right:10,width:t.width||150},arrow_pos:{right:0},attr:" id='tb_message_tip_n' ",wrap:t.wrap,closeBtn:!1,level:1,arrowReq:!0},i=new UiBubbleTipBase(e);return i},_stats:function(t){var e=this;e._container.on("click",function(i){var n=i.target||i.srcElement,o=$(n).data("log");o&&($.stats.sendRequest("fr=tb0_forum&st_page="+e._page+"&st_mod=lottery_footer_new&st_fid="+t.forum.id+"&first_class="+encodeURIComponent(t.forum.first_class)+"&second_class="+encodeURIComponent(t.forum.second_class)+"&enfirst_class="+t.forum.first_class+"&ensecond_class="+t.forum.second_class+"&st_type="+o),$.stats.track(o,"新版足彩样式",e._page,"click"))})}}});_.Module.define({path:"comforum/widget/SsqLottery",requires:["comforum/widget/LotteryHelper"],sub:{_container:null,_red:[],_blue:[],_lotteryHelper:null,_redTpl:'
  • #{red}
  • ',_blueTpl:'
  • #{blue}
  • ',initial:function(t,e,n){this._container=$("#ssq_lottery"),this._red=t,this._blue=e,this._lotteryHelper=this.use("comforum/widget/LotteryHelper"),this._countTime(n),this._bindEvent(),this._stats()},_countTime:function(t){var e=this,n=e._container.find(".j_count_time"),r=function(t){return 10>t?"0"+t:t},i=setInterval(function(){if(t--,0>=t)clearInterval(i),n.text("00:00:00");else{var e=new Date(1e3*t),o=r(Math.floor(t/3600)),l=r(e.getUTCMinutes()),s=r(e.getUTCSeconds());n.text(o+":"+l+":"+s)}},1e3)},_bindEvent:function(){var t=this,e=function(t){return 10>t?"0"+t:t};t._container.on("click",".j_ssq_go",function(){for(var n="http://tieba.lecai.com/user/cooperator/baidu/bet_confirm.php?lottery_type=50",r="5001%",i=0,o=t._red.length;o>i;i++)r+=e(t._red[i])+",";r=r.slice(0,-1),r+="|"+t._blue,n+="&content="+encodeURIComponent(r)+"&mutiple=1",window.open(n)}),t._container.on("click",".j_ssq_refresh",function(){var e=t._lotteryHelper.generateRandom(1,33,6),n=t._lotteryHelper.generateRandom(1,16,1),r="",i=function(t){return 10>t?"0"+t:t};e.sort(function(t,e){return t-e}),t._red=e,t._blue=n;for(var o=0,l=e.length;l>o;o++)r+=$.tb.format(t._redTpl,{red:i(e[o])});r+=$.tb.format(t._blueTpl,{blue:i(n[0])}),t._container.find(".j_ssq_lists").html(r)})},_stats:function(){this._container.on("click",function(t){var e=t.target||t.srcElement,n=$(e).data("log");n&&$.stats.track(n,"双色球","frs","click")})}}});_.Module.define({path:"comforum/widget/LotteryWrapper",requires:[],sub:{initial:function(t){var i=1==t.type?"lot_football":"lot_ssq";this.lotHead=$(".lot_wrap_head"),this.lotBody=$(".lot_wrap_body"),this.bindEvents(),this.lotHead.find("span."+i).trigger("click")},bindEvents:function(){var t=this;this.lotHead.on("click","span",function(){t.selBlock($(this))})},selBlock:function(t){if(!t.hasClass("sel")){var i=t.data("lot");this.lotHead.find("span").removeClass("sel"),t.addClass("sel"),this.lotBody.children("div").hide().end().children("."+i).show()}}}});_.Module.define({path:"frs/widget/TimeUnit",sub:{_messages:["成功~","点太快啦,休息下再来","出状况啦,请刷新!"],$time_wrap:$("#time_unit"),taskId:0,finishTime:0,initial:function(e,t){try{var i=this;i.taskId=e,i.$time_wrap.delegate(".j_join","click",function(){try{return i.light(),!1}catch(e){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:e.message||e.description,path:"frs:widget/time_unit/time_unit.js",method:"",ln:21}),e}}),i.finishTime=1e3*t,i._initCountdown(i.finishTime)}catch(n){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:n.message||n.description,path:"frs:widget/time_unit/time_unit.js",method:"",ln:24}),n}},_initCountdown:function(e){if(e&&e>0){var t=new Date,i=e-t.getTime(),n=this;if(i>0){setInterval(function(){t=new Date,i=e-t.getTime(),0>=i?n._countdownJump(0):n._countdownJump(i)},1e3)}else n._countdownJump(0)}},_countdownJump:function(e){var t=this,i=String(Math.floor(e/1e3/60/60/24));t._renderNum(i,"#j_day_wrap");var n=String(Math.floor(e%864e5/1e3/60/60));t._renderNum(n,"#j_hour_wrap");var o=String(Math.floor(e%36e5/1e3/60));t._renderNum(o,"#j_minute_wrap");var s=String(Math.floor(e%6e4/1e3));t._renderNum(s,"#j_second_wrap")},_renderNum:function(e,t){var i=[215,191,167,143,119,96,72,48,24,0],n=e.length,o=0;n>=2&&(o=Number(e.substr(n-2,n-1)));var s=Number(e.substr(n-1,n));$(t).find(".j_letter1").css("background-position",-i[o]+"px 0px"),$(t).find(".j_letter2").css("background-position",-i[s]+"px 0px")},light:function(){var e=this,t="/timeunit/join",i={taskid:e.taskId,source:1,t:Math.round(10*Math.random())};$.get(t,i,function(t){t?0==t.errno?e._playMotion(100,55):1==t.errno?e._showMessage(e._messages[1]):e._showMessage(e._messages[2]):e._showMessage("出状况啦,请刷新!")},"json")},_playMotion:function(e,t){var i=0,n=$("#j_add_effect");n.css("z-index",$.getzIndex());var o=function(){i++;var s=0;s=50>i?5*Math.sin(i/50*2*Math.PI):i-50,n.css({top:t-i+"px",left:e+s+"px",width:28,height:23,opacity:1-i/100}),90>i?(n.show(),setTimeout(o,20)):n.hide()};o()},_showMessage:function(e){if(e){var t=new $.dialog({title:e,draggable:!0,closeable:!0,show:!1});t.show()}}}});_.Module.define({path:"frs/widget/ticket_aside",sub:{_options:{pageFrom:""},initial:function(t){try{$.extend(this._options,t),this._tongji()}catch(i){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:i.message||i.description,path:"frs:widget/ticket_aside/ticket_aside.js",method:"",ln:10}),i}},_tongji:function(){var t=this,i=$(".j_piao_card_buy_btn");if(i.size()>0){var e="frs_右侧入口",s=t._options.pageFrom;"pb"==s&&(e="pb_右侧入口"),$.stats.track(e,"明星票务二期",s,"展现"),i.bind("click",function(){try{$.stats.track(e,"明星票务二期",s,"点击")}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/ticket_aside/ticket_aside.js",method:"",ln:23}),t}})}}}});_.Module.define({path:"ucenter/widget/tbSpam",requires:[],sub:{initial:function(){$("body").append($("#tb_spam_notice_html").html())}}});_.Module.define({path:"fanclub/widget/fan_aside",sub:{_forum_id:"",_is_login:"",initial:function(t){t=t||{},this._is_login=t.user||0,this._forum_id=t.forum_id||0,this._BindEvent()},_BindEvent:function(){var t=this;this._scroll(),$(".j_join_btn").click(function(){0==t._is_login?TbCom.process("User","buildLoginFrame"):($.stats.sendRequest("fr=tb0_forum&st_type=fanclub&st_value=right_join_btn"),$.tb.location.setHref("/frsstar/browse/fanclub?page=fanjoin&forum_id="+t._forum_id+"#pay"))}),$(".fancharge_btn").click(function(){$.stats.sendRequest("fr=tb0_forum&st_type=fanclub&st_value=charge_btn")})},_scroll:function(){var t=$(".fan_join_list"),n=t.find("li"),i=n.clone(),s=parseInt(n.first().css("height"))+5,e=parseInt(t.css("height"))+s;t.append(i);{var _=0;setInterval(function(){if(0>=_+e){var a=n;n=i,i=a,i.remove(),t.append(i),_=0,t.css({top:_})}t.animate({top:_}),_-=s},3e3)}}}});_.Module.define({path:"frs/widget/PlatformAsideIknow",sub:{initial:function(){try{this.bindTracks(),this.bindEvents()}catch(o){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:o.message||o.description,path:"frs:widget/platform_aside_iknow/platform_aside_iknow.js",method:"",ln:7}),o}},bindTracks:function(){$(".platform_aside_iknow").on("click",".platform_iknow_search_btn",function(o){try{$.stats.track("ModuleSearchBtnClcik","coopwithiknow")}catch(o){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:o.message||o.description,path:"frs:widget/platform_aside_iknow/platform_aside_iknow.js",method:"",ln:11}),o}}).on("click",".platform_iknow_question",function(o){try{$.stats.track("ModuleQuestionClick","coopwithiknow")}catch(o){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:o.message||o.description,path:"frs:widget/platform_aside_iknow/platform_aside_iknow.js",method:"",ln:13}),o}}).on("click",".platform_iknow_askofficial",function(o){try{$.stats.track("ModuleAskBtnClick","coopwithiknow")}catch(o){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:o.message||o.description,path:"frs:widget/platform_aside_iknow/platform_aside_iknow.js",method:"",ln:15}),o}}).on("click",".platform_inkow_seemore",function(o){try{$.stats.track("ModuleMoreBtnClcik","coopwithiknow")}catch(o){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:o.message||o.description,path:"frs:widget/platform_aside_iknow/platform_aside_iknow.js",method:"",ln:17}),o}})},bindEvents:function(){1!=$.cookie("piabc")&&$("#j_pibubble").on("click",".j_piclose",function(o){try{o&&o.preventDefault(),$.cookie("piabc",1,{expires:365,domian:"/"}),$("#j_pibubble").remove()}catch(o){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:o.message||o.description,path:"frs:widget/platform_aside_iknow/platform_aside_iknow.js",method:"",ln:27}),o}}).show()}}});_.Module.define({path:"frs/widget/PlatformAsideSwitch",sub:{_positions:null,_tpl:["
    ","
    "].join(""),initial:function(t){try{this._positions=t.positions,this.is_star_official=t.is_star_official,$("#aside").on("click",".j_aside_switch_op",$.proxy(this.showDialog,this))}catch(i){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:i.message||i.description,path:"frs:widget/platform_aside_switch/platform_aside_switch.js",method:"",ln:14}),i}},showDialog:function(t){var i=this;t&&t.preventDefault();{var s=baidu.template("platform_aside_switch_tpl",{list:i._positions}),o=$(s);new $.dialog({html:o,title:"模块顺序调整",draggable:!0,width:418})}o.on("click",".j_paside_switch_down",i.turnDown).on("click",".j_paside_switch_up",i.turnUp).on("click",".j_paside_switch_submit",{is_star_official:i.is_star_official},i.submit)},turnDown:function(){var t=$(this).closest("tr"),i=t.find(".j_paside_switch_mod"),s=i.html(),o=t.next().find(".j_paside_switch_mod");i.html(o.html()),o.html(s)},turnUp:function(){var t=$(this).closest("tr"),i=t.find(".j_paside_switch_mod"),s=i.html(),o=t.prev().find(".j_paside_switch_mod");i.html(o.html()),o.html(s)},submit:function(t){if(t&&t.preventDefault(),t.data.is_star_official){var i=$(this).closest("tbody").find(".j_paside_switch_mod"),s={forum_id:PageData.forum.forum_id,tbs:PageData.tbs},o=[];i.each(function(){o.push($(this).find("span").tbattr("mod_id"))}),s.msort=o.join(","),$.tb.post("/official/commit/setOrder?ie=utf-8",s,function(t){0==t.no?($.dialog.close(),$.tb.location.reload()):$tip.html("调整失败,请重试")},"json")}else{var i=$(this).closest("tbody").find(".j_paside_switch_mod"),s={forum_id:PageData.forum.forum_id,tbs:PageData.tbs},o=[];i.each(function(){o.push($(this).find("span").tbattr("mod_id"))}),s.msort=o.join(","),$.tb.post("/gcf/msort?ie=utf-8",s,function(t){0==t.no?($.dialog.close(),$.tb.location.reload()):$tip.html("调整失败,请重试")},"json")}}}});_.Module.define({path:"frs/widget/Relations/Editor",sub:{initial:function(t){try{this.maxLength=t.maxLength,this.itemLength=0,this.data=t.data,this.listTPL=t.listTPL,this.dialog=new $.dialog({html:t.dialogHtml,holderClassName:" starEditor ",title:t.title,draggable:!0,width:420,minHeight:125,hideOnclose:!0,show:!1}),this.formArea=this.dialog.element.find("#formArea"),this.content=this.dialog.element.find("#content"),this.submit=t.submit,this.remove=t.remove,this.hasChange=!1,this.bindEvt()}catch(e){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:e.message||e.description,path:"frs:widget/relations/editor.js",method:"",ln:28}),e}},show:function(){this.dialog.show()},error:function(t){this.dialog.element.find(".errBox").html(''+t+"")},hide:function(){this.dialog.hide()},newItem:function(t){return t.cls="r"+t.id,$.tb.format(this.listTPL,t)},addItem:function(t){this.itemLength0&&"voting"==e&&(t="给"+a+"位吧主候选人投票"),'['+t+"]"},_getApplyLink:function(a,e,t){if(a)return $('[申请]');var n="";return n=t===!1?'':e?this.team_link+'[申请]':''},_getManagerApplying:function(){var a="";return 0==this._forumData.mgr_num&&(a=this.team_link),a+'申请处理中'},_getCandidateHandleLink:function(a){return''+a+"个吧主申请"},_getAdminTip:function(a){if(a>0){var e=[''];return e.push(''),e.push("

    待处理:

      "),e.push("
    • "+this._getCandidateHandleLink(a)+"
    • "),e.push("
    "),e.push('

    '),e.join("")}return""},showForumTeamList:function(){var a="/f/bawu/admin_group?kw="+this._forumData.name_url+"&fid="+this._forumData.id;$.dialog.open(a,{title:"吧务团队",width:550,height:260,contentType:"iframe"})},setMemberName:function(){var a,e="",t=$("#member_name_link"),n=t.html(),i=this;this._checkBarsName(n)||(n=""),e='
    ',e+='
    注意:会员名称一个月只能修改一次,请慎重修改。
    ',e+='本吧会员名称设置:',e+=' ',e+='
    ',e+='',e+='仅限使用汉字、字母、数字和下划线',e+="
    ",a=new $.dialog({title:"设置",width:400,height:120,html:e}),$("#bars_name_set").click(function(){try{i._submitSetBarsName(this,a,t)}catch(e){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:e.message||e.description,path:"frs:widget/forum_info/forum_info_manager.js",method:"",ln:125}),e}})},_submitSetBarsName:function(a,e,t){var n=$("#bars_name").val()||"",i=this;return n=n.toString(),this._checkBarsName(n)?($.ajax({url:"/f/bawu/commit/update_member_alias",type:"post",dataType:"json",async:!1,data:{kw:PageData.forum.forum_name,mbr_alias:n},success:function(a){a&&(0==a.no&&(t.html(n),setTimeout(function(){e.close()},2e3)),i._showMessage(a.no))}}),void 0):!1},_checkBarsName:function(a){"string"!=typeof a&&(a=a.toString()||a.value);for(var e=0;e8?(this._showMessage("604"),!1):!0},_showMessage:function(a){var e=this,t="",n="",i=$("#bars_message"),r={1:"名称不能为空",2:"吧不存在",3:"您当前未登录",13:"您的IP被封禁,暂不能修改",607:"抱歉,会员名称一个月只能修改一次,目前无法修改。",603:"您输入的内容包含不适宜文字,请重试",604:"长度不能超过4个汉字,请重试",605:"仅限使用汉字、字母、数字和下划线",606:"您没有操作权限",1e3:"发生了未知错误"};r["12"]=e.BanLib.render("forumInfoManager"),0==a?t='操作成功':(n=r[a]||r["1000"],t=''+n+""),i.html(t)},displayApplyInfo:function(a){var e=this,t=["ie=utf-8"];t.push("kw="+this._forumData.name_url),t.push("fid="+this._forumData.id),t.push("is_mgr="+a),t.push("mgr_num="+this._forumData.mgr_num),t.push("t="+(new Date).getTime().toString(32));var n="/managerapply/data/frs?"+t.join("&");$.ajax({type:"GET",url:n,success:function(t){var n=$.json.decode(t);if("undefined"!=typeof n){var i="",r=null;n.is_applying?(i=e._getManagerApplying(),r=$(i)):(0==e._forumData.mgr_num?i=e._getApplyLink(!1,n.is_banned,n.is_key_op):e._forumData.mgr_num<3&&1!=a&&(i=e._getApplyLink(!0,!1,!0)),r=$(i),0==n.is_key_op&&0==e._forumData.mgr_num?r.bind("click",function(){try{return e.verify("/managerapply/preSubmitIntern")}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_info/forum_info_manager.js",method:"",ln:242}),a}}):r.bind("click",function(){try{return e.verify("/managerapply/preSubmit")}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_info/forum_info_manager.js",method:"",ln:246}),a}})),""!==i&&$("#tbManagerApply").append(r).parent().show(),n.candidates_num>0&&$("#tbManagerCandidatesNum").html(e._getCandidatesLink(n.candidates_num,n.state)).css("display","block"),n.assist_candidates_num>0&&$("#assistCandidatesNum").html('[查看'+n.assist_candidates_num+"位小吧主候选人]").css("display","block"),1==a&&$("#tbAdminTip").html(e._getAdminTip(n.unhandled_manager_num)).css("display","block")}}})},verify:function(a){var e=this,t=a+"?forum_id="+PageData.forum.id+"&kw="+PageData.forum.name_url+"&t="+(new Date).getTime().toString(32),n={170001:"未满足吧主申请条件。",170002:"抱歉,申请本吧吧主吧内会员等级不得低于3级。",170003:"抱歉,您还未关注本吧。",170004:"抱歉,该吧暂时不接受吧主申请。",170005:"抱歉,该吧三个吧主职位已满。",170006:"抱歉,该吧三个吧主职位已满或该吧已有实习吧主。",170007:"抱歉,您已担任三个吧的吧主职位,不能再次申请。",170008:"抱歉,该条申请信息已处理完毕,无需重复提交处理。",170009:"抱歉,该吧暂无符合条件的申请信息。",170010:"抱歉,该条申请信息已处理完毕,无需重复提交处理。",170011:"抱歉,您的申请信息已于今天被受理,24小时内不可再次申请。",170012:"抱歉,您已提交的申请信息正在审核中,不能重复提交申请,请您耐心等待。",170013:"抱歉,您已是该吧吧主,不可重复申请。",170014:"抱歉,自该吧辞职吧主权限一个月内不可再次申请该吧吧主。",170015:"抱歉,您于近期被撤销该吧吧主权限,60天内不可再次申请。",170016:"抱歉,该吧已有吧主,暂不接受实习吧主申请。",170017:"抱歉,该吧暂不接受实习吧主申请。",170018:"抱歉,该吧暂不接受实习吧主申请。",170019:"抱歉,该吧暂不接受实习吧主申请。",170020:"抱歉,您的ip与当前吧主相同或近似,请您更换ip后重新申请。请不要用多个帐号担任同一个吧的吧主职位。",170021:"抱歉,该吧吧主为实习吧主,暂不接受吧主申请。请您于实习吧主转正或者该吧无吧主时再次申请。",250114:"抱歉,您没有操作权限。",220012:e.BanLib.render("forumManagerApply"),110000:"抱歉,您还未登录贴吧,请您登录后重新操作。",110003:"调用失败",210009:"参数错误",210011:"校验失败"};return $.ajax({type:"GET",url:t,async:!1,success:function(t){var i=$.json.decode(t);if("undefined"==typeof i)return!1;var r={not_member:124,is_voting:94,not_meet_limit:134,banned_forum:94,meet_max_apply:94,meet_max_manager:94,is_prisoner:94,fired_manager:94,banned_user:134,is_manager:94,manager_is_full:94,is_applying:94};if(e.has_right=0===i.errno?!0:!1,i.errno)if("not_login"==i.invalid_type)TbCom.process("User","buildLoginFrame");else if("no_username"==i.invalid_type)TbCom.process("User","buildUnameFrame");else{var s="";i.invalid_type in r&&(s=r[i.invalid_type]);var o=n[i.errno];o&&""!=o||(o="未知错误"),170001===i.errno&&"/managerapply/preSubmit"===a?o="抱歉,申请本吧吧主需达到如下条件:
    发言数不得少于"+(i.data.user_post_num||0)+"贴,成为会员天数不得少于"+(i.data.member_days||0)+"天。
    当前发贴数:"+(i.data.cur_user_post_num||0)+",已经成为会员天数:"+(i.data.cur_member_days||0)+"。":170001===i.errno&&"/managerapply/preSubmitIntern"===a&&(o="抱歉,申请本吧实习吧主需达到如下条件:发言数不得少于10贴。");var m='

    '+o+'

    ';m=m.replace(/#memIndexLink#/gi,document.getElementById("member_name_link").href),m=m.replace(/#memBALVINFOLink#/gi,"/f/like/level?kw="+PageData.forum.name_url),e._tip_dialog=$.dialog.open(m,{title:"吧主申请",width:470,height:s}),$("#forum_info_dialog_close").bind("click",function(){try{e._tip_dialog.close()}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_info/forum_info_manager.js",method:"",ln:353}),a}})}}}),e.has_right}}});!function(){function t(t,e,n){function i(){}i.prototype=e.prototype;var o=new i;o.constructor=t,t.superclass=e;for(var s in n)o[s]=n[s];t.prototype=o}function e(){this._events={}}function n(t){n.superclass.call(this),this.timer=null,this.container=t,this.holder=document.createElement("div"),this.holder.className="tb-editor-overlay",this.holder.style.display="none";var e=this;s.addEvent(this.holder,"mouseover",function(){e.mouseover()}),s.addEvent(this.holder,"mouseout",function(){e.mouseout()}),this.content=document.createElement("div"),this.content.className="overlay-content",this.arrow=document.createElement("span"),this.arrow.className="arrow",this.holder.appendChild(this.arrow),this.holder.appendChild(this.content),this.container.appendChild(this.holder)}function i(t){i.superclass.call(this),this.container=t,this.holder=document.createElement("div"),this.holder.className="tb-editor-overlay",this.holder.style.display="none",this.closeBtn=document.createElement("span"),this.closeBtn.className="close";var e=this;s.addEvent(this.closeBtn,"click",function(){e.close()}),this.content=document.createElement("div"),this.content.className="overlay-content",this.arrow=document.createElement("span"),this.arrow.className="arrow",this.holder.appendChild(this.closeBtn),this.holder.appendChild(this.arrow),this.holder.appendChild(this.content),this.container.appendChild(this.holder)}function o(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=void 0!==t[n]?t[n]:e[n])}window.TED=window.TED||{},window.TED.extend=t,window.TED.EventDispatcher=e,e.prototype={on:function(t,e,n,i){n=n||this,this._events[t]=this._events[t]||[],this._events[t].push({listener:e,scope:n,args:i})},fireEvent:function(t,e,n){var i,o,s,r=this._events[t];if(!r)return!1;for(o=0,s=r.length;s>o;o++)i=r[o],e=i.scope,n=n||i.args||[],i.listener.apply(e,n)},remove:function(t,e){if(!this._events[t])return!1;var n,i,o=this._events[t];for(n=0,i=o.length;i>n;n++)if(o[n].listener===e){o.splice(n,1);break}0===o.length&&delete this._events[t]}};var s={addEvent:function(t,e,n){var i;i=t.addEventListener?function(t,e,n){t.addEventListener(e,n,!1)}:function(t,e,n){t.attachEvent("on"+e,n)},i(t,e,n),this.addEvent=i},removeEvent:function(t,e,n){var i;i=t.addEventListener?function(t,e){t.removeEventListener(e,linstener,!1)}:function(t,e,n){t.detachEvent("on"+e,n)},i(t,e,n),this.addEvent=i}};window.TED.Event=s,window.TED.HoverOverlay=n,t(n,e,{container:null,holder:null,content:null,currentOpen:null,isOpen:!1,closefunction:null,open:function(t,e,n,i,o,s,r){this.isOpen=!0,this.currentOpen=r,this.arrow.style.left=o;var a=this.holder.style;a.left=t,a.top=e,a.width=n,a.height=i,a.display="block",this.content.innerHTML=''},close:function(){this.isOpen=!1,this.content.innerHTML="",this.holder.style.display="none",this.currentOpen&&(this.currentOpen.className=this.currentOpen.className.replace(" open",""),this.currentOpen=null),this.fireEvent("close")},mouseover:function(){this.closefunction=this.close,this.close=function(){},null!=this.timer&&clearTimeout(this.timer)},mouseout:function(){var t=this;t.close=t.closefunction,t.timer=setTimeout(function(){t.close()},500)}}),window.TED.Overlay=i,t(i,e,{closeButton:null,container:null,holder:null,content:null,currentOpen:null,isOpen:!1,open:function(t,e,n,i,o,s){if(1==this.isOpen&&TED.Editor&&TED.Editor.Status.isPicassoOpen===!0){var r=this,a=$.dialog.confirm('
    您正在编辑涂鸦,现在退出将不会保存,您确定要退出?
    ',{title:"涂鸦编辑器",acceptValue:"确定",cancelValue:"取消"});a.width(420),a.height(90),a.bind("onaccept",function(){TED.Editor.Status.isPicassoOpen=!1,r.picassoPanel&&(r.picassoPanel.destroy(),r.picassoPanel=null),r.isOpen=!0,r.arrow.style.left=o;var a=r.holder.style;a.left=t,a.top=e,a.width=n,a.height=i,a.display="block",r.content.innerHTML=''})}else{this.isOpen=!0,this.arrow.style.left=o;var l=this.holder.style;l.left=t,l.top=e,l.width=n,l.height=i,l.display="block",this.content.innerHTML=''}this.fireEvent("open")},close:function(t){if(TED.Editor&&TED.Editor.Status.isPicassoOpen===!0&&t!==!0){var e=this,n=$.dialog.confirm('
    您正在编辑涂鸦,现在退出将不会保存,您确定要退出?
    ',{title:"涂鸦编辑器",acceptValue:"确定",cancelValue:"取消"});n.width(420),n.height(90),n.bind("onaccept",function(){TED.Editor.Status.isPicassoOpen=!1,e.picassoPanel&&(e.picassoPanel.destroy(),e.picassoPanel=null),e.isOpen=!1,e.content.innerHTML="",e.holder.style.display="none",e.currentOpen&&(e.currentOpen.className=e.currentOpen.className.replace(" open",""),e.currentOpen=null),e.fireEvent("close")})}else 1==t&&TED.Editor&&(TED.Editor.Status.isPicassoOpen=!1),this.isOpen=!1,this.content.innerHTML="",this.holder.style.display="none",this.currentOpen&&(this.currentOpen.className=this.currentOpen.className.replace(" open",""),this.currentOpen=null),this.fireEvent("close")},toggle:function(t,e,n,i,o,s,r){this.currentOpen&&this.currentOpen===r?this.close():(r.className=r.className+" open",this.currentOpen=r,this.open(t,e,n,i,o,s))}}),window.TED.augmentObject=o;var r={get:function(t,e,n){var i=this.getXHR();i.open("GET",t,!0),i.setRequestHeader("cache",!1),i.onreadystatechange=function(){4===i.readyState&&(200==i.status?"function"==typeof e&&e(i.responseText):"function"==typeof n&&n(i.statusText),i=null)},i.send(null)},getXHR:function(){if(window.XMLHttpRequest)return function(){return new window.XMLHttpRequest};if(window.ActiveXObject)return function(){return new window.ActiveXObject("Microsoft.XMLHTTP")};throw"您的浏览器不支持AJAX!"}()};window.TED.SimpleAjax=r;var a=function(){function t(t){return t.replace(/[_\s]/g,function(t){return"_"==t?"__":"_s"})}function e(){return document.getElementById(r+"-storage")}function n(t){return"[object Date]"==={}.toString.call(t)&&"Invalid Date"!==t.toString()&&!isNaN(t)}function i(){var t;return window.localStorage?t=s():window.ActiveXObject&&(t=o()),t}function o(){var i=document.createElement("div");return i.style.display="none",i.id=r+"-storage",document.body.appendChild(i),e().addBehavior("#default#userData"),{set:function(i,o,s){var r=e(),a=t(i),l=s&&s.expires?s.expires:(new Date).getTime()+31536e6;n(l)&&(l=l.getTime()),r.expires=new Date(l).toUTCString();try{r.setAttribute(a,o),r.save(a)}catch(c){throw"baidu.data.storage.set error! Maybe space overflow."}r=null},get:function(n){var i=e(),o=t(n),s=null;try{return i.load(o),s=i.getAttribute(o)}catch(r){throw r.message}},del:function(n){var i,o=e(),s=t(n);try{return o.load(s),i=o.getAttribute(s),i?(o.removeAttribute(s),o.expires=new Date(315532799e3).toUTCString(),o.save(s),!0):!1}catch(r){return!1}}}}function s(){return{set:function(e,i,o){var s=window.localStorage,r=t(e),a=o&&o.expires?o.expires:0;n(a)&&(a=a.getTime());try{s.setItem(r,a+"|"+i)}catch(l){throw"baidu.data.storage.set error! Maybe space overflow."}},get:function(e){var n,i,o=window.localStorage,s=t(e),r=null;try{r=o.getItem(s)}catch(a){return null}return r?(n=r.indexOf("|"),i=parseInt(r.substring(0,n),10),new Date(i).getTime()>(new Date).getTime()||0==i?r=r.substring(n+1,r.length):(r=null,this.del(e),null)):null},del:function(e){var n=window.localStorage,i=t(e),o=null;try{o=n.getItem(i)}catch(s){return!1}return o?(o=o.substring(o.indexOf("|")+1,o.length),o&&n.removeItem(i),!0):!1}}}var r="tieba";return{set:function(){var t=this;!t._storage&&(t._storage=i()),t._storage.set.apply(t._storage,arguments)},get:function(){var t=this;return!t._storage&&(t._storage=i()),t._storage.get.apply(t._storage,arguments)},remove:function(){var t=this;return!t._storage&&(t._storage=i()),t._storage.del.apply(t._storage,arguments)},isSupport:function(){return!(!window.localStorage&&!window.ActiveXObject)}}}();window.TED.Storage=a}(); ;!function(){function Refer(e){e=e||{},augmentObject(e,this.constructor.defaultConfig),this.config=e}function Box(e){Box.superclass.call(this),this.container=e,this.holder=document.createElement("div"),this.holder.innerHTML='想用@提到谁?',this.holder.className="box-holder",this.holder.style.display="none",this.ul=document.createElement("ul"),this.ul.className="box-ul-empty",this.holder.appendChild(this.ul),e.appendChild(this.holder),this.initEvents()}function Data(e,t){Data.superclass.call(this),this.url=e,this.uid=t}var extend=TED.extend,EventDispatcher=TED.EventDispatcher,Event=TED.Event,Overlay=TED.Overlay,augmentObject=TED.augmentObject,Ajax=TED.SimpleAjax,Storage=TED.Storage;window.TED.EditorPlugins=window.TED.EditorPlugins||{},window.TED.EditorPlugins.Refer=Refer,Refer.defaultConfig={checkDelay:100,offsetLeft:1,offsetTop:18,dataUrl:"/at-sug",uid:null},Refer.prototype={constructor:Refer,disabled:!1,boxWrapper:null,init:function(e){e.on("keydown",this.onEditorKeydown,this),e.on("keyup",this.onEditorKeyup,this),e.on("click",this.onEditorClick,this),e.on("blur",function(){this.hide()},this),this.box=new Box(e.editAreaWrapper),this.box.on("select",this.onSelect,this),this.data=new Data(this.config.dataUrl,this.config.uid),this.data.on("datachange",this.box.update,this.box),this.editor=e},destroy:function(){},enable:function(){this.disabled=!1},disable:function(){this.disabled=!0},query:function(e){this.data.getData(e)},onSelect:function(e){var t=this.editor.getSelectedElement();null!==e&&(t.innerHTML="@"+e),this.breakMode(32)},onEditorKeydown:function(e){if(!this.disabled&&this.box.isShow){switch(e.keyCode){case 38:this.box.pre();break;case 40:this.box.next();break;case 13:this.onSelect(this.box.getValue()),this.box.hide();break;default:return}e.preventDefault?e.preventDefault():e.returnValue=!1,e.exitFunction=!0}},onEditorKeyup:function(e){if(!this.disabled){var t=e.keyCode;(50===t&&e.shiftKey||50===t&&16===this.lastUpCode)&&this.checkEnterMode();var i=this;clearTimeout(this.timer),this.timer=setTimeout(function(){i.checkShowBox()},this.config.checkDelay),this.lastUpCode=e.keyCode}},onEditorClick:function(){var e=this;clearTimeout(this.timer),this.timer=setTimeout(function(){e.checkShowBox()},this.config.checkDelay)},checkEnterMode:function(){var e,t,i=this.editor,n=i.getSelection();if(i.ua.ie?"none"===n.type.toLowerCase():n.isCollapsed){if(e=i.getRange(),i.ua.ie){if(this.editor.isEmpty())return;e.moveStart("character",-1),e.select(),t=e.text}else{var s=e.startContainer,o=e.startOffset;1===s.nodeType&&o>0&&(s=s.childNodes[o-1],o=s.length),3===s.nodeType&&o>0&&(e.setStart(s,o-1),n.removeAllRanges(),n.addRange(e),t=n.toString())}var a=i.getSelectedElement();"@"!==t||"at"===a.className&&"@"===a.innerHTML?i.ua.ie?(e.collapse(!1),e.select()):n.collapseToEnd():i.execCommand("inserthtml",'@')}},checkShowBox:function(){var e,t=this.editor.getSelectedElement(),i=t.innerHTML;"at"===t.className&&"@"===i.charAt(0)?(e=i.substring(1).replace(/$/i,""),-1===e.search(/[^\w\u4E00-\u9FA5]/)?(this.show(t.offsetLeft+this.config.offsetLeft-this.editor.editArea.scrollLeft,t.offsetTop+this.config.offsetTop-this.editor.editArea.scrollTop),this.query(e)):this.hide()):this.hide()},hide:function(){this.box.hide(),this.data.getting=null},show:function(e,t){this.box.show(e,t)},breakMode:function(e){var t,i,n=this.editor,o=n.getSelectedElement();32===e?(t=document.createElement("span"),t.innerHTML=" ",t=t.firstChild):t=document.createTextNode(String.fromCharCode(e)),o.nextSibling?o.parentNode.insertBefore(t,o.nextSibling):o.parentNode.appendChild(t),n.ua.ie?(i=document.selection.createRange(),i.moveEnd("character",1),i.collapse(!1),i.select()):(s=window.getSelection(),i=document.createRange(),i.selectNode(t),s.removeAllRanges(),s.addRange(i),s.collapseToEnd())}},extend(Box,EventDispatcher,{isShow:!1,index:null,length:0,initEvents:function(){var e=this;this.bindClick=function(){e.onClick.apply(e,arguments)},this.bindMousedown=function(){e.onMousedown.apply(e,arguments)},Event.addEvent(this.ul,"click",this.bindClick),Event.addEvent(this.ul,"mousedown",this.bindMousedown)},onMousedown:function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},onClick:function(e){var t=e.target||e.srcElement;"li"===t.tagName.toLowerCase()&&(this.fireEvent("select",null,[t.innerHTML]),this.hide())},update:function(e){this.isShow&&(0===e.length?(this.ul.innerHTML="",this.ul.className="box-ul-empty"):(this.ul.className="",this.ul.innerHTML='
  • '+e.join('
  • ')+"
  • "),this.length=e.length)},pre:function(){0!==this.length&&this.select(null===this.index?this.length-1:0===this.index?this.length-1:this.index-1)},next:function(){0!==this.length&&this.select(null===this.index?0:this.index===this.length-1?0:this.index+1)},select:function(e){null!==this.index&&(this.ul.childNodes[this.index].className=""),this.ul.childNodes[e].className="focus",this.index=e},getValue:function(){return null!==this.index?this.ul.childNodes[this.index].innerHTML:null},show:function(e,t){if(this.isShow){if(e===this.x&&t===this.y)return;this.reset()}else this.holder.style.display="block",this.isShow=!0;this.holder.style.left=e+"px",this.holder.style.top=t+"px",this.x=e,this.y=t},hide:function(){this.isShow&&(this.reset(),this.holder.style.display="none",this.isShow=!1)},reset:function(){this.ul.innerHTML="",this.length=0,this.ul.className="box-ul-empty"}}),extend(Data,EventDispatcher,{dataCache:{},queryCache:{},data:null,getData:function(e){if(this.getting!==e){if(this.getting=e,""===e)return void this.setData([],!0);if(this.dataCache[e])return void this.setData(this.dataCache[e],!0);if(!this.queryCache[e]){this.queryCache[e]=!0;var t=this;Ajax.get(this.url+"?query="+encodeURIComponent(e)+"&uid="+this.uid+"&ie=utf-8",function(i){delete t.queryCache[e],i=t.parseData(i),t.dataCache[e]=i,t.setData(i,e===t.getting)},function(i){delete t.queryCache[e],t.fireEvent("error",[i])})}}},setData:function(e,t){this.data=e,t&&this.fireEvent("datachange",null,[e])},parseData:function(data){try{if(data=eval("("+data+")"),0===data.error)return data.msg;throw new Error("服务器返回错误:"+data.error)}catch(e){throw new Error("服务器返回数据格式有误!")}}})}(); ;!function(){function e(t){e.superclass.call(this),this.init(t||{})}function t(e){t.superclass.call(this),this.area=document.createElement("textarea"),e.is_ipad&&(this.area.className="textarea_ipad"),this.area.style.width=e.width,this.area.style.height=e.height,e.autoEnable===!1&&(this.area.disabled=!0),document.getElementById(e.container).appendChild(this.area),this.init()}var i=TED.extend,n=TED.EventDispatcher,s=TED.EditorPlugins.Refer;e.defaultConfig={height:"200px",width:"400px",maxHeight:null,autoFocus:!0,autoEnable:!0,autoHeight:!1,editAreaClassName:"tb-editor-editarea",editAreaWrapperClassName:"tb-editor-editarea-wrapper",wrapperClassName:"tb-editor-wrapper",disabledEditAreaClassName:"tb-editor-editarea disabled",disabledWrapperClassName:"tb-editor-wrapper disabled",imageClassName:"BDE_Image",smileyClassName:"BDE_Smiley",emptyClassName:"BDE_Empty",musicClassName:"BDE_Music",didaDelay:300,imageWidthLimit:560},e.ResizeImage=function(t){if(t.removeAttribute("onload"),t.removeAttribute("onerror"),t.width>e.defaultConfig.imageWidthLimit){var i=t.width,n=t.height;t.setAttribute("width",e.defaultConfig.imageWidthLimit),t.setAttribute("height",e.defaultConfig.imageWidthLimit*n/i),t.setAttribute("changedsize",!0)}},i(e,n,{config:null,enabled:!1,focused:!1,autoHeighted:!1,wrapper:null,editArea:null,container:null,id:null,editValidHTML:["br","embed"],submitValidHTML:["br","embed"],execCommand:function(e,t){if(!this.enabled)return!1;this.focused||this.focus();var i,n=!0,e=e.toLowerCase();if("function"==typeof this["cmd_"+e]){for(var s=[],a=1;a"),this.editArea.className=this.config.editAreaClassName,this.wrapper.className=this.config.wrapperClassName,this.config.autoFocus&&this.focus(),this.enabled=!0)},disable:function(){this.enabled&&(this.focused&&this.blur(),this.detachEvents(),this.editArea.contentEditable=!1,this.wrapper.className=this.config.disabledWrapperClassName,this.editArea.className=this.config.disabledEditAreaClassName,this.enabled=!1)},focus:function(){this.editArea.focus(),this.ua.webkit&&this.resumeRange()},blur:function(){this.ua.ie||this.saveRange(),this.editArea.blur()},isEmpty:function(){return this.isEmptyContent(this.editArea.innerHTML)},enableAutoHeight:function(e){if(e&&e<=parseInt(this.config.height))return void(this.autoHeighted&&this.disableAutoHeight());if(e=e||this.config.maxHeight,this.ua.ie>0&&this.ua.ie<=6){var t,i=parseInt(this.config.height);t=e?"this.scrollHeight <= "+i+' ? "'+i+'px" : (this.scrollHeight >= '+e+' ? "'+e+'px" : "auto")':"this.scrollHeight <= "+i+' ? "'+i+'px" : "auto"',this.editArea.style.setExpression("height",t)}else this.editArea.style.minHeight=this.config.height,this.editArea.style.height="auto",e&&(this.editArea.style.maxHeight=e+"px");this.autoHeighted=!0},disableAutoHeight:function(){this.ua.ie>0&&this.ua.ie<=6&&this.editArea.style.removeExpression("height"),this.editArea.style.height=this.config.height,this.autoHeighted=!1},empty:function(){this.editArea.innerHTML=""},ua:function(){var e,t=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return 1==t++?"":"."}))},i=navigator,n={ie:0,opera:0,gecko:0,webkit:0,mobile:null,air:0,caja:i.cajaVersion,secure:!1,os:null},s=navigator&&navigator.userAgent,a=window&&window.location,r=a&&a.href;if(n.secure=r&&0===r.toLowerCase().indexOf("https"),s){/windows|win32/i.test(s)?n.os="windows":/macintosh/i.test(s)&&(n.os="macintosh");var o;(o=/Trident\/(\d+)/.exec(s))&&(n.trident=o[1]),/KHTML/.test(s)&&(n.webkit=1),e=s.match(/AppleWebKit\/([^\s]*)/),e&&e[1]&&(n.webkit=t(e[1]),/ Mobile\//.test(s)?n.mobile="Apple":(e=s.match(/NokiaN[^\/]*/),e&&(n.mobile=e[0])),e=s.match(/AdobeAIR\/([^\s]*)/),e&&(n.air=e[0])),n.webkit||(e=s.match(/Opera[\s\/]([^\s]*)/),e&&e[1]?(n.opera=t(e[1]),e=s.match(/Opera Mini[^;]*/),e&&(n.mobile=e[0])):(e=s.match(/MSIE\s([^;]*)/),e&&e[1]?n.ie=t(e[1]):(e=s.match(/Gecko\/([^\s]*)/),e&&(n.gecko=1,e=s.match(/rv:([^\s\)]*)/),e&&e[1]&&(n.gecko=t(e[1]))))))}return n}(),isUCWeb:function(){var e=navigator.userAgent.toString();return e.indexOf("X11;")>-1&&e.indexOf("Linux i686;")>-1&&e.indexOf("Gecko")>-1&&e.indexOf("Firefox")<0&&e.indexOf("Opera")<0?!0:!1},isAndroidOS:function(){var e=navigator.userAgent.toString();return null!=e.match(/android/i)?!0:!1},isEmptyContent:function(e){return e?""===e.replace(/]*>/gi,"").replace(/<\/?(?:span|a)[^>]*>/gi,"").replace(/[\u3000\s]+/g,"").replace(/ /g,""):!0},init:function(e){this.augmentObject(e,this.constructor.defaultConfig||{}),this.config=e,this.constructor.registerInstance&&(this.id=this.constructor.registerInstance(this,e.id)),this.initComponents(e),this.appendToDom(),this.initEvents(),this.initConfig(e)},initComponents:function(e){e.container&&("string"==typeof e.container?this.container=document.getElementById(e.container):"object"==typeof e.container&&1===e.container.nodeType&&(this.container=e.container)),this.container=this.container||document.body,this.editArea=document.createElement("div"),this.editArea.className=e.disabledEditAreaClassName,this.wrapper=document.createElement("div"),this.wrapper.className=e.disabledWrapperClassName,this.editAreaWrapper=document.createElement("div"),this.editAreaWrapper.className=e.editAreaWrapperClassName,this.editArea.style.height=e.height,this.wrapper.style.width=e.width},appendToDom:function(){this.editAreaWrapper.appendChild(this.editArea),this.wrapper.appendChild(this.editAreaWrapper),this.container.appendChild(this.wrapper)},initConfig:function(e){if(e.autoHeight&&this.enableAutoHeight(),e.enableRefer&&this.addPlugin("refer",new s({uid:this.config.uid})),e.autoEnable){var t=this;setTimeout(function(){t.enable(),t.fireEvent("initcomplete")},10)}else this.fireEvent("initcomplete")},initEvents:function(){var e=this;this.bindMousedown=function(){e.onMousedown.apply(e,arguments)},this.bindMouseup=function(){e.onMouseup.apply(e,arguments)},this.bindClick=function(){e.onClick.apply(e,arguments)},this.bindDoubleclick=function(){e.onDoubleclick.apply(e,arguments)},this.bindKeydown=function(){e.onKeydown.apply(e,arguments)},this.bindKeyup=function(){e.onKeyup.apply(e,arguments)},this.bindKeypress=function(){e.onKeypress.apply(e,arguments)},this.bindPaste=function(){e.onPaste.apply(e,arguments)},this.bindBlur=function(){e.onBlur.apply(e,arguments)},this.bindFocus=function(){e.onFocus.apply(e,arguments)}},attachEvents:function(){var e=this.editArea;this.ua.ie?(e.attachEvent("onmousedown",this.bindMousedown),e.attachEvent("onmouseup",this.bindMouseup),e.attachEvent("onclick",this.bindClick),e.attachEvent("ondblclick",this.bindDoubleclick),e.attachEvent("onkeypress",this.bindKeypress),e.attachEvent("onkeyup",this.bindKeyup),e.attachEvent("onkeydown",this.bindKeydown),e.attachEvent("onpaste",this.bindPaste),e.attachEvent("onbeforedeactivate",this.bindBlur),e.attachEvent("onbeforeactivate",this.bindFocus)):(e.addEventListener("mousedown",this.bindMousedown,!1),e.addEventListener("mouseup",this.bindMouseup,!1),e.addEventListener("click",this.bindClick,!1),e.addEventListener("dblclick",this.bindDoubleclick,!1),e.addEventListener("keypress",this.bindKeypress,!1),e.addEventListener("keyup",this.bindKeyup,!1),e.addEventListener("keydown",this.bindKeydown,!1),e.addEventListener("paste",this.bindPaste,!1),e.addEventListener("blur",this.bindBlur,!1),e.addEventListener("focus",this.bindFocus,!1)),this.on("dida",this.onDida,this)},detachEvents:function(){var e=this.editArea;this.ua.ie?(e.detachEvent("onmousedown",this.bindMousedown),e.detachEvent("onmouseup",this.bindMouseup),e.detachEvent("onclick",this.bindClick),e.detachEvent("ondblclick",this.bindDoubleclick),e.detachEvent("onkeypress",this.bindKeypress),e.detachEvent("onkeyup",this.bindKeyup),e.detachEvent("onkeydown",this.bindKeydown),e.detachEvent("onpaste",this.bindPaste),e.detachEvent("onbeforedeactivate",this.bindBlur),e.detachEvent("onbeforeactivate",this.bindFocus)):(e.removeEventListener("mousedown",this.bindMousedown,!1),e.removeEventListener("mouseup",this.bindMouseup,!1),e.removeEventListener("click",this.bindClick,!1),e.removeEventListener("dblclick",this.bindDoubleclick,!1),e.removeEventListener("keypress",this.bindKeypress,!1),e.removeEventListener("keyup",this.bindKeyup,!1),e.removeEventListener("keydown",this.bindKeydown,!1),e.removeEventListener("paste",this.bindPaste,!1),e.removeEventListener("blur",this.bindBlur,!1),e.removeEventListener("focus",this.bindFocus,!1)),this.remove("dida",this.onDida)},onMousedown:function(e){e.target&&"IMG"===e.target.tagName&&e.preventDefault&&e.preventDefault(),this.fireEvent("mousedown",null,[e]),e.exitFunction},onMouseup:function(e){this.fireEvent("mouseup",null,[e]),e.exitFunction||this.ua.ie||this.saveRange()},onClick:function(e){this.fireEvent("click",null,[e]),e.exitFunction},onDoubleclick:function(e){this.fireEvent("doubleclick",null,[e]),e.exitFunction},onKeydown:function(e){if(this.fireEvent("keydown",null,[e]),!e.exitFunction&&8===e.keyCode&&this.ua.ie){var t=this.getRange();t.item&&(t.item(0).outerHTML="",e.returnValue=!1)}},onKeypress:function(e){if(this.fireEvent("keypress",null,[e]),!e.exitFunction){var t=e.keyCode;switch(t){case 13:if(this.ua.ie){var i=this.getRange();i&&(i.pasteHTML("
    "),i.collapse(!1),i.select()),e.returnValue=!1}else this.ua.webkit&&(document.execCommand("insertlinebreak"),e.preventDefault())}}},onKeyup:function(e){this.fireEvent("keyup",null,[e]),e.exitFunction||(this.ua.ie||this.saveRange(),e.stopPropagation&&e.stopPropagation())},onPaste:function(e){if(this.fireEvent("paste",null,[e]),!e.exitFunction)if(this.ua.ie)this.doPasteIE(e),this.fireEvent("afterpaste",null,[e]);else{var t=this;setTimeout(function(){t.doPaste(),t.fireEvent("afterpaste",null,[e])},5)}},didaTimer:null,savedHeight:null,startDida:function(){var e=this;this.didaTimer=setInterval(function(){e.fireEvent("dida")},this.config.didaDelay)},stopDida:function(){clearInterval(this.didaTimer)},onDida:function(){if(this.autoHeighted){if(null===this.savedHeight)return void(this.savedHeight=this.wrapper.scrollHeight);var e=this.wrapper.scrollHeight;this.savedHeight&&e!==this.savedHeight&&(this.fireEvent("heightChanged",null,[e,e-this.savedHeight]),this.savedHeight=e)}},onBlur:function(e){this.stopDida(),this.focused=!1,this.fireEvent("blur",null,[e]),e.exitFunction||this.ua.ie&&this.saveRange()},onFocus:function(e){this.startDida(),this.focused=!0,this.fireEvent("focus",null,[e]),e.exitFunction||this.resumeRange()},augmentObject:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=void 0!==e[i]?e[i]:t[i])},getSelection:function(){return window.getSelection?window.getSelection():document.selection},getRange:function(){return this.ua.ie?document.selection.createRange():window.getSelection().getRangeAt(0)},createRange:function(){return this.ua.ie?document.body.createTextRange():document.createRange()},getSelectedElement:function(){var e=this.getRange();if(this.ua.ie)return e.item?e.item(0):e.parentElement();var t=e.commonAncestorContainer;return 3===t.nodeType&&(t=t.parentNode),t},doPasteIE:function(e){var t=clipboardData.getData("Text");return t&&""!=t?(t=t.replace(/&/g,"&").replace(//g,">").replace(/\r?\n/g,"
    ").replace(/\t/g,"    ").replace(/\s/g," ").replace(/\u3000/g,"  "),this.execCommand("inserthtml",t),void(e.returnValue=!1)):!0},doPaste:function(){this.saveCursor(),this.editArea.innerHTML=this.filteEditHTML(),this.ensureCursor()},filteEditHTML:function(){return html=this.editArea.innerHTML.replace(/_moz_dirty=""/gi,"").replace(/\[/g,"[[-").replace(/\]/g,"-]]").replace(/<\/ ?tr[^>]*>/gi,"[br]").replace(/<\/ ?td[^>]*>/gi,"  ").replace(/<(ul|dl|ol)[^>]*>/gi,"[br]").replace(/<(li|dd)[^>]*>/gi,"[br]").replace(/

    ]*>/gi,"[br]").replace(new RegExp("<(/?(?:"+this.editValidHTML.join("|")+")[^>]*)>","gi"),"[$1]").replace(new RegExp(']*class="?at"?[^>]*)>',"gi"),"[span$1]").replace(new RegExp(']*class="?(?:'+this.config.imageClassName+"|"+this.config.emptyClassName+"|"+this.config.smileyClassName+"|"+this.config.flashClassName+"|"+this.config.musicClassName+'"?[^>]*)>',"gi"),"[img$1]").replace(/<[^>]*>/g,"").replace(/\[\[\-/g,"[").replace(/\-\]\]/g,"]").replace(new RegExp("\\[(/?(?:"+this.editValidHTML.join("|")+"|img|span)[^\\]]*)\\]","gi"),"<$1>").replace(/\r?\n/gi,"
    ")},filteSubmitHTML:function(){this.reLayout(!0);var e=this.editArea.innerHTML.replace(/_moz_dirty=""/gi,"").replace(/\[/g,"[[-").replace(/\]/g,"-]]").replace(new RegExp("<(/?(?:"+this.submitValidHTML.join("|")+")[^>]*)>","gi"),"[$1]").replace(/]*>/gi,"[strong]").replace(/<\/strong[^>]*>/gi,"[/strong]").replace(/]*>/gi,"[strong]").replace(/<\/b[^>]*>/gi,"[/strong]").replace(new RegExp(']*class="?edit_font_normal"?[^>]*)>@',"gi"),"@").replace(/]*)>/gi,"[span$1]").replace(/<\/span[^>]*>/gi,"[/span]").replace(/]*color=(\")?#E10602(\")?[^>]*>/gi,'[span class="edit_font_color"]').replace(/]*color=(\")?#333333(\")?[^>]*>/gi,'[span class="edit_font_normal"]').replace(/]*>/gi,'[span class="edit_font_normal"]').replace(/<\/font[^>]*>/gi,"[/span]").replace(new RegExp(']*class="?(?:'+this.config.imageClassName+"|"+this.config.smileyClassName+"|"+this.config.flashClassName+"|"+this.config.musicClassName+')"?[^>]*)>',"gi"),"[img$1]").replace(/<[^>]*>/g,"").replace(/\[\[\-/g,"[").replace(/\-\]\]/g,"]").replace(new RegExp("\\[(/?(?:"+this.submitValidHTML.join("|")+"|img|span|strong)[^\\]]*)\\]","gi"),"<$1>").replace(new RegExp("]*>@","gi"),"@").replace(new RegExp("]*>@(.*?)","gi"),"@$1 "),t=document.createElement("div");t.innerHTML=e;var i,n,s,a,r=t.getElementsByTagName("span"),o=[];for(s=0,a=r.length;a>s;s++)"edit_font_normal"===r[s].className&&o.push(r[s]);for(s=0,a=o.length;a>s;s++){for(n=o[s],i=document.createDocumentFragment();n.firstChild;)i.appendChild(n.firstChild);n.parentNode.replaceChild(i,n)}return this.parseURL(t),t.innerHTML},filteHTML:function(e,t){return e.replace(/_moz_dirty=""/gi,"").replace(/\[/g,"[[-").replace(/\]/g,"-]]").replace(new RegExp("<(/?(?:"+t.join("|")+")[^>]*)>","gi"),"[$1]").replace(/<[^>]*>/g,"").replace(/\[\[\-/g,"[").replace(/\-\]\]/g,"]").replace(new RegExp("\\[(/?(?:"+t.join("|")+")[^\\]]*)\\]","gi"),"<$1>")},selectNodeContents:function(e,t){if(e){var i,n;this.ua.ie?(i=document.body.createTextRange(),i.moveToElementText(e),t&&i.collapse(!1),i.select()):(n=this.getSelection(),i=document.createRange(),i.selectNodeContents(e),n.removeAllRanges(),n.addRange(i),t&&n.collapseToEnd())}},hasSelection:function(){var e=this.getSelection();if(this.ua.ie)return e.type?"none"!==e.type.toLowerCase():!1;if(this.ua.opera){var t=this.getRange();return!(e.isCollapsed&&t.startContainer&&t.startContainer===t.endContainer&&t.startOffset===t.endOffset)}return!e.isCollapsed},saveCursor:function(){if(this.focused){var e=document.getElementById("editor-tmp-img");e&&e.parentNode.removeChild(e),this.execCommand("inserthtml",'')}},ensureCursor:function(){this.focused||this.focus();var e=document.getElementById("editor-tmp-img");if(e)if(this.ua.ie&&(!document.documentMode||document.documentMode<9))this.selectNodeContents(e),this.execCommand("delete");else{var t=document.createRange();t.selectNode(e);var i=window.getSelection();i.removeAllRanges(),i.addRange(t),this.execCommand("delete")}},savedRange:null,saveRange:function(){this.savedRange=this.getRange()},resumeRange:function(e){if(e=e||this.savedRange,!e)return!1;if(this.ua.ie)try{e.select()}catch(t){}else{var i=this.getSelection();i.removeAllRanges(),i.addRange(e)}},cmd_inserthtml:function(e){if(this.ua.ie){var t=this.getRange();return t.item?t.item(0).outerHTML=e:t.pasteHTML(e),[!1]}if(7==this.ua.trident){var i=this.savedRange||window.getSelection().getRangeAt(0),n=document.createElement("span");return n.innerHTML=e,i.insertNode(n.firstChild),i.collapse(!0),[!1]}return[!0]},insertImage:function(t,i,n,s,a,r){var o="";"undefined"!=typeof s&&(o=s);var c=' onload="TED.EditorCore.ResizeImage(this);"';if(a>0){if(a>e.defaultConfig.imageWidthLimit){var l=a,d=r;a=e.defaultConfig.imageWidthLimit,r=e.defaultConfig.imageWidthLimit*d/l}c=' height="'+r+'" width="'+a+'"'}if(8===this.ua.ie){this.execCommand("inserthtml",'");var u=document.getElementById("editor-tmp-img");if(u.removeAttribute("id"),u.parentNode.lastChild===u){var h=document.createElement("br");u.parentNode.appendChild(h);var g=document.body.createTextRange();g.moveToElementText(h),g.collapse(n?!1:!0),g.select()}else n&&this.execCommand("insertlinebreak")}else this.execCommand("inserthtml",'"),n&&this.execCommand("insertlinebreak")},cmd_insertlinebreak:function(){if(this.ua.webkit)document.execCommand("insertlinebreak",!1,null);else if(this.ua.gecko){document.execCommand("inserthtml",!1,'
    ');var e=document.getElementById("editor-tmp-br");if(e.removeAttribute("id"),e.parentNode.lastChild===e){e.parentNode.removeChild(e),document.execCommand("inserthtml",!1,'

    '),e=document.getElementById("editor-tmp-br"),e.removeAttribute("id");var t=window.getSelection(),i=document.createRange();i.setStartBefore(e),i.setEndBefore(e),t.removeAllRanges(),t.addRange(i)}}else if(this.ua.ie){var n=this.getRange();n&&(n.pasteHTML("
    "),n.collapse(!1),n.select())}return[!1]},cmd_insertsmiley:function(e){return this.insertImage(e,this.config.smileyClassName),[!1]},cmd_insertimage:function(e,t,i){if("string"==typeof e)this.insertImage(e,this.config.imageClassName,!0,t);else if("[object Array]"===Object.prototype.toString.apply(e))if("obj"==i)for(var n=0,s=e.length;s>n;n++)this.insertImage(e[n].url,this.config.imageClassName,!0,t,e[n].width,e[n].height);else for(var n=0,s=e.length;s>n;n++)this.insertImage(e[n],this.config.imageClassName,!0,t);return[!1]},cmd_focus2end:function(){var e=this.editArea;if(this.ua.ie)e.innerHTML=e.innerHTML;else if(e.lastChild){var t=document.createRange(),i=window.getSelection();t.setStartAfter(e.lastChild),t.setEndAfter(e.lastChild),i.removeAllRanges(),i.addRange(t)}else e.focus();return[!1]},editorPlugins:null,addPlugin:function(e,t){t.init(this),this.editorPlugins=this.editorPlugins||{},this.editorPlugins[e]=t},augmentObject:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=void 0!==e[i]?e[i]:t[i])},setStatsRequest:function(e){var t=new Image;window["bd_pv_"+(new Date).getTime()]=t,t.src="http://tb1.bdstatic.com/tb/img/pv.gif?fr=tb0_forum&st_mod=frspb&st_type=editor&st_value="+e+"&t="+(new Date).getTime(),t=null},getTagNum:function(e,t){var i=this.editArea.getElementsByTagName(e),n=i.length;if(t){n=0;for(var s=0,a=i.length;a>s;s++)i[s].className===t&&n++}return n},reLayout:function(e){for(var t=this.editArea.getElementsByTagName("img"),i=this.config.imageWidthLimit,n=[],s=0,a=t.length;a>s;s++)img=t[s],0!==img.width&&0!==img.height?(e&&img.removeAttribute("unselectable"),img.className===this.config.imageClassName?(img.width>i?(img.setAttribute("width",i),img.setAttribute("changedsize",!0)):img.setAttribute("width",img.width),img.setAttribute("height",img.height)):img.className===this.config.smileyClassName?(img.width>100?img.setAttribute("width",100):img.setAttribute("width",img.width),img.setAttribute("height",img.height)):(img.setAttribute("width",img.width),img.setAttribute("height",img.height)),img.removeAttribute("onload")):n.push(img);for(var s=0,a=n.length;a>s;s++)n[s].parentNode.removeChild(n[s])},parseURL:function(e){var t="(=*+)",i="(+*=)",n=4,s=function(e){if(3==e.nodeType){var a=e.nodeValue;a&&a.length>n&&(a="."+a,a=a.replace(/([^0-9a-zA-Z])((www\.|http:\/\/|mms:\/\/|rtsp:\/\/|ftp:\/\/|https:\/\/)[0-9a-zA-Z\.\!\~\#\?\:\/\&\%\-\+\*\'\=\@\_\$]+)/gi,"$1"+t+'a href="$2" target="_blank"'+i+"$2"+t+"/a"+i),a=a.substring(1),e.nodeValue=a)}else if(1==e.nodeType)for(var r=e.firstChild;r;)"A"!=r.nodeName.toUpperCase()&&s(r),r=r.nextSibling};s(e),e.innerHTML=e.innerHTML.replace(/\(\=\*\+\)a\ href="www\./gi,'")}}),window.TED.EditorCore=e;var a={instanceNum:0,idPrefix:"tb-editor-",registerInstance:function(e,t){return this.instances=this.instances||{},t=t||this.generateID(),this.instances[t]=e,t},generateID:function(){return this.idPrefix+ ++this.instanceNum},getInstanceById:function(e){return e&&this.instances?this.instances[e]:null}};window.TED.EditorInstanceManager=a,i(t,n,{isMobile:!0,init:function(){var e=this;this.area.onfocus=function(){e.fireEvent("focus")},this.area.onclick=function(){e.fireEvent("click")},this.constructor.registerInstance&&(this.id=this.constructor.registerInstance(this))},getImageNum:function(){return 0},getSmileyNum:function(){return 0},getFlashNum:function(){return 0},getMusicNum:function(){return 0},getHtml:function(){return this.area.value.replace(/&/gi,"&").replace(//gi,">").replace(/\r?\n/gi,"
    ").replace(/[\u3000\s]/gi," ").replace(/\t/gi,"    ")},focus:function(){this.area.focus()},blur:function(){this.area.blur()},isEmpty:function(){var e=this.area;return!(e&&e.value&&""!=e.value.replace(/[\u3000\s]/gi,"").replace(/\r?\n/gi,"").replace(/\t/gi,""))},quoteContainer:null,quote:function(e,t,i){if(e=parseInt(e),e>1){null===this.quoteContainer&&(this.quoteContainer=document.createElement("div"),this.quoteContainer.className="editor-quote",this.area.parentNode.insertBefore(this.quoteContainer,this.area));var n=document.getElementById("post_content_"+t).innerHTML.replace(/]*>/gi,"[图片]").replace(/]*>/gi,"[视频]").replace(/]*>/gi," ").replace(/]*>/gi,"").replace(/<\/a>/gi,"").subByte(270);this.quoteContainer.innerHTML='

    引用 '+i+' ('+e+'楼)

    '+n+"

    ",this.quoteContainer.style.display="block",this.fireEvent("quote",null,[t])}else this.unQuote(),Stats.sendRequest("fr=tb0_forum&st_mod=pb&st_type=quote&st_value=replyfirst");var s=this;setTimeout(function(){s.focus()},100)},unQuote:function(){this.quoteContainer&&(this.quoteContainer.style.display="none"),this.fireEvent("unquote")}}),TED.augmentObject(t,a),window.TED.TextInput=t}();!function(){function e(e,i){this.container=e,this.holder=document.createElement("div"),this.holder.style.position="relative",this.holder.className="insertsmiley_holder",this.options=i,this.container.appendChild(this.holder)}function i(e){this.maxNum=e||130,this.holder=document.createElement("div"),this.holder.className="wordlimit-holder",this.holder.style.visibility="hidden"}var t=window.TED.Overlay,o=window.TED.Event;window.TED.EditorPlugins.InsertSmiley=e,e.prototype={init:function(e){this.editor=e;var i=this;this.overlay=new t(this.holder),_.Module.use("common/component/EditorLayer",[{container:$(this.holder)}],function(e){i.editor.overlay=e,window.PAGESMILELAYER=i.editor.overlay,o.addEvent(i.holder,"click",function(e){var t=e.target||e.srcElement;t===i.holder&&(i.clickHandler(e),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0)})})},clickHandler:function(){var e={layerPos:{left:-472,top:29},layerSize:{height:315,width:552},arrowPos:{left:472,top:-7},content:{height:313},arrowType:"arrow_up",layerType:""};e=$.extend(e,this.options);var i=this;this.smileLayer?i.editor.overlay.toggle(e,this.smileLayer,this.editor,i.holder,"smile"):_.Module.use("common/component/EditorSmiley",[],function(t){i.smileLayer=t,i.editor.overlay.toggle(e,i.smileLayer,i.editor,i.holder,"smile")})},closeOverlay:function(){this.editor.overlay.close()}},window.TED.EditorPlugins.WordLimit=i,i.prototype={showLimit:10,checkTimer:null,checkDelay:300,isShow:!1,exceed:!1,init:function(e){this.editor=e,this.container=e.wrapper,this.container.appendChild(this.holder),e.on("keyup",this.handlerEvent,this),e.on("focus",this.handlerEvent,this),this.check()},handlerEvent:function(){clearTimeout(this.checkTimer);var e=this;this.checkTimer=setTimeout(function(){e.check()},this.checkDelay)},check:function(){var e=this.maxNum-this.editor.getContentLength();e<=this.showLimit?(this.holder.style.visibility="visible",this.isShow=!0,0>e?(this.exceed||(this.editor.fireEvent("overflow"),this.exceed=!0),this.holder.innerHTML='已经超出'+-e+"个字"):(this.exceed&&(this.editor.fireEvent("unoverflow"),this.exceed=!1),this.holder.innerHTML='还能输入'+e+"个字")):this.isShow&&(this.holder.style.visibility="hidden",this.isShow=!1,this.exceed&&(this.editor.fireEvent("unoverflow"),this.exceed=!1))}}}(); ;!function(){function e(i){e.superclass.call(this,i)}var i=window.TED.EditorCore,a=window.TED.extend,t=window.TED.EditorInstanceManager,r=window.TED.augmentObject;e.defaultConfig={height:"100px",width:"400px",maxHeight:null,autoFocus:!0,autoEnable:!0,autoHeight:!1,wrapperClassName:"tb-simpleeditor-wrapper",editAreaClassName:"tb-editor-editarea",editAreaWrapperClassName:"tb-editor-editarea-wrapper",disabledEditAreaClassName:"tb-editor-editarea tb-editor-editarea-disabled",disabledWrapperClassName:"tb-simpleeditor-wrapper tb-simpleeditor-wrapper-disabled",imageClassName:"BDE_Image",smileyClassName:"BDE_Smiley",rootPath:"/tb/static-common/",enableRefer:!0,emptyClassName:"BDE_Empty",flashClassName:"BDE_Flash",flashNumLimit:10,didaDelay:300,imageWidthLimit:570},a(e,i,{getContentLength:function(){return Math.ceil(this.filteHTML(this.editArea.innerHTML,["img","br"]).replace(/]*>/gi,"mm").replace(/]*>/gi,"m").replace(/ /gi,"m").replace(/[^\x00-\xff]/g,"mm").length/2)},filteEditHTML:function(){var e=this.editArea.innerHTML.replace(/_moz_dirty=""/gi,"").replace(/\[/g,"[[-").replace(/\]/g,"-]]").replace(new RegExp("<(/?(?:br)[^>]*)>","gi"),"[$1]").replace(new RegExp(']*class="?at"?[^>]*)>',"gi"),"[span$1]").replace(new RegExp(']*class="?(?:'+this.config.emptyClassName+"|"+this.config.smileyClassName+')"?[^>]*)>',"gi"),"[img$1]").replace(/<[^>]*>/g,"").replace(/\[\[\-/g,"[").replace(/\-\]\]/g,"]").replace(new RegExp("\\[(/?(?:br|img|span)[^\\]]*)\\]","gi"),"<$1>");return e},getConfig:function(){return this.config},filteSubmitHTML:function(){this.reLayout();var e=this.editArea.innerHTML.replace(/_moz_dirty=""/gi,"").replace(/\[/g,"[[-").replace(/\]/g,"-]]").replace(new RegExp("<(/?(?:"+this.submitValidHTML.join("|")+")[^>]*)>","gi"),"[$1]").replace(new RegExp(']*class="?(?:'+this.config.imageClassName+"|"+this.config.smileyClassName+"|"+this.config.flashClassName+"|"+this.config.musicClassName+')"?[^>]*)>',"gi"),"[img$1]").replace(/<[^>]*>/g,"").replace(/\[\[\-/g,"[").replace(/\-\]\]/g,"]").replace(new RegExp("\\[(/?(?:"+this.submitValidHTML.join("|")+"|img)[^\\]]*)\\]","gi"),"<$1>"),i=document.createElement("div");return i.innerHTML=e,this.parseURL(i),i.innerHTML}}),r(e,t),window.TED.SimpleEditor=e}();_.Module.define({path:"frs/widget/ForumManager",requires:["frs/widget/ForumManager/BazhuSkinManager","frs/widget/ForumManager/BaVisitCardManager"],sub:{initial:function(a,e,t,n,r){try{var i=this;i.delThreadBubble(),"album"==t||n||i.batchDeleteTip(),$(".tbBazhu").click(function(a){try{$.stats.sendRequest("st_mod=pv&fr=tb0_forum&st_type=bazhupage_from_forumManagerPannel")}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_manager/forum_manager_main.js",method:"",ln:14}),a}});var o=window.userSkinManager;if(null!=o){var s=null;$("#adminModePanel").find(".j_btn_skin_mgr").bind("click",function(){try{null==s&&(s=i.use("BazhuSkinManager",{skinId:a.background.bg_id||null,fid:a.id,tbs:e.post_params.tbs,fname:a.name,userSkinManager:o})),s.openDlg()}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/forum_manager/forum_manager_main.js",method:"",ln:32}),t}})}var c=null;null==c&&(c=i.use("BaVisitCardManager",{})),$("#adminModePanel").find(".j_btn_visit_card").bind("click",function(){try{c.openDlgOrBubble()}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_manager/forum_manager_main.js",method:"",ln:42}),a}}),i.setAttentionRecomment(r)}catch(u){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:u.message||u.description,path:"frs:widget/forum_manager/forum_manager_main.js",method:"",ln:45}),u}},setAttentionRecomment:function(a){var e=this;e.data=a,$(".j_fourth_manage").click(function(a){try{return _.Module.use("frs/widget/platform_attention_recommend",[{tbs:e.data.tbs,uid:e.data.uid,frs_access:!0,is_forum_fourth_manager:e.data.is_forum_fourth_manager,avatar:e.data.avatar}]),!1}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_manager/forum_manager_main.js",method:"",ln:58}),a}})},batchDeleteTip:function(){if("1"!=$.cookie("bacard"+PageData.forum.forum_id)){var a=$("#j_visit_card_bubble_wrap"),e=a.siblings(".j_btn_visit_card").position().left-16,t={content:"你的吧还没提交超酷个性化吧名片哦,赶紧来设置一下吧!什么是吧名片>>",arrow_dir:"up",bubble_css:{top:1,left:e,width:166},arrow_pos:{left:30},attr:"",wrap:a,closeBtn:!0},n=new UiBubbleTipBase(t);n.showBubble(),n.bind("onclose",function(){$.cookie("bacard"+PageData.forum.forum_id,1,{expires:30,path:"/"})},!0),n.j_bubble.find(".turnToDesc").click(function(){try{$.cookie("bacard"+PageData.forum.forum_id,1,{expires:30,path:"/"})}catch(a){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:a.message||a.description,path:"frs:widget/forum_manager/forum_manager_main.js",method:"",ln:90}),a}})}},delThreadBubble:function(){var a,e=0,t=["李辰号","lol","李毅","魔兽世界","地下城与勇士","凡人修仙传"],n=(PageData&&PageData.forum&&PageData.forum.name||"").toLowerCase(),r=$("#j_visit_card_bubble_wrap"),i=$("#adminModePanel"),o=i.find(".btn_batch_manage");if(o[0]&&1!=$.cookie("isDTBC")&&($.each(t,function(a,t){(t==n||t+"吧"==n)&&(e=1)}),e)){a={content:"删贴有奖励,快来查看~",arrow_dir:"right",bubble_css:{top:-93,right:o.position().left,width:150},arrow_pos:{right:0,top:6},wrap:r,closeBtn:!0};var s=new UiBubbleTipBase(a);s.bind("onclose",function(){$.cookie("isDTBC",1,{expires:30,path:"/"})},!0),s.showBubble()}}}}); ;_.Module.define({path:"frs/widget/ForumManager/bannerImageUpload",requires:["common/widget/image_uploader_manager"],sub:{BANNER_DATA:{width:980,height:180,maxSize:1e8},API:{check:"/toutu/isCommite",setBanner:"/toutu/addToutu"},ORINAL_PIC_URL_PREFIX:"http://imgsrc.baidu.com/forum/pic/item/",_status:-1,_val:"",initial:function(){try{var e=this;e._initBannerUploadTip(),e._initDialog(),e._initUpload(),e._bindEvent()}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/forum_manager/banner_image_upload.js",method:"",ln:27}),t}},_bindEvent:function(){var e=this;$("#adminModePanel .j_banner_image_upload").on("click",function(t){try{$.ajax({url:e.API.check,type:"post",data:{fid:PageData.forum.forum_id},dataType:"json"}).done(function(t){0===t.errno?(e._status=t.ret,e._setTipSubmit(),e.dialog.show()):$.dialog.alert("服务器开小差了,请重新试一下",{title:"贴吧提示"})}).fail(function(){$.dialog.alert("服务器有点动荡,请重新试一下",{title:"贴吧提示"})})}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/forum_manager/banner_image_upload.js",method:"",ln:50}),t}})},_initBannerUploadTip:function(){var e="fcardbanner"+PageData.forum.forum_id;if(!("1"==$.cookie(e)||+new Date>+new Date(2014,5,23))){var t=$("#j_banner_image_upload_wrap"),i={content:"你的吧还没提交超酷个性化吧头图哦,赶紧来设置一下吧!",arrow_dir:"up",bubble_css:{top:25,left:-160,width:166},arrow_pos:{left:110},attr:"",wrap:t,closeBtn:!0},a=new UiBubbleTipBase(i);a.showBubble(),a.bind("onclose",function(){$.cookie(e,1,{expires:30,path:"/"})},!0),a.j_bubble.find(".turnToDesc").click(function(){try{$.cookie(e,1,{expires:30,path:"/"})}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/forum_manager/banner_image_upload.js",method:"",ln:83}),t}})}},_initDialog:function(){var e=this;e.dialog=new $.dialog({html:['
    ',"","",'','","","",'','","","
    上传图片:','
    ','
    ',"

    说明:

    ","

    1. 上传尺寸为980*180

    ","

    2. 不能含有QQ、电话号码等

    ","

    3. 必须与吧主题符合

    ","

    4. 审核通过后,2天内不能修改,请慎重选择

    ","

    5. 仅支持jpg、png格式的文件

    ","
    ","
    ','','预 览','提 交',"",'',"
    ","
    "].join(""),holderClassName:"uploadHeadImageDialog",title:"上传头图",draggable:!0,width:560,hideOnclose:!0,show:!1}),e.$tipSubmitEl=e.dialog.element.find(".tip_submit"),e.dialog.element.on("click",".j_preview",function(t){try{if(!e._val)return!1;$("#container .card_banner img").tbattr("src",e._val),window.scrollTo(0,0)}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/forum_manager/banner_image_upload.js",method:"",ln:133}),t}}),e.dialog.element.on("click",".j_submit",function(t){try{if(!e._val)return!1;$.ajax({url:e.API.setBanner,type:"post",data:{fid:PageData.forum.forum_id,avatar:e._val},dataType:"json"}).done(function(t){0===t.errno?(e._val="",e.dialog.hide(),$.dialog.alert("提交成功,请等待审核通过。",{title:"贴吧提示"})):e._setTipSubmit("服务器开小差了,请重新试一下",!0)}).fail(function(){e._setTipSubmit("服务器有点动荡,请重新试一下",!0)})}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/forum_manager/banner_image_upload.js",method:"",ln:159}),t}})},_setTipSubmit:function(e,t){var i=this,a=e||"",n={1:"提交成功,审核中",2:"距离上次修改不满2天,无法修改"};n.hasOwnProperty(i._status)&&(a=n[i._status]),i.$tipSubmitEl.text(a),t&&(clearTimeout(i.autoReset),i.autoReset=setTimeout(function(){i.$tipSubmitEl.text("")},3e3))},_initUpload:function(){var e=this,t=e.dialog.element.find(".img_upload_btn"),i=e.BANNER_DATA;e.upload=e.use("common/widget/image_uploader_manager",{width:t.width(),height:t.height(),container:t,maxSize:i.maxSize,queueLen:1,isFlash:!0,isAutoUp:!1}),e.upload.bind("onComplete",function(t,a){var n=a.imageList[0].response;e._setTipSubmit(""),0==n.error_code&&0==n.info.err_no?(n=n.info,n.fullpic_width!=i.width||n.fullpic_height!=i.height?e._setTipSubmit("图片尺寸不对",!0):(e._val=e.ORINAL_PIC_URL_PREFIX+n.pic_id_encode+".jpg",e.dialog.element.find(".j_preview").tbattr("class","j_preview ui_btn ui_btn_m"),e.dialog.element.find(".j_submit").tbattr("class","j_submit ui_btn ui_btn_m"))):e._setTipSubmit("图片上传失败,请重试。",!0)}),e.upload.bind("onStartUpload",function(){e._setTipSubmit("上传中...")}),e.upload.bind("onFileSelected",function(t,i){e._status<=0&&(i.imageList&&/\.(jpe*g|png)$/i.test(i.imageList[0].name)?e.upload.startUpload():e._setTipSubmit("仅支持jpg、png格式的文件",!0))})}}}); ;_.Module.define({path:"frs/widget/ForumManager/BazhuSkinManager",requires:["frs/widget/ForumManager/SkinData","frs/widget/ForumManager/FrsSkinDlg"],sub:{_skinData:null,_skinDlg:null,_userSkinManager:null,initial:function(i){try{var n=this;this._skinData=this.use("SkinData",i),this._skinData.onSaved=function(i){n.afterSave(i)},this._userSkinManager=i.userSkinManager}catch(s){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:s.message||s.description,path:"frs:widget/forum_manager/bazhu_skin_manager.js",method:"",ln:19}),s}},_initDlg:function(){var i=this,n=this.use("FrsSkinDlg","frs_skin_dlg",this._skinData);n.onSelectSkin=function(n){i._userSkinManager.setSkin(n)},n.onCancel=function(){var n=i._skinData.getSkinOriginal();i._userSkinManager.setSkin(n)},n.onOk=function(){var n=i._skinData.getSkinSelected();i._userSkinManager.resetSkin(n)},this._skinDlg=n},openDlg:function(){var i=this;null==this._skinDlg?this._loadData(function(){i._initDlg(),i._skinDlg.show()}):this._skinDlg.show()},_loadData:function(i){this._skinData.loadData(i)},closeDlg:function(){null!=this._skinDlg&&this._skinDlg.hide()},afterSave:function(i){i&&this._showSaveResult(i)},_showSaveResult:function(){var i='
    保存成功
    本窗口在3秒后自动关闭
    ',n=new $.dialog({html:i,title:"背景设置",width:300});setTimeout(function(){n.close()},3e3)}}}); ;_.Module.define({path:"frs/widget/ForumManager/FrsSkinDlg",sub:{_id:"",_skinData:null,_dlgInstance:null,_tabCapacity:8,_status:0,initial:function(t,i){try{this._id=t,this._skinData=i,this._dlgInstance=this._initDlgInstance(),this.restoreDlg(),this.bindEvents()}catch(n){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:n.message||n.description,path:"frs:widget/forum_manager/frs_skin_dlg.js",method:"",ln:20}),n}},_initDlgInstance:function(){var t=this._createDlgHtml(),i=null;return i=new $.dialog({html:t,title:"背景设置",showShadow:!1,width:498,hideOnclose:!0,show:!1})},_createDlgHtml:function(){var t=['
    ',this._createTabNavHtml(),'
      ','
        ','
        ',"
        "];return t.join("")},_createTabNavHtml:function(){for(var t=['
          '],i=this._skinData.getSkinDataConfig(),n=0,s=i.length;s>n;n++)t.push("
        • '),n.push(o),n.push("
        • ")}return n.join("")},_createPagerContentHtml:function(t,i){var n=this._skinData.getSkinDataConfig()[t].skinList,s=this._tabCapacity,a=Math.ceil(n.length/s);if(n.length>s)if(1==i){for(var e=['
        • 上一页
        • 1
        • '],l=2;a>=l;l++)e.push("
        • '+a+"
        • 下一页
        • ")}else{for(var e=["
        • '+l+"
        • "):e.push("
        • 勾选
          "),$(this).tbattr("addcheckbox","true")}})},createChooseNode:function(){var e=this;e.hasDom=!0,e.addCheckedBox(),$(".th_footer_2").after("
          删除并封禁楼主一天
          删除
          "),$(".th_footer_2").hide(),$(".j_deleteThreads").click(function(){try{e.deleteThread(0)}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/thread_batch_delete/thread_batch_delete.js",method:"",ln:63}),t}}),$(".j_deleteAndBan").click(function(){try{e.deleteThread(1)}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/thread_batch_delete/thread_batch_delete.js",method:"",ln:66}),t}})},switchMode:function(){var e=this,t=$(".j_btn_batch_delete span");"进入管理模式"==t.html()?(t.html("返回普通模式"),e.intoDeleteMode()):(t.html("进入管理模式"),e.intoNormalMode())},intoDeleteMode:function(){var e=this;e.hasDom?($(".j_batch_delete").show(),$(".j_batch_delete_btn_area").show(),$(".th_footer_2").hide()):e.createChooseNode(),"false"==$.cookie("batch_delete_mode")&&$.tb.location.reload(),$.cookie("batch_delete_mode",!0,{expires:30,path:"/"})},intoNormalMode:function(){$(".j_batch_delete").hide(),$(".j_batch_delete_btn_area").hide(),$(".th_footer_2").show(),"true"==$.cookie("batch_delete_mode")&&$.tb.location.reload(),$.cookie("batch_delete_mode",!1,{expires:30,path:"/"})},deleteThread:function(e,t){var a=this,o="",d=[],i=[];$(".j_batch_delete_select:checked").each(function(e,t){var a=$(t).parent().parent(),c=a.getData();d.push(c.author_name),i.push(c.id),o=0==e?c.id:o+"_"+c.id});var c={fid:PageData.forum.id,tbs:PageData.tbs,tid:o,kw:PageData.forum.name,isBan:0};c=t?$.extend(c,t):c;PageData.user.identity;""!=o&&$.tb.post("/f/commit/thread/batchDelete",c,function(t){if(0==t.no)e?_.Module.use("common/widget/BlockUser",[d,{ban_id:!0,ban_ip:!0},PageData.forum,PageData.tbs,i[0],function(){$.tb.location.reload()}]):$.tb.location.reload();else if(12==t.no)$.dialog.alert("

          抱歉,账号处于封禁状态,暂时不能删贴。点击此处查看详细信息

          ");else if(13==t.no)$.dialog.alert("

          抱歉,网络地址处于封禁状态,暂时不能删贴。点击此处查看详细信息

          ");else if(899==t.no)$.dialog.alert("

          您无法删除该贴子。

          ");else{if(4011==t.no)return a._getCaptcha(t,e),void 0;""==t.error?$.dialog.alert("出错啦,刷新页面看下吧。"):$.dialog.alert(t.error)}})},_getCaptcha:function(e,t){var a=this;_.Module.use("common/component/CaptchaDialog",{title:"删除贴子",message:"删了那么多贴子,输个码验证下身份吧~",vCode:e.data.vcode.captcha_vcode_str,vCodeType:e.data.vcode.captcha_code_type,forumName:PageData.forum.forum_name,forumId:PageData.forum.forum_id,postType:"thread",paramsCallback:function(){return{}}},function(e){a.captchaDialog=e,e.bind("onclose",function(){return e.hide(),!1}),e.bind("onaccept",function(){var o={vcode:e.getInputValue(),vcode_md5:e.getVCode()};a.deleteThread.call(a,t,o)}),e.show()})},_showDelScreenTip:function(){if("1"!=$.cookie("SCREEN_DELETE_TIP")){var e=$("#adminModePanel .j_btn_batch_delete"),t={content:"管理模式下可以删除被屏蔽贴啦~~",arrow_dir:"right",bubble_css:{top:e.offset().top-5,left:e.offset().left-205,width:205},arrow_pos:{right:0},attr:"",wrap:$("body"),closeBtn:!0},a=new UiBubbleTipBase(t);a.showBubble(),$.cookie("SCREEN_DELETE_TIP",1,{expires:30,path:"/"})}}}});_.Module.define({path:"bawu/widget/manager_apply_post",sub:{_managerErrorMap:{170001:"未满足吧主申请条件。",170002:"抱歉,申请本吧吧主,吧内会员等级不得低于3级。",170003:"抱歉,您还未关注本吧。",170004:"抱歉,该吧暂时不接受吧主申请。",170005:"抱歉,该吧三个吧主职位已满。",170006:"抱歉,该吧三个吧主职位已满或该吧已有实习吧主。",170007:"抱歉,您已担任三个吧的吧主职位,不能再次申请。",170008:"抱歉,该条申请信息已处理完毕,无需重复提交处理。",170009:"抱歉,该吧暂无符合条件的申请信息。",170010:"抱歉,该条申请信息已处理完毕,无需重复提交处理。",170011:"抱歉,您的申请信息已于今天被受理,24小时内不可再次申请。",170012:"抱歉,您已提交的申请信息正在审核中,不能重复提交申请,请您耐心等待。",170013:"抱歉,您已是该吧吧主,不可重复申请。",170014:"抱歉,自该吧辞职吧主权限一个月内不可再次申请该吧吧主。",170015:"抱歉,您于近期被撤销该吧吧主权限,60天内不可再次申请。",170016:"抱歉,该吧已有吧主,暂不接受实习吧主申请。",170017:"抱歉,该吧暂不接受实习吧主申请。",170018:"抱歉,该吧暂不接受实习吧主申请。",170019:"抱歉,该吧暂不接受实习吧主申请。",170020:"抱歉,您的ip与当前吧主相同或近似,请您更换ip后重新申请。请不要用多个帐号担任同一个吧的吧主职位。",170021:"抱歉,该吧吧主为实习吧主,暂不接受吧主申请。请您于实习吧主转正或者该吧无吧主时再次申请。",220012:"抱歉,您的帐号被封禁,暂时无法申请吧主。",250114:"抱歉,您没有操作权限。",110000:"抱歉,您还未登录贴吧,请您登录后重新操作。",110003:"内部错误",210009:"参数错误",210011:"校验失败"},_assistErrorMap:{170001:"未满足小吧主申请条件。",170002:"抱歉,申请本吧小吧主,吧内会员等级不得低于3级。",170003:"抱歉,您还未关注本吧。",170004:"抱歉,该吧暂时不接受小吧主申请。",170005:"抱歉,该吧小吧主职位已满。",170006:"抱歉,该吧没有吧主,暂时不接受小吧主申请。",170007:"抱歉,您担任小吧主职位的名额已满,不能再次申请。",170008:"抱歉,该条申请信息已处理完毕,无需重复提交处理。",170009:"抱歉,该吧暂无符合条件的申请信息。",170010:"抱歉,该条申请信息已处理完毕,无需重复提交处理。",170011:"抱歉,您的申请信息已于今天被受理,24小时内不可再次申请。",170012:"抱歉,您已提交的申请信息正在审核中,不能重复提交申请,请您耐心等待。",170013:"抱歉,您已是该吧吧主,不可重复申请。",170025:"抱歉,您已是该吧小吧主,不可重复申请。",220012:"抱歉,您的帐号被封禁,暂时无法申请小吧主。",250114:"抱歉,您没有操作权限。",110000:"抱歉,您还未登录贴吧,请您登录后重新操作。",110003:"内部错误",210009:"参数错误",210011:"校验失败"},initial:function(){var t=this;t._wrap=$("body"),t.bindEvents(),_.Module.use("ueglibs/widget/Ban",[],function(a){t._managerErrorMap["220012"]=a.render("forumManagerApply"),t._assistErrorMap["220012"]=a.render("forumManagerApply")})},bindEvents:function(){var t=this;this._wrap.delegate(".j_btn_apply_manager","click",function(){return t.isLogin()&&t.managerApply(),!1}),this._wrap.delegate(".j_btn_apply_assist","click",function(){return t.isLogin()&&t.assistApply(),!1})},isLogin:function(){return PageData.user.is_login?PageData.user.no_un?(TbCom.process("User","buildUnameFrame"),!1):!0:(_.Module.use("common/widget/LoginDialog",["","userBar"]),!1)},managerApply:function(){var t,a=this,i="";0==PageData.forum.is_key_op&&0==PageData.forum.mgr_num?(t=!0,i="/managerapply/preSubmitIntern"):(t=!1,i="/managerapply/preSubmit");var s=i+"?forum_id="+PageData.forum.id+"&kw="+PageData.forum.name_url+"&t="+(new Date).getTime().toString(32);$.ajax({type:"GET",url:s,async:!1,success:function(i){var s=$.json.decode(i);if(0===s.errno)a.openApplyLink(t);else{var e=a._managerErrorMap[s.errno];e&&""!=e||(e="未知错误"),170001!==s.errno||t?170001===s.errno&&t&&(e="抱歉,申请本吧实习吧主需达到如下条件:发言数不得少于10贴。"):e="抱歉,申请本吧吧主需达到如下条件:
          发言数不得少于"+(s.data.user_post_num||0)+"贴,成为会员天数不得少于"+(s.data.member_days||0)+"天。
          当前发贴数:"+(s.data.cur_user_post_num||0)+",已经成为会员天数:"+(s.data.cur_member_days||0)+"。";var n='

          '+e+'

          ';a._tip_dialog=$.dialog.open(n,{title:"申请吧主",width:470,height:134}),$("#forum_info_dialog_close").bind("click",function(){a._tip_dialog.close()})}}})},openApplyLink:function(t){var a=t?"/managerapply/applyIntern":"/managerapply/apply",i=a+"?forum_id="+PageData.forum.id+"&kw="+PageData.forum.name_url;window.open(i)},assistApply:function(){var t=this;this.assistPreAjax&&this.assistPreAjax.abort(),this.assistPreAjax=$.ajax({url:"/managerapply/assist/preSubmit",type:"post",data:{forum_id:PageData.forum.forum_id,tbs:PageData.tbs},dataType:"json"}).done(function(a){0===a.errno?t.openAssitApplyDlg(a.data):t.assistMsgDialog(a.errno)})},openAssitApplyDlg:function(t){var a=['

          本吧小吧主申请要求:

          ','
            ',"
          1. 本吧等级不低于3级
          2. ","
          3. #{assist_condition}
          4. ","
          ",'

          本吧目前已有小吧主#{assist_cur_num}名,还有#{assist_left_num}个名额

          ','

          申请感言:

          ','
          ','',"
          ",'"].join("");this._assit_apply_dlg=new $.dialog({html:$.tb.format(a,t),title:"申请小吧主",width:550,holderClassName:"assist_apply_dlg"}),this.bindDlgEvent()},bindDlgEvent:function(){var t=this;this.j_dlg_wrap=$(".assist_apply_dlg"),this.j_statement=this.j_dlg_wrap.find(".j_statement"),this.j_dlg_wrap.find(".j_submit").bind("click",function(){return t.checkInputs()&&t.initAssistPost(),!1});var a={container:".j_statement_wrap",inputObj:".j_statement",showLimit:400,maxNum:400,numStyle:{color:"red"}};_.Module.use("common/widget/WordLimit",[a],function(a){t.word_limit_instance=a,a.init()})},checkInputs:function(){var t=this,a=this.j_dlg_wrap.find(".error_text"),i=this.j_statement.val();return""===i?(a.html("申请感言为空").show(),!1):t.word_limit_instance.exceed?(a.html("申请感言字数已超上限").show(),!1):!0},initAssistPost:function(){var t=this,a={declaration:this.j_statement.val(),forum_id:PageData.forum.forum_id,ie:"utf-8",tbs:PageData.tbs};$.ajax({url:"/managerapply/assist/submit",type:"post",data:a,dataType:"json"}).done(function(a){0===a.errno?t.showSuccess():(t._assit_apply_dlg.close(),t.assistMsgDialog(a.errno))}).fail(function(){t._assit_apply_dlg.close(),t.assistMsgDialog("POST ERROR")})},showSuccess:function(){var t=this,a="http://tieba.baidu.com/bawu2/platform/listCandidateInfo?word="+PageData.forum.name_url,i=['
          ',"
          ",'
          提交成功,吧主将尽快处理
          ','','',"确定","","
          ","
          "].join("");this._assit_apply_dlg.setContent(i),this.j_dlg_wrap.addClass("no_title"),$(".j_dlg_close").click(function(){return t._assit_apply_dlg.close(),!1})},assistMsgDialog:function(t){var a=this,i=this._assistErrorMap[t];i&&""!=i||(i="未知错误");var s=['
          ',"
          ",'
          提交失败:
          ','
          '+i+"
          ",'',"确定","","
          ","
          "].join("");a._tip_dialog=$.dialog.open(s,{title:"申请小吧主",width:470,height:150}),$(".j_dlg_close").click(function(){return a._tip_dialog.close(),!1})}}});_.Module.define({path:"frs/widget/Zyq",sub:{initial:function(){try{$("#zyq_mod_album").length&&this.album("zyq_mod_album"),$("#zyq_mod_video").length&&this.video("zyq_mod_video"),$("#zyq_mod_friend").length&&this.friend("zyq_mod_friend"),$("#mod_stock").length&&this.stock("mod_stock"),$("#zyq .zyq_mod_link_items .j_mod_item").on("click",function(){try{$.stats.track("自定义链接点击","吧主配置数据统计","frs","click")}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/zyq/zyq.js",method:"",ln:20}),t}}),$("#zyq .zyq_mod_friend_items .j_mod_item").on("click",function(){try{$.stats.track("友情贴吧链接点击","吧主配置数据统计","frs","click")}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/zyq/zyq.js",method:"",ln:24}),t}}),$("#aside_album_good a").on("click",function(){try{$.stats.track("图册精选链接点击","吧主配置数据统计","frs","click")}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/zyq/zyq.js",method:"",ln:28}),t}})}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/zyq/zyq.js",method:"",ln:29}),t}},friend:function(t){var e=$("#"+t);e.delegate(".j_mod_item","mousedown",function(){var t={st_mod:"aside_friend_forum",st_type:"enterba",st_from:encodeURIComponent(PageData.product),st_uid:PageData.user.id,st_benba:encodeURIComponent(PageData.forum.name),st_goto:encodeURIComponent($(this).text())};$.tb.Stats.sendRequest("http://tb1.bdstatic.com/tb/img/hive.gif",t)})},album:function(t){var e=$("#"+t);!e.length,e.hide();var i=e.find(".alb_box_inner img:first");i.length&&i.tbattr("isrc")&&(i.bind("load",function(){resizePic_temp(this,133,170)}),i.tbattr("src",i.tbattr("isrc")))},video:function(t){if(t&&$("#"+t).length){var e=$("#"+t).tbattr("video-num");if(!(0>=e)){var i={ITEMWiDTH:120,FRAMEHWIDTH:140,SPACHEWIDTH:10,_leftPadding:0,scroll:function(){var t=document.getElementById("scrollCt"),e=document.getElementById("itemsCt");if(t&&e){var o=parseInt(e.offsetWidth),n=function(){i._leftPadding<=-o+i.FRAMEHWIDTH-5?(i._leftPadding=0,t.style.left=i._leftPadding+"px"):(i._leftPadding=i._leftPadding-2,t.style.left=i._leftPadding+"px")};o+10>=2*(i.ITEMWiDTH+i.SPACHEWIDTH)&&(timer=setInterval(n,120))}}};$(window).bind("load",i.scroll)}}},stock:function(t){t&&$("#"+t).length&&$.JsLoadManager.use("http://tb1.bdstatic.com/tb/static-zyq/js/mod/zyq_mod_frs_stock.js?v=2011.05.31",function(){$("#j_zyq_stock").bind("click",function(){try{changeToKChart(),Common.statistic(11)}catch(t){throw"undefined"!=typeof alog&&alog("exception.fire","catch",{msg:t.message||t.description,path:"frs:widget/zyq/zyq.js",method:"",ln:97}),t}})})}}});_.Module.define({path:"album/widget/entryFrsDiscuss",requires:[],sub:{jqContainer:null,initial:function(n){this.jqContainer=$("#"+n),this.bindEvents()},bindEvents:function(){this.jqContainer.on("mousedown","a",function(){$.stats.sendRequest("fr=tb0_forum&page=new_version&st_mod=album_new&st_type=frs_discuss&st_value=album_good_thread")})}}});_.Module.define({path:"common/widget/asidead",sub:{initial:function(t,s){if(t.length>0&&t.getData()){var a=t.getData(),i=this;t.find(".aside_ad_pic").on("click",function(){i._stats(s,"右侧","商业推广位统计",a,"点击"),i._stats(s,"frs页_右侧推广_图","PC端商业化游戏统计",a,"点击")}),i._stats(s,"右侧","商业推广位统计",a,"展现"),i._stats(s,"frs页_右侧推广_图","PC端商业化游戏统计",a,"展现")}},_stats:function(t,s,a,i,_){$.stats.track(s,a,t,_,{obj_id:i.id||"",obj_name:i.title||"",obj_url:i.pic||"",obj_type:"游戏",obj_subtype:i.subtype||""})}}}); ;_.Module.define({path:"common/widget/asidead/asidead_slide",requires:["common/component/SlideShow"],sub:{_slideConfig:{target:"#aside_ad .asidead_slidewrap",nav:"#aside_ad .asidead_navs",activeClass:"active",interval:5e3,auto:!0,prev:"#aside_ad .asidead_control_left",next:"#aside_ad .asidead_control_right",delayLoadPic:!0,slide:{speed:400}},initial:function(){console.log(9),this.use("common/component/SlideShow",this._slideConfig)}}});_.Module.define({path:"comforum/widget/Rank",sub:{_container:null,initial:function(){"frs"===PageData.product?this.local="FRS页":"pb"===PageData.product&&(this.local="PB页"),this._container=$("#j_game_rank"),this._rightSection=$(".content .right_section"),this._bindEvents(),this._showTrack()},_showTrack:function(){var t=this,a=this._container.find(".game_rank_item .rank_game_pic"),n=[];a.length>0&&(a.each(function(){n.push($(this).tbattr("alt"))}),$.stats.track(t.local+"_右侧下方_排行榜","PC端商业化游戏统计",PageData.product||"","展现",{obj_name:n.join(","),obj_type:"游戏"}))},_bindEvents:function(){var t=this;t._container.on("click",".game_rank_item",function(){var a=$(this).find(".rank_game_pic");$.stats.track(t.local+"_右侧下方_排行榜","PC端商业化游戏统计",PageData.product||"","点击",{obj_url:a.tbattr("src"),obj_name:a.tbattr("alt"),obj_type:"游戏"})}).on("mouseenter",".game_rank_item",function(){$(this).hasClass("game_rank_item_fold")&&$(this).removeClass("game_rank_item_fold").siblings(".game_rank_item").addClass("game_rank_item_fold")})}}});_.Module.define({path:"tbmall/widget/tshow_out_date_warn",requires:["common/widget/JoinVipDialog"],sub:{initial:function(t){var o=this;this.joinVipDialog=this.use("common/widget/JoinVipDialog"),setTimeout(function(){t.show_pre?o.buildPreHtml.call(o):t.show_suf&&o.buildSufHtml.call(o)},3e3)},buildPreHtml:function(){var t=this,o=$("#tshow_out_date_warn_pre_html").html(),e={html:o,title:"提醒",draggable:!1,width:601};this._dialog=new $.dialog(e),$.cookie("tshow_out_hide",1,{expires:1}),this._dialog.onclose(function(){$.cookie("tshow_out_hide",1,{expires:1})}),this._dialog.element.on("click",".j_join_vip",function(o){o.preventDefault(),t.joinVipDialog.getMemberDialog(),t._dialog.close()})},buildSufHtml:function(){var t=this,o=$("#tshow_out_date_warn_suf_html").html(),e=$("#com_userbar"),i=$("#com_userbar_message"),a=parseInt(e.css("top")),s=parseInt(i.css("top"));$(o).css("height",0).prependTo("body").animate({height:100},500,"swing",function(){$(window).trigger("resize")}),$.cookie("tshow_out_hide",1,{expires:1}),e.parent().hasClass("search_form")?e.parent().hasClass("core_title")&&(e.css({top:6}),i.animate({top:125},500)):(e.animate({top:100+a},500),i.animate({top:125},500)),$(window).on("scroll",function(){$.cookie("tshow_out_hide")||(setTimeout(function(){e.css(e.parent().hasClass("search_form")?{top:a}:e.parent().hasClass("core_title")?{top:6}:{top:100+a})},2),setTimeout(function(){i.hasClass("ui_bubble_wrap_fixed")||i.css({top:125})},10))}),$("#tshow_out_date_warn_close_btn").click(function(){$("#tshow_out_date_warn").animate({height:0},500,"swing",function(){$("#tshow_out_date_warn").remove(),$(window).trigger("resize")}),e.animate({top:a},500),i.animate({top:s},500),$.cookie("tshow_out_hide",1,{expires:1})}),$("#tshow_out_date_warn_btn").click(function(){t.joinVipDialog.getMemberDialog(),$("#tshow_out_date_warn").animate({height:0},500,"swing",function(){$("#tshow_out_date_warn").remove(),$(window).trigger("resize")}),e.animate({top:a},500),i.animate({top:s},500),$.cookie("tshow_out_hide",1,{expires:1})})}}});_.Module.define({path:"comforum/widget/GamePopWindow",sub:{nextDay:new Date((new Date).getTime()+864e5-1e3*(60*(new Date).getHours()*60+60*(new Date).getMinutes()+(new Date).getSeconds())),tmp:['
          ','
          ','',"
          ",'
          ','
          ','','',"",'

          ','#{game_name}',"

          ",'
          #{game_hot}
          ',"
          ",'
          ','
          ','

          #{game_reco_info}

          ',"
          ",'','

          ',"#{game_desc_text}",'详情介绍',"

          ","
          ","
          "].join(""),initial:function(e){e&&PageData.user.is_login&&this.checkToShow(e)&&(this.game_name=e.game_name,this.popWindow=null,this.buildTmp(e),this.bindEvents(e),this.runStrategy(e))},checkToShow:function(e){var a=parseInt((new Date).getTime()/1e3);return e.start_time&&e.end_time&&e.start_timea},bindEvents:function(e){var a=this,t=1==e.pop_type?"吧推荐弹窗":"用户推荐弹窗",n="frs"==PageData.product?"frs页_":"pb页_";$("#game_pop_window").on("click",".pop_head_close",function(){$.stats.track(n+"弹窗_关闭弹窗","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_game:a.game_name}),a.hidePop(),a.clearStrategy()}).on("click",".game_name a",function(){$.stats.track(n+"弹窗_进入游戏","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_name:"游戏名称",obj_game:a.game_name}),a.hidePop(),a.clearStrategy()}).on("click",".game_image",function(){$.stats.track(n+"弹窗_进入游戏","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_name:"游戏图标",obj_game:a.game_name}),a.hidePop(),a.clearStrategy()}).on("click",".game_btn",function(){$.stats.track(n+"弹窗_进入游戏","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_name:"游戏按钮",obj_game:a.game_name}),a.hidePop(),a.clearStrategy()}).on("click",".game_desc a",function(){$.stats.track(n+"弹窗_详情介绍","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_name:"游戏按钮",obj_game:a.game_name})}).on("click",".forum_title",function(){$.stats.track(n+"弹窗_推荐吧点击","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_name:$(this).getData().forum_name,obj_game:a.game_name})}).on("click",".user_link",function(){$.stats.track(n+"弹窗_推荐用户点击","个性化弹窗实验","","click",{obj_type:"游戏",obj_subtype:t,obj_name:$(this).getData().user_name,obj_game:a.game_name})})},buildTmp:function(e){var a="",t={game_name:$.tb.subByte(e.game_name,16),game_image:e.game_image,game_link:e.game_link,game_hot:this.buildGameHot(e),game_reco_info:this.buildGameRecoInfo(e),game_desc_text:$.tb.subByte(e.game_desc,44),game_desc_link:e.game_desc_link};a=$.tb.format(this.tmp,t),this.popWindow=$(a).appendTo("body")},runStrategy:function(e){var a=$.cookie("game_pop_window");!a||0>a||a>3?(this.resetStrategy(),this.stepStrategy()):3==a?(this.showPop(e),this.resetStrategy()):0==a||this.stepStrategy()},resetStrategy:function(){$.cookie("game_pop_window",1,{expires:this.nextDay})},stepStrategy:function(){var e=$.cookie("game_pop_window");$.cookie("game_pop_window",++e,{expires:this.nextDay})},clearStrategy:function(){$.cookie("game_pop_window",0,{expires:this.nextDay})},showPop:function(e){var a=this,t=1==e.pop_type?"吧推荐弹窗":"用户推荐弹窗",n="frs"==PageData.product?"frs页_":"pb页_",o=setTimeout(function(){a.popWindow.show().css("bottom","-280px").animate({bottom:0},500),clearTimeout(o),o=null},2e3),i=setTimeout(function(){a.hidePop(),clearTimeout(i),i=null},12e3);$.stats.track(n+"弹窗_展现","个性化弹窗实验","","view",{obj_type:"游戏",obj_subtype:t,obj_game:a.game_name})},hidePop:function(){this.popWindow.animate({bottom:"-280px"},500,function(){$(this).hide()})},buildGameHot:function(e){var a=0,t="",n=parseInt(e.game_hot)||0,o=n>9?9:n;for(a;o>a;++a)a%2!=1&&(t+='');for(a%2==0&&(t+=''),a;10>a;++a)a%2!=1&&(t+='');return t+=''+e.game_hot+""},buildGameRecoInfo:function(e){var a,t="";if(1==e.pop_type){var n=$.tb.dataField({forum_name:e.forum_name});t+=''+$.tb.subByte(e.forum_name,12)+"吧里已经有"+e.user_num+"位贴吧小伙伴在玩这款游戏,马上加入到他们的行列!"}else if(2==e.pop_type)if(e.damn_friends)t+=e.damn_friends;else if("土豪足球"==e.game_name)t+="巴西世界杯激情开战,贴吧为你开启专享的世界杯!";else if("2014巴西世界杯"==e.game_name)t+="桑巴荣耀,谁能问鼎世界巅峰?贴吧邀你一起征战!";else{for(a=0;a3);++a){var o=$.tb.dataField({user_name:e.user_info[a]});t+=''+$.tb.subByte(e.user_info[a],12)+"、"}t=t.slice(0,t.length-1),t+="等多位贴吧小伙伴在玩这款游戏,马上跟他们一起玩!"}return t}}});