if(typeof Sina=="undefined"){Sina={}}Sina.pkg=function(ns){if(!ns||!ns.length){return null}var levels=ns.split(".");var nsobj=Sina;for(var i=levels[0]=="Sina"?1:0;ifile:"+file+"
line:"+line+"
");return true};function Jobs(oOption){this.option=oOption||{};this._jobTable=[[],[],[],[]]}Jobs.prototype={_registedJobTable:{},errorMsg:[],_registJob:function(jobName,rel){this._registedJobTable[jobName]=rel},error:function(sMsg){Debug.error(sMsg);this.errorMsg.push(sMsg)},add:function(jobName,type){type=type||1;if(Core.Array.findit(this._jobTable[type],jobName)==-1){this._jobTable[type].push(jobName)}else{this.error("Error: Job "+jobName+" is existed now.")}},start:function(){if(this.option.onStart!=null){this.option.onStart()}var regJobs=this._registedJobTable;var jobs=this._jobTable[1].concat(this._jobTable[2]);var _this=this;this.fe=Core.Function.bind3(_this.focus,_this,[]);var addFocus=function(){if(_this._jobTable[3].length==0){if(_this.option.onEnd!=null){_this.option.onEnd()}return}Core.Events.addEvent(document.body,_this.fe,"focus");Core.Events.addEvent(window,_this.fe,"scroll");Core.Events.addEvent(document.body,_this.fe,"mousemove");Core.Events.addEvent(document.body,_this.fe,"mouseover")};this.queue(jobs,addFocus)},focus:function(){var _this=this;if(this.focusdown){Core.Events.removeEvent(document.body,_this.fe,"focus");Core.Events.removeEvent(window,_this.fe,"scroll");Core.Events.removeEvent(document.body,_this.fe,"mousemove");Core.Events.removeEvent(document.body,_this.fe,"mouseover");_this.fe=null;return}this.focusdown=true;var jobs=this._jobTable[3];this.queue(jobs,this.option.onEnd)},queue:function(jobs,callback){var _this=this;var getTime=function(){return(new Date).valueOf()};var regJobs=this._registedJobTable;var joblen=jobs.length;var i=0;var interNum=window.setInterval(function(){if(i>=joblen){clearInterval(interNum);interNum=null;if(callback!=null){callback()}return}var jobName=jobs[i];var job=regJobs[jobName];i++;if(typeof job=="undefined"){_this.error("Job["+jobName+"] is undefiend!!!");return}var _try=true;var _start=getTime();try{job.call()}catch(e){_this.error("Job["+jobName+"] failed!!!"+e.message+"");if(callback!=null){callback()}_try=false;throw e}finally{if(_try){var _end=getTime();Debug.info("Job["+jobName+"] done in "+(_end-_start)+"ms.")}}},10)},call:function(jobName,args){if(typeof this._registedJobTable[jobName]!="undefined"){this._registedJobTable[jobName].apply(this,args)}else{trace("Job["+jobName+"] is undefined!!!",{color:"#900",bgColor:"#FFF;"})}}};$registJob=function(name,rel){Jobs.prototype._registJob(name,rel)};$callJob=function(name){var args=[];if(arguments.length>1){Core.Array.foreach(arguments,function(v,i){args[i]=v});args.shift()}Jobs.prototype.call(name,args)};if(typeof Lib=="undefined"){Lib={}}Lib.pkg=function(ns){if(!ns||!ns.length){return null}var levels=ns.split(".");var nsobj=Lib;for(var i=levels[0]=="Lib"?1:0;i "'+where+'"'}var range=el.ownerDocument.createRange();var frag;switch(where){case"beforebegin":range.setStartBefore(el);frag=range.createContextualFragment(html);el.parentNode.insertBefore(frag,el);return el.previousSibling;case"afterbegin":if(el.firstChild){range.setStartBefore(el.firstChild);frag=range.createContextualFragment(html);el.insertBefore(frag,el.firstChild);return el.firstChild}else{el.innerHTML=html;return el.firstChild}break;case"beforeend":if(el.lastChild){range.setStartAfter(el.lastChild);frag=range.createContextualFragment(html);el.appendChild(frag);return el.lastChild}else{el.innerHTML=html;return el.lastChild}break;case"afterend":range.setStartAfter(el);frag=range.createContextualFragment(html);el.parentNode.insertBefore(frag,el.nextSibling);return el.nextSibling}throw'Illegal insertion point -> "'+where+'"'};Core.Dom.setStyle=function(el,property,val){switch(property){case"opacity":el.style.filter="alpha(opacity="+val*100+")";if(!el.currentStyle||!el.currentStyle.hasLayout){el.style.zoom=1}break;case"float":property="styleFloat";default:el.style[property]=val}};if(!$IE||!($IE<9)){Core.Dom.setStyle=function(el,property,val){if(property=="float"){property="cssFloat"}el.style[property]=val}}Sina.pkg("Core.String");Core.String.formatNumber=function(n){n=n+"";return n.replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g,"$1,")};Core.String.encodeHTML=function(str){var div=document.createElement("div");div.appendChild(document.createTextNode(str));return div.innerHTML.replace(/\s/g," ")};Core.String.trimHead=function(str){return str.replace(/^(\u3000|\s|\t)*/gi,"")};Core.String.trimTail=function(str){return str.replace(/(\u3000|\s|\t)*$/gi,"")};Core.String.trim=function(str){return Core.String.trimHead(Core.String.trimTail(str))};Sina.pkg("Utils");if(typeof Utils=="undefined"){Utils=Sina.Utils}Sina.pkg("Utils.Io");Sina.pkg("Core.System");!function(){var parseParam=function(oSource,oParams){var key;try{if(typeof oParams!="undefined"){for(key in oSource){if(oParams[key]!=null){oSource[key]=oParams[key]}}}}finally{key=null;return oSource}};Core.System.parseParam=parseParam}();Utils.Url=function(url){url=url||"";this.url=url;this.query={};this.parse()};Utils.Url.prototype={parse:function(url){if(url){this.url=url}this.parseAnchor();this.parseParam()},parseAnchor:function(){var anchor=this.url.match(/\#(.*)/);anchor=anchor?anchor[1]:null;this._anchor=anchor;if(anchor!=null){this.anchor=this.getNameValuePair(anchor);this.url=this.url.replace(/\#.*/,"")}},parseParam:function(){var query=this.url.match(/\?([^\?]*)/);query=query?query[1]:null;if(query!=null){this.url=this.url.replace(/\?([^\?]*)/,"");this.query=this.getNameValuePair(query)}},getNameValuePair:function(str){var o={};str.replace(/([^&=]*)(?:\=([^&]*))?/gim,function(w,n,v){if(n==""){return}o[n]=v||""});return o},getParam:function(sPara){return this.query[sPara]||""},clearParam:function(){this.query={}},setParam:function(name,value){if(name==null||name==""||typeof name!="string"){throw new Error("no param name set")}this.query=this.query||{};this.query[name]=value},setParams:function(o){this.query=o},serialize:function(o){var ar=[];for(var i in o){if(o[i]==null||o[i]==""){ar.push(i+"=")}else{ar.push(i+"="+o[i])}}return ar.join("&")},toString:function(){var queryStr=this.serialize(this.query);return this.url+(queryStr.length>0?"?"+queryStr:"")+(this.anchor?"#"+this.serialize(this.anchor):"")},getHashStr:function(forceSharp){return this.anchor?"#"+this.serialize(this.anchor):forceSharp?"#":""}};Core.String.encodeDoubleByte=function(str){if(typeof str!="string"){return str}return encodeURIComponent(str)};Utils.Io.JsLoad={};!function(){function createScripts(oOpts,oCFG){processUrl(oOpts,oCFG);var urls=oOpts.urls;var i,len=urls.length;for(i=0;i0){_cfg.timeout_flag=setTimeout(function(){if(_cfg.is_loadcomplete!=true){if(_opts.onException!=null){_opts.onException()}_cfg.is_timeout=true}},_opts.timeout)}}Utils.Io.JsLoad.request=function(aUrls,oOpts){new ancestor(aUrls,oOpts)}}();Sina.pkg("Core.Class");Core.Class.AsPrototype={};Core.Class.create=function(){return function(t){if(t!=Core.Class.AsPrototype){this.initialize.apply(this,arguments)}}};Lib.pkg("Lib.Component");Lib.Component=Core.Class.create();Lib.Component.instances=Lib.Component.instances||{};Lib.Component.compSize={};Lib.Component.getInitCompSize=function(){if(scope.component_lists!=null){var compList=scope.component_lists;for(var key in compList){if(compList[key].list.length>0){Core.Array.foreach(compList[key].list,function(oItem){Lib.Component.compSize[oItem]=compList[key].size})}}return true}else{return null}};Lib.Component.refresh=function(sCompId,oOption){oOption=oOption||{};try{if(Lib.Component.instances[sCompId]==null){if(typeof Lib.Component["Comp_"+sCompId]=="undefined"){$registComp(sCompId,{},"static")}Lib.Component.instances[sCompId]=new Lib.Component["Comp_"+sCompId](sCompId)}}catch(e){}Debug.log("刷新组件 "+sCompId+" ,新宽度是 "+oOption.width);Debug.log("组件 "+sCompId+" 增加管理链接:"+oOption.addManage);Lib.Component.instances[sCompId].reload(oOption.width,oOption.addManage,oOption.forceRefresh)};Lib.Component.set=function(sCompId){Debug.log("展开组件 "+sCompId+" 的设置功能");if(Lib.Component.instances[sCompId]==null){Lib.Component.instances[sCompId]=new Lib.Component["Comp_"+sCompId](sCompId)}Lib.Component.instances[sCompId].getUserSet()};Core.Class.extend=function(destination,supClass,bForce){for(var property in supClass){if(bForce!=null){if(!destination[property]){destination[property]=supClass[property]}}else{destination[property]=supClass[property]}}return destination};Core.Class.define=function(init,superClz,methods){if(init&&init.__isClass&&init.__isClass()){throw new Error("class cnt be used as another class' constructor : "+init)}superClz=superClz||Object;methods=methods||{};methods.initialize=init||methods.initialize||superClz.prototype.initialize||function(){};if(typeof methods.initialize!="function"){throw new Error("only function can be used as constructor")}methods.__isClass=function(){return true};var clz=Core.Class.create();clz.__isClass=methods.__isClass;var proto=superClz==Object?{}:new superClz(Core.Class.AsPrototype);clz.prototype=Core.Class.extend(proto,methods);return clz};$registComp=Lib.Component.registComp=function(id,override,superClass){superClass=superClass==null?Lib.Component.Comp:Lib.Component["Comp_"+superClass];superClass=superClass||Lib.Component.Comp;override.compId=id;Lib.Component["Comp_"+id]=Core.Class.define(null,superClass,override)};Core.Function.bind2=function(fFunc,object){var __method=fFunc;return function(){return __method.apply(object,arguments)}};Function.prototype.bind2=function(object){var __method=this;return function(){return __method.apply(object,arguments)}};Core.Dom.getElementsByClass=function(el,tg,clz){el=el||document;var rs=[];clz=" "+clz+" ";var cldr=el.getElementsByTagName(tg),len=cldr.length;for(var i=0;i'+'[隐藏]'}},setContent:function(sContent){sContent=typeof sContent=="string"?sContent:sContent+"";this.getContent().innerHTML=sContent||""},clearContent:function(){this.getContent().innerHTML=""},remove:function(){Core.Dom.removeNode(this.getContainer());this.finalize()},finalize:function(){this.isInit=null;Lib.Component.instances[this.compId]=null}};var $SYSMSG={};$SYSMSG.extend=function(info,override){for(var i in info){$SYSMSG[i]=!!override==false?info[i]:$SYSMSG[i]}};$SYSMSG.extend({A80001:"暂无内容。",A80002:"暂无内容。",A80101:"组件加载失败,请刷新。",A80201:"你要删除留下的访问记录吗?",A80202:'
删除后一小时内不会在此留下访问记录。
',A80203:"确实要删除此访问记录吗?",A80204:['
    '+'
  • '+'
  • '+'
加入黑名单的用户无法和你沟通。
'].join(""),A02003:"已添加过此模块,不能重复添加。",A02004:"抱歉,该模块不能被克隆。",A02005:"抱歉,您的博客尚未升级,请升级后再“添加到您的博客”。",A02006:"模块已成功添加到你的博客。",A02007:"确实要隐藏此模块吗?隐藏后可在“页面设置”中恢复。",A02008:"确实要隐藏此模块吗?此模块活动时间已结束,隐藏后不可恢复。"});$registComp("dynamic",{render_210:function(){},render_510:function(){},render_730:function(){},show:function(str){this.setContent(str)},showEmpty:function(sEmptyTips){this.setContent('
'+(sEmptyTips||$SYSMSG.A80001)+"
")},showError:function(sStatusCode){this.setContent(sStatusCode)},setManage:function(){if($isAdmin&&this.getManage()){this.getManage().innerHTML=''+'[隐藏]'}},reload:function(sSize,bAddManage,bForceRequest){var sizeCorrect=sSize==null||sSize&&(sSize==210||sSize==510||sSize==730);if(!sizeCorrect){Debug.error("请检查传入的组件尺寸是否正确。"+sSize);return}this.size=sSize||this.size;this.getContent().innerHTML='
加载中…
';this.isSetOn=null;Debug.log("this.isSetOn : "+this.isSetOn);if(bForceRequest==true||this.cacheData==null){Debug.log("强制刷新:"+this.compId);this.load()}else{Debug.log("缓存刷新:"+this.compId);this["render_"+this.size]()}if(bAddManage){this.setManage()}}});Sina.pkg("Utils.Cookie");Utils.Cookie.getCookie=function(name){name=name.replace(/([\.\[\]\$])/g,"\\$1");var rep=new RegExp(name+"=([^;]*)?;","i");var co=document.cookie+";";var res=co.match(rep);if(res){return res[1]||""}else{return""}};Core.System.keyValue=function(string,key){var arr=string.match(new RegExp("(\\?|&)"+key+"=([^&]*)(&|$)"));if(arr!=null)return arr[2];return null};var __reqCheckLogin__=function(){var isReqEnd=false;var isReq=false;var funQueue=[];return function(func){funQueue.push(func);if(isReq){return}else if(isReqEnd){if(func){func()}}else{var times=(new Date).getTime();isReq=true;window["__check_login_status__"+times]=function(data){isReq=false;var user=data.user;$nick=user.nick||null;$UID=user.uid||null;$isLogin=!!$UID;if(typeof scope.$uid=="undefined"){$isAdmin=false}else{$isAdmin=scope.$uid==$UID}try{delete window["__check_login_status__"+times];document.head.removeChild(document.getElementById("jsonp_script"+times))}catch(e){}isReqEnd=true;for(var i=0;i0){Utils.Io.JsLoad.request(this._interfaceNick+notHitCacheList.join(",")+"?fields=uname,avatar",{returnType:"jsonp",onComplete:function(result){if(result.success){for(var key in result.data){hitCache[key]=result.data[key].uname||"用户"+key;this.cacheNickName[key]=result.data[key].uname||"用户"+key;this.cacheNickPic[key]=result.data[key].avatar||{b:"http://portrait"+(key*1%8+1)+".sinaimg.cn/"+key+"/blog/180",s:"http://portrait"+(key*1%8+1)+".sinaimg.cn/"+key+"/blog/180",m:"http://portrait"+(key*1%8+1)+".sinaimg.cn/"+key+"/blog/180"}}fCallBack(hitCache)}}.bind2(this)})}else{fCallBack(hitCache)}},getUserPic:function(key,fCallBack){if(!this.cacheNickPic[key]){Utils.Io.JsLoad.request(this._interfaceNick+key+"?fields=uname,avatar",{returnType:"jsonp",onComplete:function(result){if(result.success){for(var key in result.data){hitCache[key]=result.data[key].uname;this.cacheNickName[key]=result.data[key].uname||"用户"+key;this.cacheNickPic[key]=result.data[key].avatar||{b:"http://portrait"+(key*1%8+1)+".sinaimg.cn/"+key+"/blog/180",s:"http://portrait"+(key*1%8+1)+".sinaimg.cn/"+key+"/blog/180",m:"http://portrait"+(key*1%8+1)+".sinaimg.cn/"+key+"/blog/180"}}fCallBack(this.cacheNickPic[key])}}.bind2(this)})}else{fCallBack(this.cacheNickPic[key])}}};$registComp("901",{load:function(){var _this=this;Lib.checkAuthor(function(){if($isAdmin==false&&$isLogin){_this.loadIsFriend()}else if($isAdmin==false&&!$isLogin){_this.isFriend=false;_this.loadOnline()}else{_this.isOnline=true;_this.showOnlineInfo()}_this.loadNickname();_this.loadOtherInfo()},"901_load"+(new Date).getTime())},loadIsFriend:function(){var _isFriend=new Interface("http://control.blog.sina.com.cn/riaapi/profile/IsFriend.php","jsload");_isFriend.request({GET:{friend_uids:scope.$uid,version:7},onSuccess:function(result){this.friendSuccessCallback(result)}.bind2(this),onError:function(result){this.friendErrorCallback()}.bind2(this),onFail:function(){this.friendErrorCallback()}.bind2(this)})},friendSuccessCallback:function(result){for(var i=0,len=result.length;i