(function($,window){var UNDEFINED,NULL=null,TRUE=true,FALSE=false,slice=Array.prototype.slice,toString=Object.prototype.toString,toInt=parseInt,xwb=window.XWB,load_version=xwb.load_version,load_http=xwb.load_http,domain=xwb.load_domain,load_js=xwb.load_js,flashShow=xwb.flashShow,eventMgr=xwb.eventMgr,buildModulePath=xwb.url,htmlEscape=xwb.escape,alertMsg=xwb.alert,confirmBox=xwb.confirm,findParentElement=xwb.findParentElement,apiCall=xwb.apiCall,isArray=$.isArray,invokeClick=xwb.invokeClick,FileUploader=xwb.FileUploader,removeError=xwb.removeError,isFn=$.isFunction,isIE6=xwb.isIE6,TimeOut=xwb.TimeOut,event_default_handler=333,event_submenu_pro=1,event_submenu_indexGroup=2,event_submenu_userOption=3,event_submenu_headMore=4,event_submenu_xGroup=5,event_submenu_xApp=6,event_submenu_headAccount=7,event_submenu_headFriend=8,event_submenu_headMessages=9,event_submenu_headPoints=10,event_submenu_xPlaza=11,event_type_forward=1,event_type_fav=2,event_type_comment=3,event_type_thumbpic=4,event_type_trunleft=6,event_type_trunright=7,event_type_sendComment=8,event_type_pic_forward=12,button_hidepic=9,button_trunleft=10,button_trunright=11,event_type_video=13,event_type_forward_video_hide=15,event_type_delete=16,event_type_play_music=17,event_type_publish=19,event_type_fav_del=20,event_type_viewuser=21,event_type_originalForward=22,event_type_originalSendComment=23,event_type_userRemarks=24,event_type_userAttention=25,event_type_usermsgs=26,event_type_attaQuickly=27,event_type_magicFace=28,event_type_recommend=29,event_type_blackList=30,event_type_groupNameAdd=31,event_type_groupNameEdit=32,event_type_groupNameDel=33,event_type_Tags=34,event_type_desFri=35,event_type_blackDestroy=36,event_type_AttentionGroup=37,event_type_newFeed=38,event_type_ProfileInfo=39,event_type_commentDelBlack=40,event_type_weibo=41,event_type_dress=42,event_type_dressmore=43,event_type_in=44,event_type_feedback=45,event_type_recommendXWB=46,event_type_checkAll=47,event_type_groupOrder=48,event_type_addBrowserFavorite=49,event_type_invite=50,event_type_inviteHandle=51,event_type_feed=52,event_type_myselfDress=53,event_type_adegg=54,event_type_adegg_noIntegral=55,event_type_sign=56,event_type_constellation=57,event_type_proSend=58,event_type_featureTipsClose=59,music_type_189=1,music_type_sina=2,disable_class="disable",emotionPath="",picId=0,sina_music_player="http://music.sina.com.cn/yueku/m.php",errorMsgs={"0":$DMBMSG.DMB000,"5":$DMBMSG.DMB005,"1":$DMBMSG.DMB001,"2":$DMBMSG.DMB002,"3":$DMBMSG.DMB003,"4":$DMBMSG.DMB004,"1010000":$DMBMSG.DMB021,"20014":$DMBMSG.DMB014,"20015":$DMBMSG.DMB015,"20011":$DMBMSG.DMB011,"20020":$DMBMSG.DMB020,"20021":$DMBMSG.DMB021,"20022":$DMBMSG.DMB022,"20023":$DMBMSG.DMB023,"20024":$DMBMSG.DMB024};function regEvent(type,fn,event_type){eventMgr.add(type,fn,event_type?event_type:"click")}function getImageSrc(tid,type){var data=XWEIBO&&XWEIBO.data;var ele=data[tid];var propertyName;if(type==1){propertyName="tp"}else{if(type==2){propertyName="mp"}else{if(type==3){propertyName="op"}}}return propertyName&&data&&ele&&(ele[propertyName]||(ele.rt&&ele.rt[propertyName]))}var sinaurls=(function(){var urlInfos={};function getSinaUrlInfo(ids,callback){var total=ids.length,dataFromCache={},caches=0;$.each(ids,function(i,url_id){if(urlInfos[url_id]){dataFromCache[url_id]=urlInfos[url_id];caches++}});if(caches'+$DMBMSG.DMB027+'
').hide();$box.append($img);var pic_id=getNextPicId();this.bindEvent($box,pic_id);var $loading=$('
').insertBefore($box),img=new Image();img.onload=function(){$(this).appendTo("#"+img_panel_id).addClass("narrow-move").wrap(function(){return' '});Oheight=this.height;Owidth=this.width;picRatio=this.width/this.height;if(this.width>373){this.width=373;Nheight=373/picRatio;this.height=Nheight}$loading.remove();$img.show();this.onload=NULL;bindRight.freshRightContentInit()};img.src=getImageSrc(tid,2);img.title=$DMBMSG.DMB027},bindEvent:function($box){$box.click(function(e){var $target=$(e.target),rel=toInt($target.attr("rel")),$img=findParentElement("DIV",$target);switch(TRUE){case button_trunleft==rel:$("img",$img).imgRotate("left");break;case button_trunright==rel:$("img",$img).imgRotate("right");break}rel&&e.preventDefault()})}};var wbReader=(function(){function eventBind(){$(document).keydown(function(e){var reader=wbReader,_target=e.target;if(!_target||(_target.tagName!="INPUT"&&_target.tagName!="TEXTAREA")){if(!reader._timeout){reader._timeout=setTimeout(function(){if(e.keyCode==74||e.keyCode==38){reader.move("up")}else{if(e.keyCode==75||e.keyCode==40){reader.move("down")}}reader._timeout=NULL;delete reader._timeout},200)}if(e.keyCode==40||e.keyCode==38&&!reader.firstIsInVeiw()){e.preventDefault()}}});$(window).scroll(function(){wbReader.checkUnread();var firstIsInVeiw=wbReader.firstIsInVeiw();if(!wbAutoInsert.isStop&&!firstIsInVeiw){wbAutoInsert.stop()}else{if(wbAutoInsert.isStop&&firstIsInVeiw&&XWEIBO.autoshow==="1"){wbAutoInsert.insert()}}})}return{ctn:NULL,first:NULL,last:NULL,lastTop:0,curList:NULL,init:function(ctn){this.ctn=ctn;this.lastTop=$(document).scrollTop()||0;this.first=this.getFirstInVeiw();this.last=this.getLastInVeiw();eventBind.call(this)},move:function(dir){var _$tarEl,_$first,_osTop=80;this.curList=this.getFirstInVeiw();if(this.curList){this.curList=$(this.curList).next().get(0)}else{_$first=$(this.ctn).children().first();if(_$first.offset().top-_osTop<=$(document).scrollTop()){this.curList=_$first.get(0)}}if(dir==="up"){_$tarEl=$(this.curList).prev()}else{if(dir==="down"){if(this.curList){_$tarEl=$(this.curList).next()}else{_$tarEl=_$first}}}if(_$tarEl[0]){_$tarEl.moveToView(_osTop);this.curList=_$tarEl[0]}_$tarEl=_osTop=_$first=NULL},firstIsInVeiw:function(){var $child=$(this.ctn).children(),_top=$child[0]?$(this.ctn).children().first().offset().top:0;return _top>=$(document).scrollTop()},getChildsInVeiw:function(){var _top=$(document).scrollTop(),els=[];$.each($(this.ctn).children(),function(i,child){var _offsetTop=$(child).offset().top,_height=$(window).height();if(_offsetTop>_top){if(_height+_top-_offsetTop<=$(child).height()){_offsetTop=_height=NULL;return false}else{els.push(child)}}});_top=NULL;return els},getFirstInVeiw:function(){var _top=$(document).scrollTop();var first=NULL;$.each($(this.ctn).children(),function(i,child){var _offsetTop=$(child).offset().top;if(_offsetTop>_top){if(i==0){first=NULL}else{first=$(child).prev()[0]}_offsetTop=NULL;return false}});_top=NULL;return first},getLastInVeiw:function(){var _top=$(document).scrollTop(),_height=$(window).height();var last=NULL;$.each($(this.ctn).children(),function(i,child){var _offsetTop=$(child).offset().top;if(_height+_top-_offsetTop<$(child).height()){last=child;_offsetTop=_height=NULL;return false}});_top=NULL;return last},checkUnread:function(){var _top=$(document).scrollTop(),_dir=this.lastTop>_top?"up":"down";this.lastTop=_top;var $el,first=this.getFirstInVeiw(),last=this.getLastInVeiw(),rFirst=this.first,rLast=this.last;if(first!=rFirst){if(_dir==="down"){$el=$(rFirst)}if(first!=last&&$el){$el.removeClass("unread")}this.first=first}if(last!=rLast){this.last=last}}}})();var wbFuns={getLists:function(type,category,num,subs){apiCall("getCmdNav",{data:"category="+category+"&num="+num+"&sub="+subs+"&type="+type,success:function(result){if(result&&result.errno==0){var html="",cls="";featureTips.init("four");$.each(result.rst.result.categorys[0]["items"],function(key,obj){switch(type){case"HOME":var linker=obj.link.indexOf("http://")!="-1"?'':' ';html+=""+linker+' '+linker+""+obj.subname+" ";break;case"MSG":html+=" ";break}});html+='
';$("#right_cmd_list"+category).html(html);return true}else{$("#right_cmd_list"+category).html("");return false}},error:function(httpException){$("#right_cmd_list"+category).html("")},timeout:TimeOut});if(type=="HOME"){apiCall("getNavList",{data:"category_ids="+category,success:function(result){if(result&&result.errno==0){var html="";var n="";$.each(result.rst.result.categorys[0]["items"],function(key,obj){if(key<10){html+=' ';if(category==2){if(obj.unread_count>99){n="99+"}else{n=obj.unread_count}html+=''+n+" "+$DMBMSG.DMB487+" "}html+=''+obj.name_str+" "}});html+='
';$("#right_user_list"+category).html(html);return true}else{$("#right_user_list"+category).html(html);return false}},error:function(httpException){$("#right_cmd_list"+category).attr("class","");$("#right_user_list"+category).html("")},timeout:TimeOut})}return false},getInterested:function(){apiCall("getSuggestions",{data:"",success:function(result){if(result&&result.errno==0){var html="";$.each(result.rst,function(key,obj){html+="'+obj.uInfo.screen_name_str+" ";if(obj.reason_url!=""){html+=''+obj.reason_str+" "}else{html+=''+obj.reason_str+"
"}html+=" "});html+='
';$("#right_sug_list").html(html);return true}else{$("#right_sug_list").html('
');return false}},error:function(httpException){$("#right_sug_list").html('
')},timeout:TimeOut})},getMaybe:function(){apiCall("getMaybe",{data:"",success:function(result){if(result&&result.errno==0){var html="";$.each(result.rst,function(key,obj){html+="'+obj.screen_name_str+" ";if(obj.reason){html+=''+obj.reason+"
"}html+=" "});$("#right_maybe_list").html(html);return true}},error:function(httpException){},timeout:TimeOut})}};var wbFeed={saveGroup:function(){var ids=[];$("input[name='group[]']:checkbox:checked").each(function(){ids.push($(this).val())});if(globalGroup.rst.defaults!=""&&ids.sort(function(a,b){return b-a}).join(",")!=globalGroup.rst.defaults.split(",").sort(function(a,b){return b-a}).join(",")){apiCall("saveGroup",{data:"groupid="+ids,success:function(msg){if(msg.errno==0){wbFeed.loadGroup();$("#feed-list").html("");wbFeed.getFeeds()}}})}return this},getFeeds:function(str){$(document).scrollTop(195);if(str.indexOf("fir=1")==-1){window.location.hash="hIndex"}else{window.location.hash="#"}$("#feed-list").html("");$("#TimeOutErr").remove();var re=/^[0-9]+.?[0-9]*$/;if(re.test(str)){$("#feed-list").html("");$("#feed-page").html("");str="gid="+str}this.loading(false,false);this.isLoading=true;apiCall("index.",{data:str,success:function(result){if(result&&result.errno==0){if(result.rst.total==0&&str.indexOf("fir=1")!=-1){wbFeed.loading(true,false);this.isLoading=true;$(".nodata_box").show();return false}if(str.indexOf("fir=1")!=-1){featureTips.init("thr")}XWEIBO_TMP=XWEIBO;wbFeed.createFeeds(result);$.each(XWEIBO_TMP,function(i,obj){i!="data"&&(XWEIBO[i]=XWEIBO_TMP[i])});$.extend(XWEIBO.data,XWEIBO_TMP.data);wbFeed.loading(true,false);this.isLoading=true;return false}else{wbFeed.loading(true,"feed-list");$("#feed-list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,false);$("#feed-list").append(''+$DMBMSG.DMB988+"
")},timeout:TimeOut});return false},createFeeds:function(result){$("#feed-list").html(result.rst.html);$("#feed-page").html(result.rst.page);createAction("feed-list")},loading:function(isStop,id){if(isStop){$("#xweibo-loading").remove()}else{$("#xweibo-loading").remove();id=id==false?"#feed-list":"#"+id;var $loading=$("
").attr("id","xweibo-loading").addClass("loading");$(id).after($loading)}},getFeedInfo:function(params){var tid=parseInt(params.tid),callBack=params.callback,ctype=params.ctype||"",source=params.source,isforward=params.isforward,btype=params.btype||this.Btype,isnew=params.isnew,rel=params.rel||"",uid=params.uid,ptid,btnI=0,dataAction="",isfeed=1,_this;if(isnew){isfeed=0;if(ctype=="comment"){dataAction+="&cuid="+uid;btnI=2}if(ctype=="forward"){dataAction+="&ruid="+uid+"&count=10";btnI=1}}if(isforward!==undefined){ptid=tid;tid=XWEIBO.data[tid].rt.id;XWEIBO.data[tid]=XWEIBO.data[ptid].rt}if(bindRight.cache.get("feed-"+tid)&&(!isnew)){this._lastValue(tid,rel,isnew,ctype,bindRight.cache.get("feed-"+tid),isfeed)}else{_this=this;apiCall("getFeedInfo",{data:"tid="+tid+"&isfeed="+isfeed+dataAction,success:function(result){bindRight.freshRightContent.html("");if(result&&(result.rst)&&(result.errno==0||result.errno==-1)){if(result.rst.check==-1){$(".base_right_main").attr("class","right_main");$("#freshRightContent").html(result.rst.html)}else{_this._lastValue(tid,rel,isnew,ctype,result.rst.html,isfeed);isnew||bindRight.cache.set("feed-"+tid,result.rst.html);showForward.moreLinkEventBind(tid,isfeed)}}else{$(".base_right_main").attr("class","right_main");apiCall("getErrorSystem",{data:{},success:function(result){$("#freshRightContent").html(result.rst)}});return false}}})}return this},_lastValue:function(tid,rel,isnew,ctype,html,isfeed){var XWEIBO_TMP=XWEIBO,uid,envlope={},_this=this;bindRight.freshDataInsert(html);$.each(XWEIBO_TMP,function(i,obj){i!="data"&&(XWEIBO[i]=XWEIBO_TMP[i])});$.extend(XWEIBO.data,XWEIBO_TMP.data);uid=XWEIBO.data[tid].u.id;$.each([XWEIBO.data[tid],XWEIBO.data[tid].rt],function(idx,ele){if(!ele){return}if(!ele.tp){return}rel=idx;if(idx){idx=event_type_pic_forward}});wbSubjoin.getEmotionData(function(){var _text=_this.toVisit(XWEIBO.data[tid].tx.replace(/\/gi,">")),_s=XWEIBO.data[tid].s;$(_this.config.content).html(_text);viewMiddlePicS(tid);(ctype!="forward")&&wbComment.get(tid+"",isnew).toggle(isnew);envlope[tid]=XWEIBO.data[tid];linkRender(envlope,1);wbSubjoin.init(".forward_box .add-area",".forward_box textarea:last",{font:"",face:{left:8,pos:1}},"icon_a");showForward.init(tid,isfeed);bindRight.rightToolBind.init({tid:tid,isnew:isnew,ctype:ctype})});$(this.config.img).attr("src",XWEIBO.data[tid].u.p);$(this.config.name).attr({title:XWEIBO.data[tid].u.sn,uid:uid});$(this.config.name).html(XWEIBO.data[tid].u.sn);if(!!XWEIBO.data[tid].rt){$(this.config.rt+" a:eq(0)").attr({uid:XWEIBO.data[tid].rt.u.id,"class":XWEIBO.data[tid].rt.u.v==1?"v-icon icon-bg b_link":"b_link"}).text("@"+XWEIBO.data[tid].rt.u.sn);wbSubjoin.getEmotionData(function(){var _text=_this.toVisit(XWEIBO.data[tid].rt.tx.replace(/\/gi,">"));$(_this.config.rt+" span:first").html(_text)})}$(".feed_option a.tpl_btn_bg2 span").attr("tid",tid)},toVisit:function(str){var returnValue="";returnValue=str.replace(/(@[0-9a-zA-Z\u4e00-\u9fa5_-]*)/ig,function($1){return''+$1+" "});returnValue=returnValue.replace(/(http:\/\/[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+([A-Z0-9a-z-_\$\.\+\!\*\(\)//,:;@&=\?\~\#\%]*))/ig,'$1 ');returnValue=returnValue.replace(/(#[0-9a-zA-Z\u4e00-\u9fa5_-]*#)/g,function($1){return''+$1+" "});returnValue=returnValue.replace(/(\[[^\[\]]*\])/g,function($1){var temp="";$.each(XWEIBO.emotions,function(i,it){if($1=="["+it[0]+"]"){temp=' ';return false}else{temp=$1}});return temp});return returnValue},getAtmeFeeds:function(str){removeError();this.loading(false,false);this.isLoading=true;apiCall("index.atme",{data:str,success:function(result){if(result&&result.errno==0){$("#feed-list").append(result.rst.html);$("#feed-page").html(result.rst.page);createAction("feed-list");wbFeed.loading(true,false);this.isLoading=true}else{wbFeed.loading(true,"feed-list");$("#feed-list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,false);$("#feed-list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},getProfile:function(param){$(document).scrollTop(195);$(".nodata_box").hide();$("#profile-list").html("");$("#profile-page").html("");for(var i=0;i<5;i++){if(param.indexOf("feature="+i)!=-1){$("#feature"+i).addClass("current")}else{$("#feature"+i).removeClass("current")}}removeError();var re=/^[0-9]+.?[0-9]*$/;if(re.test(param)){$("#profile-list").html("");$("#profile-page").html("")}var module=param.indexOf("mid")!=-1?"index.profile":"ta.profile";this.loading(false,"profile-list");apiCall(module,{data:param,success:function(result){if(result&&result.errno==0){if(!result.rst.total&¶m.indexOf("fir=1")!=-1){wbFeed.loading(true,false);$(".nodata_box").show();$("#profile-page").html("");return false}$("#profile_feature").show();wbFeed.loading(true,false);$("#profile-list").html(result.rst.html);$("#profile-page").html(result.rst.page);createAction("profile-list")}else{wbFeed.loading(true,"profile-list");$("#profile-list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,false);$("#profile-list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},getUserProfile:function(param){removeError();var re=/^[0-9]+.?[0-9]*$/;if(re.test(param)){$("#feed_right_list").html("");$("#feed_right_page").html("")}this.loading(false,"feed_right_list");apiCall("getUserProfile",{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,false);$("#feed_right_list").append(result.rst.html);$("#feed_right_page").html(result.rst.page);createAction("feed_right_list")}else{wbFeed.loading(true,"feed_right_list");$("#feed_right_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,false);$("#feed_right_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},getFavs:function(str){removeError();this.loading(false,"favs-list");apiCall("index.favorites",{data:str,success:function(result){if(result&&result.errno==0){$("#favs-list").append(result.rst.html);$("#favs-page").html(result.rst.page);wbFeed.loading(true,"favs-list");var $feedList=$("#favs-list");XWB.linkRender();XWB.counterAdd()}else{wbFeed.loading(true,"favs-list");$("#favs-list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"favs-list");$("#favs-list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},getFollow:function(param,changeid){apiCall("follow",{data:param,success:function(result){if(result&&result.errno==0){if(changeid!=""&&typeof changeid!="undefined"){var change_gid=$("#change_lists").attr("gid");$(".allgroup_list ul").prepend(''+$("#change_lists").text()+" ");$("#change_lists").text($("#change_"+changeid.toString()).text()).attr("onclick","XWB.feed.getFollow('gid="+changeid+"')").attr("gid",changeid);$("#changeLi_"+changeid.toString()).remove()}$("#showfollow_list").html(result.rst.html);$("#showfollow_page").html(result.rst.page)}else{return false}},error:function(httpException){},timeout:TimeOut});return this},config:{img:"#feed_comment .wb_info_t1:eq(0) .face img",name:"#feed_comment .wb_info_t1:eq(0) .feed-content p a",content:"#feed_comment .wb_info_cont .feed-content p",rt:"#feed_comment .newsforward_main .box-content p"}};function createAction(id){linkRender();counterAdd();imgLazyLoad()}var wbUserEdit={blackJoin:function(uid,msg){alertMsg({msg:$DMBMSG.DMB442,type:"success",timeout:1,style:1,pos:"center"});apiCall("joinBlocks",{data:"id="+uid,success:function(result){if(!msg){return}if(result&&result.errno==0&&result.rst==1){return true}else{if(result.rst==false){alertMsg({msg:result.err,type:"error",timeout:1,style:1,pos:"center"});return false}}}})},getDes:function(){apiCall("getUserInfo",{data:{},success:function(result){if(result&&result.errno==0){return result}else{alert($DMBMSG.DMB987);return false}}})},desFri:function(id){if(id!=""){apiCall("destroyFriends",{data:"id="+id,success:function(result){if(result&&result.errno==0&&result.rst==1){window.location.href="index.php?m=ta&id="+id;return true}else{if(result.rst==false){alert(result.err);return false}}}})}else{return false}},remark:function(id,name,win){if(id!=""){apiCall("remarkUser",{data:"id="+id+"&remark="+name,success:function(result){if(result&&result.errno==0&&result.rst==1){$("#remarkName").text(name);win.remove();return true}else{if(result.rst==false&&result.errno==80021){alert($DMBMSG.DMB081);return false}else{if(result.rst==false){alert(result.err);return false}}}}})}else{return false}},getGroup:function(){apiCall("getGroup",{data:{},success:function(result){if(result&&result.errno==0&&result.rst==1){return true}else{if(result.rst==false){alert(result.err);return false}}}})},joinGroup:function(){var gid=$("#subval").attr("gid").toString(),subval=$("#subval").val();if(gid!=""&&subval!=""){apiCall("joinGroup",{data:"gid="+gid+"&subval="+subval,success:function(result){if(result&&result.errno==0&&result.rst==1){location.reload(true);return true}else{if(result.rst==false){return false}}}})}},setLang:function(val){apiCall("setting.setlang",{data:"lang="+val,success:function(json){window.location.href="index.php"}})}};var wbMessage={getMsg:function(param){removeError();wbFeed.loading(false,"message_list");apiCall("index.messages",{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"message_list");$("#message_list").append(result.rst.html);$("#message_page").html(result.rst.page)}else{wbFeed.loading(true,"message_list");$("#message_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"message_list");$("#message_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut})},getMsgInfo:function(id,page,startpos,endpos){apiCall("getMsgShow",{data:"id="+id+"&page="+page+"&startpos="+startpos+"&endpos="+endpos,success:function(result){if(result&&result.errno==0){bindRight.freshDataInsert(" "+result.rst.html);Msgs.init("showPopup","#msgright",2);$("#msglist").attr("uid",id);return true}else{if(result.rst==false&&result.errno==-1){$("#freshdiv").html(result.err)}}}})},getConversation:function(str){wbFeed.loading(false,"msglist");apiCall("getMsgShow",{data:str,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"msglist");$("#msglist").append(result.rst.html);$("#message_detail_page").html(result.rst.page);return true}else{if(result.rst==false&&result.errno==-1){$("#msglist").html(result.err)}}}})},getNotice:function(str){wbFeed.loading(false,"notice_list");apiCall("index.notice",{data:str,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"notice_list");$("#notice_list").append(result.rst.html);$("#notice_page").html(result.rst.page);return true}else{if(result.rst==false&&result.errno==-1){$("#notice_list").html(result.err)}}}})},getInvite:function(str){wbFeed.loading(false,"invite_list");apiCall("index.invite",{data:str,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"invite_list");$("#invite_list").append(result.rst.html);$("#invite_page").html(result.rst.page);return true}else{if(result.rst==false&&result.errno==-1){$("#invite_list").html(result.err)}}}})}};var wbFans={getFans:function(param){removeError();wbFeed.loading(false,"user_list");var module=param.indexOf("mid")!=-1?"index.fans":"ta.fans";apiCall(module,{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"user_list");$("#user_list").append(result.rst.html);$("#user_page").html(result.rst.page)}else{wbFeed.loading(true,"user_list");$("#user_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"user_list");$("#user_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut})},getChain:function(param){removeError();wbFeed.loading(false,"user_list");var module=param.indexOf("mid")!=-1?"index.fans":"ta.chain";apiCall(module,{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"user_list");$("#user_list").append(result.rst.html);$("#user_page").html(result.rst.page)}else{wbFeed.loading(true,"user_list");$("#user_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"user_list");$("#user_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut})},getFollow:function(param){removeError();wbFeed.loading(false,"follow_list");var module=param.indexOf("mid")!=-1?"index.follow":"ta.follow";apiCall(module,{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"follow_list");$("#follow_list").append(result.rst.html);$("#follow_page").html(result.rst.page)}else{wbFeed.loading(true,"follow_list");$("#follow_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"follow_list");$("#follow_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut})},getCommon:function(param){removeError();wbFeed.loading(false,"follow_list");var module=param.indexOf("mid")!=-1?"index.follow":"ta.common";apiCall(module,{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"follow_list");$("#follow_list").append(result.rst.html);$("#follow_page").html(result.rst.page)}else{wbFeed.loading(true,"follow_list");$("#follow_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"follow_list");$("#follow_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut})},getAttlist:function(param){removeError();wbFeed.loading(false,"follow_list");apiCall("index.attlist",{data:param,success:function(result){if(result&&result.errno==0){wbFeed.loading(true,"follow_list");$("#follow_list").append(result.rst.html);$("#follow_page").html(result.rst.page)}else{wbFeed.loading(true,"follow_list");$("#follow_list").append(''+result.err+" ");return false}},error:function(httpException){wbFeed.loading(true,"follow_list");$("#follow_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut})},editInfo:function(){var newDes=$("#edit_des").val();if(newDes!=""){apiCall("updateProfile",{data:"description="+newDes,success:function(result){if(result&&result.errno==0&&result.rst==1){$(".user_des").text(newDes);return true}else{if(result.errno==80005){alert($DMBMSG.DMB060);return false}else{if(result&&result.errno==0){alert($DMBMSG.DMB062);return false}}}}})}else{return true}},addTags:function(){var tags=$("#add_tag").val();if(tags!=""){var rTags=tags.replace(",",",");if($.asciiLen(rTags.split(",").join(""))>14){alert($DMBMSG.DMB070);return false}apiCall("addTags",{data:"tags="+rTags,success:function(result){if(result&&result.errno==0&&result.rst==1){var user_tag=$("#user_tags").text();user_tag==""?$("#user_tags").text(tags):$("#user_tags").text(user_tag+","+tags);return true}else{if(result&&result.errno==0){alert($DMBMSG.DMB986);return false}}}})}else{return true}},getFriendsCommon:function(sinaid,count,id){apiCall("getFriendsCommon",{data:"uid="+sinaid+"&count="+count,success:function(result){var html=''+$DMBMSG.DMB485+',
'+$DMBMSG.DMB486+" ";if(result&&result.errno==0){if(result.rst.total_number>0){html="";$.each(result.rst.users,function(key,obj){html+=' '})}html+='
';$("#"+id).html(html);$("#"+id+"_count").text(result.rst.total_number);if(result.rst.total_number>8){$("#"+id+"_more").show()}}else{$("#"+id).html(html);return false}},error:function(httpException){$("#"+id).html(httpException)},timeout:TimeOut})},getFriendsChain:function(sinaid,count,id){apiCall("getFriendsChain",{data:"uid="+sinaid+"&count="+count,success:function(result){var html=''+$DMBMSG.DMB483+',
'+$DMBMSG.DMB484+" ";if(result&&result.errno==0){if(result.rst.total_number>0){html="";$.each(result.rst.users,function(key,obj){html+=' '})}html+='
';$("#"+id).html(html);$("#"+id+"_count").text(result.rst.total_number);if(result.rst.total_number>8){$("#"+id+"_more").show()}}else{$("#"+id).html(html);return false}},error:function(httpException){$("#"+id).html(httpException)},timeout:TimeOut})},getUser:function(objuid,utype){var eventBind=function(){$(".user_option_area a").click(function(e){var $target=$(this),$li=findParentElement("LI",$target),id=$li.attr("uid"),type=$(this).attr("type"),i=$.inArray($target[0],$(".user_option_area a"));if(type=="ufeed"){$("#feed_right_list").html("");$("#feed_right_page").html("")}else{$("#right_"+type+"_list").html("");$("#right_"+type+"_page").html("")}$target.siblings().addClass("a_link").removeClass("current c_link");$target.addClass("current c_link").removeClass("a_link");$(".right_box_list").hide();$(".right_box_list").eq(i).show();switch(type){case"ufeed":XWB.feed.getUserProfile("id="+id+"&fr=1");break;case"ufollow":XWB.fans.getRightUFollow("id="+id+"&fr=1");break;case"ufans":XWB.fans.getRightUFans("id="+id+"&fr=1");break}})};apiCall("getUserShow",{data:"objuid="+objuid+"&utype="+utype,success:function(result){if(result&&result.errno==0){var XWEIBO_TMP=XWEIBO;bindRight.freshDataInsert(result.rst.html);bindRight.freshRightContentInit();$.each(XWEIBO_TMP,function(i,obj){i!="data"&&(XWEIBO[i]=XWEIBO_TMP[i])});$.extend(XWEIBO.data,XWEIBO_TMP.data);linkRender();subMenuMgr.init();wbFans.getFriendsChain(result.rst.sinaid,8,"right_friends_chain");wbFans.getFriendsCommon(result.rst.sinaid,8,"right_friends_common");eventBind();return true}else{if(result.rst==false&&result.errno==-1||result.errno!=0){if(result.errno=="20003"){$("#freshRightContent").html(result.err)}else{$("#freshRightContent").html(result.err)}}}}})},getRightUFollow:function(params){wbFeed.loading(false,"right_ufollow_list");$("#right_ufollow_list").after('
');apiCall("getUserFollow",{data:params,success:function(result){if(result&&result.errno==0){$("#xweibo-loading").siblings(".clearall").remove();wbFeed.loading(true,"right_ufollow_list");$("#right_ufollow_list").append(result.rst.html);$("#right_ufollow_page").html(result.rst.page);return true}else{if(result.rst==false&&result.errno==-1||result.errno!=0){wbFeed.loading(true,"right_ufollow_list");$("#right_ufollow_list").html(result.err)}}}})},getRightUFans:function(params){wbFeed.loading(false,"right_ufans_list");$("#right_ufans_list").after('
');apiCall("getUserFans",{data:params,success:function(result){if(result&&result.errno==0){$("#xweibo-loading").siblings(".clearall").remove();wbFeed.loading(true,"right_ufans_list");$("#right_ufans_list").append(result.rst.html);$("#right_ufans_page").html(result.rst.page);return true}else{if(result.rst==false&&result.errno==-1||result.errno!=0){wbFeed.loading(true,"right_ufans_list");$("#right_ufans_list").html(result.err)}}}})}};var wbSearch={feeds:function(str){$("#TimeOutErr").remove();var re=/^[0-9]+.?[0-9]*$/;if(re.test(str)){$("#search-list").html("");$("#search-page").html("");str="t="+str}this.loading(false,false);apiCall("search.",{data:str,success:function(result){if(result&&result.errno==0){wbSearch.createFeeds(result);wbSearch.loading(true,false)}else{wbFeed.loading(true,"search-list");$("#search-list").append(''+result.err+" ");return false}},error:function(httpException){wbSearch.loading(true,false);$("#search-list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},users:function(str){$("#TimeOutErr").remove();var re=/^[0-9]+.?[0-9]*$/;if(re.test(str)){$("#search-list").html("");$("#search-page").html("");str="t="+str}this.loading(false,false);apiCall("search.user",{data:str,success:function(result){if(result&&result.errno==0){wbSearch.loading(true,false);wbSearch.createFeeds(result)}else{wbFeed.loading(true,"search-list");$("#search-list").append(''+result.err+" ");return false}},error:function(httpException){wbSearch.loading(true,false);$("#search-list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},createFeeds:function(result){$("#search-list").append(result.rst.html);$("#search-page").html(result.rst.page)},loading:function(isStop,id){if(isStop){$("#xweibo-loading").remove()}else{$("#xweibo-loading").remove();id=id==false?"#search-list":"#"+id;var $loading=$("
").attr("id","xweibo-loading").addClass("loading");$(id).after($loading)}}};var wbNavmgr=(function(){var $ui={};function eventBind(){}return({toggle:function($box){var j=1,$appBox=$box,$ul=$(".win_group_list_k ul",$appBox).eq(1),$morelinks=$(".morelinks",$appBox),$more=$(".morelinks a",$appBox).eq(0),$all=$(".morelinks a",$appBox).eq(1),$li=$("li",$ul),$morelink=$(".morelink a",$appBox),size=$li.size(),$cookie=$("div[cookie]",$appBox),min=parseInt($cookie.attr("min")),max=parseInt($cookie.attr("max")),hide=parseInt($more.attr("hide")),cookie=$cookie.attr("cookie"),cookieValue=parseInt($.cookie(cookie));$li.hide();if(cookieValue){min=max}$.each($li,function(i,li){if(i==min){return false}$(li).show();j++});if(!cookieValue){$morelinks.hide();$more.text("更多");$more.show();$all.hide()}else{$morelinks.hide();$more.show();$more.text($DMBMSG.DMB026);if(size>max){$all.show()}}if((size'].join("");$target.html(layer);$(parentId+" .win_group_list_k ul li").live({mouseenter:function(){$(this).siblings().removeClass("current");$(this).addClass("current")},mouseleave:function(){$(this).removeClass("current")}})},liTemp:function(){var str=['
'].join("");return $(str)}(),getData:function(param){function defaultSet(){if($winGroup.eq(0).is(":visible")&&$winGroup.eq(1).is(":visible")){$(".doline",$box).show()}else{$(".doline",$box).hide()}if($winGroup.last().is(":hidden")){$morelink.find("a").eq(1).hide()}else{$morelink.find("a").eq(1).show();$more.hide();$more.find("a:first").hide();$more.find("a:last").show()}}var $box=param.$box,action=param.action,data=param.data,$ul=param.$ul,$more=$ul.find("div.morelinks"),$morelink=$(".morelink",$box),$h2=$ul.find("h2"),cachName=param.cachName,wbnum=param.wbnum||0,toggle=param.toggle||0,$winGroup=$(".win_group_k",$box);var cachContent=wbNavmgr.cach[cachName];$ul.find("ul").html('
');$more.hide();apiCall(action,{data:data,success:function(ret){$ul.find("ul").html("");if(ret.errno!=0){return}if(ret.rst.result.length==0){return}var items=ret.rst.result.categorys[0].items,$liTmp,uCount;if(items.length==0){$ul.hide();defaultSet();return}$.each(items,function(i,item){$liTmp=wbNavmgr.liTemp.clone();uCount=parseInt(item.unread_count);if(uCount>99){$("div.wbnum span a",$liTmp).text("+99");$("div.wbnum span a",$liTmp).attr("href",item.link)}else{if(uCount>0){$("div.wbnum span a",$liTmp).text("+"+uCount);$("div.wbnum span a",$liTmp).attr("href",item.link)}else{$("div.wbnum",$liTmp).remove()}}$("div.text a",$liTmp).text(item.name);$("div.text a",$liTmp).substrText(6);$("div.text a",$liTmp).attr({title:item.name,href:item.link});$("a.pic",$liTmp).attr("href",item.link);$("a.pic img",$liTmp).attr({src:item.icon,title:item.name,title:item.name});$ul.find("ul").append($liTmp)});$ul.show();toggle&&wbNavmgr.toggle($box);wbNavmgr.cach[cachName]=$ul.find("ul").html();defaultSet()}})}})})();var wbComment=(function(){var _wbid,_$cEl,_$ul,_$more,_isnew,_isfocus;function eventBind(){$(".comment_textarea").autoResize({onResize:function(){},animateCallback:function(){$(this).css({opacity:1})},animateDuration:300,extraSpace:0});_$ul.unbind("click");_$ul.bind("click",wbComment,function(e){var $target=$(e.target),rel=$target.attr("rel"),wbc=e.data,self=$target.attr("self"),style=0;if(rel){var $li=findParentElement("LI",$(e.target)),cid=$li.attr("rel").slice(2);switch(rel){case"del":if(self=="false"){commentDelBlack($target,event_type_commentDelBlack);return}confirmBox({title:$DMBMSG.DMB991,msg:$DMBMSG.DMB100,type:"remind",target:$target,oxr:36,oy:130,oyr:-40,pos:1,style:style},function(){wbc.delComment(cid)});return false;break;case"reply":wbc.replyComment(cid);return false;break}}})}return{get:function($srcEl,isnew){if(typeof $srcEl==="string"){_wbid=$srcEl}else{_wbid=getWeiboID($srcEl)}var $wb=$('li[id*="'+_wbid+'"]').not('[id^="i"]');if($wb[0]){_$cEl=$wb.find("div.feed-comment");if(!_$cEl[0]){wbComment.isLoading=FALSE;_$cEl=this.createTextArea(true,_wbid,"","",isnew,XWEIBO.data[_wbid].rt).appendTo(".right_scroll").show();wbSubjoin.init($(".add-area[subjoin=right_comment]"),_$cEl.find("textarea"),{font:"",face:{left:28,pos:1}},"icon_a")}_$ul=_$cEl.find("ul");_$more=_$cEl.find("div.more-comment");eventBind()}return this},toggle:function(isnew,isfocus){isnew=isnew||0;this._isnew=isnew;this.loadData();this.isShow=false;this._isfocus=isfocus;isnew&&bindRight.freshRightContentInit()},show:function(){if(_$cEl&&_$cEl[0]){_$cEl.show()}return this},loading:function(isStop){if(isStop){$("#xweibo-loading").remove();var $replayList=$(".right_comment .feed-comment ul");if($replayList.find("li").size()==0){$replayList.append(''+$DMBMSG.DMB012+" ")}}else{var $loading=$("
").attr("id","xweibo-loading").addClass("loading");$(".right_comment .more-comment:eq(0)").before($loading)}},isLoading:FALSE,loadData:function(param){var _this=this,isfeed=_this._isnew?0:1,tid=_wbid,count=10;_this.isfeed=isfeed;if(this.isLoading){return}this.loading();this.isLoading=TRUE;apiCall("getComments",{data:param?param:"id="+_wbid+"&page=1&isfeed="+isfeed,success:function(msg){if($(".feed_option a:eq(0)").hasClass("current")||!isfeed){if(msg.errno==0){wbComment.createList(msg.rst,msg.rst.total-count,_wbid);wbComment.show()}wbComment.loading("stop");wbComment.isLoading=FALSE}}})},createTextArea:function(hasList,wbid,classname,cid,isnew,rt){var listStr=hasList?'':"",classname=classname?classname:"right_comment",cid=cid?cid:"",send_tools='",$el=$("
").addClass(classname).html([(isnew?'':""),'",'",""].join("")).hide();$el.find("a.choose-emotion").click(function(e){wbSubjoin.showEmotion(this,$el.find("textarea"),-20,30,1);return FALSE});return $el},createList:function(data,more,tid){if(_$ul&&_$ul[0]){var frag=document.createDocumentFragment();$.each(data,function(i,item){if(isNaN(i)){return}var $li=wbComment.createComment(item,tid);frag.appendChild($li[0])});_$ul[0].appendChild(frag)}$("#comment_page").html(data.makePage);$("#comment_page a").attr("class","morelist_link a_link");return this},createComment:function(item,tid){var delStr="",sinaV=item.sina_v?'class="v-icon icon-bg"':"",wbUid=XWEIBO.data&&XWEIBO.data[_wbid]&&XWEIBO.data[_wbid].u.id,url=XWB.url("ta","","id="+item.uid);if(wbUid==XWEIBO.uid||item.uid==XWEIBO.uid){delStr=''+$DMBMSG.DMB985+" "}var picSize=30;var $li=$(' ').attr({id:tid,nick:item.nick,uid:item.uid,rel:"c_"+item.id}).html(['','
',"
",'
'].join(""));return $li},delComment:function(cid){var $li=$("li[rel=c_"+cid+"]");var $commentNum=$("li[id$='"+cid+"']").find('a[rel="3"]');$li.slideUp(function(){var $replayList=$(".right_comment .feed-comment ul");if($replayList.find("li:visible").size()==0){$replayList.append(''+$DMBMSG.DMB012+" ")}});if($commentNum[0]){var num=$commentNum.text().match(/\d+/);if(num==1){$commentNum.text($DMBMSG.DMB106)}else{$commentNum.text($DMBMSG.DMB106+"("+(--num)+")")}}apiCall("comment_destroy",{data:"id="+cid,success:function(msg){if(msg.errno==0){}}})},replyComment:function(cid){var $li=$("li[rel=c_"+cid+"]"),relid=$li.attr("rel"),$el=$li.find("div.right_comment_reply"),$input;if(!$el[0]){$el=wbComment.createTextArea("",cid,"right_comment_reply",cid);$li.append($el);var $input=$("textarea",$el);$input.val($DMBMSG.DMB105+"@"+$li.attr("nick")+":");$input.attr("rel",relid);wbSubjoin.init($li.find(".add-area"),$li.find("textarea"),{font:"",face:{left:16,pos:1}},"icon_a");$el.show()}else{$el.toggle();return false}$input=$("textarea",$el);if($el[0].offsetWidth){var $area=$el.find("textarea.comment_textarea"),fontBtn=$("a.font-icon",$el),inHxw,_timeout;$area.propertychange(function(event){inHxw=fontBtn[0]?fontBtn.attr("hxw"):0;clearTimeout(_timeout);if(parseInt(inHxw)){_timeout=setTimeout(function(){wbSubjoin.outpuHxw($area.get(0),event)},100)}publisher.at.to(this,0)});$area.focusEnd()}$input.autoResize({onResize:function(){},animateCallback:function(){$(this).css({opacity:1})},animateDuration:300,extraSpace:0})},sendComment:function(params){var _data,_action,wbid=params.wbid,$li=params.$li[0]?params.$li:$('li[rel*="'+wbid+'"]'),$commentNum=params.needCommentCount&&$("li[id='i"+wbid+"']").find('a[rel="3"]'),$cb=params.$cb||$li.find("div.post-comment input:visible:first"),$cta=$li.find("div.post-comment input.comment_to_author"),needHTML=params.needHTML,needCommentCount=params.needCommentCount,photoType=params.type,$target=$(params.target),_cid=$target.attr("cid"),$area=params.$area||(_cid?$("li[rel=c_"+_cid+"]").find("textarea.comment_textarea:last"):$li.find("textarea.comment_textarea:last")),callback=params.callback;if(!$.trim($area.val().replace(/.*@.*:/,""))){alertMsg({title:$DMBMSG.DMB991,msg:$DMBMSG.DMB108,type:"remind",callback:callback,target:$target,style:0,timeout:2,pos:1,ox:-150,oxr:-130,oy:130});return false}if(_cid){_action="reply";_data={id:wbid,cid:_cid,text:$area.val()}}else{_action="comment";_data={id:wbid,text:$area.val()}}if($cb.attr("checked")){_data.forward=1}else{_data.forward=0}_data.type=photoType||1;_data.needHTML=needHTML?1:0;if($cta&&$cta.prop("checked")){apiCall(_action,{data:{"id[]":XWEIBO.data[wbid].rt.id,text:$area.val(),type:photoType||1,needHTML:needHTML?1:0}})}apiCall(_action,{data:_data,success:function(msg){var data=msg.rst.comment;var wbData=msg.rst.rel;if(msg.errno==0&&data){if(callback){callback(data);return}$area.focus();wbComment.insertComment(data,wbid);$area.val("");if(_cid){var $cli=$("li[rel=c_"+_cid+"] .feed-comment");$cli.hide()}$("#feed_comment").find(".tips span").text(140);if(needCommentCount){var num=$commentNum.text().match(/\d+/);if(num){$commentNum.text($DMBMSG.DMB106+"("+(++num)+")")}else{$commentNum.text($DMBMSG.DMB106+"(1)")}}if(wbData&&msg.rst.html){publisher.insert(wbData.data.id,wbData.data,msg.rst.html)}return true}else{alertMsg({type:"error",msg:errorMsgs[msg.errno]||errorMsgs[0],target:$target,style:0,oxr:-100,timeout:2,oy:25})}}});return true},insertComment:function(data,wbid){if(_$ul&&data){var $li=wbComment.createComment(data,wbid);_$ul.find("li[rel=remain]").remove();_$ul.prepend($li)}},init:function(returnHtml){regEvent(event_type_comment,function($srcEl){var _wbid=getWeiboID($srcEl),$target=$($srcEl),$li=findParentElement("LI",$target),isNew=$target.attr("isnew"),uid=$li.attr("uid"),isfocus=$target.attr("focus");bindRight.freshShow({tid:_wbid,callback:_wbid,btype:"feed",ctype:"comment",uid:uid,isnew:isNew})});regEvent(event_type_sendComment,function($srcEl){wbComment.get($srcEl).sendComment({wbid:_wbid,$li:$("#f"+_wbid),needHTML:returnHtml,needCommentCount:TRUE,target:$srcEl})})},createComments:function(result){$("#mycomment_list").append(result.rst.html);$("#mycomment_page").html(result.rst.page)},_loading:function(isStop){if(isStop){$("#xweibo-loading").remove()}else{$("#xweibo-loading").remove();var $loading=$("
").attr("id","xweibo-loading").addClass("loading");$("#mycomment_list").after($loading)}},getMyComment:function(str){removeError();var re=/^[0-9]+.?[0-9]*$/;if(re.test(str)){$("#mycomment_list").html("");$("#mycomment_page").html("");str="type="+str}this._loading(false);this.isLoading=true;apiCall("index.comments",{data:str,success:function(result){if(result&&result.errno==0){wbComment.createComments(result);wbComment._loading(true);this.isLoading=true}else{wbFeed.loading(true,"mycomment_list");$("#mycomment_list").append(''+result.err+" ");return false}},error:function(httpException){wbComment._loading(true);$("#mycomment_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this},getSendComment:function(str){removeError();this._loading(false);this.isLoading=true;apiCall("index.commentsend",{data:str,success:function(result){if(result&&result.errno==0){wbComment.createComments(result);wbComment._loading(true);this.isLoading=true}else{wbFeed.loading(true,"mycomment_list");$("#mycomment_list").append(''+result.err+" ");return false}},error:function(httpException){wbComment._loading(true);$("#mycomment_list").append(''+$DMBMSG.DMB988+" ")},timeout:TimeOut});return this}}})();var wbSubjoin=(function(){var $ui={},_num=0,remain,inHxw,timerAdd=function(event,$input,limit,$box){var $parent=$input.parent().parent(),$tips=$parent.find(".tips");if(_num>=30){remain=$input.checkText(limit,$box);if(remain>=0){$tips.html($DMBMSG.DMB993+""+remain+" "+$DMBMSG.DMB995).removeClass("out140 icon-bg")}else{$tips.html($DMBMSG.DMB994+""+Math.abs(remain)+" "+$DMBMSG.DMB995).addClass("out140 icon-bg")}_num=0}_num++},timerControl=function(e,$input,limit,$box){var timer;switch(e.type){case"focus":if(!timer){timer=timeout.add(function(){timerAdd(e,$input,limit,$box)})}timeout.play(timer);break;case"blur":timeout.pause(timer);break}};function eventBind(textarea,limit,$box){var $input=$(textarea);$input.focus(function(e){$input.parent().addClass("onfocus");timerControl(e,$input,limit,$box)}).blur(function(e){$input.parent().removeClass("onfocus");timerControl(e,$(this),limit,$box)});$input.keyup(function(e){$(this).focus()});$input.propertychange(function(e){var $fontBtn=$(this).parent().parent().find("a.font-icon"),inHxw=$fontBtn[0]?$fontBtn.attr("hxw"):0,t=this,clock;clearTimeout(clock);if(parseInt(inHxw)){clock=setTimeout(function(){outpuHxw(t,e)},100)}at.to(this,0)})}function setCaretTo(obj,pos){if(obj.createTextRange){var range=obj.createTextRange();range.move("character",pos);range.select()}else{if(obj.selectionStart){obj.focus();obj.setSelectionRange(pos,pos)}}}function toHxw(str){var jtArr=str.split("");var ind=-1;var returnstr="",returnstrhxw="";$.each(jtArr,function(i,it){ind=jtw.indexOf(it);if(ind!=-1){returnstr=returnstr+hxw.charAt(ind)}else{returnstr=returnstr+it}});var ftArr=returnstr.split("");$.each(ftArr,function(j,t){ind=ftw.indexOf(t);if(ind!=-1){returnstrhxw=returnstrhxw+hxw.charAt(ind)}else{returnstrhxw=returnstrhxw+t}});return returnstrhxw}function outpuHxw(el,e){var keys=[0,8,16,17,27,37,38,39,40,45,46,144,undefined],types=["focus","blur","keyup","mouseup","keypress"];if(e.ctrlKey||e.shiftKey||keys.include(e.keyCode)&&types.include(e.type)){return}var t=$(el),c=t.get(0),s=0,_val=t.val(),temp=_val,start=at.selectionStart,end=!!c.selectionStart||c.selectionStart==0?c.selectionStart:(function(){var er=document.selection.createRange(),er1=document.body.createTextRange();er1.moveToElementText(c);for(s;er1.compareEndPoints("StartToStart",er)<0;s++){er1.moveStart("character",1)}return s})(),last=_val.slice(end,_val.length),reserved=_val.slice(0,start),val=_val.slice(start,end),regexp=/(@[0-9a-zA-Z\u4e00-\u9fa5_-]{0,20})|(\[[^\[\]]*\])|(http:\/\/[a-zA-Z0-9]+(\.[a-zA-Z0-9]+)+([A-Z0-9a-z-_\$\.\+\!\*\(\)//,:;@&=\?\~\#\%]*))|(http:\/\/[a-zA-Z0-9]+)|(http:\/\/|http:\/|http:|http|htt|ht|h)/ig,oreg=null,newStr="",star=0;do{oreg=regexp.exec(val);if(oreg){newStr+=toHxw(val.substring(star,oreg.index));newStr+=oreg[0];star=regexp.lastIndex}else{newStr+=toHxw(val.substring(star))}}while(oreg);t.val(reserved+newStr+last);setCaretTo(c,end)}return{init:function(btnArea,textarea,btnObjs,btnClass,limit,$box){var tem=btnArea||"#publish_box .add-area",$tem=$(tem),textarea=textarea||"#publish_text",btns="",target,rel,face={},video={},music={};if(!btnObjs){btnObjs={font:"",face:"",pic:"",video:"",music:"",topic:""}}$.each(btnObjs,function(i,btn){switch(i){case"face":btns+="face,";face.left=btn.left||20;face.top=btn.top||0;face.pos=btn.pos||0;face.parent=btn.parent||0;face.facePageCounts=btn.facePageCounts||(12*7);face.aniPageCounts=btn.aniPageCounts||(6*3);break;case"video":btns+="video,";video.left=btn.left||-82;video.top=btn.top||0;video.pos=btn.pos||0;break;case"music":btns+="music,";music.left=btn.left||-132;music.top=btn.top||0;music.pos=btn.pos||0;break;case"topic":btns+="topic,";break;case"font":btns+="font,";break;case"pic":btns+="pic,";break}});$tem.unbind("click");$tem.bind("click",function(e){target=e.target;rel=target.rel;if(target.tagName=="A"){switch(rel){case"face":wbSubjoin.createEmotion();wbSubjoin.showEmotion(target,textarea,face.left,face.top,face.pos,face.parent,face.facePageCounts,face.aniPageCounts);break;case"video":wbSubjoin.createLayer("video",textarea);wbSubjoin.showVideo(target,textarea,video.left,video.top,video.pos);break;case"music":wbSubjoin.createLayer("music",textarea);wbSubjoin.showMusic(target,textarea,music.left,music.top,music.pos);break;case"topic":wbSubjoin.insertTopic(textarea);break;case"font":wbSubjoin.createLayer("hxw",textarea);var pbid=$(target).attr("pbid");if(!parseInt($(target).attr("hxw"))){$(target).text($DMBMSG.DMB124);$(target).attr({hxw:1,title:$DMBMSG.DMB444+$DMBMSG.DMB123})}else{$(target).text($DMBMSG.DMB123);$(target).attr({hxw:0,title:$DMBMSG.DMB444+$DMBMSG.DMB124})}break;case"pic":wbSubjoin.createLayer("image",textarea);wbSubjoin.showUpladPic(target,-32,0);break}}return false});this.creatSubjoinArea(tem,btns,btnClass);eventBind(textarea,limit,$box);return false},creatSubjoinArea:function(area,btn,btnClass){var html=[],btnClass=btnClass||"icon_bg",fontHtml=''+$DMBMSG.DMB123+" ",faceHtml=''+$DMBMSG.DMB171+" ",picHtml=''+$DMBMSG.DMB172+" ",videoHtml=''+$DMBMSG.DMB173+" ",musicHtml=''+$DMBMSG.DMB174+" ",topicHtml=''+$DMBMSG.DMB175+" ";if(btn=="all"||!btn){btn="font,face,pic,video,music,topic"}btn=btn.split(",");$.each(btn,function(i,_btn){(_btn=="font")&&html.push(fontHtml);(_btn=="face")&&html.push(faceHtml);(_btn=="pic")&&html.push(picHtml);(_btn=="video")&&html.push(videoHtml);(_btn=="music")&&html.push(musicHtml);(_btn=="topic")&&html.push(topicHtml)});html=html.join("");$(html).hide().prependTo(area).show()},setUiCache:function(data){$.extend($ui,data)},insertTopic:function(textarea){var start=0,end=0,input=$(textarea)[0],text,defaultText=$DMBMSG.DMB110,hasCustomTopic=/#$DMBMSG.DMB110#/.test(input.value);text=defaultText;input.focus();if(document.selection){var cr=document.selection.createRange();text=cr.text||defaultText;if(text==defaultText&&hasCustomTopic){start=RegExp.leftContext.length+1;end=defaultText.length}else{if(text==defaultText){cr.text="#"+defaultText+"#";start=input.value.indexOf("#"+defaultText+"#")+1;end=defaultText.length}else{cr.text="#"+text+"#"}}if(text==defaultText){cr=input.createTextRange();cr.collapse();cr.moveStart("character",start);cr.moveEnd("character",end)}cr.select()}else{if(input.selectionStart||input.selectionStart=="0"){start=input.selectionStart;end=input.selectionEnd;if(start!=end){text=input.value.substring(start,end)}if(hasCustomTopic&&text==defaultText){start=RegExp.leftContext.length+1;end=start+text.length}else{if(text==defaultText){input.value=input.value.substring(0,start)+"#"+text+"#"+input.value.substring(end,input.value.length);start++;end=start+text.length}else{input.value=input.value.substring(0,start)+"#"+text+"#"+input.value.substring(end,input.value.length);end=start=start+text.length+2}}input.selectionStart=start;input.selectionEnd=end}else{input.value+="#"+text+"#"}}$(textarea).keyup()},buildEmotionsObjData:function(dataAttr){var emosObj={},emo={},title,href,lang,category,subclass;$.each(XWEIBO[dataAttr],function(index,item){lang=item[3];if($DMBMSG.DMB1000==lang){title=item[0];href=item[1];subclass=item[2]||$DMBMSG.DMB120;category=item[4];emosObj[category]?"":emosObj[category]={};emosObj[category][subclass]?"":emosObj[category][subclass]=[];emosObj[category][subclass].push({title:title,href:href})}});$(XWEIBO).data(dataAttr,emosObj)},getEmotionsObjData:function(mtype,subClass){var dataAttr="emotions";mtype=="cartoon"?dataAttr="cartoons":"";if(!$(XWEIBO).data(dataAttr)){this.buildEmotionsObjData(dataAttr)}var data=$(XWEIBO).data(dataAttr);if(mtype&&subClass){return data[mtype][subClass]}else{if(mtype){return data[mtype]}else{return data}}},getEmotionsSubClassListHtml:function(mtype){var subClassArr=[],subClassNameWidth=0,strlen,emotionObj=this.getEmotionsObjData(mtype);subClassArr.push('');$.each(emotionObj,function(name,value){strlen=name.length*12+15+10;subClassNameWidth+=strlen;if(subClassNameWidth>330){subClassArr.push('
');subClassNameWidth=strlen}subClassArr.push('
'+name+' ')});subClassArr.push("
");return subClassArr.join(" ")},getEmotionsSubClassContentHtml:function(mtype,subClass,xEmotion){var contentArr=[],aniclass,pWidth,pHeight,k=1,facePageCounts=xEmotion?(xEmotion.facePageCounts):null,aniPageCounts=xEmotion?(xEmotion.aniPageCounts):null,subClassContentArr=this.getEmotionsObjData(mtype,subClass);(mtype=="face")?(pWidth=pHeight=22):(pWidth=pHeight=56);contentArr.push('')}k++;break;case"cartoon":contentArr.push(""+emotion.title+" ");if(k%18==0){contentArr.push('
')}k++;break;default:contentArr.push("");if(k%facePageCounts==0){contentArr.push('
')}k++}});contentArr.push('
');switch(mtype){case"ani":contentArr.push('
点击
预览魔法动画
');contentArr.push('
');if((k-1)/aniPageCounts>1){contentArr.push('
1 ');for(i=2;i<=((k-1)/aniPageCounts+1);i++){contentArr.push('
'+i+" ")}}contentArr.push("
");break;case"face":contentArr.push('
');if((k-1)/facePageCounts>1){contentArr.push('
1 ');for(i=2;i<=((k-1)/facePageCounts+1);i++){contentArr.push('
'+i+" ")}}contentArr.push("
");break;case"cartoon":contentArr.push('
');contentArr.push('
');if((k-1)/18>1){contentArr.push('
1 ');for(i=2;i<=((k-1)/18+1);i++){contentArr.push('
'+i+" ")}}contentArr.push("
");break}contentArr.push("
");return contentArr.join(" ")},getEmotionBox:function(mtype){var emotionListHtml,emotionContentHtml;if(mtype=="cartoon"){var xImage=$("#xImage"),emotionPage=xImage.find(".emotion_page");emotionContentHtml=this.getEmotionsSubClassContentHtml(mtype,$DMBMSG.DMB120);emotionListHtml=this.getEmotionsSubClassListHtml(mtype);xImage.find(".emotion_list").html(emotionListHtml);xImage.find(".emotion_content").html(emotionContentHtml);xImage.find(".emotiongroup").each(function(i,$div){$("span",$div).last().remove()});xImage.find(".emotion_class").scrollLeft(0);emotionPage.first().attr("class","page_left_no");emotionPage.last().attr("class","page_right");xImage.find(".emotion_class a:first").attr("class","current")}else{var xEmotion=XWB.layerMgr.get("xEmotion"),$xEmotion=$("#xEmotion");emotionListHtml=this.getEmotionsSubClassListHtml(mtype),emotionContentHtml=this.getEmotionsSubClassContentHtml(mtype,$DMBMSG.DMB120,xEmotion);$xEmotion.find(".emotion_list").html(emotionListHtml);$xEmotion.find(".emotion_content").html(emotionContentHtml);$xEmotion.find(".emotion_box_t2 .emotiongroup").each(function(i,$div){$("span",$div).last().remove()});$xEmotion.find(".emotion_box_t2 .emotion_class").scrollLeft(0);$xEmotion.find(".emotion_box_t2 .emotion_page a").first().attr("class","page_left_no");$xEmotion.find(".emotion_box_t2 .emotion_page a").last().attr("class","page_right");$xEmotion.find(".emotion_class a:first").attr("class","current")}},getEmotion:function(mtype){var This=this,$facBtn=$("#xEmotion").find(".change_item").find("dd:first"),$aniBtn=$("#xEmotion").find(".change_item").find("dd:last");if(mtype=="face"){$facBtn.attr("class","current");$aniBtn.attr("class","")}else{$facBtn.attr("class","");$aniBtn.attr("class","current")}$(".emotion_list").html('
');$(".emotion_content").html("");this.getEmotionData(function(){This.getEmotionBox(mtype)})},getEmotionData:function(callback){var emotions;if(typeof(emotions)!="undefined"||(XWEIBO&&typeof(XWEIBO.emotions)!="undefined"&&XWEIBO.emotions!="")){(XWEIBO.emotions)||(XWEIBO.emotions=emotions);callback&&callback();return}else{apiCall("emotions",{success:function(result){if(result){XWEIBO.emotions=result;callback&&callback();return true}else{if(result.rst==false){return false}}}})}},getCartoon:function(mtype,callback){var This=this,xImage=$("#xImage");xImage.find(".emotion_list").html('
');xImage.find(".emotion_content").html("");this.getCartoonData(function(){This.getEmotionBox(mtype);callback&&callback()})},getCartoonData:function(callback){var cartoons,_this=this;if(!!cartoons||!!XWEIBO.cartoons){(XWEIBO.cartoons)||(XWEIBO.cartoons=cartoons);callback&&callback();return}else{apiCall("getCartoon",{data:"k="+$DMBMSG.DMB1000,success:function(result){if(result){XWEIBO.cartoons=_this.setValue(result.rst,$DMBMSG.DMB1000);callback&&callback();return true}else{if(result.rst==false){return false}}}})}},setValue:function(args,name){var returnValue=[];$.each(args,function(i,it){var data=[];data.push(it.phrase.replace(/\[|]/g,""));data.push(it.url);data.push(it.category);data.push(name);data.push(it.type);data.join(",");returnValue.push(data)});returnValue.join(",");return returnValue},showMagicEmotion:function(src,param){flashShow.init({src:src,autoClose:1,eventBind:1})},createEmotion:function(){var $xEmotion=$("#xEmotion");if($xEmotion[0]){return XWB.layerMgr.get("xEmotion")}var layer=XWB.layerMgr.addLayer({layerid:"xEmotion",type:"emotion",item_title:'",config:{insertCallback:function(input){$(input).keyup()}},content:['",'',"
"].join("")});var $xEmotion=$(layer.element),windowBox=$xEmotion.find(".windows_box"),This=this,i,ft=0,target,parent,emotionBox,emotiongroup,$emotions,src;windowBox.css({padding:"10px 5px 15px 5px",width:"400px",overflow:"hidden"});windowBox.unbind("click");windowBox.bind("click",function(event){target=event.target;parent=event.target.parentNode;emotiongroup=$xEmotion.find(".emotiongroup");emotionBox=$xEmotion.find(".emotion-box");if(parent.tagName=="DIV"){switch(parent.className){case"emotiongroup":var xEmotion=XWB.layerMgr.get("xEmotion");var category=$(target).attr("category");var subClass=$(target).text();var emotionContent=$xEmotion.find(".emotion_content");var emotionContentHtml=This.getEmotionsSubClassContentHtml(category,subClass,xEmotion);emotionContent.empty();emotionContent.html(emotionContentHtml);$xEmotion.find(".emotion_class a").attr("class","");$(target).attr("class","current");break;case"emotion_page":if(!$(target).next("a").get(0)){var gourpSize=emotiongroup.size()-1;$(target).prev().attr("class","page_left");if(ft>=gourpSize){return}ft++;if(ft==gourpSize){$(target).attr("class","page_right_no")}}else{$(target).next().attr("class","page_right");if(ft<=0){return}ft--;if(ft==0){$(target).attr("class","page_left_no")}}$(parent).prev("div").scrollLeft(ft*330);break;case"emotion_pages pagenums":$emotions=findParentElement("DIV",$(target)).siblings(".emotion_boxs");$emotions.hide();$(target).siblings().attr("class","");$emotions.eq($(target).text()-1).show();$(target).attr("class","current");break;default:break}}else{if(target.tagName=="SPAN"&&parent.tagName=="A"&&parent.getAttribute("mtype")=="ani"){src=$(parent).find("img").attr("src").replace(".gif",".swf");This.showMagicEmotion(src)}}return false});$xEmotion.find("div.change_item").unbind("click");$xEmotion.find("div.change_item").click(function(event){if(event.target.tagName=="A"){ft=0;$xEmotion.find(".change_item dd").removeClass("current");$(event.target).parent().parent().addClass("current");This.getEmotion($(event.target).attr("mtype"))}});return layer},createLayer:function(type,textarea){var layer,This=this;switch(type){case"video":layer=XWB.layerMgr.addLayer({layerid:"xVideo",type:"video",item_title:$DMBMSG.DMB447,content:['"].join("")});break;case"music":layer=XWB.layerMgr.addLayer({layerid:"xMusic",type:"music",item_title:$DMBMSG.DMB448,content:['"].join("")});break;case"hxw":layer=XWB.layerMgr.addLayer({layerid:"xHxw",type:"xHxw",addClass:"showFont",item_title:"",content:[''].join("")});$(layer.element).find(".close-btn").remove();$(layer.element).find(".fontlink").click(function(e){var pbid=$(this).attr("pbid");if(!parseInt($(this).attr("hxw"))){$("#"+pbid).find("a.font-icon").text($DMBMSG.DMB124);$(this).text($DMBMSG.DMB123);$(this).attr("hxw",1)}else{$("#"+pbid).find("a.font-icon").text($DMBMSG.DMB123);$(this).text($DMBMSG.DMB124);$(this).attr("hxw",0)}layer.close()});break;case"image":var _html=this.resetUploadPic(),parent;layer=XWB.layerMgr.addLayer({layerid:"xImage",type:"image",addClass:"insert-window emotion-window",noclose:1,content:[_html].join(""),item_title:''});var $input=$(textarea),xImage=$("#xImage"),windowTitle=xImage.find(".windows_title"),uploadWindowBox=xImage.find(".windows_box"),target,id,uploader,input_nav_bg=$("#input_nav_bg"),uLoading,view,recomPic,magicPic,closeBtn=xImage.find("a.close_btn"),uploadpic_layer,showImg,i,ft=0,emotiongroup,emotionBox;uploadWindowBox.unbind("click");uploadWindowBox.bind("click",function(event){target=event.target;parent=target.parentNode;id=target.id;showImg=xImage.find("#showImage");emotiongroup=xImage.find(".emotiongroup");emotionBox=xImage.find(".emotion-box");if(!parent){return}if(parent.tagName=="A"&&parent.getAttribute("mtype")=="cartoon"){closeBtn.css({visibility:"hidden"});showImg.html("");var img=$(parent).children("img"),text=$(parent).children("span").text(),view=xImage.find("#preview");xImage.find("#xUpload").trigger("click");view.find("p:first").find("span:last").html(text);var uImg=new Image();uImg.onload=function(){var picRatio=this.width/this.height;if(this.width>200){this.width=200;Nheight=200/picRatio;this.height=Nheight}this.onload=null;view.siblings().hide();view.show();if($input.val()==""){$input.val($DMBMSG.DMB168).focusEnd()}};uImg.src=img.attr("src");setTimeout(function(){showImg.html($(uImg))},500);$input.attr("pic",img.attr("src"))}else{if(parent.tagName=="A"&&parent.id=="cancelUpload"){input_nav_bg.find("a.pic-icon").attr("hide",0);XWB.layerMgr.setContent("xImage",_html)}else{if(parent.tagName=="DIV"&&parent.className=="emotiongroup"){var category=$(target).attr("category");var subClass=$(target).text();var emotionContent=xImage.find(".emotion_content");var emotionContentHtml=This.getEmotionsSubClassContentHtml(category,subClass);emotionContent.empty();emotionContent.html(emotionContentHtml);xImage.find(".emotion_class a").attr("class","");$(target).attr("class","current");return false}else{if(parent.tagName=="DIV"&&parent.className=="emotion_page"){if(!$(target).next("a").get(0)){var gourpSize=emotiongroup.size()-1;$(target).prev().attr("class","page_left");if(ft>=gourpSize){return}ft++;if(ft==gourpSize){$(target).attr("class","page_right_no")}$(parent).prev("div").scrollLeft(ft*330)}else{$(target).next().attr("class","page_right");if(ft<=0){return}ft--;if(ft==0){$(target).attr("class","page_left_no")}$(parent).prev("div").scrollLeft(ft*330)}return false}else{if(parent.tagName=="DIV"&&parent.className=="emotion_pages pagenums"){var $emotions=findParentElement("DIV",$(target)).siblings(".emotion_boxs");$emotions.hide();$(target).siblings().attr("class","");$emotions.eq($(target).text()-1).show();$(target).attr("class","current");return false}else{switch(id){case"publisher_file":$(target).unbind("change");$(target).bind("change",function(e){uploader=new FileUploader(target);uLoading=xImage.find("#upLoading");view=xImage.find("#preview");if(!checkPicName(this.value)){alertMsg({msg:$DMBMSG.DMB167,timeout:2,type:"error",style:1,pos:"center",oxr:148,oy:75,target:$(e.target),callback:function(){}});return}uLoading.show();uLoading.siblings().hide();uploader.upload(function(ret){if(ret.errno=="0"){closeBtn.css({visibility:"hidden"});view.find("p:first span:last").html(ret.rst.original_name);var uImg=new Image();uImg.onload=function(){var picRatio=this.width/this.height;if(this.width>200){this.width=200;Nheight=200/picRatio;this.height=Nheight}this.onload=null;view.siblings().hide();view.show();if($input.val()==""){$input.val($DMBMSG.DMB168).focusEnd()}};uImg.src=ret.rst.msg;showImg.html($(uImg));$input.attr("pic",ret.rst.msg)}else{XWB.layerMgr.setContent("xImage",_html);alertMsg({type:"error",msg:getError(ret.errno),pos:"center",style:1,timeout:2,callback:function(){}})}})});break;case"del":if($input.val()==$DMBMSG.DMB168){$input.val("")}$input.attr("pic","");input_nav_bg.find("a.pic-icon").attr("hide",0);xImage.hide();XWB.layerMgr.setContent("xImage",_html);break;case"zz_morpic":$("#zz_mshows").css("display","block");$.get("/apps/puzzle/puzzmod.php",{act:"isinto"},function(data){});flashShow.init({id:"FlashID1",src:"/apps/puzzle/imgapp.swf",flashWidth:"740",flashHeight:"494",allowScriptAccess:"always",noWin:1});window.GETURL=load_http+"apps/puzzle/puzzmod.php";window.hendlepreshows=function(url){zzshow.showpreview(url);$("#zz_mshows").css("display","none")};window.zzshow={$input:$input,xImage:null,closeBtn:null,showImg:null,$input:null,text:"",src:"",view:null,showpreview:function(url){try{this.xImage=$("#xImage");this.closeBtn=this.xImage.find("a.close_btn");this.closeBtn.css({visibility:"hidden"});this.showImg=this.xImage.find("#showImage");this.showImg.html("");this.$input=$input;this.view=this.xImage.find("#preview");this.xImage.find("#xUpload").trigger("click");for(var x in zzshow){if(!zzshow[x]){console.log(x);console.log(zzshow[x])}}}catch(e){}zzshow.src=url;zzshow.text=url;zzshow.view.find("p:first").find("span:last").html(zzshow.text);var uImg=new Image();uImg.onload=function(){var picRatio=this.width/this.height;if(this.width>200){this.width=200;Nheight=200/picRatio;this.height=Nheight}this.onload=null;zzshow.view.siblings().hide();zzshow.view.show();if(zzshow.$input.val()==""){zzshow.$input.val($DMBMSG.DMB168).focusEnd()}setTimeout(function(){zzshow.showImg.html($(uImg))},500);zzshow.$input.attr("pic",zzshow.src)};uImg.src=zzshow.src}};break;default:return false;break}}}}}}});windowTitle.unbind("click");windowTitle.bind("click",function(event){target=event.target;id=target.id;showImg=xImage.find("#showImage");uploadpic_layer=xImage.find("#uploadpic_layer");recomPic=xImage.find("#recommended_pic");magicPic=xImage.find("#magic_pic");switch(id){case"xUpload":if(!!showImg.html()){closeBtn.css({visibility:"hidden"})}recomPic.hide();magicPic.hide();uploadpic_layer.show();uploadpic_layer.parent().parent().css({padding:"15px 20px ",width:"370px"});$(target).parent().parent().addClass("current").siblings("dd").removeClass("current");break;case"recPic":closeBtn.css({visibility:"visible"});uploadpic_layer.hide();magicPic.hide();recomPic.show();recomPic.parent().parent().css({padding:"10px 5px 15px 5px",width:"400px"});$(target).parent().parent().addClass("current").siblings("dd").removeClass("current");wbSubjoin.getCartoon($("#recPic").attr("mtype"));break;case"zzmagicPic":closeBtn.css({visibility:"visible"});recomPic.hide();uploadpic_layer.hide();magicPic.show();magicPic.parent().parent().css({padding:"15px 20px ",width:"370px"});$(target).parent().parent().addClass("current").siblings("dd").removeClass("current");break}});break}layer.close();return layer},layerClick:function(layer,textarea,type){var $err=$(layer.element).find("p.error-tips").hide(),$input=$(layer.element).find("input"),tempVal="",_text;$err.find("a").eq(0).bind("click",function(e){layer.close();e.preventDefault()});$err.find("a").eq(1).bind("click",function(e){insertToArea();e.preventDefault()});$(layer.element).find("a.general-btn").unbind().bind("click",textarea,function(e){var url=$input.val();if(url==""){tempVal=$err.html();type=="video"?_text=$DMBMSG.DMB449:_text=$DMBMSG.DMB450;$err.text(_text);$err.show();return}if(!!tempVal){$err.html(tempVal)}if(url=="http://"){$err.show();return}var check=type=="video"?wbSubjoin.checkVideoUrl:wbSubjoin.checkMusicUrl;if(check(url)){insertToArea(e.data)}else{$err.show()}});function insertToArea(textarea){var $input=$(layer.element).find("input"),url=$input.val();wbSubjoin.insertText(url,textarea);$input.val("");layer.close()}},resetUploadPic:function(){return' 多张图片上传 魔法拼图支持您拖拽图片,更换模板和背景,赶快来体验吧!仅支持JPG、GIF、PNG图片文件,且文件小于5M
'},selectAll:function(input){input.focus();var cr;if(document.selection){cr=input.createTextRange();cr.collapse();cr.moveStart("character",0);cr.moveEnd("character",input.value.length);cr.select()}else{input.selectionStart=0;input.selectionEnd=input.value.length}},showEmotion:function(rel,input,ox,oy,pos,parent,facePageCounts,aniPageCounts){var emotion=XWB.layerMgr.get("xEmotion");if(!emotion){emotion=this.createEmotion()}if(rel instanceof $){rel=rel.get(0)}emotion.config({rel:rel,input:input,ox:ox||0,oy:oy||30,pos:0||pos,parent:0||parent,facePageCounts:facePageCounts,aniPageCounts:aniPageCounts});this.getEmotion("face");XWB.layerMgr.showLayer("xEmotion","default")},showUpladPic:function(rel,ox,oy){var img=XWB.layerMgr.get("xImage"),target=$("#xImage"),xImg=target.find(".windows_box"),html=this.resetUploadPic(),temp=target.find("p#showImage").html();xImg.html(html);var preview=target.find("#preview"),close=target.find("a.close_btn");target.find("#xUpload").parent().parent("dd").addClass("current").siblings("dd").removeClass("current");if(!!temp){target.find("p#showImage").html($(temp));preview.prev().hide();preview.show();close.css({visibility:"hidden"})}else{close.css({visibility:"visible"})}if(!img){img=createLayer("xImage")}img.config({rel:rel,ox:ox||0,oy:oy||30,noCommonEvent:1});XWB.layerMgr.showLayer("xImage","default")},showHxw:function(rel,ox,oy){var hxw=XWB.layerMgr.get("xHxw");if(!hxw){hxw=this.createLayer("xHxw")}hxw.config({rel:rel,ox:ox||0,oy:oy||0});XWB.layerMgr.showLayer("xHxw","default")},showVideo:function(rel,textarea,ox,oy,pos){var video=XWB.layerMgr.get("xVideo");if(!video){video=this.createLayer("video")}video.config({rel:rel,ox:ox||0,oy:oy||30,pos:pos||0});XWB.layerMgr.showLayer("xVideo","default");$(video.element).find("p.error-tips").hide();$(video.element).find("input").val("http://");this.selectAll($(video.element).find("input")[0]);this.layerClick(video,textarea,"video");return false},showMusic:function(rel,textarea,ox,oy,pos){var music=XWB.layerMgr.get("xMusic");if(!music){music=this.createLayer("music")}music.config({rel:rel,ox:ox||0,oy:oy||30,pos:pos||0});XWB.layerMgr.showLayer("xMusic","default");$(music.element).find("p.error-tips").hide();$(music.element).find("input").val("http://");this.selectAll($(music.element).find("input")[0]);this.layerClick(music,textarea)},insertText:function(text,textarea){$(textarea).insertText(text).focus();$(textarea).keyup()},checkMusicUrl:function(str){var match=FALSE,re=/(?:^http:\/\/club\.189\.cn\/favor\/music\/playCheckMusic\?mids=.\d+)|(?:^http:\/\/music\.sina\.com\.cn\/yueku\/i\/.\d+\.html)|(?:\.mp3$)/;match=re.test(str);return match},checkVideoUrl:function(str){var match=FALSE,re=/(?:^http:\/\/2010\.sina\.com\.cn\/video\/.+)|(?:^http:\/\/video\.sina\.com\.cn\/.+)|(?:^http:\/\/v\.ku6\.com\/special\/.+)|(?:^http:\/\/www\.tudou\.com\/playlist\/playindex\.do\?lid.+)|(?:^http:\/\/v\.youku\.com\/v_show\/.+)/;match=re.test(str);return match},outpuHxw:outpuHxw}})();var EncodeUtils=(function(){var _hash={"<":"<",">":">",'"':""","\\":"\","&":"&","'":"'","\r":"","\n":" "},fReg=/<|>|\'|\"|&|\\|\r\n|\n|/gi;var it={};it.regexp=function(value){return value.replace(/\}|\]|\)|\.|\$|\^|\{|\[|\(|\|\|\*|\+|\?|\\/gi,function(k){k=k.charCodeAt(0).toString(16);return"\\u"+(new Array(5-k.length)).join("0")+k})};it.html=function(value,hash){hash=hash||_hash;return value.replace(fReg,function(k){return !!hash[k]?hash[k]:""})};return it})();var suggest=(function(){var it={},filter=EncodeUtils.regexp,toIndex,value,content,current,key,reg,tip,panel,head,lis=[],onSelect,onClose,len,selected=0;it.validate=false;it.index=function(num){toIndex=!num?0:selected+num;toIndex=toIndex<0?len:(toIndex>len)?0:toIndex;lis[selected].removeClass("cur");lis[toIndex].addClass("cur");selected=toIndex;value=content[selected]};it._click=function(){onSelect&&onSelect(value)};it.hidden=function(){it.initTip();tip.css({display:"none"});it.validate&&!(it.validate=false)&&onClose&&onClose()};it.initTip=function(){if(!tip){tip=$("
");panel=$("");tip.append(panel);with(tip.get(0).style){zIndex=99999999;position="absolute";display="none"}tip.addClass("Atwho");$("body").append(tip)}};it.position=function(x,y,offsetX,offsetY){it.initTip();it.validate=true;tip.show();with(tip.get(0).style){left=(x+offsetX)+"px";top=(y+offsetY)+"px"}};it.selection=function(event){var keyCode=event.keyCode,toIndex,value;if(!it.validate){return}if(keyCode==40||keyCode==38){it.index(keyCode==40?1:-1);it.stopEvent()}else{if(keyCode==13||keyCode==9){it._click();it.stopEvent()}else{if(keyCode==27){it.hidden();it.stopEvent()}}}};it.addItem=function(itemValue){var li=$(" "),index;li.html(itemValue.replace(reg,"$1 "));lis.push(li);len=index=lis.length-1;content.push(itemValue);panel.append(li);li.mouseover(function(event){lis[selected].removeClass("cur");lis[index].addClass("cur");value=itemValue;selected=index;it.stopEvent()});li.mousedown(function(){it._click();it.hidden();it.stopEvent()})};it.bind=function(oElement,aContent,sKey,fOnSelect,fOnClose,sHead){var i=0,l=aContent.length;reg=new RegExp("("+filter(sKey)+")","gi");selected=0;content=[];onSelect=fOnSelect;len=0;lis=[];onClose=fOnClose;it.initTip();panel.html("");if(sHead){head=$("
");panel.append(head);head.html(sHead)}for(i;i";var isCss1=false,ua=navigator.userAgent,r=/MSIE([0-9]{1,}[\.0-9]{0,})/.exec(ua);if(r&&(r=parseFloat(RegExp.$1))&&r<8){isCss1=true}var hash={"<":"<",">":">",'"':""","\\":"\","&":"&","'":"'","\r":"","\n":" "," ":!isCss1?" ":" "},fReg=/<|>|\'|\"|&|\\|\r\n|\n|/gi;var it={},current,panel,cache,lastCache,flag,content,nbody,reg,tu=textareaUtils,clock,reqed={},validate=false,currentKey,keyChange=0,items,_cache=[];reg=/@[^@\s]{1,20}$/g;it.selectionStart=0;it.onClose=function(){cache=null;lastCache=null;currentKey=null;setTimeout(function(){try{current.focus()}catch(e){}},0)};it.onSelect=function(value){var st=current.scrollTop;current.focus();tu.insertText(current,value.substring(0,value.indexOf("(")>0?value.indexOf("("):value.length)+" ",at.selectionStart,currentKey.length);current.scrollTop=st};it.setContent=function(value,last){panel.css({height:current.clientHeight+"px"});if(!!value&&cache!=value){cache=value;content.html(format(value,hash))}if(lastCache!=last){lastCache=last;nbody.html(format(last,hash))}if($.browser.safari){panel.css({overflowY:$(current).getStyle("overflowY")=="hidden"?"hidden":"scroll"})}else{panel.css({overflowY:(current.scrollHeight>current.clientHeight)?"auto":"hidden"})}};it.initTip=function(key){var data,point;if(!!key){point=$(flag).pos();data=it.loadCache(key);select.position(point[0],point[1],0,-(current.scrollTop-20));select.bind(current,data,currentKey,it.onSelect,it.onClose,selectHead);reqed[currentKey]=key;return}select.hidden()};it.loadCache=function(key){var regexp=/.*[\u4e00-\u9fa5]+.*$/,data=[],num=0,tempValue=[],returnValue=[];for(var i=0,len=_cache.length;i-1||_cache[i][property].indexOf($.trim(key))>-1){data.push(_cache[i])}}data.join(",")}data.sort(function(a,b){var c=0,d=0;if(!!regexp.test($.trim(key))){for(var i in a){c=a[i].indexOf($.trim(key.toLowerCase()))}for(var j in b){d=b[j].indexOf($.trim(key.toLowerCase()))}}else{for(var i in a){c=i.indexOf($.trim(key.toLowerCase()))}for(var j in b){d=j.indexOf($.trim(key.toLowerCase()))}}if(cd){return 1}return 0});for(var s=0,l=data.length;s9){break}tempValue.push(data[s]);num++}tempValue.join("");for(var k=0,len=tempValue.length;k ":" ";panel.css({width:((parseInt(current.style.width)||current.offsetWidth)+fix)+"px"});it.bindEvent(current,true);it.rePosition();return false};it.to=function(oElement,oStyleFix){if(current==oElement){return}if(!it.panel){$("body").append(it.panel=panel=$("
"));panel.append(it.content=content=$(" "));panel.append(it.flag=flag=$(" "));panel.append(it.nbody=nbody=$(" "));with(panel.get(0).style){zIndex=-1000;position="absolute"}flag.html("@");$(panel).css({opacity:0})}current&&it.bindEvent(current,false);(current=oElement)&&it.mirror(oStyleFix)};return it})();var publisher=(function(){var uploading=FALSE,publishing=FALSE,pic="",$box,$input,$submit,$tips,$list,$btnPhoto,$photo,$btnUpload,$uploading,$form,uploader;_cache=[];var insertToList=FALSE;var $floatBox;function bindEvent($box){$submit.hover(function(){$(this).addClass("send_mouseover")},function(){$(this).removeClass("send_mouseover")});$box.click(function(e){var $target=$(e.target);var rel=toInt($target.attr("rel"));if(rel){switch(rel){case event_type_publish:publish(e.target);break}if($target.attr("tagName")=="A"){e.preventDefault()}}})}function insert(id,data,html){var $html=$(html),url_Search=location.search,query;if(url_Search.match(/m=ta/i)){return}if(url_Search.match(/m=index\.profile/i)){$("div.user-pic2",$html).remove();$("strong",$html).remove()}try{XWEIBO.data||(XWEIBO.data={});XWEIBO.data[id]=data;query=$.queryString("m");$list&&$html.attr("uid",XWEIBO.uid).prependTo($list).hide().fadeIn(1000,function(){var envlope={};envlope[id]=data;linkRender(envlope)})}catch(e){throw e}}function checkInput($input){var err=0;var text=$input.val();if($input.checkText()<0){err=5}if(!$.trim(text)){err=3}else{if(text=="#"+$DMBMSG.DMB110+"#"){err=4}}return err}function publish(target){var text=$input.val();pic=$input.attr("pic");var data={text:text,s:1};var err=0;if(uploading){err=1}else{if(publishing){err=2}else{err=checkInput($input)}}if(err){setTimeout(function(){$input.addClass("onfocus1")},200);setTimeout(function(){$input.removeClass("onfocus1")},400);setTimeout(function(){$input.addClass("onfocus1")},600);setTimeout(function(){$input.removeClass("onfocus1")},800);return}if(pic){data.pic=pic}publishing=1;$submit.addClass(disable_class);var xImage=$("#xImage");xImage.find(".windows_box").html(wbSubjoin.resetUploadPic());xImage.find(".close_btn").trigger("click");$input.attr("pic","");var $success=$('
');$success.appendTo($box);$("#user-weibo-count").zoomText();$success.fadeOut(2000,function(){$success.remove();$input.focus()});$input.val("");$("#publish_box .key-tips span").text(140);apiCall("update",{data:data,success:function(ret){var errno=ret.errno;if(toInt(errno)==0){var rst=ret.rst;if(insertToList){insert(rst.data.id,rst.data,rst.html)}}else{alertMsg({target:$(target),msg:getError(errno),type:"error",pos:"center",style:1,oxr:-150,oy:-35,timeout:2})}publishing=0;$submit.removeClass(disable_class)}})}return{pic:"",init:function(boxSelector,listSelector,needInsert){if(boxSelector==""){$list=listSelector?$(listSelector):NULL;return}$box=$(boxSelector);if(needInsert){insertToList=needInsert}$tips=$("div.key-tips",$box);$input=$("#publish_text",$box);$submit=$("div.share-btn",$box);$list=listSelector?$(listSelector):NULL;$photo=$("#photo_name",$box);$uploading=$("span.pic_uploading",$box);$btnPhoto=$("a.pic-icon",$box);$btnUpload=$("#publisher_file",$box);$form=$btnUpload.parent();bindEvent($box);wbSubjoin.init()},insert:insert,checkInput:checkInput,at:at}})();var wbAutoInsert=(function(){var timeout=NULL,ctn=NULL,delay=5000,count=10,dataCache=[];return{hasInit:FALSE,isStop:TRUE,init:function(opt){if(opt){ctn=opt.ctn;delay=opt.delay||delay;count=opt.count||count}this.hasInit=TRUE},pushData:function(data){if(data&&data.length&&data instanceof Array){$.each(data,function(i,item){var hasExist=FALSE;$.each(dataCache,function(j,citem){if(citem.id===item.id){hasExist=TRUE;return false}});hasExist||dataCache.push(item)})}if(dataCache.length&&wbReader.firstIsInVeiw()){this.stop();this.insert()}},slideDown:function(nodes){if(nodes.length){var node=nodes.shift();$(node).slideDown(400,function(){wbAutoInsert.slideDown(nodes)})}},insert:function(){this.isStop=FALSE;if(!$(ctn)[0]||!dataCache.length){return}var $last=$(ctn).find("li:first-child");var startNum=dataCache.length-count;startNum=startNum<0?0:startNum;var data=dataCache.splice(startNum,count);var domFragment=toWeiboHtml(data,{isUnread:TRUE});var newListArr=$.makeArray(domFragment.childNodes);$(ctn)[0].insertBefore(domFragment,$last[0]);wbAutoInsert.slideDown(newListArr);var clild=$(ctn).children();while(clild.length>=500){clild.last().empty().remove()}var temData={};$.each(data,function(i,item){temData[item.id]=item});linkRender(temData);timeout=setTimeout(arguments.callee,delay)},clearCache:function(){dataCache=[]},stop:function(){this.isStop=TRUE;clearTimeout(timeout)}}})();var notifyChecker=(function(){var timer=NULL,lastestId=0,tips={panel:NULL,elements:{fans:NULL,comment:NULL,atme:NULL,priLetter:NULL,notice:NULL,invite:NULL},init:function(type){var $panel,$item;$panel=$(".headmessages .win_linkbox");$item=$("#headmsgbox a em");this.panel=$panel.parent().parent();var elements=this.elements;elements.fans=$item.eq(0);elements.comment=$item.eq(1);elements.atme=$item.eq(2);elements.priLetter=$item.eq(3);elements.invite=$item.eq(4);elements.notice=$item.eq(5);elements.integral=$item.eq(6);elements.msgnum=$(".msg_num");elements.msgicon=$(".msgicon")},show:function(type,fans,comment,atme,priLetter,notice,invite,integral){this.init(type);eventBind();var panel=this.panel,elements=this.elements,numStr='({num} )',$msgTip=$(".messages_con"),$msgBox=$(".messages_tags"),$msgTipFans=$(".messages_con li:eq(0) span"),$msgTipComment=$(".messages_con li:eq(1) span"),$msgTipAtme=$(".messages_con li:eq(2) span"),$msgTipPriLetter=$(".messages_con li:eq(3) span"),$msgTipInvite=$(".messages_con li:eq(4) span"),$msgTipNotice=$(".messages_con li:eq(5) span"),$msgTipIntegral=$(".messages_con li:eq(6) span");if(fans||comment||atme||priLetter||notice||invite||integral){var msgnum=fans+comment+atme+priLetter+notice+invite,fansTip=elements.fans,comTip=elements.comment,priTip=elements.priLetter,atmeTip=elements.atme,noticeTip=elements.notice,inviteTip=elements.invite;msgnumTip=elements.msgnum,msgiconTip=elements.msgicon,msgiconTip=elements.msgicon,integralTip=elements.integral;msgiconTip.removeClass("header_mgs");msgiconTip.addClass("header_mgs_y");msgnumTip.text(msgnum).show();if(fans){fansTip.html(numStr.replace("{num}",fans));$msgTipFans.text(fans).parent().show()}else{$msgTipFans.parent().hide()}if(comment){comTip.html(numStr.replace("{num}",comment));$msgTipComment.text(comment).parent().show()}else{$msgTipComment.parent().hide()}if(priLetter){priTip.html(numStr.replace("{num}",priLetter));$msgTipPriLetter.text(priLetter).parent().show()}else{$msgTipPriLetter.parent().hide()}if(atme){atmeTip.html(numStr.replace("{num}",atme));$msgTipAtme.text(atme).parent().show()}else{$msgTipAtme.parent().hide()}if(notice){noticeTip.html(numStr.replace("{num}",notice));$msgTipNotice.text(notice).parent().show()}else{$msgTipNotice.parent().hide()}if(invite){inviteTip.html(numStr.replace("{num}",invite));$msgTipInvite.text(invite).parent().show()}else{$msgTipInvite.parent().hide()}if(integral){integralTip.html(numStr.replace("{num}",integral));$msgTipIntegral.text(integral).parent().show()}else{$msgTipIntegral.parent().hide()}toggleMessagesTags.check()||$msgBox.show();if(!XWEIBO.tipLight){$(".pets_mess_info").is(":visible")&&$(".pets_mess_info").hide();$("#tipLight").is(":hidden")&&$("#tipLight").show();this.panel.parent().show();this.panel.show()}}else{elements.msgicon.removeClass("header_mgs_y");elements.msgicon.addClass("header_mgs")}},lightToggle:function(type){var This=this;if(!type){this.panel.slideToggle("fast",function(){$(".pets_mess_info").show("fast")});XWEIBO.tipLight=1}else{this.panel.parent().show();$(".pets_mess_info").hide("fast",function(){This.panel.slideToggle("fast")});XWEIBO.tipLight=0}}};function checkNewItem(){var data={};if(XWEIBO.maxid){data.id=XWEIBO.maxid}apiCall("unread",{data:data,success:function(ret){if(ret&&(toInt(ret.errno)==0)){var data=ret.rst.unread;var list=ret.rst.data;var itemNum=data[0];if(XWEIBO&&+XWEIBO.autoshow&&XWEIBO.page==1){wbAutoInsert.hasInit||wbAutoInsert.init({ctn:$("#feed-list")});wbAutoInsert.pushData(list);if(list){$.each(list,function(i,item){XWEIBO.data[item.id]=item});lastestId=list[list.length-1].id}}else{if($.queryString("gid")||$.queryString("feature")){return}var $newItemShow=$("#new-feed").html("你有"+itemNum+"条新微博,点击查看").attr("href",buildModulePath("index")).attr("rel",38);itemNum?$("#new-feed").slideDown("fast"):$("#new-feed").slideUp("fast");wbAutoInsert.hasInit&&wbAutoInsert.stop()}if(window.XWEIBO){var tipType=+XWEIBO.tipshow?"bottom":"top";tips.show(tipType,data[3],data[2],data[1],data[4],data[5],data[6],data[7])}}else{}timer=setTimeout(checkNewItem,30000)},error:function(){timer=setTimeout(checkNewItem,30000)}})}function checkStart(){if(!timer){checkNewItem();$("#tipLight,.mess_info a.close_btns img").live("click",function(){tips.lightToggle(XWEIBO.tipLight||0);return false})}}function eventBind(){toggleMessagesTags.close()}return{start:checkStart}})();var showForward=function(tid){function querymid(inputText){apiCall("querymid",{data:{id:tid,type:1},success:function(ret){inputText=inputText.replace("{mid}",ret.rst.mid);$input.val(inputText);showForward.autoHeight()}})}function changeSelectMenu(val,t,i){var $el=$selectBtn.eq(i),inputText="",originText="",rtText="";$forwardForm.hide();$("span",$el).text(t);$el.attr("value",val);$selectMenu.hide();$checkBox.hide();$tips.hide();$tips.text("");if(i){$groupForm.show();return}if(rt){rtText=" -//@"+rt.u.sn+":"+rt.tx}originText="//@"+data.u.sn+":"+data.tx;inputText="{title}:“"+originText+rtText+"” - 原文地址:http://weibo.com/"+data.u.id+"/{mid}";switch(val){case"weibo":$checkBox.show();if(rt){$input.val(originText)}else{$input.val("")}showForward.autoHeight();break;case"msg":$msgForm.show();Msgs.init("showPopup",".forward_box",3);inputText=inputText.replace("{title}",$DMBMSG.DMB105);querymid(inputText);$msgForm.find("input").val($DMBMSG.DMB343);break;case"group":var $groupMenu=$selectMenu.eq(1).find(".main_box"),$el=$selectBtn.eq(1);apiCall("getNavList",{data:"category_ids=2",success:function(ret){if(ret.errno!=0){return}if(ret&&ret.rst&&ret.rst.result.length==0){return}var items=ret.rst.result.categorys[0].items,str="";if(items.length==0){$noGroupForm.show();return}$.each(items,function(i,item){str=str+''+item.name+" "});$groupMenu.html(str);$("span",$el).text(items[0].name);$el.attr("value",items[0].id);inputText=inputText.replace("{title}",$DMBMSG.DMB043);querymid(inputText);$groupForm.show()}});break;case"nogroup":$noGroupForm.show();break}}function weiboSend($target,tid){var errMsg,rids=[],$forwardListBox=$(".forward_list_box ul:first"),$liTemp=$forwardListBox.find("li:hidden").clone(),$noMsg=$forwardListBox.find(".forward_list_box");if($input.checkText()<0){errMsg=$DMBMSG.DMB992}if(errMsg){alertMsg({msg:errMsg,type:"error",target:$target,style:0,oxr:-120,timeout:2,oy:25,callback:function(){$input.focus()}})}else{$('input[type="checkbox"]',$html).each(function(i,ele){if(ele.checked){rids.push(ele.value)}});var text=$input.val();if(!text){text=$DMBMSG.DMB043}$liTemp.find(".text_content").append(text).end().prependTo($forwardListBox).show();$noMsg.remove();apiCall("repost",{data:{id:tid,text:text,rtids:rids.join(",")},success:function(ret){$tips.hide();var cmt=ret.rst.comment;if(ret.errno=="0"){$input.val("");publisher.insert(ret.rst.data.id,ret.rst.data,ret.rst.html);wbComment.insertComment(cmt,tid);var $forwards=$("p>a[rel=1]",$("#i"+tid));increaseText($DMBMSG.DMB041,$forwards)}else{alertMsg({type:"error",msg:getError(ret.errno),pos:"center",oxr:0,target:$target,style:1})}}})}}function one(obj){$(document.body).one("click",obj,function(e){var $obj=$(e.data);$obj.is(":visible")&&$obj.hide()})}var text,inputText,str="",comments,data,uid,rt,tid,$html,$btn,$checkBox,$input,$inputTemp,$tips,$select,$selectBtn,$selectMenu,$groupForm,$msgForm,$noGroupForm,$forwardForm,liTemp=['','','
',"
",'','
{nick} :{text}
','
{create_at}
','
','
',"
","
",'
'," "].join("");return{init:function(tid,isfeed){tid=tid;str="";comments=[];data=XWEIBO.data[tid];uid=XWEIBO.uid;rt=data.rt;$html=$(".forward_box");$btn=$(".xwm_msgs_sndbtn",$html);$checkBox=$(".check_box",$html);$input=$("textarea:last",$html);$inputTemp=$("textarea:first");$tips=$("em.tips",$html),$select=$(".forward_select",$html);$selectBtn=$(".select_btn",$html);$selectMenu=$(".content",$html);$groupForm=$(".forward_select:last",$html);$msgForm=$(".form_input",$html);$noGroupForm=$(".weibo_des",$html);$forwardForm=$(".forward_form",$html);comments=[];$msgForm.click(function(){var $input=$(this).find("input");($input.val()==$DMBMSG.DMB343)&&$input.val("")});$select.click(function(e){var $target=$(e.target),rel=$target.attr("rel"),i=$(this).index(".forward_select");switch(rel){case"select":$selectMenu.eq(i).slideToggle(function(){one(this)});break;case"val":var val=$target.attr("value"),t=$target.text();changeSelectMenu(val,t,i)}});(uid!=data.u.id)&&comments.push({uid:tid,nick:data.u.sn});if(rt&&rt.u.id!=uid&&rt.u.sn!=data.u.sn){comments.push({uid:rt.id,nick:rt.u.sn})}if(rt){inputText="//@"+data.u.sn+":"+data.tx}else{inputText=""}for(var i=0,l=comments.length;i 0)?'class="check_second" ':"")+'type="checkbox" value="'+comments[i].uid+'"/>0)?'class="check_second" ':"")+">"+$DMBMSG.DMB039+""+comments[i].nick+""+$DMBMSG.DMB040+" ";str+='
'}$checkBox.html(str);$input.val(inputText);$input.autoResize({onResize:function(){},animateCallback:function(){$(this).css({opacity:1})},animateDuration:300,extraSpace:0});$btn.die().live("click",function(e){var $target=$(e.target),val=$selectBtn.attr("value",val);switch(val){case"weibo":weiboSend($target,tid);break;case"msg":break;case"group":if($input.checkText()<0){return}var groupid=$selectBtn.eq(1).attr("value"),content=$input.val();apiCall("updateGroups",{data:{group_id:groupid,status:content},success:function(ret){if(!ret.rst){alertMsg({type:"error",msg:getError(ret.errno),pos:1,oy:100,oxr:-150,target:$target,style:1,timeout:2})}else{alertMsg({type:"success",msg:$DMBMSG.DMB044,pos:1,timeout:2,style:1,target:$target,oy:100,oxr:-150});$input.val("")}}});break;case"nogroup":alert(val);break}});if(isfeed){$(".right_page_r a").attr("class","b_link")}else{$(".right_page_r a").attr("class","morelist_link a_link");$(".right_page_r a").html(""+$DMBMSG.DMB979+" ");$(".right_page_r").css("text-align","center")}},loadData:function(param){apiCall("repostList",{data:param,success:function(ret){if(ret.rst){var data=ret.rst,$ul=$(".right_main .forward_list_box ul");$.each(data,function(i,it){if(typeof it!="object"){return}var li=liTemp;li=li.replace(/\{rel\}/ig,"c_"+it.id);li=li.replace(/\{nick\}/ig,it.nick);li=li.replace(/\{id\}/ig,"i"+it.id);li=li.replace(/\{uid\}/ig,it.uid);li=li.replace(/\{profileImg\}/ig,it.profileImg);li=li.replace(/\{text\}/ig,it.text);li=li.replace(/\{create_at\}/ig,it.create_at);$(li).appendTo($ul)});$(".right_page_r").html(data.makePage)}}})},autoHeight:function(){$inputTemp.height(0);$inputTemp.val($input.val()).scrollTop(10000);$input.height($inputTemp.scrollTop());($input.height()<34)&&$input.height(34)},moreLinkEventBind:function(tid,isfeed){$(".right_page_r a").click(function(){if(isfeed){$("#i"+tid+" a[rel=1]").trigger("click")}else{showForward.loadData("id="+tid+"&count=10&isfeed=0")}return false})}}}();var toggleMessagesTags=function(){var $msg=$(".messages_tags");return{check:function(){return $msg.attr("hide")?true:false},over:function(){if(parseInt($(".msg_num").text())){$msg.fadeOut("fast")}},out:function(){if($(".msg_num").text()){$msg.attr("hide")||$msg.fadeIn("fast")}},close:function(){$msg.find(".head_close").unbind().bind("click",function(){$msg.attr("hide",1).hide()})}}}();function createVideoThumb(thumb){return $('')}function createFacePic(shortId,src){return $('')}function getWeiboID($element){var element=$element.get(0);if(!element){return FALSE}element.tid=$element.eq(0).attr("tid");if(element.tid==UNDEFINED||element.tid=="undefined"||element.tid==""){$li=($element.get(0).tagName=="LI")?$element:findParentElement("LI",$element);var ele_id=$li.attr("id"),tid;if(ele_id){tid=ele_id.match(/\d+/)}element.tid=tid?tid:NULL}return element.tid}function getError(errno){return errno in errorMsgs?errorMsgs[errno]:$DMBMSG.DMB999}function getNextPicId(){return"pic_"+picId++}function viewMiddlePic($source){var tid=getWeiboID($source);bindRight.freshShow({tid:tid,ctype:"middlepic",btype:"feed"})}function viewMiddlePicS(tid){var $li=$("#f"+tid);if(!getImageSrc(tid,2)){return}var $box=$li.find(".wb_info_t2");pictures.init(tid,$box)}function increaseText(text,$forwards){var str=$forwards.text(),hasNum=0,newstr=str.replace(/(\d+)/gi,function(num){hasNum++;return parseInt(num)+1});if(hasNum){$forwards.text(newstr)}else{$forwards.text(text+"(1)")}}function weiboForward($target){var tid=getWeiboID($target),$li=findParentElement("LI",$target),uid=$li.attr("uid");bindRight.freshShow({tid:tid,btype:"feed",ctype:"forward",isnew:1,uid:uid})}function addWeiboFavorite($target){var tid=parseInt(getWeiboID($target)),oxr=($target.attr("istool"))?-150:(-70),$li=$("#i"+tid);($("#f"+tid)[0])?oy=80:oy=130;alertMsg({title:$DMBMSG.DMB991,msg:$DMBMSG.DMB045,type:"success",callback:function(){if($target.attr("tid")){$target.removeAttr("rel").text($DMBMSG.DMB047)}else{$target.replaceWith(''+$DMBMSG.DMB047+" ")}},target:$target,style:0,timeout:2,pos:1,ox:-100,oy:oy,oyr:-20,oxr:oxr});apiCall("statsFavs");apiCall("createFavorite",{data:{id:tid},success:function(ret){if(ret.errno=="0"){}else{alertMsg({title:$DMBMSG.DMB991,msg:$DMBMSG.DMB046,type:"remind",timeout:2,target:$target,style:0,pos:1,ox:-120,oy:oy,oyr:-20,oxr:70})}}})}function delWeiboFavorite($taget){var $li=findParentElement("LI",$taget),tid=getWeiboID($taget);confirmBox({title:$DMBMSG.DMB991+":",msg:$DMBMSG.DMB048,target:$taget,type:"remind",oxr:-70,oy:130,oyr:-50},function(){$li.slideUp("normal",function(){$li.remove()});apiCall("deleteFavorite",{data:"id="+tid,success:function(ret){if(ret.errno=="0"){}else{alertMsg({type:"error",msg:$DMBMSG.DMB990+":"+htmlEscape(ret.err),timeout:1,target:$target,style:1,pos:1})}}})})}function deleteWeiboConfirm($target){var tid=getWeiboID($target),$li=$("#i"+tid+",#u"+tid);($("#f"+tid)[0])?oy=80:oy=130;confirmBox({title:$DMBMSG.DMB991,msg:$DMBMSG.DMB051,target:$target,type:"remind",ox:0,oy:oy,oxr:-80,oyr:-50,pos:1},function(){$li.slideUp("normal",function(){$("#i"+tid).remove();if($("#freshRightContent").find("#f"+tid).size()>0){bindRight.freshHide()}var $text=$("#user-weibo-count"),num=$text.text().match(/\d+/g);$text.text(num-1)});apiCall("destroy",{data:"id="+tid,success:function(ret){if(ret.errno=="0"){}else{alertMsg({msg:$DMBMSG.DMB989+": "+htmlEscape(ret.err),type:"error",style:0,pos:"center",timeout:2})}}})});$li.addClass("liover_bg")}function showListVideo($target){var $li=findParentElement("LI",$target),tid=getWeiboID($target);bindRight.freshShow({tid:tid,ctype:"showlistvideo"})}function showVideo($li,video,videoId){var $box=$li.find(".wb_info_t2"),flashWidth=373,flashHeight=373;flash=xwb.flash({src:video.annotations[0].url,width:flashWidth,height:flashHeight,w3c:1,id:"sinaVideo_"+(+new Date()),quality:"high",allowScriptAccess:"always",wmode:"transparent",allowFullscreen:"true",flashvars:"playMovie=true"}),html='",$video=$(html);$box.append($video);bindRight.freshRightContentInit()}function eventDispatch($target,event_type){var event_type=event_type?event_type:"click",type=$target.attr("rel");if(event_type=="auto"){type=$target.attr("submenu")}if(type&&type.toString().match(/\d+/ig)){eventMgr.broadcast(type,event_type,$target,type)}}function findSinaurl(data){var data=data||(XWEIBO&&XWEIBO.data);var result={urls:[],map:{}},tmp,url_id;if(data){var matchs,map=result.map,urls=result.urls;var reg=/http:\/\/(t|sinaurl)\.cn\/([0-9a-z]+)/gi;for(var i in data){$.each([data[i],data[i].rt],function(idx,ele){if(!ele){return}var txt=ele.tx;while(reg.test(txt)){url_id=RegExp.$2;if(!map[url_id]){map[url_id]=[]}map[url_id].push([i,idx]);urls.push(url_id)}})}}return result.urls.length?result:NULL}function getPreviewBox($li,is_forward){var $preview,$content,$previewLast;if(is_forward){$content=$("div.forward .wb_info_t2",$li);if(!$content[0]){$(".showbox-f p",$li).after('
');$content=$("div.wb_info_t2",$li)}}else{$content=$("div.wb_info_t2",$li);if(!$content[0]){$(".feed-main",$li).append('
');$content=$("div.wb_info_t2",$li)}}$preview=$('
');$content.append($preview);return $preview}function addVideoPreview(url_id,video,$li,isforward,tid){$("a[href$="+url_id+"]",$li).each(function(i,ele){if(!$("img",$(this))[0]){$(this).addClass("").attr("title",video.annotations[0].title).append(" ")}}).attr({rel:event_type_video,is_forward:isforward,video_id:url_id});$.each($li,function(i,$li){if($li.id.substr(0,1)!="f"){if($(".preview-video",$li).size()==0){XWEIBO.data[tid]["v"]=url_id;XWEIBO.data[tid]["v_f"]=isforward;var $thumb=createVideoThumb(video.annotations[0].pic),$box=getPreviewBox($li,isforward);$("div.video-view",$thumb).attr({is_forward:isforward,video_id:url_id});$box.append($thumb)}}else{showVideo($($li),video,url_id)}})}function addMagic(url_id,face,$li,isforward){$li.each(function(i,ele){var $a=$("a[href$="+url_id+"]",this);if(!$("img",$a)[0]){$a.append(" ").attr({rel:event_type_magicFace,shortid:url_id})}});$.each($li,function(i,$li){if($(".preview-video",$li).size()==0){var $thumb=createFacePic(url_id,face.annotations[0].pic),$box=getPreviewBox($li,isforward);$box.append($thumb)}})}function addMusic($li,url_id,linkInfo,music_type){var annotation=linkInfo.annotations[0];if(music_type==music_type_189){return}$("a[href$="+url_id+"]",$li).each(function(i,ele){$(ele).attr({rel:event_type_play_music,link_id:url_id,tid:getWeiboID($li),site:music_type,title:annotation.author+" "+annotation.title}).addClass("music-url icon-bg")})}function playMusic($link){var link_id=$link.attr("link_id"),linkInfo=sinaurls.get(link_id),tid=getWeiboID($link),music_type=parseInt($link.attr("site")),playurl="",sizes;if(music_type==music_type_sina){sizes="width=629,height=595";var sinaurl=encodeURIComponent("http://t.cn/"+link_id);playurl=sina_music_player+"?ads=1&coFlag=200006&url="+sinaurl+"&id="+tid}else{if(music_type==music_type_189){playurl=linkInfo.url;sizes="width=490,height=550"}}playurl&&window.open(playurl,"xweibo_player",sizes+",top="+(window.screen.height-600)/2+", left="+(window.screen.width-730)/2+", toolbar=no, menubar=no, scrollbars=no,resizable=no,location=no, status=no")}function counterAdd(data){var ids=[];if(!data){if(XWEIBO.data==undefined){return}$.each(XWEIBO.data,function(i,item){ids.push(i);if(item.rt&&item.rt.id){ids.push(item.rt.id)}});ids=ids.join(",")}apiCall("getCounts",{data:data||{ids:ids},success:function(ret){if(ret&&ret.errno===0){ret.rst&&$.each(ret.rst,function(i,item){if(item[0]){$("#i"+i).find(".feed-info a[rel=3]").text($DMBMSG.DMB106+"("+item[0]+")")}if(item[1]){$("#i"+i).find(".feed-info a[rel=1]").text($DMBMSG.DMB150+"("+item[1]+")")}$.each(XWEIBO.data,function(j,wbData){if(wbData.rt&&wbData.rt.id==i){var $tarEl=$("#i"+j).find(".forward>p>span>a");if(item[0]){$tarEl.eq(1).text($DMBMSG.DMB151+"("+item[0]+")")}if(item[1]){$tarEl.eq(0).text($DMBMSG.DMB152+"("+item[1]+")")}}})})}}})}function linkRender(data){var url=findSinaurl(data),urlStr="";if(url){var urls=url.urls,map=url.map;sinaurls.query(urls,function(data){for(var url_id in data){$.each(map[url_id],function(i,pos){var tid=pos[0],isforward=pos[1],urlStrTmp=url_id+tid+isforward,linkInfo=data[url_id];if(urlStr.indexOf(urlStrTmp)>=0){return true}urlStr+=urlStrTmp+",";var $li=$("#i"+tid+",#f"+tid+",#u"+tid);switch(parseInt(linkInfo.type)){case 1:addVideoPreview(url_id,linkInfo,$li,isforward,tid);break;case 2:addMusic($li,url_id,linkInfo,music_type_sina);break;case 4:addMagic(url_id,linkInfo,$li,isforward);break;case 0:break}})}})}}function getShortFileName(str,len){if(str.indexOf("\\")){var parts=str.split("\\");str=parts.pop()}if(str.length>len){return str.substr(0,len-4)+".."+str.substr(str.length-4)}else{return str}}function checkPicName(filename){var pieces=filename.split(".");if(!pieces.length||-1==$.inArray(pieces.pop().toLowerCase(),["jpg","png","gif"])){return FALSE}return TRUE}function toWeiboHtml(row,opt){var frag=document.createDocumentFragment();var showFace,showOper,showUnread,avatarSize;if(opt){showFace=opt.avatar===UNDEFINED?TRUE:opt.avatar;showOper=opt.button===UNDEFINED?TRUE:opt.button;showUnread=opt.isUnread}var unreadClass=showUnread?'class="unread"':"";$.each(row,function(i,item){var wbHtml="",user=item.u,vStyle=user.sina_v?'class="v-icon icon-bg"':"",forwardHtml="",oprateHtml="",faceHtml="",imgHtml="",userUrl=buildModulePath("ta","","id="+user.id),detailUrl=buildModulePath("show","","id="+item.id);if($("#i"+item.id)[0]){return true}if(showFace){faceHtml=''}if(showOper){var delHtml="";if(user.id==XWEIBO.uid){delHtml=''+$DMBMSG.DMB985+" "}oprateHtml=''+$DMBMSG.DMB983+" "+delHtml+''+$DMBMSG.DMB150+""+(item.rts?"("+item.rts+")":"")+' '+$DMBMSG.DMB049+' |
"}if(item.tp){imgHtml=''}if(item.rt&&item.rt.u){var rtImgHtml="",rt=item.rt,rtu=rt.u;if(rt.tp){rtImgHtml=' '}forwardHtml=['"].join("")}wbHtml=['',faceHtml,'','
','
"+user.sn+" :",item.ftx,"
",imgHtml,forwardHtml,'
','
'+oprateHtml+"
",'
'+item.cr+" "+$DMBMSG.DMB982+" "+item.s+"","
","
"," "].join("");frag.appendChild($(wbHtml)[0])});return frag}function listenAttention($container,type,userid,ship){var attention=xwb.attention,disabled_class="disabled",ufollow,uname;var hover_handler=function(e){var $target=$(e.target);var onList=$target.attr("tagName")=="LI";var $li=onList?$target:findParentElement("LI",$target);var $btn=$("a.forjs-cancel-att,a.forjs-private",$li);if($btn.length){if((e.type=="mouseover")&&(onList||$.contains($li.get(0),e.target))){$btn.show()}else{if(!$.contains($li.get(0),e.relatedTarget)){$btn.hide()}}}};if(type==2){$container.click(function(e){var $target=$(e.target),uname=$target.attr("uname"),uid=$target.attr("rel");if(!$target.hasClass("addfollow-btn")){return}attention(uid,1,function(ret){if(ret.errno=="0"){AttentionButton(uid,1)}});e.preventDefault()})}else{$container.click(function(e){var $target=$(e.target);if($target.hasClass("addfollow-btn")){if(!$target.hasClass("disabled")){$target.addClass("disabled");var uid=$target.attr("rel");attention(uid,1,function(ret){if(ret.errno=="0"){$target.replaceWith(''+$DMBMSG.DMB203+" ")}else{alertMsg({type:"error",msg:$DMBMSG.DMB201+":"+htmlEscape(ret.err)})}})}e.preventDefault()}})}}function viewUser($target){var $li=findParentElement("LI",$target),utype=$target.attr("utype"),tid=getWeiboID($target,$li),uid=$target.attr("uid")||$li.attr("uid");bindRight.freshShow({uid:uid,btype:"user",utype:utype,tid:tid})}function originalForward($target){var $li=findParentElement("LI",$target),tid=getWeiboID($target,$li),isforward=$target.attr("forward"),uid=$li.find(".showbox-f a[rel=21]:first").attr("uid");bindRight.freshShow({tid:tid,btype:"feed",isforward:isforward,ctype:"forward",uid:uid,isnew:1})}function originalSendComment($target){var $li=findParentElement("LI",$target),tid=getWeiboID($target),isNew=$($target).attr("isnew"),isforward=$target.attr("forward"),uid=$li.find("div.showbox-f a[rel=21]:first").attr("uid");if(isNew){bindRight.freshShow({tid:tid,callback:tid,ctype:"comment",isforward:isforward,isnew:1,uid:uid})}else{wbComment.get($target).toggle()}}function userRemarks($target,type){var $box=floatLayerMgr($target,type);$box.show()}function AttentionButton(uid,show,ufollow){var $user_option_area=$(".user_opera_area:first"),$left_btn=$("#i"+uid).find("div.content_btn"),$search_btn=$("#i"+uid).find("div.content_btn"),$search_right_btn=$("li[uid="+uid+"]").find(".user_infos"),$invite_btn=$("li[uid="+uid+"]").find(".invite_btn");if(show){if($user_option_area.size()>0){$user_option_area.find(".btn_follows").eq(ufollow).hide().next("span").hide();$user_option_area.find(".btn_follow").eq(ufollow).show().next("span").show();$user_option_area.find(".icon_setgroup").show();$user_option_area.find(".icon_remarks").show()}if($left_btn.size()>0){$left_btn.find(".follow_each").show();$left_btn.find(".addfollow-btn").hide()}if($search_btn[0]){$search_btn.find("span").show();$search_btn.find(".addfollow-btn").hide()}if($search_right_btn[0]){$search_right_btn.find(".follow_ed").show();$search_right_btn.find(".addfollow-btn").hide()}if($invite_btn[0]){$invite_btn.find(".link_ignore").hide();$invite_btn.find(".link_follow").hide();$invite_btn.find(".icon_follow_each").show()}}else{if($user_option_area.size()>0){$user_option_area.find(".btn_follow").eq(ufollow).hide().next("span").hide();$user_option_area.find(".btn_follows").eq(ufollow).show().next("span").show();$user_option_area.find(".icon_setgroup").hide();$user_option_area.find(".icon_remarks").hide()}if($left_btn.size()>0){$left_btn.find(".follow_each").hide();$left_btn.find(".addfollow-btn").show()}if($search_btn[0]){$search_btn.find("span").hide();$search_btn.find(".addfollow-btn").show()}if($search_right_btn[0]){$search_right_btn.find(".follow_ed").hide();$search_right_btn.find(".addfollow-btn").show()}}}function userAttention($target){var attention=xwb.attention,$li=findParentElement("LI",$target),uid=$li.attr("uid")||$li.attr("id").match(/\d+/)||$target.attr("uid"),uname=$li.attr("uname"),ship=$li.attr("ship")^1,follow=parseInt($target.attr("follow")),ufollow=parseInt($target.attr("ufollow")),$parent=findParentElement("DIV",$target);if(!follow){AttentionGroup($target);AttentionButton(uid,1,ufollow);apiCall("inviteHandle",{data:{id:uid,value:1}});attention(uid,1,function(ret){if(ret.errno=="0"){}else{alertMsg({type:"error",msg:$DMBMSG.DMB990+":"+htmlEscape(ret.err),timeout:2,target:$target,oxr:-130})}})}else{confirmBox({title:$DMBMSG.DMB991,msg:$DMBMSG.DMB200,type:"remind",target:$target.parent(),oxr:150,pos:1,oy:135},function(){AttentionButton(uid,0,ufollow);attention(uid,0,function(ret){if(ret.errno=="0"){}else{alertMsg({type:"error",msg:$DMBMSG.DMB990+":"+htmlEscape(ret.err),$target:$target,timeout:2})}})})}}var Msgs=function(){function getFn(fnTemp,fn){var fnArray=fn.split("."),fnArrayLength=fnArray.length;for(var i=0;i ');$.each(result.rst.list,function(i,rst){if(!XWEIBO.data[rst.data.id]){publisher.insert(rst.data.id,rst.data,rst.html)}});if(result.rst.end_pos!=0){$(".morelist_link").attr("onclick","").bind("click",function(){XWB.feed.getFeeds("endmid="+result.rst.endmid+"&page=2&end_pos="+result.rst.end_pos)})}XWEIBO.maxid=result.rst.endmid;$newfeed.next("div.loading_newfeed").remove()}else{if(result.rst==false){alert(result.err);return false}}}})}function commentDelBlack($target,type,param){var $box=floatLayerMgr($target,type,param);$box.show()}function weiboSend($target,type,param){var url="http://"+location.hostname+"/index.php?m=ta&id="+XWEIBO.uid,texareaValueDefault=param?(param.texareaValueDefault||""):"",closeCallback=param?(param.closeCallback||""):"",textareaType,msgTitle,$li,uname,uid;switch(type){case event_type_recommendXWB+"":$li=findParentElement("LI",$target);uname=$li.attr("uname");textareaType=6;param={id:XWEIBO.uid,textareaType:textareaType,feedpre:"@"+uname+":",feedback:"http://mo.weibo.com/?guidetype=ta&uid="+XWEIBO.uid};msgTitle=$DMBMSG.DMB441.replace("@name",uname);break;case event_type_attaQuickly+"":$li=findParentElement("LI",$target);uname=$li.attr("uname");param={feedpre:"@"+uname+":"};msgTitle=$DMBMSG.DMB160.replace("@name",uname);break;case event_type_recommend+"":$li=findParentElement("LI",$target);uname=$li.attr("uname");uid=$li.attr("uid");param={feedpre:"@"+uname+":",uid:uid};msgTitle=$DMBMSG.DMB418.replace("@name",uname);break;case event_type_proSend+"":$DMBMSG.DMB160=$DMBMSG.DMB163;param={};break;default:textareaType=3;msgTitle=$DMBMSG.DMB432;$.extend(param,{feedback:"http://"+location.hostname+"/?guidetype=changeskin&uid="+XWEIBO.uid,textareaType:textareaType||4});break}var $box=floatLayerMgr($target,type,param),$layer=$box.element,$area=$(".tools_area",$layer),$textarea=$("textarea",$layer);wbSubjoin.init($area,$textarea,{font:"",face:{left:0,pos:1,parent:$layer,facePageCounts:36,aniPageCounts:6},pic:"",video:{left:0},music:{left:0}},"windows_bg");$("span.item_name",$layer).html(msgTitle);if(texareaValueDefault){$("textarea",$layer).val(texareaValueDefault)}else{if(textareaType){TextareaRnd($textarea,textareaType,param)}else{(type==(event_type_attaQuickly+""))&&$("textarea",$layer).val("@"+uname+":");(type==(event_type_recommend+""))&&$("textarea",$layer).val($DMBMSG.DMB422.replace("@name",uname));$(".windows_text",$layer).hide()}}$("textarea",$layer).keyup();$("textarea",$layer).focusEnd();$box.config({closeCallback:closeCallback&¶m.closeCallback});$box.show()}function weiboIn($target,type){var guide=XWEIBO&&XWEIBO.guide;if(!guide){return}var weiboIn=guide.weiboIn?parseInt(guide.weiboIn):"",openway=guide.openway?parseInt(guide.openway):1000,url=guide.url?guide.url:"",page1=guide.page1?guide.page1:"",page2=guide.page2?guide.page2:"",page3=guide.page3?guide.page3:"",left_button=guide.left_button?guide.left_button:"",right_button=guide.right_button?guide.right_button:"",guidetype=guide.guidetype?guide.guidetype:"other",openApps=function(openway,url){if(openway!=2){var uid=$.queryString("uid")||"",ptitle=$.queryString("ptitle")||"",fileid=$.queryString("fileid")||"";url=url.replace(/\{uid\}/gi,uid).replace(/\{ptitle\}/gi,ptitle).replace(/\{fileid\}/gi,fileid)}switch(openway){case 0:location.href=url;break;case 1:var $a=$("").hide().appendTo("body");$a.attr({href:url,target:"_blank"});invokeClick($a.get(0));break;case 2:XWB[url]&&XWB[url]();break}};if(weiboIn){if(XWB.Apps.weiboIn){XWB.Apps.weiboIn.show()}else{$LAB.script(load_js+"js/apps/weiboin.js"+load_version).wait(function(){XWB.Apps.weiboIn.show({callback:openApps,openway:openway,url:url,page1:page1,page2:page2,page3:page3,left_button:left_button,right_button:right_button,guidetype:guidetype})})}}else{openApps(openway,url)}}function TextareaRnd($obj,msgId,params){msgId=msgId||5;apiCall("getInlang",{data:"cid="+msgId,success:function(result){if(result&&result.errno==0){if(result.rst.result==""){return}var msg=result.rst.result||"",msgArray=msg.split("|||"),rnd=parseInt(Math.random()*(msgArray.length)),msgContent=msgArray[rnd],msgTS=msgContent.split("||");if(msgTS.length>1){($DMBMSG.DMB1000=="cnname")?msgContent=msgTS[0]:msgContent=msgTS[1]}else{msgContent=msgTS}params.feedback&&(msgContent+=params.feedback);params.feedpre&&(msgContent=params.feedpre+msgContent);if(msgContent!=$obj.val()){if($obj.is("textarea")){$obj.val(msgContent+" ");$obj.keyup();$obj.focus()}else{$obj.html(msgContent+" ")}}else{TextareaRnd($obj,msgId,params)}}}})}function dress($target,type,param){var nav,$li=param||findParentElement("LI",$target),$img=param||$li.find("img"),ishome=param||$img.attr("home"),cate=param?param.cate:$img.attr("cate"),filename=param?decodeURIComponent(param.filename):$img.attr("filename"),fileid=param?param.fileid:$img.attr("fileid"),feedimg=param?decodeURIComponent(param.feedimg):$img.attr("src"),diyBg=param?decodeURIComponent(param.diyBg):($img.attr("diyBg")||0),align=param?decodeURIComponent(param.align):($img.attr("align")||0),repeat=param?decodeURIComponent(param.repeat):($img.attr("repeat")||0),locked=param?decodeURIComponent(param.locked):($img.attr("locked")||0),ptitle=param?decodeURIComponent(param.ptitle):$img.attr("title"),ptitle=(diyBg=="0")?ptitle:"自定义背景",data={fileid:fileid,cate:cate,filename:filename,feedimg:feedimg,ptitle:(ptitle),tadress:1,diyBg:diyBg,align:align,repeat:repeat,locked:locked,cancel_callback:function(){location.href="/index.php"}};if(!ishome){location.href="/index.php?"+$.param(data,true);return}switch(cate){case"package":nav=$DMBMSG.DMB426;break;case"backgroup":nav=$DMBMSG.DMB427;break;case"template":nav=$DMBMSG.DMB428;break;case"inputbox":nav=$DMBMSG.DMB429;break;case"navigation":nav=$DMBMSG.DMB430;break;case"avatar":nav=$DMBMSG.DMB431;break}var $box=floatLayerMgr($target,type,data);$("p.title",$box.element).text($DMBMSG.DMB425+":"+ptitle);$("div.win_dress_pic img",$box.element).attr("src",feedimg);$(".dress_names",$box.element).text(ptitle);$(".dress_name",$box.element).text(nav);$box.show()}function feedback($target,type){var $box=floatLayerMgr($target,type),$layer=$box.element,$area=$(".tools_area",$layer),$textarea=$("textarea",$layer);wbSubjoin.init($area,$textarea,{font:"",face:{left:0,facePageCounts:36,aniPageCounts:6}},"windows_bg");$box.show()}function invite($target,type){var $li=findParentElement("LI",$target),uid=$li.attr("uid"),$box=floatLayerMgr($target,type,{uid:uid});$box.show()}function showSign(stats){if(stats){apiCall("apps/happy_magic/apphappymagic.php?goto=addStats&filed="+stats+"&type=sign")}if(XWB.Apps.Sign){XWB.Apps.Sign.init()}else{$LAB.script(load_js+"js/apps/sign.js?20120207030000").wait(function(){XWB.Apps.Sign.init()})}}function floatLayerMgr($target,type,param){var html,uid,uname,$floatBox,box,tid,text,pic,This=this,type=parseInt(type),$li=$target?findParentElement("LI",$target):"",rename;function heightAuto($div){$div.css("margin-top","-"+$div.height()/2+"px")}function send(type){switch(type){case event_type_invite:var $el=$("textarea",$floatBox),val=$.trim($el.val()),$tips=$(".warn",$floatBox);if($.asciiLen(val)>280){$tips.text($DMBMSG.DMB489).show();return false}else{if(val==""){$tips.text($DMBMSG.DMB490).show();return false}}box.close();alertMsg({msg:$DMBMSG.DMB177,type:"success",timeout:1,style:1,pos:"center"});apiCall("inviteSend",{data:{sinaid:param.uid,content:val}});break;case event_type_blackList:box.close();wbUserEdit.blackJoin(uid,1);break;case event_type_groupNameAdd:var el=$('input[name="groupname"]',$floatBox),groupname=el.val(),errorMsg=$("#errorTips",$floatBox);if(!groupname){el.focus();errorMsg.html($DMBMSG.DMB091);return}else{errorMsg.html("");apiCall("editGroup",{data:"groupname="+groupname,success:function(result){if(result&&result.errno==0&&result.rst!=false){window.location.href="index.php?m=index.follow";return true}else{if(result.errno==80017){errorMsg.html($DMBMSG.DMB091);return false}else{if(result.errno==80018){errorMsg.html($DMBMSG.DMB092);return false}else{if(result.errno==80019){errorMsg.html($DMBMSG.DMB093);return false}else{if(result.errno==400){errorMsg.html($DMBMSG.DMB094);return false}else{if(result.rst==false){alertMsg({msg:result.err||$DMBMSG.DMB461,type:"error",timeout:1,style:1,pos:"center",callback:function(){window.location.reload()}});return false}}}}}}}})}break;case event_type_groupOrder:var listsort="";$.each(param,function(i,it){listsort+=it.id+","});listsort=listsort.substring(0,listsort.length-1);apiCall("action.saveGroupSort",{data:"listsort="+listsort,success:function(result){if(result.rst==1){box.close();alertMsg({msg:$DMBMSG.DMB482,timeout:2,type:"success",style:1,pos:"center",callback:function(){window.location.reload()}});return}else{if(result.rst==-1){alertMsg({msg:$DMBMSG.DMB481,timeout:2,type:"error",style:1,pos:"center",callback:function(){}});return false}else{if(result.rst==false){alertMsg({msg:$DMBMSG.DMB480,timeout:2,type:"error",style:1,pos:"center",callback:function(){window.location.href="/login.html"}});return false}}}}});break;case event_type_groupNameEdit:var groupname=$('input[name="groupname"]',$floatBox).val(),gid=$target.attr("gid"),_groupname=$target.attr("listname"),errorMsg=$(".errorTips",$floatBox);if(gid==""||groupname==""){errorMsg.html($DMBMSG.DMB091);return}if(_groupname==groupname){errorMsg.html($DMBMSG.DMB094);return}errorMsg.html("");apiCall("editGroup",{data:"groupname="+groupname+"&gid="+gid,success:function(result){if(result&&result.errno==0&&result.rst!=false){window.location.href="index.php?m=index.attlist&gid="+gid;return true}else{if(result.errno==80017){errorMsg.html($DMBMSG.DMB091);return false}else{if(result.errno==80018){errorMsg.html($DMBMSG.DMB092);return false}else{if(result.errno==80019){errorMsg.html($DMBMSG.DMB093);return false}else{if(result.errno==400){errorMsg.html($DMBMSG.DMB094);return false}else{if(result.rst==false){alertMsg({type:"error",msg:result.err.error,pos:"center",style:1});return false}}}}}}}});break;case event_type_Tags:var el=$('input[name="tags"]',$floatBox),tags=el.val().replace(/\s/g,""),errorMsg=$("#errorTips",$floatBox);if(!tags){el.focus();errorMsg.html($DMBMSG.DMB479);return}var rTags=tags.replace(",",",");if($.asciiLen(rTags.split(",").join(""))>14){errorMsg.html($DMBMSG.DMB070);return false}if(!/[0-9a-zA-Z\u4e00-\u9fa5\,]/gi.test(rTags)){errorMsg.html($DMBMSG.DMB071);return}errorMsg.html("");box.close();alertMsg({msg:$DMBMSG.DMB478,type:"success",timeout:1,style:1,pos:"center"});apiCall("addTags",{data:"tags="+rTags,success:function(result){if(result&&result.errno==0&&result.rst==1){var user_tag=$(".mytag_t2").html();user_tag==""?$(".mytag_t2").html(tags):$(".mytag_t2,.right_boxs .right_content2:last").prepend(" '+tags+" ");var num=$("#tags_add").attr("tagnum");if(num==9){$("#tags_add").remove()}else{$("#tags_add").attr("tagnum",parseInt(num)+1)}return true}else{if(result.rst==false){alertMsg({msg:result.err||$DMBMSG.DMB461,type:"error",timeout:1,style:1,pos:"center",callback:function(){window.location.reload()}});return false}}}});break;case event_type_userRemarks:var el=$('input[name="remark"]',$floatBox),uname=el.val(),errorMsg=$("#errorTips",$floatBox);if(!rename.get(0)){$(" ").addClass("font12").text(uname?$DMBMSG.DMB080+":"+uname:uname).insertBefore($(".mybaby").find("li#i"+uid+" p.formLocation"))}apiCall("remarkUser",{data:"id="+uid+"&remark="+uname,success:function(result){if(result&&result.errno==0&&result.rst==1){if(uname!=""){$("#remark_"+uid).text(uname).attr("remark",uname).attr("title",uname).substrText(10)}else{$("#remark_"+uid).text($DMBMSG.DMB082).attr("remark","").attr("title","")}box.close();return true}else{if(result.rst==false&&result.errno==80021){errorMsg.html($DMBMSG.DMB081);return false}else{if(result.rst==false){alertMsg({msg:result.err||$DMBMSG.DMB461,type:"error",timeout:1,style:1,pos:"center",callback:function(){location.reload()}});return false}}}}});break;case event_type_desFri:if(uid==""){return}if($("input:checked",$floatBox).val()){wbUserEdit.blackJoin(uid,1)}else{if($.queryString("m").toLowerCase()=="index.fans"){$("#i"+uid).slideUp();box.close()}alertMsg({type:"success",msg:$DMBMSG.DMB215,pos:"center",style:1,timeout:2})}$("a.icon_movefans").fadeOut();box.close();apiCall("destroyFriends",{data:"id="+uid,success:function(result){if(result&&result.errno==0&&result.rst==1){return true}else{if(result.rst==false){alertMsg({msg:result.err||$DMBMSG.DMB461,type:"error",timeout:1,style:1,pos:"center",callback:function(){window.location.reload()}});return false}}}});break;case event_type_AttentionGroup:var groupid=$("input:checked",$floatBox),groupidArray=[],groupidStr="";$layer=$(box.element),$remark=$layer.find("input[name=remark]"),$warn=$layer.find(".warn"),remarkValue=$remark.val(),remarkValueLen=$.asciiLen(remarkValue);if(remarkValueLen>30){$warn.text($DMBMSG.DMB081);$warn.show();return false}$warn.hide();groupid.each(function(){groupidArray.push($(this).val())});groupidStr=groupidArray.join(",");apiCall("remarkUser",{data:"id="+uid+"&remark="+remarkValue});if(groupidStr==""){box.close();return}apiCall("volumeJoinGroup",{data:"objuid="+uid+"&gid="+groupidStr,success:function(result){if(result&&result.errno==0&&result.rst==1){box.close();return true}else{if(result.rst==false){alertMsg({msg:result.err,type:"error",timeout:1,style:1,pos:"center"});return false}}}});break;case event_type_ProfileInfo:var el=$("textarea",$floatBox),newDes=$.trim(el.val())?$.trim(el.val()):$DMBMSG.DMB059,errorMsg=$("#errorTips",$floatBox);if($.asciiLen(newDes)>140){errorMsg.html($DMBMSG.DMB060);return false}box.close();alertMsg({msg:$DMBMSG.DMB434,type:"success",timeout:1,style:1,pos:"center",callback:function(){setTimeout(function(){$(".user_des").text(newDes)},200)}});apiCall("setting.saveProfile",{data:"only=1&description="+newDes,success:function(result){if(result&&result.errno==0&&result.rst==true){return true}else{if(result.errno==80005){errorMsg.html($DMBMSG.DMB060);return false}else{if(result.errno==40009){errorMsg.html($DMBMSG.DMB061);return false}else{if(result.rst==false&&result.errno==-1){alertMsg({msg:result.err||$DMBMSG.DMB461,type:"error",timeout:1,style:1,pos:"center",callback:function(){window.location.reload()}});return false}}}}}});break;case event_type_commentDelBlack:box.close();$li.attr("noback")?XWB.myComment.handle(event_type_commentDelBlack,param):wbComment.delComment(tid);$("input:checked",$floatBox).val()&&wbUserEdit.blackJoin(uid,0);break;case event_type_recommendXWB:case event_type_weibo:case event_type_attaQuickly:case event_type_proSend:case event_type_recommend:var follow=$floatBox.find(":checkbox").is(":checked")?1:0,text=$textarea.val(),data={follow:follow,text:text,id:param.id,s:1},pic=$textarea.attr("pic"),err=publisher.checkInput($textarea);if(type==event_type_recommend){data.text+="http://"+location.host+"?guidetype=recommenduser&uid="+param.uid}if(type==event_type_attaQuickly){data.s=4}if(pic){data.pic=pic}if(text==""||err){alertMsg({type:"error",style:1,msg:getError(err),timeout:2,pos:"center",callback:function(){$textarea.focus()}});return false}else{var $success=$("div.post-success",$floatBox);if(pic){$textarea.attr("pic","");var xImage=$("#xImage");xImage.find(".windows_box").html(wbSubjoin.resetUploadPic());xImage.find(".close_btn").trigger("click")}box.close();alertMsg({type:"success",msg:$DMBMSG.DMB177,pos:"center",style:1,timeout:2,callback:function(){$textarea.val("")}});apiCall("update",{data:data,success:function(ret){var errno=ret.errno;if(toInt(errno)==0){var rst=ret.rst;publisher.insert(rst.data.id,rst.data,rst.html);return}else{alertMsg({msg:getError(errno),type:"error",timeout:2,style:1,pos:"center",callback:function(){$textarea.focus()}})}}})}break;case event_type_dress:var fileid=param.fileid,cate=param.cate,filename=param.filename,diyBg=parseInt(param.diyBg),align=param.align,repeat=param.repeat,locked=param.locked,photo=param.feedimg,cateArray,confirmMsg=$DMBMSG.DMB424,style;if(diyBg){$LAB.script(load_js+"js/src/shop.js"+load_version).wait(function(){xwb.Shop.showDiyBg({photo:photo,align:align,repeat:repeat,locked:locked})})}else{if(cate=="package"){filename=filename.split(",");$.each(filename,function(i,data){cateArray=data.split("|");$LAB.script(load_js+"js/src/shop.js"+load_version).wait(function(){xwb.Shop.installSkin(cateArray[0],cateArray[1])})})}else{$LAB.script(load_js+"js/src/shop.js"+load_version).wait(function(){xwb.Shop.installSkin(cate,filename)})}}box.close();if(cate=="avatar"){confirmMsg=$DMBMSG.DMB433;style=2}confirmBox({title:$DMBMSG.DMB991,msg:confirmMsg,type:"remind",ox:-100,oy:-80,style:style,fileid:fileid},function(){if(diyBg){alertMsg({title:$DMBMSG.DMB991,msg:"抱歉,此装扮是用户自己上传的自定义背景,您也赶快开给自己设计一套不同的背景吧!",type:"remind",enterCallback:function(){location.href="/?m=shops&a=diy"},callback:function(){location.href="/"},pos:"center"})}else{$LAB.script(load_js+"js/src/shop.js"+load_version).wait(function(){xwb.Shop.save(fileid)})}},function(){window.location.href="index.php"});break;case event_type_feedback:var text=$textarea.val(),data={text:$DMBMSG.DMB474+text,name:$DMBMSG.DMB470},left=$textarea.checkText(296),$em=$("em",box.element);if(text==""){$em.html($DMBMSG.DMB475);return false}if(left<0){$em.html($DMBMSG.DMB476);return false}else{$em.html("")}box.close();Msgs.init("model.send",data);break;case event_type_myselfDress:box.close();location.href="/";break;case event_type_adegg:if($textarea.checkText()<0){return}box.close();adMgr.names.egg.send($textarea);break;case event_type_adegg_noIntegral:box.close();adMgr.names.egg.noIntegral();break}}switch(type){case event_type_blackList:uid=$li.attr("uid"),uname=$li.attr("uname");html=['','
','
'+$DMBMSG.DMB213+" ",'
',"
",'
','
','
','
','
'+$DMBMSG.DMB414+""+uname+" "+$DMBMSG.DMB415+"
","
",'
'+$DMBMSG.DMB416+"
",'
","
","
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_userRemarks:uid=$li.attr("uid"),html=['','
','
'+$DMBMSG.DMB082+" ",'
',"
",'
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();rename=$(".mybaby").find("li#i"+uid+" span.font12");$floatBox.find('input[name="remark"]').focus().val($("#remark_"+uid).attr("remark"));break;case event_type_groupNameAdd:case event_type_groupNameEdit:var listname=$target.attr("listname")||"";var btnName=type==event_type_groupNameAdd?$DMBMSG.DMB034:$DMBMSG.DMB996;var nameTitle=type==event_type_groupNameAdd?$DMBMSG.DMB033:$DMBMSG.DMB980;html=['"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_groupOrder:var _fixEvent=function(event){event=event||window.event;if(!event.target){event.target=event.srcElement||document}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode}if(!event.which&&event.button!==undefined){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)))}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc&&doc.clientLeft||body&&body.clientLeft||0);event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc&&doc.clientTop||body&&body.clientTop||0)}return event};var _wantedTarget=function(tag,node){while(tag){if(tag.parentNode===node){return tag}tag=tag.parentNode}return null};var tmpdiv=document.createElement("div");tmpdiv.style.cssText="cursor:move; height:3px; background-color:#36f;display:none;overflow:hidden";var Mouse=function(){this.initialize.apply(this,arguments)};Mouse.prototype={initialize:function(){var _this=this;this._mouseStarted=false;var mouseDownFunc=function(event){event=_fixEvent(event);_this.mouseDown(event)};$(document).unbind("mousedown");$(document).mousedown(function(event){mouseDownFunc(event)})},mouseDown:function(event){var _this=this;this.cancel=!this.mouseCapture(event);if(this.cancel){return false}this.mouseStart(event);this.mouseMoveFunc=function(){_this.mouseDrag(event)};this.mouseUpFunc=function(){_this.mouseUp(event)};$(document).unbind("mouseover mouseup");$(document).bind("mouseover",function(){_this.mouseMoveFunc(event)});$(document).bind("mouseup",function(){_this.mouseUpFunc(event)})},mouseDrag:function(event){event=_fixEvent(event);if(this._mouseStarted){this.mouseMove(event)}if(this.moveDistance(event)){this._mouseStarted=true}},mouseUp:function(event){if(this.cancel){return false}this._mouseStarted=false;this.mouseStop(event)},mouseStart:function(event){return true},mouseMove:function(event){},mouseStop:function(event){},mouseCapture:function(event){return true},moveDistance:function(event){return true}};var template=function(param){html=['分组名
'];$.each(param,function(i,it){html.push("'+it.name+" ")});html.push('
');return html.join("")};$floatBox=$(template(param)).appendTo("body");box=$floatBox.toXwin();var groupUl=$("#group_ul_lists",$floatBox),groupUlLists=groupUl.children("li").children("a"),len=groupUlLists.length,selected=groupUlLists.hasClass("down"),saveBtn=$("#save",$floatBox),orderUp=$("#orderUp",$floatBox),orderDown=$("#orderDown",$floatBox);var next,prev,selectedLi;var moveOverFunc=function(o,d){o.getElementsByTagName("a")[0].focus();var oi=o.getAttribute("_index"),di=d.getAttribute("_index"),temp;o.setAttribute("_index",di);d.setAttribute("_index",oi);temp=param[di];param[di]=param[oi];param[oi]=temp};var changeMouseOrder=function(o,d){var lis=groupUl.children("li"),oi=0|o.getAttribute("_index"),di;if(d){di=d&&0|d.getAttribute("_index")}else{di=-1}var joi=param[oi];if(oidi){param.splice(oi,1);param.splice(di+1,0,joi)}else{return}}for(var i=0,len=lis.length;i2};mouseorder.mouseMove=function(event){if(event.target===tmpdiv){return}tagli=_wantedTarget(event.target,groupUl.get(0));if(tagli){if(firstFlag||destag!=tagli){taga=tagli.getElementsByTagName("a")[0];if(taga.style.cursor==""){taga.style.cursor="move"}firstFlag=false;tmpdiv.style.display="";destag=tagli;$(tmpdiv).insertAfter($(destag))}}else{if(destag===groupUl.children(":first").get(0)){firstFlag=true;$(tmpdiv).insertBefore($(destag))}if($.contains(buttons.get(0),event.target)){groupUl.get(0).parentNode.scrollTop+=10}}};mouseorder.mouseStop=function(event){tmpdiv.style.display="none";if(destag){if(selected){selected.className=""}thisTag.className="down";selected=thisTag;if(firstFlag){$(thisTag.parentNode).insertBefore($(groupUl.children(":first")));changeMouseOrder(thisTag.parentNode)}else{$(thisTag.parentNode).insertAfter($(destag));changeMouseOrder(thisTag.parentNode,destag)}destag=null}else{if(thisTag==selected){selected=null;thisTag.className=""}else{selected&&(selected.className="");thisTag.className="down";selected=thisTag}}var _up=orderUp.get(0),_down=orderDown.get(0),ulList=groupUl[0].getElementsByTagName("a");if(selected===null){_up.className="btn_notclick";_down.className="btn_notclick"}else{if(selected==ulList[0]){_up.className="btn_notclick";_down.className="btn_normal"}else{if(selected==ulList[len-1]){_up.className="btn_normal";_down.className="btn_notclick"}else{_up.className="btn_normal";_down.className="btn_normal"}}}};break;case event_type_Tags:html=['','
','
'+$DMBMSG.DMB036+" ",'
',"
",'
",'
',"
"].join("");$floatBox=$(html).appendTo("body");box=$floatBox.toXwin();break;case event_type_desFri:uid=$li.attr("uid"),uname=$li.attr("uname");html=['','
','
'+$DMBMSG.DMB212+" ",'
',"
",'
','
','
','
','
'+$DMBMSG.DMB413+""+uname+" ?
",'
'+$DMBMSG.DMB412+'
',"
","
",'
","
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_AttentionGroup:uname=$li.attr("uname");uid=$li.attr("uid"),html=['','
",'
','
','
','
','
'+$DMBMSG.DMB409+"
","
",'
'+$DMBMSG.DMB082+'
','
',"
",'
'+$DMBMSG.DMB410+" "+uname+" "+$DMBMSG.DMB411+"
",'
','
",'
",'
','
","
","
",'
'].join("");$floatBox=$(html).appendTo("body");var groupList=param.groupList,groupStr="";$.each(groupList,function(i,group){groupStr+=''+group.name+'
'});groupStr+='
';$(".group_list_box ul",$floatBox).html(groupStr);heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_ProfileInfo:var des=$.trim($(".user_des").eq(0).text());html=['','
','
'+$DMBMSG.DMB035+" ",'
',"
",'
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_commentDelBlack:tid=$li.attr("id").match(/\d+/);uid=$li.attr("uid");html=['','
','
'+$DMBMSG.DMB991+" ",'
',"
",'
','
','
','
','
'+$DMBMSG.DMB100+"?
",'
'+$DMBMSG.DMB405+'
',"
","
",'
","
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_recommendXWB:case event_type_weibo:case event_type_attaQuickly:case event_type_proSend:case event_type_recommend:html=['','
'+$DMBMSG.DMB160.replace("@name",uname)+' ','
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_dress:html=['
动感相框
小莲蓬
'].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_feedback:html=['','
','
','
','
发现了问题或错误?对魔法版有意见和建议? 通知魔法信使吧,把你的问题和想法告诉我们!
','
','
'+$DMBMSG.DMB331+"
",'
','
',"
",'
','
'+$DMBMSG.DMB332+"
",'
",'
',"
",'
","
","
",'
',"
"].join("");$floatBox=$(html).appendTo("body");heightAuto($floatBox);box=$floatBox.toXwin();break;case event_type_invite:html=['"].join("");$floatBox=$(html).appendTo("body");box=$floatBox.toXwin();break;case event_type_addBrowserFavorite:html=['','
",'
','
请同时按住ctrl和d,收藏魔法微博!
','
',"
",'
',"
"].join("");$floatBox=$(html).appendTo("body");box=$floatBox.toXwin();break;case event_type_myselfDress:html=['','
",'
','
','
','
','
抱歉,此装扮是需要参加活动才能获得,
快去参加活动 领取属于自己的装扮吧!
',"
","
",'
',"
",'
',"
"].join("");$floatBox=$(html).appendTo("body");box=$floatBox.toXwin();break;case event_type_adegg:html=['','
','
','
",'
恭喜你!+100 积分
','
','
恭喜你找到了魔法微博隐藏的神秘水晶球,经常打开右栏浏览,就有更多积分哦~
','
还可以输入140 字
','
',' ',"
",'
',' ',"
","
","
","
"].join("");$floatBox=$(html).appendTo("body");box=$floatBox.toXwin();break;case event_type_adegg_noIntegral:html=['','
','
','
",'
',"
每天最多能获得500
","
积分哦,明天再来吧!
","
",'
','
',"
魔法微博隐藏了好多神秘的水晶球,经常打开右栏浏览,就有机会获得积分。
","
8过,要积分的童鞋,一定要记得每天早早的来哦~
","
",'
',' ',"
","
","
","
"].join("");$floatBox=$(html).appendTo("body");box=$floatBox.toXwin();break}function groupToggle(){$(".group_creat_button",$floatBox).toggle(function(){if(this.style.display=="block"){$(".errorTips",$floatBox).html("")}});$(".group_creat_box",$floatBox).toggle()}function groupCreat(){var $groupName=$("input[name=groupname]",$floatBox),$tip=$(".errorTips",$floatBox);if($groupName.val()==""){$groupName.focus();$tip.html($DMBMSG.DMB096);return}$tip.html("");apiCall("editGroup",{data:"groupname="+$groupName.val(),success:function(result){if(result&&result.errno==0&&result.rst!=false){$(".group_list_box ul li:last",$floatBox).after(''+$groupName.val()+'
');$groupName.val("");groupToggle();return true}else{if(result.errno==80017){$tip.html($DMBMSG.DMB091);return false}else{if(result.errno==80018){$tip.html($DMBMSG.DMB092);return false}else{if(result.errno==80019){$tip.html($DMBMSG.DMB093);return false}else{if(result.errno==400){$tip.html($DMBMSG.DMB094);return false}else{if(result.rst==false){alertMsg({msg:result.err||$DMBMSG.DMB461,type:"error",timeout:1,style:1,pos:"center",callback:function(){window.location.reload()}});return false}}}}}}}})}var $textarea=$("textarea",$floatBox),$tip=$(".key-tips",$floatBox),outclass="icon-bg out140",$publish=$("div.share-btn",$floatBox);$floatBox.click(function(e){var $target=$(e.target),stopDefault=TRUE;switch(TRUE){case $target.is(":checkbox"):return true;break;case $target.attr("rel")=="rechange":TextareaRnd($textarea,param.textareaType,param);break;case $target.attr("rel")=="dressmore":box.close();location.href="?m=shops";break;case $target.attr("rel")=="group_toggle":groupToggle();break;case $target.attr("rel")=="groupcreat":groupCreat();break;case $target.hasClass("share-btn"):if($target.hasClass(disable_class)){return}send(type);e.stopPropagation();break;case $target.attr("rel")=="close":box.close();param&&(param.cancel_callback&¶m.cancel_callback());break;case $target.attr("rel")=="remove":box.remove();break;default:stopDefault=FALSE}});return box}function imgLazyLoad(){var loadImg=function(){$("img[original]").lazyload({threshold:50})};if($.fn.lazyload){loadImg()}else{$LAB.script(load_js+"js/lib/jquery.lazyload.js"+load_version).wait(function(){loadImg()})}}function checkAll(name){$('input[name="'+name+'"]:checkbox').each(function(){if($(this).is(":checked")){attr("checked","")}else{attr("checked","checked")}})}function subMenuPro($target){$target.toSubMenu({btnDefaultClass:"more_option_btn2 a_link",content:$(".pro_submenu").html()})}function subMenuIndexGroup($target){$target.toSubMenu({submenuClass:"allgroup",btnDefaultClass:"tpl_btn_bgs more a_link",btnCurrentClass:"tpl_btn_bgs more a_link current",content:$(".indexgroup_content").html()})}function subMenuUserOption($target){$target.toSubMenu({btnDefaultClass:"more_option_btn a_link",content:$(".pro_submenu").html()})}function subMenuHeadMore($target){$target.toSubMenu({submenuClass:"more_option",btnDefaultClass:"more",btnCurrentClass:"more head_bg menu_current",content:$(".headmore").html(),contentClass:"no"})}function subMenuXPlaza($target){$target.toSubMenu({submenuClass:"more_option",btnDefaultClass:"more",btnCurrentClass:"more head_bg menu_current",content:$(".xplazaContent").html(),contentClass:"head_windows",overCallBack:function(){toggleMessagesTags.over()},outCallBack:function(){toggleMessagesTags.out()}});$(".head_plaza ul li").live({mouseenter:function(){$(this).siblings().removeClass("current");$(this).addClass("current")},mouseleave:function(){$(this).removeClass("current")}})}function subMenuHeadAccount($target){$target.toSubMenu({submenuClass:"more_option",btnDefaultClass:"more",btnCurrentClass:"more head_bg menu_current",content:$(".headaccount").html(),contentClass:"no",overCallBack:function(){toggleMessagesTags.over()},outCallBack:function(){toggleMessagesTags.out()}})}function subMenuHeadFriend($target){$target.toSubMenu({submenuClass:"more_option",btnDefaultClass:"more2",btnCurrentClass:"more2 head_bg menu_current",content:$(".headfriend").html(),contentClass:"no"})}function subMenuHeadMessages($target){$target.toSubMenu({submenuClass:"more_option",btnDefaultClass:"more",btnCurrentClass:"more head_bg menu_current",content:$(".headmessages").html(),contentClass:"no",overCallBack:function(){toggleMessagesTags.over()},outCallBack:function(){toggleMessagesTags.out()}})}function subMenuHeadPoints($target){$target.toSubMenu({submenuClass:"more_option",btnDefaultClass:"more",btnCurrentClass:"more menu_current",content:$(".poinsaccount").html(),contentClass:"no"})}function subMenuXGroup($target){wbNavmgr.createLayerTemp(".xgroupContent",".pXGroup");$target.toSubMenu({submenuClass:"more_option pXGroup",btnDefaultClass:"xGroup more",btnCurrentClass:"xGroup more head_bg menu_current",content:$(".xgroupContent").html(),contentClass:"head_windows"});$("#header .xGroup").mouseenter(function(){$appBox=$(".pXGroup"),$titleCommend=$("h2.title",$appBox).eq(0),$titleMine=$("h2.title",$appBox).eq(1),$morelink=$(".morelink a",$appBox),$all=$(".morelinks a",$appBox).eq(1),$Cookie=$(".xGroup",$appBox).eq(0),$ulCommend=$(".win_group_k",$appBox).eq(0);$ulMine=$(".win_group_k",$appBox).eq(1);var cookieName="xgroup";$titleCommend.text($DMBMSG.DMB466);$titleMine.text($DMBMSG.DMB467);$morelink.eq(0).text($DMBMSG.DMB468);$morelink.eq(1).text($DMBMSG.DMB469);$morelink.eq(0).attr("href","http://q.weibo.com/");$morelink.eq(1).attr("href","http://q.weibo.com/profile");$all.attr({href:"http://q.weibo.com/profile"});$Cookie.attr("cookie",cookieName);wbNavmgr.getData({action:"getCmdNav",data:{category:2},$ul:$ulCommend,cachName:"getCmdNav2",$box:$appBox});$Cookie.attr({min:6,max:6});wbNavmgr.getData({action:"getNavList",data:{category_ids:2},$ul:$ulMine,cachName:"getNavList2",wbnum:1,toggle:1,$box:$appBox})})}function subMenuXApp($target){wbNavmgr.createLayerTemp(".xAppContent",".pXApp");$target.toSubMenu({submenuClass:"more_option pXApp",btnDefaultClass:"xApp more",btnCurrentClass:"xApp more head_bg menu_current",content:$(".xAppContent").html(),contentClass:"head_windows"});$("#header .xApp").mouseover(function(){$appBox=$(".pXApp"),$titleCommend=$("h2.title",$appBox).eq(0),$titleMine=$("h2.title",$appBox).eq(1),$morelink=$(".morelink a",$appBox),$all=$(".morelinks a",$appBox).eq(1),$Cookie=$(".xApp",$appBox).eq(0);$ulCommend=$(".win_group_k",$appBox).eq(0);$ulMine=$(".win_group_k",$appBox).eq(1);var cookieName="xapp";$titleCommend.text($DMBMSG.DMB462);$titleMine.text($DMBMSG.DMB463);$morelink.eq(0).text($DMBMSG.DMB464);$morelink.eq(1).text($DMBMSG.DMB465);$morelink.eq(0).attr("href","http://weibo.com/app");$morelink.eq(1).attr("href","http://weibo.com/settings/connections");$all.attr({href:"http://weibo.com/app/my"}).text($DMBMSG.DMB491);$Cookie.attr("cookie",cookieName);wbNavmgr.getData({action:"getCmdNav",data:{category:3},$ul:$ulCommend,cachName:"getCmdNav3",$box:$appBox});$Cookie.attr({min:12,max:12});wbNavmgr.getData({action:"getNavList",data:{category_ids:3},$ul:$ulMine,cachName:"getNavList3",toggle:1,$box:$appBox})})}var subMenuMgr=(function(){return{init:function(type){var $submenuList=$("span[submenu]");regEvent(event_submenu_pro,subMenuPro,"auto");regEvent(event_submenu_indexGroup,subMenuIndexGroup,"auto");regEvent(event_submenu_userOption,subMenuUserOption,"auto");regEvent(event_submenu_headMore,subMenuHeadMore,"auto");regEvent(event_submenu_headAccount,subMenuHeadAccount,"auto");regEvent(event_submenu_xPlaza,subMenuXPlaza,"auto");regEvent(event_submenu_xGroup,subMenuXGroup,"auto");regEvent(event_submenu_xApp,subMenuXApp,"auto");regEvent(event_submenu_headFriend,subMenuHeadFriend,"auto");regEvent(event_submenu_headMessages,subMenuHeadMessages,"auto");regEvent(event_submenu_headPoints,subMenuHeadPoints,"auto");$submenuList.each(function(i,obj){eventDispatch($(obj),"auto")})}}})();function getUserInfo(){apiCall("getUserInfo",{success:function(ret){if(ret&&!ret.errno){var $accountRelaction=$(".account_relation span"),$userPic=$(".account_user .pic img"),$userName=$(".account_user .info a"),data=ret.rst;$accountRelaction.eq(0).text(data.bi_followers_count);$accountRelaction.eq(1).text(data.friends_count);$accountRelaction.eq(2).text(data.followers_count);$userPic.attr("src",data.profile_image_url);$userName.text(data.screen_name)}}})}function addBrowserFavorite($target,type){if(document.all){window.external.addFavorite("http://mo.weibo.com",$DMBMSG.DMB978)}else{if(window.sidebar){window.sidebar.addPanel($DMBMSG.DMB978,"http://mo.weibo.com","")}else{var $box=floatLayerMgr($target,type);$box.show();return true}}}function headNotice(ret){if(ret&&ret.rst&&ret.rst.result){$("#header .header_notice:first .contents").prepend(ret.rst.result.replace(/\|\|\|/g," "));isIE6||$("#header .header_notice:first").show()}}function adIndexBanner(ret){if(ret&&ret.rst&&ret.rst.result){var banners=ret.rst.result,contentStr="",navStr="",$content=$("#temp7 .JQ-content-box .JQ-slide-content"),$nav=$("#temp7 .JQ-content-box .JQ-slide-nav");$.each(banners,function(i,datas){contentStr=contentStr+' ';navStr=navStr+""+(i+1)+" "});$content.html(contentStr);$nav.html(navStr);$nav.find("li:first").addClass("on");adMgr.showAd.slide("#temp7",{effect:"scroolX",speed:"normal",timer:3000});$(".main_bgs .ad_area:first").show()}}function inviteHandle($target,type){var $li=findParentElement("LI",$target),$img=$li.find(".invite-main img"),uid=$li.attr("uid"),tid=getWeiboID($li),type=parseInt($li.attr("type")),val=parseInt($target.attr("val")),src;if(type){invokeClick($li.find(".text_content a[pop=1]").get(0))}return;apiCall("inviteHandle",{data:{id:tid,value:val},success:function(ret){if(ret.rst){if(val==1){alert(1);$li.find(".text_content a[pop=1]").trigger("click")}else{$li.slideUp()}}}});return false}function showFeed($target,type){var tid=$target.attr("tid"),uid;bindRight.freshShow({tid:tid,history:true,uid:uid,btype:"feed"})}var adMgr=function(){var cookieTime=1000*60*60*12;function eventBind($closeBtn,$adBox,cookieName,cookieExpires,noCookie){$closeBtn.live("click",function(){$adBox.hide("fast",function(){bindRight.autoFixHeight.init();if(adMgr.names[cookieName]&&adMgr.names[cookieName].closeCallback){adMgr.names[cookieName].closeCallback()}});noCookie||$.cookie(cookieName,1,{expires:cookieExpires})})}function slide(selector,param){if($.fn.Slide){$(selector).Slide(param)}else{$LAB.script(load_js+"js/lib/jq.Slide.js"+load_version).wait(function(){$(selector).Slide(param)})}}return{add:function(param){param.init&¶m.init();var $adBox=$(param.adBox),$closeBtn=$adBox.find(param.closeBtn),closeCallback=param.closeCallback||"",cookieName=param.cookieName,cookieExpires=param.cookieExpires?param.cookieExpires:cookieTime,callback=param.callback,noCookie=isNaN(param.noCookie)?0:1,action=param.action||"";if(cookieName){this.names[cookieName]={};closeCallback&&(this.names[cookieName].closeCallback=closeCallback)}if(!action){param.fn();eventBind($closeBtn,$adBox,cookieName,cookieExpires,noCookie);callback&&callback();return}if($.cookie(cookieName)){return}eventBind($closeBtn,$adBox,cookieName,cookieExpires,noCookie);apiCall(action,{data:param.param?param.param:"",success:function(ret){if(ret&¶m.fn){param.fn(ret);callback&&callback()}}})},names:{},showAd:{slide:slide}}}();function constellation($target,type){if(XWB.Apps.Zodiac){XWB.Apps.Zodiac.show(xwb)}else{$LAB.script(load_js+"js/apps/constellation.js"+load_version).wait(function(){XWB.Apps.Zodiac.show(xwb)})}}var featureTips=function(){var arrayTimes={one:1,two:2,thr:3,four:4,five:5};return{hide:function($target,type){var $parent=$target.parents(".featureTips"),times=$parent.attr("times"),href=$target.attr("href"),$targetClone=$target.clone().hide();$(".featureTips[times="+times+"]").hide();apiCall("userTips",{data:{id:arrayTimes[times]},success:function(){if(href&&href!=""){$target.removeAttr("rel");$targetClone.removeAttr("rel").appendTo($parent);invokeClick($targetClone.get(0))}}})},init:function(times){if(typeof XWEIBO_UTIPS=="undefined"){return false}$.each(arguments,function(i,it){if(parseInt(XWEIBO_UTIPS[it+"time"])!=0){$(".featureTips[times="+it+"]").hide()}else{$(".featureTips[times="+it+"]").show()}})}}}();function setVersion(){apiCall("setVersion",{success:function(ret){$(".header_notice.object_hide").hide()}});alertMsg({type:"success",msg:$DMBMSG.DMB977,pos:"center",style:1,timeout:2})}function showScrollToTop(){if($.scrollToTop){$.scrollToTop()}else{$LAB.script(load_js+"js/lib/jquery.scrolltotop.js"+load_version).wait(function(){$.scrollToTop()})}}function showAvatar(){var avatarId="avatarSwf",$avatar=$("#"+avatarId),swf=$avatar.attr("swf"),img=$avatar.attr("src");flashShow.init({src:"/js/flash/avatar/avatar.swf",id:avatarId,flashWidth:"200",flashHeight:"200",allowScriptAccess:"always",flashVer:"9.0.0",flashInner:"/js/flash/expressInstall.swf",flashVars:{swf:swf,img:img},noWin:1})}xwb.setVersion=setVersion;xwb.textareaRnd=TextareaRnd;xwb.weiboSend=weiboSend;xwb.commentDelBlack=commentDelBlack;xwb.subjoin=wbSubjoin;xwb.navMgr=wbNavmgr;xwb.comment=wbComment;xwb.search=wbSearch;xwb.fans=wbFans;xwb.msg=wbMessage;xwb.useredit=wbUserEdit;xwb.feed=wbFeed;xwb.reader=wbReader;xwb.weiboForward=weiboForward;xwb.showForward=showForward;xwb.increaseText=increaseText;xwb.imgLazyLoad=imgLazyLoad;xwb.linkRender=linkRender;xwb.counterAdd=counterAdd;xwb.notifyChecker=notifyChecker;xwb.listenAttention=listenAttention;xwb.publisher=publisher;xwb.adMgr=adMgr;xwb.funs=wbFuns;xwb.showSign=showSign;xwb.constellation=constellation;xwb.setList=function($feedList){regEvent(event_type_thumbpic,viewMiddlePic);regEvent(event_type_pic_forward,viewMiddlePic);regEvent(event_type_video,showListVideo);regEvent(event_type_fav,addWeiboFavorite);regEvent(event_type_fav_del,delWeiboFavorite);regEvent(event_type_forward,weiboForward);regEvent(event_type_delete,deleteWeiboConfirm);regEvent(event_type_viewuser,viewUser);regEvent(event_type_originalForward,originalForward);regEvent(event_type_originalSendComment,originalSendComment);regEvent(event_type_userRemarks,userRemarks);regEvent(event_type_userAttention,userAttention);regEvent(event_type_usermsgs,userMsgs);regEvent(event_type_proSend,weiboSend);regEvent(event_type_attaQuickly,weiboSend);regEvent(event_type_magicFace,magicFace);regEvent(event_type_play_music,playMusic);regEvent(event_type_recommend,weiboSend);regEvent(event_type_blackList,blackList);regEvent(event_type_groupNameAdd,groupName);regEvent(event_type_groupNameEdit,groupName);regEvent(event_type_groupNameDel,groupName);regEvent(event_type_Tags,Tags);regEvent(event_type_desFri,desFri);regEvent(event_type_blackDestroy,blackDestroy);regEvent(event_type_AttentionGroup,AttentionGroup);regEvent(event_type_newFeed,newFeed);regEvent(event_type_ProfileInfo,ProfileInfo);regEvent(event_type_dress,dress);regEvent(event_type_dressmore,function(){location.href="/?m=shops"});regEvent(event_type_feedback,feedback);regEvent(event_type_recommendXWB,weiboSend);regEvent(event_type_checkAll,checkAll);regEvent(event_type_groupOrder,groupOrder);regEvent(event_type_addBrowserFavorite,addBrowserFavorite);regEvent(event_type_invite,invite);regEvent(event_type_inviteHandle,inviteHandle);regEvent(event_type_feed,showFeed);regEvent(event_type_sign,showSign);regEvent(event_type_constellation,constellation);regEvent(event_type_featureTipsClose,featureTips.hide);$("body").click(function(e){var $target=$(e.target);if($target.attr("rel")!=event_default_handler){while($target[0]){if($target.attr("rel")){eventDispatch($target);return false}else{$target=$target.parent()}}}});counterAdd();imgLazyLoad()};if(!window.XWEIBO){}$(function(){subMenuMgr.init();var data={},url,urlArray,urlParam,urlParamValue;if($.queryString("tadress")){url=location.search.replace("?","");urlArray=url.split("&");for(i=0;i
'+item.nick+":"+item.text+"
",'