/*! 2018-07-13 */
function showthis(a){var b=getMsgItemById(a),c=$(b).find(".u-head").eq(0),d=$(c).find("img").attr("src"),e=$(b).find(".u-nickname").eq(0);e=$(e).text();var f=$(b).find(".u-msgword").find("img").attr("src");$("#hdimg").attr("src",d),$("#zsmc").html(e),$(".jbmz").html("大图"),$(".jbshow").addClass("view"),$(".jbleft").css({background:"url("+f+") no-repeat center center","background-size":"auto 100%"}),$(".jbshow").addClass("view")}function getMsgItemById(a){for(var b=$(".MsgItem"),c=0,d=b.length;c<d;c++)if($(b[c]).attr("msg_id")==a)return b[c];return!1}function closeit(){$(".jbshow").removeClass("view")}!function(a,b){function c(a,b,c,d,e,f){if(a.attr("msg_id",e),a.find(".u-head img").attr("src",b),a.find(".u-nickname").html(c),2==f){d="<div class='msg-pic'><img src = "+d+" width=auto height = "+(a.find(".u-msgword").height()-5)+"px onClick='showthis("+e+")' /></div>"}a.find(".u-msgword").html(d).toFillText(),a.find(".u-msgword").html(n(d,parseInt(a.find(".u-msgword").css("font-size"))+10))}function d(d,e,f,g,h,i){if(!getMsgItemById(g)){var k=b(j[r]);k.fadeOut(function(){k.css({visibility:"hidden",display:"block"}),c(k,d,e,f,g,h),k.css({visibility:"visible"}),k.addClass("msgin"),a.setTimeout(function(){k.removeClass("msgin")},2e3),++r>l&&(r=0)}),$.isFunction(i)&&i.call(this)}}function e(a,d,e,f,g,h){if(!getMsgItemById(f)){if(j=k.children(),s<=l){var i=b(j[s]);i.fadeIn(),c(i,a,d,e,f,g)}else{var i=b(j[0]);i.fadeOut(function(){b(j[2]).css({"margin-bottom":i.css("margin-bottom")}),i.css({"margin-bottom":i.css("margin-bottom"),visibility:"hidden",display:"block"}),c(i,a,d,e,f,g),i.slideUp(function(){i.remove().css({visibility:"visible",display:"none"}).appendTo(k).fadeIn()})})}s++,$.isFunction(h)&&h.call(this)}}function f(){var a;u.length>0?(a=u.pop(),v.push(a)):v.length>0&&1==y&&(a=g()),a&&("0"==x?e(a.avatar,a.nick_name,a.content,a.shenhetime,a.type):d(a.avatar,a.nick_name,a.content,a.shenhetime,a.type),2!=a.type||$(".jbshow").hasClass("view")||1!=z||(clearInterval(show_msg_2),$(".jbleft").css({background:"url("+a.content+") no-repeat center center","background-size":"auto 100%"}),$("#hdimg").attr("src",a.avatar),$("#zsmc").html(a.nick_name),$(".jbshow").addClass("view"),setTimeout(function(){$(".jbshow").removeClass("view"),show_msg_2=setInterval(function(){f()},w)},A)))}function g(){var a=v.length,c=Math.floor(Math.random()*a),d=v[c];return b(".MsgItem[msg_id="+d.shenhetime+"]",".Panel.MsgList").length<=1?d:g()}function h(a){b.getJSON(PATH_ACTIVITY+Path_url("ajax_act_new_msg.php"),{shenhetime:t},function(a){a&&0==a.ret&&b.isArray(a.data)&&a.data.length>0&&(u=a.data.concat(u),t=a.data[0].shenhetime)}).complete(function(){a&&"function"==typeof a&&a.call()})}var i,j,k,l,m=["#微笑#","#喜欢#","#晕#","#尴尬#","#汗#","#惊讶#","#郁闷#","#疑问#","#书呆子#","#悲伤#","#口罩#","#再见#","#冷#","#奸诈#","#困#","#被打#","#财迷#","#大哭#","#无聊#","#中毒#","#可爱#","#呲牙#","#大笑#","#馋#","#吵闹#","#愤怒#","#怀疑#","#闭嘴#","#鄙视#","#不屑#","#色#","#无聊#","#斜眼#","#酸#","#亲#","#恐吓#","#左鄙夷#","#右鄙夷#","#嘘#","#委屈#","#可怜#","#感动#","#酷#","#逗趣#","#黑#"],n=function(a,c){return b.each(m,function(b,d){a.indexOf(d)>-1&&(flg=!0,a=a.replace(new RegExp(d,"g"),p(b,c)))}),a},o=64,p=function(a,c){return i||(i=b(".faceicon")),'<span class="faceicon" style="width:'+c+"px;height: "+c+'px;display: inline-block"><img style="width:'+2880*c/o+"px;height:"+c+"px;left:-"+c*a+'px" src="'+i.find(".icon-seed").attr("src")+'" ></span>'},q=a.WBActivity.resize=function(){if(k){var a=20,c=k.height();j.each(function(d,e){var f=b(e);f.css({"margin-bottom":(c-f.outerHeight()*MSG_NUM)/(MSG_NUM-1)});var g=f.width(),h=f.height(),i=f.height()-2*a,j=i,k=g-i-3*a,l=j/4,m=k,n=h-3*a-l,o=l+2*a;f.find(".u-msgword").css({width:m+"px",height:n+"px",top:o+"px"})})}},r=0,s=0,t=0,u=[],v=[],w=1e3*WALL_INFO.re_time,x=WALL_INFO.show_style,y=WALL_INFO.show_type,z=WALL_INFO.show_big,A=1e3*WALL_INFO.show_big_time;WALL_INFO.chistory&&WALL_INFO.chistory,a.WBActivity.start=function(){k=b(".Panel.MsgList"),l=k.children().length-1,j=k.children(),h(function(){a.WBActivity.hideLoading(),b(".Panel.Top").css({top:0}),b(".Panel.Bottom").css({bottom:0}),b(".Panel.MsgList").css({display:"block",opacity:1}),q(),j.hide(),show_msg_2=setInterval(function(){f()},w),check_msg=setInterval(function(){h()},w)})}}(window,jQuery);