XN.namespace("config.status");
XN.config.status.enableMedia=false;
XN.config.status.enableReplyAll=false;
XN.config.status.params="";
XN.namespace("app.status");
XN.event.enableCustomEvent(XN.app.status);
XN.app.status.crossDomain=1;
(function(ns){
var _2=XN.ENV.staticRoot;
ns._errors={1:"\u8bf7\u4e0d\u8981\u4ece\u7ad9\u5916\u63d0\u4ea4",2:"\u8be5\u72b6\u6001\u4e0d\u5b58\u5728",6:null,3:"\u62b1\u6b49\uff0c\u60a8\u4e0d\u80fd\u53d1\u5e03\u7a7a\u72b6\u6001",4:"\u8bf7\u4e0d\u8981\u53d1\u5e03\u653f\u6cbb\u654f\u611f\u5185\u5bb9\u3001\u8272\u60c5\u5185\u5bb9\u3001\u5546\u4e1a\u5e7f\u544a\u6216\u5176\u4ed6\u4e0d\u6070\u5f53\u5185\u5bb9",5:"\u4f60\u77ed\u65f6\u95f4\u5185\u53d1\u8868\u4e86\u592a\u591a\u76f8\u540c\u7684\u5185\u5bb9",9:"\u4f60\u8fd8\u4e0d\u662fTA\u7684\u597d\u53cb\uff0c\u4e0d\u80fd\u4f7f\u7528\u201c\u56de\u590d\u6240\u6709\u4eba\u201d",10:"\u8be5\u5206\u4eab\u4e0d\u5b58\u5728\u6216\u5df2\u5220\u9664",11:"\u8be5\u7528\u6237\u4e0d\u662f\u60a8\u7684\u597d\u53cb, \u4e0d\u80fd\u8f6c\u53d1\u5176\u72b6\u6001",12:"\u53c2\u6570\u4e0d\u5b8c\u6574, \u63d0\u4ea4\u5931\u8d25, \u8bf7\u8054\u7cfb\u5ba2\u670d",15:"\u8bf7\u6fc0\u6d3b\u8d26\u53f7",100:"\u672c\u516c\u5171\u4e3b\u9875\u7ba1\u7406\u5458\u5173\u95ed\u4e86\u8be5\u516c\u5171\u4e3b\u9875\uff0c\u8bf7\u7a0d\u540e\u518d\u8bd5",101:"\u4f60\u73b0\u5728\u4e0d\u662f\u8be5\u516c\u5171\u4e3b\u9875\u7684\u7c89\u4e1d\uff0c\u6210\u4e3a\u7c89\u4e1d\u540e\u624d\u53ef\u56de\u590d",102:"\u6b64\u516c\u5171\u4e3b\u9875\u7684\u4e3b\u4eba\u5173\u95ed\u4e86\u56de\u590d\u529f\u80fd\uff0c\u76ee\u524d\u4e0d\u80fd\u56de\u590d"};
ns.getError=function(_3){
return this._errors[_3]||false;
};
ns.getProfileRef=function(){
if(arguments.callee.ref){
return arguments.callee.ref;
}
var _4=window.location.href;
var _5="";
if(_4.indexOf("Home.do")!==-1){
_5="newsfeed";
}else{
_5="minifeed";
}
arguments.callee.ref=_5;
return _5;
};
})(XN.APP.status);
(function(ns){
var _7=XN.STRING;
var _8=false;
function log(_9){
if(_8){
XN.log(_9);
}
}
ns.updateAction=function(_a){
$extend(this,_a);
};
var _b="";
ns.fwdRef="";
ns.setForwardTrue=function(_c,_d,_e){
this.fwdid=_c||null;
this.fwdOwner=_d||null;
this.fwdRef="fwdRef="+_e;
_b="&fwdId="+this.fwdid+"&fwdOwner="+this.fwdOwner;
};
ns.getForwardParam=function(){
return _b;
};
ns.setForwardNull=function(){
_b="";
this.fwdRef="";
};
ns.updateAction.prototype={maxLength:140,requestURI:"http://status."+XN.env.domain+"/doing/update.do",parseMediaURI:"http://share."+XN.env.domain+"/share/GetUrlInfo.do",enableMedia:false,_tscCode:null,_postRequest:null,_getMediaRequest:null,addOnsParam:{},abort:function(){
try{
this._postRequest.abort();
}
catch(e){
}
try{
this._getMediaRequest.abort();
}
catch(e){
}
},update:function(_f){
var _10=this;
_f=_7.trim(_f);
if(_f===""){
this.fireEvent("postError","\u62b1\u6b49\uff0c\u60a8\u4e0d\u80fd\u53d1\u5e03\u7a7a\u72b6\u6001",_f);
return;
}
if(_f.length>this.maxLength){
this.fireEvent("postError","\u60a8\u6700\u591a\u80fd\u591f\u8f93\u5165"+this.maxLength+"\u4e2a\u5b57\u7b26",_f);
return;
}
this.fireEvent("beforePost");
if(this.enableMedia&&XN.config.status.enableMedia){
this._parseMedia(_f);
}else{
this._updateStatus(_f);
}
},_parseMedia:function(_11){
var _12=this;
var _13=/http:\/\/[A-Za-z0-9\%\-\:\+\#\.\?=&_~\/]+[^\:\(\s\u0391-\uFFE5]/i.exec(_11);
if(!_13){
this._updateStatus(_11);
return;
}
var _14=_13[0],_15;
var _16;
if(/(mp3|wma)$/i.test(_14)){
_15={type:2,link:_14};
_16=_11.replace(_14,"[audio]");
this._updateStatus(_11,_16,_15);
return;
}
new XN.NET.xmlhttp({url:_12.parseMediaURI+"?link="+encodeURIComponent(_14),method:"get",onSuccess:function(r){
try{
var m=XN.JSON.parse(r.responseText);
}
catch(e){
_12._updateStatus(_11);
return;
}
switch(m.type){
case 10:
_15={type:3,link:m.url};
_16=_11.replace(_14,"[video]");
break;
case 6:
_15={type:1,link:_14};
_16=_11.replace(_14,"[link]");
break;
}
_12._updateStatus(_11,_16,_15);
},onError:function(){
_12._updateStatus(_11);
}});
},_updateStatus:function(_19,_1a,_1b){
var _1c=this;
var _1d={};
_1d["c"]=_1a||_19;
if(_1b){
_1d["media"]=XN.json.build(_1b);
}
_1d["raw"]=_19;
var _1e=XN.array.toQueryString(_1d);
_1e+="&"+XN.config.status.params;
_1e+=_b;
for(var i in this.addOnsParam){
_1e+="&"+i+"="+this.addOnsParam[i];
}
var url=this.requestURI+"?"+XN.app.status.fwdRef;
this._postRequest=new XN.NET.xmlhttp({url:url,data:_1e,onComplete:function(){
_1c.fireEvent("postComplete");
},onSuccess:function(r){
try{
r=XN.JSON.parse(r.responseText);
if(r.code==0){
if(XN.STRING.isBlank(r.msg)){
r.msg="\u4f60\u53ef\u4ee5\u66f4\u65b0\u72b6\u6001\uff0c\u8ba9\u670b\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...";
}
_1c.fireEvent("postSuccess",r.msg,_19,r);
XN.app.status.fireEvent("postSuccess",r.msg,_19,r);
XN.app.status.setForwardNull();
}else{
_1c.fireEvent("postError",XN.APP.status.getError(r.code),r.msg,r.code);
XN.app.status.fireEvent("postError",XN.APP.status.getError(r.code),r.msg,r.code);
}
}
catch(e){
_1c.fireEvent("postError");
}
},onError:function(){
_1c.fireEvent("postError");
}});
}};
XN.EVENT.enableCustomEvent(ns.updateAction.prototype);
})(XN.APP.status);
(function(ns){
var _23=XN.STRING;
var _24=XN.EVENT.addEvent;
var _25;
var _26=true;
function log(s){
if(_26){
XN.log(s);
}
}
ns.editor=function(_28){
$extend(this,_28);
this.init();
};
ns.editor.prototype={IDsubmit:"publisher_statusSubmit",IDinput:"publisher_statusInput",IDcounter:"statusCount",IDinputContent:"statusContent",IDcurrentStatus:"currentStatus",IDoriginalStatus:"currentStatus_bak",IDupdateTime:"statusUpdateTime",IDemotion:"status_emotion",IDemoPan:"status_emotions",IDemoBtn:"status_emotion_legend",IDspecial:"commendStatus",IDtools:"publisher_tools",IDerr:"publisher_err",IDmsg:"publisher_msg",TIPinputDefault:"\u4f60\u53ef\u4ee5\u66f4\u65b0\u72b6\u6001\uff0c\u8ba9\u597d\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...",TIPonPostError:"\u72b6\u6001\u66f4\u65b0\u5931\u8d25,\u8bf7\u91cd\u8bd5",TIPupdateTime:"\u521a\u521a\u66f4\u65b0",TIPnewUser:"\u4f60\u53ef\u4ee5\u66f4\u65b0\u72b6\u6001\uff0c\u8ba9\u670b\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...",CFGshowError:true,CFGmaxLength:140,CFGspCookieName:"sta1",CFGshowMax:true,action:null,_lastStatus:null,actionParam:null,_uiType:"home",getConfig:function(key){
return this["CFG"+key];
},getEl:function(id){
return $(this["ID"+id]);
},getTip:function(key){
return this["TIP"+key];
},init:function(){
var _2c=this,ac;
this._patchForNewUser();
this.action=ac=new XN.APP.status.updateAction($extend({maxLength:this.getConfig("maxLength"),enableMedia:true},this.actionParam));
ac.addEvent("beforePost",function(){
_2c._beforePost();
});
ac.addEvent("postSuccess",function(msg,_2f,_30){
_2c._onPostSuccess(msg);
_2c.fireEvent("updateSuccess",msg,_2f,_30);
});
ac.addEvent("postError",function(r,msg,_33){
_2c._onPostError(r,msg,_33);
_2c.fireEvent("updateError",r,msg,_33);
});
var _34=this.getEl("input");
_34.addEvent("focus",function(e){
_2c._onInputFocus(e);
_2c.fireEvent("inputFocus",_34.value);
},false);
_34.addEvent("blur",function(e){
_2c._onBlur();
_2c.fireEvent("inputBlur",_34.value);
});
this._inputHelper=new XN.FORM.inputHelper(this.getEl("input")).limit(this.getConfig("maxLength"),false).count(this.getEl("counter"),false).setDefaultValue(this.getTip("inputDefault"));
XN.EVENT.addEvent(this.getEl("input"),"keydown",function(e){
if(e.keyCode==13){
_2c.fireEvent("beforeUpdate");
_2c.getEl("input").blur();
_2c.update(_2c.getEl("input").value);
}
});
this._enableSubmit();
this.getEl("emotion").addEvent("click",function(e){
_2c._parseEmotionEvent(e);
XN.EVENT.stop(e||window.event);
}).addEvent("mouseover",function(e){
_2c._overEmotion=true;
}).addEvent("mouseleave",function(){
_2c._overEmotion=false;
}).addEvent("mousedown",function(e){
_2c.getInputPos();
XN.event.stop(e||window.event);
});
if(this.getEl("special")){
this.getEl("special").addEvent("mousedown",function(){
_2c.getInputPos();
});
}
if(this.getEl("emoBtn")){
this._uiType="other";
this.showEmotion=function(){
var p=this.getEl("emoPan");
var btn=this.getEl("emoBtn");
if(p){
p.show();
}
if(btn){
btn.hide();
}
};
this.hideEmotion=function(){
var p=this.getEl("emoPan");
var btn=this.getEl("emoBtn");
if(p){
p.hide();
}
if(btn){
btn.show();
}
};
this.getEl("emoBtn").onclick=function(e){
_2c.showEmotion();
XN.event.stop(e||window.event);
};
}else{
this.showEmotion=function(){
this.getEl("emotion").show();
};
this.hideEmotion=function(){
this.getEl("emotion").hide();
};
}
},showErr:function(msg){
if(this.IDerr){
var t=$(this.IDerr);
if(t){
t.innerHTML=msg;
t.show();
}
}
},hideErr:function(){
if(this.IDerr){
var t=$(this.IDerr);
if(t){
t.hide();
}
}
},showMsg:function(msg){
if(this.IDmsg){
var t=$(this.IDmsg);
if(t){
t.innerHTML=msg;
t.show();
}
}
},hideMsg:function(){
if(this.IDmsg){
var t=$(this.IDmsg);
if(t){
t.hide();
}
}
},getInputPos:function(){
this._currentInputPos=$CursorPosition(this.getEl("input"));
},showEmotion:XN.func.empty,hideEmotion:XN.func.empty,_patchForNewUser:function(){
var _46=this.getEl("currentStatus");
var _47=this.getEl("updateTime");
if(_46&&_23.isBlank(_46.innerHTML)){
_46.innerHTML=this.getTip("newUser");
if(_47){
_47.innerHTML="";
}
}
},_parseEmotionEvent:function(e){
var el=XN.EVENT.element(e);
if(el.tagName.toLowerCase()=="a"){
el=el.getElementsByTagName("img")[0];
}
if(el.tagName.toLowerCase()=="img"&&el.getAttribute("emotion")){
this.addEmotion(el.getAttribute("emotion"));
}
},_forSpecial:false,addEmotion:function(_4a,sp){
if(sp){
XN.Cookie.set(this.getConfig("spCookieName"),"1",10000,"/","."+XN.env.domain+"");
this._forSpecial=true;
}
var _4c=this;
if(this.forSpecial){
_4a=this.forSpecial(_4a);
}
var _4d=this.getEl("input");
if(this.getTip("inputDefault")==_4d.value){
_4d.value="";
}
var pos=this._currentInputPos;
_4d.value=_4d.value.slice(0,pos.start)+_4a+_4d.value.slice(pos.end);
_4d.blur();
setTimeout(function(){
_4c._inputHelper.focus(pos.start+_4a.length);
},10);
},update:function(_4f){
var _50=XN.STRING.trim(_4f);
if(this.getTip("inputDefault")==_50){
this.fireEvent("updateError","\u62b1\u6b49\uff0c\u60a8\u4e0d\u80fd\u53d1\u5e03\u7a7a\u72b6\u6001");
return;
}else{
if(_50==""){
this.getEl("input").value="";
this.fireEvent("updateError",XN.APP.status.getError(3));
return;
}
}
var _51=this.getEl("currentStatus");
if(_51){
this._lastStatus=XN.STRING.trim(_51.innerHTML);
}
this.action.update(_4f);
},_disableSubmit:function(){
this.getEl("submit").onclick=null;
this.getEl("input").disalbe=true;
},_enableSubmit:function(){
var _52=this;
var _53=this.getEl("submit");
_53.onclick=function(e){
XN.EVENT.stop(e||window.event);
_52.fireEvent("beforeUpdate");
_52.update(_52.getEl("input").value);
};
this.getEl("input").disabled=false;
},_resetInput:function(){
var _55=this.getEl("input");
_55.value=this.getTip("inputDefault");
_55.style.color="#888";
_55.blur();
},advancedMode:function(){
if(this._modeTimer){
clearTimeout(this._modeTimer);
this._modeTimer=null;
}
if(this._uiType=="home"){
var _56=this.getEl("inputContent");
var _57=this.getEl("submit");
var _58=this.getEl("counter");
var _59=this.getEl("special");
if(_56){
_56.addClass("inputactve");
}
if(_57){
_57.show();
}
if(_58){
_58.show();
}
if(_59){
_59.hide();
}
}
this.showEmotion();
this.getEl("input").style.color="#333";
var _5a=$("statusEdit");
if(_5a){
_5a.style.backgroundPosition="0 0";
}
this.fireEvent("advancedMode");
this._patchForIE();
},simpleMode:function(){
var _5b=this;
if(this._uiType=="home"){
var _5c=this.getEl("inputContent");
var _5d=this.getEl("counter");
var _5e=this.getEl("special");
if(_5c){
_5c.delClass("inputactve");
}
if(this._uiType=="home"){
if(_5d){
_5d.hide();
}
}
if(_5e&&(!this._forSpecial)){
_5e.show();
}
}
var _5f=$("statusEdit");
if(_5f){
_5f.style.backgroundPosition="0 -58px";
}
this.hideEmotion();
this.fireEvent("simpleMode");
},_resetInputCounter:function(_60){
var _61=this.getEl("counter");
if(_61){
var v=this.getEl("input").value;
if(_60){
_61.innerHTML=0;
}
_61.delClass("full");
if(this._uiType=="home"){
_61.hide();
}
this.fireEvent("resetCounter");
}
},_onBlur:function(){
var _63=this;
var _64=this.getEl("input");
$(_64).delClass("focus");
var v=_64.value;
if(v!==""&&v!=this.getTip("inputDefault")){
return;
}
if(this._overEmotion){
return;
}
_63.simpleMode();
},_patchForIE:function(){
if(XN.BROWSER.IE7){
document.body.style.zoom=1.1;
document.body.style.zoom="";
}
},_onInputFocus:function(){
var _66=this.getEl("input");
if(_66.value==this.getTip("inputDefault")){
_66.value="";
}
this._resetInputCounter();
this.advancedMode();
$(_66).addClass("focus");
this.fireEvent("inputFocus");
},_beforePost:function(){
this._disableSubmit();
if(this.getEl("currentStatus")){
this.getEl("currentStatus").innerHTML="<img class=\"loading-img\" src=\""+XN.ENV.staticRoot+"img/upload_progress.gif\"/>\u66f4\u65b0\u4e2d\uff0c\u8bf7\u7a0d\u5019..";
}
},_onPostSuccess:function(r){
if(this._specialCode&&r.indexOf(this._specialCode)!==-1){
XN.COOKIE.set("sta1","1",10000);
}
this._enableSubmit();
this._resetInput();
this._resetInputCounter(true);
this.simpleMode();
var _68=this.getEl("updateTime");
if(_68){
_68.innerHTML=this.getTip("updateTime");
}
var _69=this.getEl("currentStatus");
if(_69){
_69.innerHTML=r;
_69.style.backgroundColor="rgb(255,255,150)";
setTimeout(function(){
XN.Effect.gradient(_69,255,255,150,function(){
_69.style.backgroundColor="transparent";
});
},50);
}
},_onPostError:function(r){
this._enableSubmit();
this.advancedMode();
if(this.getEl("currentStatus")){
this.getEl("currentStatus").innerHTML=this._lastStatus;
}
if(this.getEl("updateTime")){
this.getEl("updateTime").innerHTML="";
}
if(this.getConfig("showError")){
XN.DO.showError(r||this.getTip("onPostError"));
}
}};
XN.EVENT.enableCustomEvent(ns.editor.prototype);
})(XN.APP.status);
XN.dom.ready(function(){
if(new RegExp("home.|www."+XN.env.domain_reg).test(window.location.href)){
return;
}
if(!$("statusEdit")&&!$("publisher_statusInput")){
return;
}
var p={};
if(/status\.renren\.com/.test(window.location.href)){
p.TIPinputDefault="\u4f60\u6b63\u5728\u5e72\u561b?";
XN.config.status.params="statusPage=1";
}
var _6c=new XN.APP.status.editor(p);
_6c.forSpecial=function(_6d){
return _6d;
};
window.statusEditor=_6c;
});
(function(ns){
var _6f=XN.STRING;
var _70=XN.EVENT.addEvent;
var _71;
var _72=true;
var lib;
function log(s){
if(_72){
XN.log(s);
}
}
ns.forPublisher=function(_75){
$extend(this,_75);
this.init();
};
ns.forPublisher.prototype={IDsubmit:"publisher_submit",IDinput:"publisher_statusInput",IDinputContent:"statusContent",IDcurrentStatus:"currentStatus",IDupdateTime:"statusUpdateTime",IDspecial:"commendStatus",IDemotion:"publisher_emotion",IDcounter:"publisher_count",TIPinputDefault:"\u4f60\u6b63\u5728\u5e72\u561b\uff1f",TIPinputPhoto:"\u8bf7\u6dfb\u52a0\u7167\u7247\u63cf\u8ff0...",TIPonPostError:"\u72b6\u6001\u66f4\u65b0\u5931\u8d25,\u8bf7\u91cd\u8bd5",TIPupdateTime:"\u521a\u521a\u66f4\u65b0",TIPnewUser:"\u8ba9\u670b\u53cb\u4eec\u77e5\u9053\u4f60\u5728\u505a\u4ec0\u4e48...",TIPpublishing:"\u6b63\u5728\u53d1\u5e03, \u8bf7\u7a0d\u5019...",CFGshowError:true,CFGmaxLength:140,CFGspCookieName:"sta1",CFGinputMinHeight:XN.browser.IE?28:36,CFGinputMaxHeight:XN.browser.IE?42:50,CFGemoShow:true,_action:null,_lastStatus:null,getConfig:function(key){
return this["CFG"+key];
},getEl:function(id){
return $(this["ID"+id]);
},getTip:function(key){
return this["TIP"+key];
},init:function(){
var _79=this,ac;
this.sbt=this.getEl("submit");
this.ipt=this.getEl("statusInput");
this._action=ac=new XN.APP.status.updateAction({maxLength:this.getConfig("maxLength"),enableMedia:true});
ac.addEvent("beforePost",function(){
_79._beforePost();
_79.fireEvent("beforeUpdate");
});
ac.addEvent("postSuccess",function(r,_7c,_7d){
_79._onPostSuccess(r,_7d);
_79.fireEvent("updateSuccess");
});
ac.addEvent("postError",function(r){
_79._onPostError(r);
_79.fireEvent("updateError",r);
});
var _7f=this.getEl("input");
_7f.addEvent("focus",function(e){
_79._onInputFocus(e);
},false);
_7f.addEvent("blur",function(e){
_79._onBlur();
},false);
var _82=$element("div");
_82.id="publisher_counter_wrap";
_82.className="counter";
_82.innerHTML="<span id=\""+this.IDcounter+"\">0</span><span>/140</span>";
if($("publisher_tools")){
$("publisher_tools").style.overflow="";
$("publisher_tools").appendChild(_82);
}
this.counter=_82;
this._inputHelper=new XN.FORM.inputHelper(this.getEl("input")).limit(this.getConfig("maxLength"),false).count(this.getEl("counter"),false).setDefaultValue(this.getTip("inputDefault"));
this._inputHelper.setDefaultValue(this.getTip("inputDefault"));
XN.EVENT.addEvent(this.getEl("input"),"keydown",function(e){
if(e.keyCode==13){
_79.getEl("input").blur();
if(_79.mode=="keep"){
return true;
}
_79.update(_79.getEl("input").value);
}
});
this._enableSubmit();
if(this.getEl("emotion")){
this.getEl("emotion").addEvent("click",function(e){
e=e||window.event;
XN.EVENT.stop(e);
_79._parseEmotionEvent(e);
}).addEvent("mouseover",function(e){
_79._overEmotion=true;
}).addEvent("mouseleave",function(){
_79._overEmotion=false;
}).addEvent("mousedown",function(e){
XN.EVENT.stop(e||window.event);
_79.getInputPos();
});
}
if(this.getEl("special")){
this.getEl("special").addEvent("mousedown",function(){
_79.getInputPos();
});
}
this.showEmotion=function(){
if(XN.widgets.publisher.currentTab){
return;
}
if(!this.getEl("emotion")){
return;
}
this.loadRealEmotion();
if(this.getConfig("emoShow")){
this.getEl("emotion").show();
}
};
this.loadRealEmotion=function(){
XN.func.runOnce(function(){
var _87=_79.getEl("emotion").getElementsByTagName("img");
XN.array.each(_87,function(i,v){
v.setAttribute("src",v.getAttribute("rsrc"));
v.removeAttribute("rsrc");
});
});
};
this.hideEmotion=function(){
XN.log("hideEmotion");
if(this.getEl("emotion")){
this.getEl("emotion").hide();
}
};
},_patchForNewUser:function(){
if("profile"==document.body.id){
return;
}
if(_6f.isBlank(this.getEl("currentStatus").innerHTML)){
this.getEl("currentStatus").innerHTML=this.getTip("newUser");
this.getEl("updateTime").innerHTML="";
}
},_parseEmotionEvent:function(e){
var el=XN.EVENT.element(e);
if(el.tagName.toLowerCase()=="a"){
el=el.getElementsByTagName("img")[0];
}
if(el.tagName.toLowerCase()=="img"){
this.addEmotion(el.getAttribute("emotion"));
}
},getInputPos:function(){
this._currentInputPos=$CursorPosition(this.getEl("input"));
},_forSpecial:false,addEmotion:function(_8c,sp){
var _8e=this;
if(sp){
XN.Cookie.set(this.getConfig("spCookieName"),"1",10000,"/","."+XN.env.domain+"");
this._forSpecial=true;
}
if(this.forSpecial){
_8c=this.forSpecial(_8c);
}
var _8f=this.getEl("input");
if(this.getTip("inputDefault")==_8f.value){
_8f.value="";
}
var pos=this._currentInputPos;
_8f.value=_8f.value.slice(0,pos.start)+_8c+_8f.value.slice(pos.end);
_8f.blur();
setTimeout(function(){
_8e._inputHelper.focus(pos.start+_8c.length);
},10);
},update:function(_91){
if(this.getTip("inputDefault")==_91){
return;
}
if(this.getEl("currentStatus")){
this._lastStatus=XN.string.trim(this.getEl("currentStatus").innerHTML);
}
this.justStatus=XN.string.trim(_91);
this._action.update(_91);
},_disableSubmit:function(){
this.getEl("submit").onclick=null;
this.getEl("input").disalbe=true;
},_enableSubmit:function(){
var _92=this;
var _93=this.getEl("submit");
_93.onclick=function(e){
if(_92.mode=="keep"){
return true;
}
XN.EVENT.stop(e||window.event);
_92.update(_92.getEl("input").value);
};
this.getEl("input").disabled=false;
},_resetInput:function(){
var _95=this.getEl("input");
_95.value=this.getTip("inputDefault");
_95.style.color="#888";
},_effect:function(d){
var _97=this;
var _98=this.getEl("input");
var mih=this.getConfig("inputMinHeight");
var mah=this.getConfig("inputMaxHeight");
if(this._aEffect){
this._aEffect.stop();
}
if(!this._aEffect){
this._aEffect=new XN.effect.Motion("easeOut",50);
}
if(d=="open"){
this._aEffect.onTweening=function(){
_98.style.height=this.equation(mih,mah)+"px";
};
this._aEffect.onComplete=function(){
_97.showEmotion();
};
this._aEffect.start();
}else{
this._aEffect.onTweening=function(){
_98.style.height=this.equation(mah,mih)+"px";
};
this._aEffect.onComplete=null;
this._aEffect.start();
}
this.fireEvent("effectEnd");
},mode:"simple",advancedMode:function(){
if(this.mode=="advance"||this.mode=="keep"){
return;
}
this.mode="advance";
this.getEl("input").addClass("focus");
this._effect("open");
if(this.getEl("special")){
this.getEl("special").hide();
}
this.fireEvent("advancedMode");
},simpleMode:function(){
var _9b=this;
if(this.mode=="simple"||this.mode=="keep"||this.mode=="keepMode"){
return;
}
this.isShow=false;
this.mode="simple";
this._effect("close");
this.getEl("input").delClass("focus");
if(this.getEl("special")&&(!this._forSpecial)){
this.getEl("special").show();
}
this.hideEmotion();
this.fireEvent("simpleMode");
},_resetInputCounter:function(){
var _9c=this.getEl("counter");
_9c.innerHTML=this.getEl("input").value.length+"/"+this.getConfig("maxLength");
_9c.delClass("full");
_9c.hide();
this.fireEvent("resetCounter");
},_onBlur:function(){
var _9d=this;
var v=this.getEl("input").value;
if(v!==""&&v!=this.getTip("inputDefault")){
return;
}
if(this._overEmotion){
return;
}
if(this._overShare){
return;
}
_9d.simpleMode();
},_patchForIE:function(){
if(XN.BROWSER.IE){
document.body.style.zoom=1.1;
document.body.style.zoom="";
}
},_onInputFocus:function(){
var _9f=this.getEl("input");
if(_9f.value==this.getTip("inputDefault")||_9f.value==this.getTip("inputPhoto")){
_9f.value="";
}
this.advancedMode();
_9f.style.color="#333";
this.fireEvent("inputFocus");
},_beforePost:function(){
this._disableSubmit();
if(this.getEl("currentStatus")){
this.getEl("currentStatus").innerHTML="<img class=\"loading-img\" src=\""+XN.ENV.staticRoot+"img/upload_progress.gif\"/>\u66f4\u65b0\u4e2d\uff0c\u8bf7\u7a0d\u5019 ";
}
},_onPostSuccess:function(r,_a1){
this._enableSubmit();
this._resetInput();
var _a2=this;
_a2.simpleMode();
setTimeout(function(){
_a2.getEl("input").blur();
},0);
if(this.getEl("updateTime")){
this.getEl("updateTime").innerHTML=this.getTip("updateTime");
}
if(!this.getEl("currentStatus")){
return;
}
var _a3=this.getEl("currentStatus");
_a3.innerHTML="<a href=\"http://status."+XN.env.domain+"/getdoing.do?id="+XN.user.id+"\">\u521a\u521a\u66f4\u65b0: "+r+"</a>";
_a3.title=this.justStatus;
_a3.style.backgroundColor="rgb(255,255,150)";
setTimeout(function(){
XN.Effect.gradient(_a3,255,255,150,function(){
_a3.style.backgroundColor="transparent";
});
},50);
},noMoreThan:function(str,num){
if(str.length<=num){
return str;
}
return str.slice(0,num)+"...";
},_onPostError:function(r){
var _a7=this;
this._enableSubmit();
this.simpleMode();
this.getEl("currentStatus").innerHTML=this._lastStatus;
this.getEl("input").delClass("full");
if(this.getConfig("showError")){
XN.DO.showError(r||this.getTip("onPostError"));
setTimeout(function(){
_a7._inputHelper.focus();
},2100);
}else{
_a7._inputHelper.focus();
}
}};
XN.EVENT.enableCustomEvent(ns.forPublisher.prototype);
})(XN.app.status);
XN.namespace("widgets");
XN.widgets.publisher={getID:function(id){
return "publisher_"+id;
},getEl:function(id){
return $(this.getID(id));
},hideEl:function(id){
this.getEl(id).style.display="none";
},inited:false,error:false,init:function(){
if(this.inited){
return;
}
this.inited=true;
var _ab=this;
this.statusEditor=new XN.app.status.forPublisher({IDsubmit:this.getID("submit")});
this.statusEditor.addEvent("advancedMode",function(){
_ab.open();
});
this.statusEditor.addEvent("simpleMode",function(){
_ab.close();
});
this.statusEditor.addEvent("updateSuccess",function(){
if($(_ab.statusEditor.IDcounter)){
$(_ab.statusEditor.IDcounter).innerHTML=0;
}
});
this.statusEditor.addEvent("updateError",function(r,msg,_ae){
if($(_ab.statusEditor.IDcounter)){
$(_ab.statusEditor.IDcounter).innerHTML=0;
}
});
if(XN.browser.IE){
this.getEl("upload_form").onsubmit=function(){
_ab.submit();
return false;
};
}
this.getEl("submit").removeAttribute("disabled");
function stopEvent(e){
e=e||window.event;
XN.event.stop(e);
}
function enableEvent(e){
if(_ab.currentTab){
return;
}
}
this._tab={"uploading":{name:"uploading",title:"\u4e0a\u4f20",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"publisher-login\" style=\"text-align:center;\">\u6b63\u5728\u4e0a\u4f20\uff0c\u8bf7\u7a0d\u5019...</div>",isAttach:true,canSubmit:false},"attachPhoto":{name:"attachPhoto",title:"\u76f8\u518c",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"success\"><p>\u4e0a\u4f20\u6210\u529f\uff0c\u8bf7\u5b8c\u5584\u7167\u7247\u4fe1\u606f</p></div><div id=\"place_holder\"></div>",isAttach:false,canSubmit:"photo"},"uploadPhoto":{name:"uploadPhoto",title:"\u4e0a\u4f20",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/retrieveUploadPhoto.do",canSubmit:"upload",cache:true},"uploadSuccess":{name:"uploadSuccess",title:"\u4e0a\u4f20",className:"iPhoto",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/photofeed.do",isAttach:true,canSubmit:false,cache:false},"publishing":{name:"publishing",title:"\u6b63\u5728\u53d1\u5e03",className:"publishing",html:"<div class=\"publisher-login\" style=\"text-align:center;\">\u6b63\u5728\u53d1\u5e03\uff0c\u8bf7\u7a0d\u5019...</div>",icon:"http://s.xnimg.cn/a.gif",isAttach:true,canSubmit:false,cache:false},"shareLink":{name:"shareLink",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/retrieveShareLink.do",canSubmit:"share",cache:true},"postShare":{name:"postShare",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",url:"http://status."+XN.env.domain+"/publisher/save2share.do",canSubmit:false,cache:false},"emotion":{name:"emotion",title:"\u8868\u60c5",className:"",icon:"http://s.xnimg.cn/imgpro/icons/statusface/1.gif",url:"http://status."+XN.env.domain+"/publisher/showEmotion.do",canSubmit:"emotion",cache:true}};
XN.event.addEvent(this.getID("file"),"mousedown",stopEvent);
XN.event.addEvent(this.getID("file"),"mouseup",enableEvent);
XN.event.addEvent(this.getID("file"),"change",function(e){
var v=_ab.getEl("file").value;
if(!/\.(png|jpg|jpeg|gif|bmp)/i.test(v)){
XN.DO.showError("\u8bf7\u9009\u62e9\u4e00\u5f20\u56fe\u7247");
return;
}
_ab.openTab(_ab._tab.uploading);
_ab.statusEditor.getEl("input").value;
_ab.statusEditor._inputHelper._defaultValue="";
_ab.statusEditor._inputHelper.element.value="";
_ab.getEl("upload_form").submit();
});
var tip=XN.dom.getElementsByClassName("status-tips-cion",this.getID("frame"))[0];
if(tip){
XN.event.addEvent(tip,"mousedown",stopEvent);
XN.event.addEvent(tip,"mouseup",enableEvent);
}
var _b4=this.statusEditor.getEl("input");
XN.event.addEvent(this.getID("share"),"mouseover",function(){
_ab.statusEditor._overShare=true;
});
XN.event.addEvent(this.getID("share"),"mouseout",function(){
_ab.statusEditor._overShare=false;
});
XN.event.addEvent(this.getID("share"),"click",function(e){
_ab.statusEditor._inputHelper.focus();
if(!_ab._shareTip){
_ab._shareTip=new XN.ui.tooltip({bar:_ab.statusEditor.getEl("input"),alignType:"1-4",offsetY:-6,fireOn:"manual",msg:"\u73b0\u5728\u53ef\u4ee5\u76f4\u63a5\u5728\u8fd9\u91cc\u5206\u4eab\u5566\uff01"});
}
_ab._shareTip.show();
_ab.statusEditor.CFGemoShow=false;
});
XN.event.addEvent(_b4,"blur",function(){
_ab.statusEditor.CFGemoShow=true;
try{
_ab._shareTip.hide();
}
catch(e){
}
});
XN.event.addEvent(this.getID("action_close"),"click",function(e){
_ab.closeTab();
e=e||window.event;
XN.event.stop(e);
});
XN.event.addEvent(this.getID("action_content"),"click",function(e){
_ab.parseEvent(e||window.event);
});
XN.event.addEvent(this.getID("submit"),"click",function(e){
XN.event.stop(e||window.event);
_ab.submit();
});
XN.event.addEvent(this.statusEditor.getEl("input"),"keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
_ab.submit();
}
});
this.fireEvent("init");
XN.log("publisher:init over");
},submit:function(){
if(this.mode=="close"){
return;
}
if(this._submitDisabled){
return;
}
if(!this.currentTab){
return;
}
var cs=this.currentTab.canSubmit;
if(!cs){
return;
}
var _bb=this;
if(cs=="createAlbum"){
this.getEl("create_form").submit();
}else{
if(cs=="photoDesc"){
this.openTab(this._tab.updateDesc,"description="+encodeURIComponent(this.getEl("photo_description").value)+"&photoId="+this.getEl("photo_id").value);
}else{
if(cs=="share"){
var _bc=this.getEl("share_title").value;
if(!/^http:\/\//i.test(_bc)){
_bc="http://"+_bc;
}
var _bd="weblink="+encodeURIComponent(_bc);
if(this.getEl("share_name")){
_bd+="&title="+encodeURIComponent(this.getEl("share_name").value);
_bd+="&fromname="+encodeURIComponent(this.getEl("share_fromname").value);
}else{
_bd+="&fromname=";
}
var _be=this.statusEditor.getEl("input").value;
if(_be==this.statusEditor.getTip("inputDefault")){
_be="";
}
_bd+="&status="+encodeURIComponent(_be);
_bd+=XN.app.status.getForwardParam();
XN.app.status.setForwardNull();
this.openTab(this._tab.postShare,_bd);
this.statusEditor.getEl("input").value="";
}else{
if(cs=="photo"){
var _be=this.statusEditor.getEl("input").value;
if(_be==this.statusEditor.getTip("inputPhoto")){
_be="";
}
var sel=$("album");
var p={id:this._photoId,status:_be,albumSelect:sel.value};
if(_be.length>200){
XN.DO.showError("\u7167\u7247\u63cf\u8ff0\u6700\u591a\u53ea\u80fd\u8f93\u5165200\u5b57");
setTimeout(function(){
_bb.statusEditor._inputHelper.focus();
},2000);
return;
}
var _c1=this;
XN.element.addClass("publisher_frame","publishing");
_c1.openTab(_c1._tab.uploadSuccess,XN.array.toQueryString(p)+XN.app.status.getForwardParam());
XN.app.status.setForwardNull();
_c1.statusEditor.getEl("input").value="";
$("publisher_action_content").innerHTML="<div class=\"photo-uploading\">"+_bb.statusEditor.getTip("publishing")+"</div>";
}else{
if(cs=="emotion"){
this.statusEditor.update(this.statusEditor.getEl("input").value);
this.closeTab();
}
}
}
}
}
this.fireEvent("submit",this.currentTab);
},parseEvent:function(e){
},openEffect:function(_c3,_c4,end,_c6){
_c3.style.display="block";
var _c7=this.getEl("patch_iframe");
var _c8=this.getEl("frame");
if(this._frameEffect){
this._frameEffect.stop();
}
if(!this._frameEffect){
this._frameEffect=new XN.effect.Motion("easeOut",50);
}
this._frameEffect.onTweening=function(){
_c3.style.height=this.equation(_c4,end)+"px";
if(_c7){
_c7.style.height=_c8.offsetHeight+"px";
}
};
this._frameEffect.onComplete=_c6||XN.func.empty;
this._frameEffect.start();
},buttonEffect:function(_c9,end){
var _cb=this.getEl("submit");
if(this._submitEffect){
this._submitEffect.stop();
}
if(!this._submitEffect){
this._submitEffect=new XN.effect.Motion("easeOut",50);
}
this._submitEffect.onTweening=function(){
_cb.style.top=this.equation(_c9,end)+"px";
};
this._submitEffect.start();
},_tabEffect:function(tab){
var _cd=this;
var _ce=this.getEl("action_title");
if(this._titleEffect){
this._titleEffect.stop();
}
if(!this._titleEffect){
this._titleEffect=new XN.effect.Motion("easeOut",50);
}
this._titleEffect.onTweening=function(){
_ce.style.left=this.equation(200,10)+"px";
};
this._titleEffect.start();
if(!tab.name=="photo"){
this.buttonEffect(this.getEl("submit").offsetTop,25+this.getEl("action_rframe").offsetHeight);
}else{
this.buttonEffect(this.getEl("submit").offsetTop,7+this.getEl("action_rframe").offsetHeight);
}
this.openEffect(this.getEl("action_frame"),this.getEl("action_frame").offsetHeight,this.getEl("action_rframe").offsetHeight+10);
},startLoading:function(){
this.getEl("action_content").addClass("loading");
this.getEl("action_content").clear();
this.isLoading=true;
},stopLoading:function(){
this.getEl("action_content").delClass("loading");
this.isLoading=false;
},disableSubmit:function(){
this._submitDisabled=true;
this.getEl("submit").addClass("disabled");
this.getEl("submit").setAttribute("disabled","disabled");
},enableSubmit:function(){
this._submitDisabled=false;
this.getEl("submit").delClass("disabled");
this.getEl("submit").removeAttribute("disabled");
},_startCheckSubmit:function(){
var _cf=this;
this._stopCheckSubmit();
var cs=_cf.currentTab.canSubmit;
if(!cs){
return;
}
var _d1=null;
if(cs=="share"){
_d1=function(){
var v=_cf.getEl("share_title").value;
if(XN.string.isBlank(v)){
return true;
}
if(v=="\u8bf7\u8f93\u5165\u7f51\u5740/\u89c6\u9891\u5730\u5740/\u97f3\u9891\u5730\u5740"){
return true;
}
if(v=="http://"){
return true;
}
if(!/^[a-zA-Z]/.test(v)){
return true;
}
if(!/[a-zA-Z0-9]\.[a-zA-Z0-9]/.test(v)){
return true;
}
return false;
};
}else{
if(cs=="createAlbum"){
_d1=function(){
return XN.string.isBlank(_cf.getEl("album_title").value);
};
}else{
if(cs=="photoDesc"){
_d1=function(){
return XN.string.isBlank(_cf.getEl("photo_description").value);
};
}else{
if(cs=="photo"){
_d1=function(){
return false;
};
}else{
if(cs=="emotion"){
_d1=function(){
return false;
};
}
}
}
}
}
this._submitTimer=setInterval(function(){
if(_d1&&_d1()){
_cf.disableSubmit();
}else{
_cf.enableSubmit();
}
},200);
},_stopCheckSubmit:function(){
if(this._submitTimer){
clearInterval(this._submitTimer);
this._submitTimer=null;
}
},mode:"open",canClose:true,closeTab:function(){
var tab=this.currentTab;
var _d4=this.getEl("statusInput");
this.fireEvent("beforeTabClose",{currentTab:tab,input:_d4});
var _d5=this;
if(tab&&(tab.name=="attachPhoto")){
if($("album").value||_d4.value&&_d4.value!=this.statusEditor.getTip("inputPhoto")){
XN.DO.confirm({message:"\u786e\u5b9a\u4e0d\u53d1\u5e03\u8be5\u7167\u7247\u5417\uff1f\u4f60\u7684\u597d\u53cb\u5c06\u4e0d\u4f1a\u6536\u5230\u8be5\u7167\u7247\u7684\u65b0\u9c9c\u4e8b\u3002",title:"\u63d0\u793a",submit:"\u4e0d\u53d1\u5e03",callBack:function(yes){
if(!yes){
}else{
_d5.getEl("statusInput").value="";
_d5._closeTab();
}
}});
return;
}else{
_d5._closeTab();
return;
}
}
this._closeTab();
},_closeTab:function(){
if(this.currentTab&&this.currentTab.pre){
this.openTab(this._tab[this.currentTab.pre]);
return;
}
var _d7=this;
this.statusEditor.mode="advance";
this.getEl("submit").style.top="0px";
this.getEl("submit").show();
this.getEl("tools").style.display="block";
this.hideEl("action_frame");
this.statusEditor.getEl("input").show();
this._stopCheckSubmit();
this.enableSubmit();
var val=this.getEl("statusInput").value;
this.getEl("upload_form").reset();
this.getEl("statusInput").value=val;
if(this.currentTab&&this.currentTab.name=="attachPhoto"){
}else{
this.currentTab=null;
if(!this.error){
this.statusEditor.showEmotion();
}
}
this.currentTab=null;
this.mode="close";
$("publisher_frame").className="publisher";
$("publisher_submit").style.top="0px";
$("publisher_submit").show();
$("publisher_tools").show();
if($(this.statusEditor.IDcounter)){
$(this.statusEditor.IDcounter).innerHTML=0;
}
this.statusEditor._inputHelper.setDefaultValue(this.statusEditor.getTip("inputDefault"));
$("publisher_upload_form").delClass("no-spacing");
this.error=false;
setTimeout(function(){
var se=_d7.statusEditor;
se.simpleMode();
se._inputHelper._default=false;
se._inputHelper.setDefaultValue(se.TIPinputDefault);
_d7.fireEvent("afterTabClose");
},0);
},openTab:function(tab,_db){
var _dc=this;
if(this.foldTimer){
clearTimeout(this.foldTimer);
}
this.statusEditor.mode="keep";
this.statusEditor.hideEmotion();
this.currentTab=tab;
this.getEl("action_frame").show();
this.getEl("action_title").innerHTML=tab.title;
this.getEl("action_title_img").className=tab.className+" icon";
this.getEl("action_title_img").src=tab.icon;
this.getEl("tools").hide();
this.statusEditor.getEl("input").blur();
this.disableSubmit();
this._stopCheckSubmit();
if(tab.url){
this.loadAction(tab.url+(_db?"?"+_db:""));
this.startLoading();
}
if(tab.html){
this.renderTab(tab.html);
}
this._tabEffect(tab);
this.mode="open";
setTimeout(function(){
if(_dc.statusEditor.getEl("input").offsetHeight>36){
return;
}
_dc.statusEditor.mode="simple";
_dc.statusEditor.advancedMode();
_dc.statusEditor.mode="keep";
},0);
},renderTab:function(_dd){
var _de=this;
_de.getEl("action_content").innerHTML=_dd;
if(this.currentTab.isAttach){
this.getEl("action_close").style.visibility="hidden";
}else{
this.getEl("action_close").style.visibility="inherit";
}
if(_de.currentTab.focus){
setTimeout(function(){
var _df=_de.getEl(_de.currentTab.focus);
_df.focus();
_df.select();
},0);
}
if(this.currentTab.title=="\u8868\u60c5"){
var el=this.getEl("action_content").getElementsByTagName("ul")[0];
XN.event.addEvent(el,"click",function(e){
_de.statusEditor._parseEmotionEvent(e||window.event);
});
XN.event.addEvent(el,"mousedown",function(e){
XN.event.stop(e||window.event);
_de.statusEditor.getInputPos();
});
}
if(this.currentTab.title=="\u4e0a\u4f20"){
var _tt=$("publisher_frame");
XN.element.addClass(_tt,"photo-upload");
XN.element.addClass("publisher_upload_form","no-spacing");
$("publisher_statusInput").hide();
_tt=$("publisher_action_rframe");
$(this.getEl("action_title").parentNode).hide();
$("publisher_submit").hide();
}
if(this.currentTab.name){
if(this.currentTab.name=="uploadSuccess"||this.currentTab.name=="postShare"){
this.foldTimer=setTimeout(function(){
_de.closeTab();
$("publisher_statusInput").blur();
},2000);
XN.element.delClass("publisher_frame","attach-sus");
var s=$("h_status");
if(s&&!XN.string.isBlank(s.value)){
this.statusEditor.getEl("currentStatus").innerHTML="<a href=\"http://status."+XN.env.domain+"/getdoing.do?id="+XN.user.id+"\">\u521a\u521a\u66f4\u65b0: "+XN.string.escapeHTML(s.value)+"</a>";
}
if(this.currentTab.name=="uploadSuccess"){
XN.element.addClass("publisher_frame","up-sus");
}
}
if(_de.currentTab.name=="attachPhoto"){
_de.statusEditor.getEl("input").show();
_de.statusEditor.getEl("submit").show();
$("publisher_action_close").show();
$($("publisher_upload_form").getElementsByTagName("h4")[0]).hide();
_de.statusEditor._inputHelper.setDefaultValue(_de.statusEditor.getTip("inputPhoto"));
XN.element.addClass("publisher_frame","attach-sus");
XN.element.delClass("publisher_frame","photo-upload");
}
if(_de.currentTab.name=="uploading"){
XN.debug.log("uploading");
}
if(_de.currentTab.name=="shareLink"){
_tt=$("publisher_action_rframe");
$(_tt.getElementsByTagName("h4")[0]).show();
_tt=$("publisher_action_close").show();
XN.element.addClass("publisher_frame","shareLink");
}
XN.app.status.fireEvent("postSuccess");
}
_de.buttonEffect(_de.getEl("submit").offsetTop,25+_de.getEl("action_rframe").offsetHeight);
_de.openEffect(_de.getEl("action_frame"),_de.getEl("action_frame").offsetHeight,_de.getEl("action_rframe").offsetHeight+10);
_de._startCheckSubmit();
this.fireEvent("tabOpen",this.currentTab);
},loadAction:function(_e5){
if(this.isLoading){
return;
}
var _e6=this;
new XN.net.xmlhttp({url:_e5,useCache:this.currentTab.cache,onComplete:function(){
_e6.stopLoading();
},onSuccess:function(r){
_e6.renderTab(r.responseText);
},onError:function(){
err();
}});
function err(){
XN.DO.showError("\u7f51\u7edc\u51fa\u9519, \u8bf7\u91cd\u8bd5...");
setTimeout(function(){
_e6.closeTab(_e6.currentTab);
},2000);
_e6.error=true;
}
},extend:false,open:function(){
if(this.extend){
return;
}
this.extend=true;
this.getEl("frame").delClass("status-main");
this.getEl("frame").addClass("status-main-background");
},close:function(){
if(!this.extend){
return;
}
this.extend=false;
var _e8=this;
_e8.getEl("frame").delClass("status-main-background");
_e8.getEl("frame").addClass("status-main");
},onBeforeUpload:function(){
this.getEl("upload_iframe").hide();
var _e9=$element("div");
_e9.addClass("publisher-login");
_e9.innerHTML="\u6b63\u5728\u4e0a\u4f20....";
this.getEl("action_content").appendChild(_e9);
},onUploadSuccess:function(_ea,url,msg,pid){
if(_ea!=0){
XN.DO.showError(msg);
this.error=true;
this.closeTab();
return;
}
this._photoId=pid;
var _ee=/(<div id="place_holder">)(<\/div>)/;
var _ef=this._tab.attachPhoto.html;
var _f0=this;
new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/publisher/getAlbumAjax.do",onSuccess:function(r){
_f0._tab.attachPhoto.html=_ef.replace(_ee,"$1"+r.responseText+"$2");
_f0.openTab(_f0._tab.attachPhoto);
},onError:function(){
XN.DO.showError("\u7f51\u7edc\u51fa\u9519, \u8bf7\u91cd\u8bd5...");
setTimeout(function(){
_f0.closeTab(_f0.currentTab);
},2000);
_f0.error=true;
}});
},showPhotoDesc:function(url,pid){
this.openTab(this._tab.photoDesc,"url="+encodeURIComponent(url)+"&photoId="+pid);
}};
XN.event.enableCustomEvent(XN.widgets.publisher);
XN.dom.ready(function(){
if(!new RegExp("^http://www.|home."+XN.env.domain).test(window.location.href)){
return;
}
if(!$("publisher_statusInput")){
return;
}
XN.config.status.params="isAtHome=1";
XN.widgets.publisher.init();
XN.APP.status.replyEditor.prototype.slideUp=true;
});
(function(ns){
var _f5=XN.browser.IE;
function getPasteContent(p1,p2,s,l){
p1=p1.start;
p2=p2.start;
return l.substring(p1,p2);
}
ns.bindPaste=function(obj){
var _fb={before:XN.func.empty,after:XN.func.empty,callBack:XN.func.empty};
$extend(_fb,obj);
var _fc=$(obj.element);
var _fd=_fc.value;
var _fe={start:0};
XN.event.addEvent(_fc,"focus",function(){
_fe=XN.form.help(_fc).cursorPosition();
});
var i=0;
var _100=setInterval(function(){
var v=_fc.value;
if(v!==_fd){
var cPos=XN.form.help(_fc).cursorPosition();
var _103=getPasteContent(_fe,cPos,_fd,v);
if(_103.length<6){
return;
}
XN.log("XN.event.bindPaste:\u7c98\u8d34\u4e86\u5185\u5bb9");
XN.log(_103);
XN.log(_fe);
XN.log(cPos);
_fb.callBack.call(_fc,_103,_fe,cPos,_fd,v);
}
_fd=v;
_fe=XN.form.help(_fc).cursorPosition();
},200);
};
})(XN.event);
(function(_104){
var _105=function(_106){
var This=this;
var pos=0;
var _109=_106.length;
this.image=function(){
return _106[pos];
};
this.next=function(){
if(this.cn()){
pos++;
}
return This.image();
};
this.pre=function(){
if(this.cp()){
pos--;
}
return This.image();
};
this.cn=function(){
return pos<_109-1;
};
this.cp=function(){
return pos>0;
};
this.pos=function(){
return pos+1;
};
this.length=function(){
return _109;
};
};
_104.pasteParser={urls:[],isAdded:function(url){
return XN.array.include(this.urls,url);
},init:function(){
var This=this;
XN.event.bindPaste({element:_104.statusEditor.getEl("input"),callBack:function(_10c){
This.parseShare(_10c);
}});
},initShareTab:function(){
},parseShare:function(p){
var This=this;
if(!XN.string.isUrl(p)){
XN.log("\u7c98\u8d34\u7684\u5185\u5bb9\u4e0d\u662furl");
}else{
if(/renren\.com|kaixin\.com/.test(p)){
XN.log("\u4e0d\u652f\u6301\u7ad9\u5185\u5206\u4eab");
return;
}
if(_104.currentTab&&_104.currentTab.name!="shareLink"){
XN.log("\u5f53\u524d\u5df2\u7ecf\u6253\u5f00\u975e\u5206\u4eabtab\uff0c\u8fd4\u56de");
return;
}
_104.startLoading();
new XN.net.xmlhttp({url:"http://share."+XN.env.domain+"/parse_share.do",data:"link="+encodeURIComponent(p),method:"get",onComplete:function(){
_104.stopLoading();
},onSuccess:function(r){
This.renderTab(XN.json.parse(r.responseText));
}});
}
},renderTab:function(json){
if(json.code!==0){
_104.closeTab();
return;
}
$(_104.getEl("action_title").parentNode).show();
this._tsc=json.tsc;
XN.log("publisher\u4e2d\u5206\u4eab\u89e3\u6790\u7ed3\u679c:");
XN.log(json);
json.description=json.description||"";
var tab={name:"fastShare",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",canSubmit:"fastShare"};
var html="";
if(json.type==11){
html=["<div class=\"share-publisher\">","<h5><input id=\"publisher_link_title\" onfocus=\"this.style.backgroundColor='#fff';this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.backgroundColor='#FFFF99';this.style.border='1px solid #fff';\" type=\"text\" style=\"background-color:#FFFF99;font-weight:bold;color:#005EAC;border:1px solid #fff;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\""+json.title+"\"/></h5>","<p><input id=\"publisher_fromname\" onfocus=\"this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.border='1px solid #fff';\" type=\"text\" style=\"border:1px solid #fff;width:95%;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\"\u672a\u77e5\u827a\u672f\u5bb6\"/></p>","<p class=\"description\">"+json.link+"</p>","</div>"].join("");
}else{
if(json.type==6){
json.images=json.images||[];
this.shareScroll=new _105(json.images);
html=["<div class=\"share-publisher\">","<div class=\"figure\">","<img width=\"100px\" id=\"publisher_share_thumb_img\" src=\""+(this.shareScroll.image()||"javascript:void(0);")+"\">","</div>","<div id=\"publisher_share_ar\" "+(this.shareScroll.length()==0?"style=\"margin-left:0px;\"":"")+"class=\"article\">","<h5><input id=\"publisher_link_title\" onfocus=\"this.style.backgroundColor='#fff';this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.backgroundColor='#FFFF99';this.style.border='1px solid #fff';\" type=\"text\" style=\"background-color:#FFFF99;font-weight:bold;color:#005EAC;border:1px solid #fff;width:95%;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\""+json.title+"\"/></h5>","<p class=\"description\">"+(json.description||json.link)+"</p>","<div "+((this.shareScroll.length()==0||/\.(jpg|jpeg|gif|png)$/i.test(json.link))?"style=\"display:none;\"":"")+" class=\"nav\">","<div id=\"publisher_share_inav\" class=\"fore-next no-fore "+(this.shareScroll.length()==1?"no-next":"")+"\">","<a class=\"fore\" onclick=\"var s=XN.widgets.publisher.pasteParser.shareScroll;var p = $(this.parentNode);if(s.cp()){$('publisher_share_thumb_img').src=$('publisher_share_thumb').value=s.pre();if(s.cp()){p.delClass('no-fore');}else{p.addClass('no-fore');}if(s.cn()){p.delClass('no-next');}else{p.addClass('no-next');}}$('publisher_share_thumb_num').innerHTML=s.pos();\"href=\"#nogo\">\u4e0a\u4e00\u5f20</a>"," <a class=\"next\" href=\"#nogo\" onclick=\"var s=XN.widgets.publisher.pasteParser.shareScroll;var p = $(this.parentNode);if(s.cn()){$('publisher_share_thumb_img').src=$('publisher_share_thumb').value=s.next();if(s.cp()){p.delClass('no-fore');}else{p.addClass('no-fore');}if(s.cn()){p.delClass('no-next');}else{p.addClass('no-next');}}$('publisher_share_thumb_num').innerHTML=s.pos();\">\u4e0b\u4e00\u5f20</a>","<p>&nbsp;<span id=\"publisher_share_thumb_num\">1</span>/"+this.shareScroll.length()+" <span class=\"description\">\u9009\u62e9\u4e00\u4e2a\u7f29\u7565\u56fe</span></p>","<input type=\"hidden\" id=\"publisher_share_thumb\" value=\""+this.shareScroll.image()+"\" />","</div>","<p><label><input onclick=\"var This = this;var nav = $('publisher_share_inav');var img = $('publisher_share_thumb_img');var ar =$('publisher_share_ar');setTimeout(function(){if(!This.checked){img.show();nav.show();ar.style.marginLeft='110px';}else{img.hide();nav.hide();ar.style.marginLeft='0px';}},0);\" id=\"publisher_share_nothumb\" name=\"noThumb\" value=\"true\" type=\"checkbox\"> \u4e0d\u52a0\u7f29\u7565\u56fe</label></p>","</div>","</div>","</div>"].join("");
}else{
if(json.type==10){
html=["<div class=\"share-publisher\">","<div class=\"figure\">","<img width=\"100px\" id=\"publisher_share_thumb_img\" src=\""+json.pic+"\">","</div>","<div class=\"article\" style=\"height:100px;\">","<h5><input id=\"publisher_link_title\" onfocus=\"this.style.backgroundColor='#fff';this.style.border='1px solid #BDC7D8';\" onblur=\"this.style.backgroundColor='#FFFF99';this.style.border='1px solid #fff';\" type=\"text\" style=\"background-color:#FFFF99;font-weight:bold;color:#005EAC;border:1px solid #fff;width:95%;\" onmouseover=\"this.focus();\" onmouseout=\"this.blur();\" value=\""+json.title+"\"/></h5>","<p class=\"description\">"+json.link+"</p>","</div>","</div>"].join("");
}
}
}
tab.html=html;
this.currentTab=tab;
this.postData=json;
_104.openTab(tab);
_104.getEl("action_close").show();
},submit:function(tab){
var This=this;
if(tab!==this.currentTab&&tab.canSubmit!="pasteShareURI"){
XN.log("\u4e0d\u662f\u7c98\u8d34\u5206\u4eabtab,\u4e0d\u6267\u884c\u5206\u4eab\u63d0\u4ea4");
return;
}
if(tab.canSubmit==="pasteShareURI"){
this.parseShare($("publisher_share_title").value);
return;
}
var data=$extend({albumid:"0",fromname:"",fromno:"0",fromuniv:"",largeurl:"",link:"",pic:"",title:"",summary:"",type:""},this.postData);
delete data.code;
data["title"]=$("publisher_link_title").value;
if(data.images){
delete data.images;
}
if($("publisher_share_thumb")&&!$("publisher_share_nothumb").checked){
data["pic"]=$("publisher_share_thumb").value;
}
if(data.type==11){
var _116=$("publisher_fromname").value;
if(_116!="\u672a\u77e5\u827a\u672f\u5bb6"){
data["fromname"]=_116;
}
}
if(data.type==6){
data.summary=data.description;
delete data.description;
}
data["action"]="add";
data["auth"]="99";
var _117=XN.string.trim(_104.statusEditor.getEl("input").value);
if(_117==_104.statusEditor.getTip("inputDefault")){
_117="";
}
if(_117==data.link){
data["body"]="";
}else{
data["body"]=_117;
}
_104.startLoading();
new XN.net.xmlhttp({url:"http://share."+XN.env.domain+"/share/submit.do",data:"post="+encodeURIComponent(XN.json.build(data))+"&tsc="+this._tsc,onComplete:function(){
_104.stopLoading();
},onSuccess:function(r){
_104.statusEditor.getEl("input").value="";
setTimeout(function(){
_104.closeTab();
},2000);
var j=XN.json.parse(r.responseText);
if(j.status===0){
This.success("\u5206\u4eab\u6210\u529f!");
}else{
This.error(j.msg);
}
},onError:function(){
_104.closeTab();
}});
},success:function(msg){
_104.openTab({name:"fastShareLoading",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"success\"><p>"+msg+"</p></div>",canSubmit:false});
},error:function(msg){
_104.openTab({name:"fastShareLoading",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"fail\"><p>"+msg+"</p></div>",canSubmit:false});
},loading:function(msg){
msg=msg||"\u8bf7\u7a0d\u5019...";
_104.openTab({name:"fastShareLoading",title:"\u5206\u4eab",className:"iShare",icon:"http://s.xnimg.cn/a.gif",html:"<div class=\"loading\"></div>",canSubmit:false});
}};
})(XN.widgets.publisher);
XN.widgets.publisher.addEvent("init",function(){
XN.log("publisher \u7c98\u8d34url\u89e3\u6790\u521d\u59cb\u5316\u5f00\u59cb");
this.pasteParser.init();
XN.log("publisher \u7c98\u8d34url\u89e3\u6790\u521d\u59cb\u5316\u7ed3\u675f");
});
XN.widgets.publisher.addEvent("submit",function(tab){
this.pasteParser.submit(tab);
});
(function(ns){
var ecd=function(str){
return encodeURIComponent(str);
};
var dcd=function(str){
return decodeURIComponent(str);
};
var $=xn_getEl;
var _124={};
getReplyEditor=function(idx,_126){
return _124[_126+idx];
};
delReplyEditor=function(idx,_128){
delete _124[_128+idx];
};
ns.replyEditor=function(_129){
this.config=this.config||{};
$extend(this.config,{loadReplyURI:"/doing/getReply.do",sendReplyURI:"/doing/reply.do",delReplyURI:"/doing/deleteReply.do",maxlength:140,showMore:true});
$extend(this.config,_129);
_124[this.getConfig("delFlag")+this.getConfig("idx")]=this;
this.xinit();
};
ns.replyEditor.prototype={_tips:{loadError:"\u52a0\u8f7d\u56de\u590d\u5931\u8d25",replyError:"\u56de\u590d\u5931\u8d25",deleteConfirm:"\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u56de\u590d?",deleteError:"\u5220\u9664\u56de\u590d\u5931\u8d25",inputTip:"\u6dfb\u52a0\u56de\u590d",sending:"\u6b63\u5728\u53d1\u9001..."},_tscCode:null,_replyData:null,_replyRequest:null,_replyCount:null,_showMore:false,_hasLoadAll:false,isProfile:function(){
return "profile"==document.body.id;
},xinit:function(){
},abortRequest:function(){
try{
this._replyRequest.abort();
}
catch(e){
}
},getTip:function(key){
return this._tips[key];
},getConfig:function(key){
if(key=="idx"){
return this.config["doingId"];
}
return this.config[String(key)];
},getEl:function(id){
if(id=="feedbody"){
return $(this.getID("feedbody"))||$(this.getID("replyfordoing"));
}
return $(this.getID(id));
},getID:function(id){
if(this.getConfig("delFlag")=="p"||/^album/.test(this.getConfig("delFlag"))){
return id+"_"+this.getConfig("delFlag")+"_"+this.getConfig("idx");
}
return id+this.getConfig("idx");
},canDel:function(){
return this._canDel;
return this.getConfig("delFlag")=="d";
},isHostId:function(id){
return this.getConfig("hostId")===String(id);
},replyMode:"none",replyTo:function(sid,uid,_131){
_131=dcd(_131);
this.clearReply();
this.replyMode="one";
this._replyData={sid:sid,uid:uid,uname:_131};
var _132=this.getEl("input");
var _133=_132.value;
this._replyPrefix="\u56de\u590d"+_131+": ";
_132.value=this._replyPrefix+_133;
this._inputHelper.focus();
this.saveInputPos();
},replyToAll:function(){
var _134=this.getEl("input");
this.replyMode="all";
this.stripReply();
this._replyPrefix="\u56de\u590d\u5927\u5bb6: ";
_134.value=this._replyPreifx+_134.value;
this._inputHelper.focus();
this._replyData={toAll:true};
},stripReply:function(){
var _135=this.getEl("input");
var v=_135.value;
if(this._replyPrefix){
v=v.replace(this._replyPrefix,"");
}
_135.value=v.replace(new RegExp("^\u6dfb\u52a0\u56de\u590d"),"");
},clearReply:function(){
this.replyMode="none";
this.stripReply();
this.getEl("replyall").checked=false;
this._replyData=null;
},updateReplyCounter:function(){
var c1=this.getEl("counter_m");
if(c1){
c1.innerHTML=this._replyCount;
}
var c2=this.getEl("replyCount");
if(c2){
c2.innerHTML=this._replyCount;
}
},sendReply:function(){
var This=this;
reply=this.getEl("input").value;
if(reply==this.getTip("inputTip")){
return;
}
if(XN.STRING.isBlank(reply)){
XN.DO.showError("\u8f93\u5165\u4e0d\u80fd\u4e3a\u7a7a");
return;
}
if(reply.length>this.getConfig("maxlength")){
XN.DO.showError("\u6700\u591a\u53ea\u80fd\u8f93\u5165"+this.getConfig("maxlength")+"\u4e2a\u5b57\u7b26");
return;
}
var _13a={};
_13a["source"]=this.getConfig("doingId");
_13a["doingId"]=this.getConfig("doingId");
_13a["owner"]=this.getConfig("ownerId");
if(this.getConfig("fromId")){
_13a["fromId"]=this.getConfig("fromId");
}
if(this.getConfig("type")){
_13a["t"]=this.getConfig("type");
}
if(this._replyData){
if(this._replyData.toAll){
_13a["replayAllUser"]=1;
if(!new RegExp("^\u56de\u590d\u5927\u5bb6:").test(reply)){
if(reply.length+6<=this.getConfig("maxlength")){
reply="\u56de\u590d\u5927\u5bb6: "+reply;
}
}
}else{
_13a["rpLayer"]="1";
_13a["replyTo"]=this._replyData["uid"];
_13a["replyName"]=this._replyData["uname"];
_13a["secondaryReplyId"]=this._replyData["sid"];
}
}else{
_13a["rpLayer"]="0";
}
_13a["c"]=reply;
this.loadingMode();
this.fireEvent("beforePost",this._replyData,this);
this._replyRequest=new XN.NET.xmlhttp({url:this.getConfig("sendReplyURI"),data:XN.ARRAY.toQueryString(_13a),onSuccess:function(r){
var rt=XN.JSON.parse(r.responseText);
if(rt.code==0){
This._onReplySuccess(rt);
}else{
if(rt.code==15){
This.resetInput();
This.simpleMode();
return;
}else{
This._onReplyError(XN.APP.status.getError(rt.code)||rt.msg);
}
}
},onError:function(){
This._onReplyError(This.getTip("replyError"));
}});
},disableSubmit:function(){
var el=this.getEl("submit");
el.addClass("gray");
el.disabled=true;
},enableSubmit:function(){
var el=this.getEl("submit");
el.delClass("gray");
el.disabled=false;
},_onReplyError:function(msg){
this.resetInput();
this.simpleMode();
XN.DO.showError(msg);
},_onReplySuccess:function(v){
var This=this;
this.clearReply();
this._replyCount++;
this.updateReplyCounter();
this.resetInput();
this.simpleMode();
this.getEl("input").blur();
this.getEl("input").value=this.getTip("inputTip");
this.getEl("input").style.color="#888";
var div=$element("div");
div.className="statuscmtitem";
div.id="status_reply_"+v.id;
var html=[];
html.push("<span class=\"share-n-hide float-right\"><a class=\"x-to-hide\" href=\"#nogo\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+this.getConfig("delFlag")+"').del('"+v.replyerId+"','"+v.id+"');\"> </a></span>");
html.push("<a class=\"minfriendpic\" style=\"background-image: url("+v.replyerHead+")\" href=\"http://"+XN.env.domain+"/profile.do?id="+v.replyerId+"\" target=\"_blank\"></a>");
html.push("<p class=\"replybody\">");
html.push("<a class=\"replyername\" href=\"http://"+XN.env.domain+"/profile.do?id="+v.replyerId+"\" target=\"_blank\">"+v.replyerName+"</a><span class=\"time\">"+v.replyTime+"</span><br/>");
html.push("<span class=\"replycontent\">"+v.replyContent+"</span>");
html.push("</p>");
div.innerHTML=html.join("");
this.getEl("replyList").show();
this.getEl("replyList").appendChild(div);
this.showMore("s");
},del:function(uid,sid){
var This=this;
function request(){
var p={};
p["replyId"]=sid;
p["source"]=This.getConfig("doingId");
p["doingId"]=This.getConfig("doingId");
p["owner"]=This.getConfig("ownerId");
p["t"]=This.getConfig("type");
new XN.NET.xmlhttp({url:This.getConfig("delReplyURI"),data:XN.ARRAY.toQueryString(p),onSuccess:function(){
This._onDeleteSuccess(sid);
},onError:function(){
XN.DO.showError(This.getTip("deleteError"));
}});
}
XN.DO.confirm({message:this.getTip("deleteConfirm"),callBack:function(r){
if(r){
request();
}
}});
},_onDeleteSuccess:function(id){
this._replyCount--;
this.updateReplyCounter();
$("status_reply_"+id).remove();
if(!this._showMore){
this.showMore();
}
},load:function(more){
var This=this;
if(more&&this.getEl("show_more_link")){
this.getEl("show_more_link").innerHTML="\u52a0\u8f7d\u4e2d&nbsp;<img src=\""+XN.env.staticRoot+"imgpro/bg/indicator_blue_small.gif\" />";
this.getEl("show_more_link").show();
}
var _14c={};
_14c["doingId"]=this.getConfig("doingId");
_14c["source"]=this.getConfig("doingId");
_14c["owner"]=this.getConfig("ownerId");
if(this.getConfig("type")){
_14c["t"]=this.getConfig("type");
}
new XN.NET.xmlhttp({data:XN.array.toQueryString(_14c),url:this.getConfig("loadReplyURI"),onComplete:function(){
if(more&&This.getEl("show_more_link")){
This.getEl("show_more_link").hide();
}
},onSuccess:function(r){
try{
var rt=XN.JSON.parse(r.responseText);
if(rt.code!==0){
XN.DO.showError(XN.APP.status.getError(rt.code)||rt.msg||This.getTip("loadError"));
return;
}
}
catch(e){
XN.DO.showError(This.getTip("loadError"));
return;
}
if(!This._replyCount){
This._replyCount=rt.replyList.length;
}
This._canDel=This.isHostId(rt.ownerid);
if(XN.user&&XN.user.auth&&parseInt(XN.user.auth,0)>=15){
XN.log("\u4f60\u6709\u6743\u9650\u5220\u9664\u522b\u4eba\u7684\u72b6\u6001,\u8fd9\u4e0b\u725bx\u4e86");
This._canDel=true;
}
if(more){
This._hasLoadAll=true;
This.renderReplys(rt.replyList);
This.showMore();
}else{
This._updateUIonLoadReply(rt.replyList);
}
},onError:function(){
XN.DO.showError(This.getTip("loadError"));
}});
},loadMore:function(){
this.load(true);
},loadJSON:function(json){
this.loadFromJSON=true;
this._replyCount=json.length;
this._canDel=this.isHostId(json.ownerid);
if(XN.user&&XN.user.isAdmin){
this._canDel=true;
}
this.config["ownerId"]=json.ownerid;
if(json.isOpenReply){
this._updateUIonLoadReply(json.replyList,parseInt(json.digged),parseInt(json.userDigged),json.type,json.ownerid);
this.show("t");
}
},showMore:function(flag){
this._showMore=true;
if(!this.getEl("show_more_link")){
return;
}
this.getEl("show_more_link").hide();
if(this.loadFromJSON&&!this._hasLoadAll){
this.loadMore();
}
this.getEl("replyList").delClass("nomore");
this.getEl("replyList").addClass("blockmore");
this.fireEvent("replyListOpened");
},insertCloseTag:function(){
if(this._showed){
return;
}
var _151=this.getEl("replyKey");
_151.innerHTML="\u6536\u8d77\u56de\u590d";
var _t=$element("span");
_t.className="seperator";
_t.innerHTML="|";
XN.dom.insertAfter(_t,_151);
this._showed=true;
},hideMore:function(){
this._showMore=false;
if(!this.getEl("show_more_link")){
return;
}
this.getEl("show_more_link").show();
this.getEl("replyList").addClass("nomore");
this.getEl("replyList").delClass("blockmore");
},_updateUIonLoadReply:function(obj,_154,_155,type){
var This=this;
var html=[],type=type||"";
html.push("<div class=\"min-cmtbox statustab\">");
html.push("<div class=\"mincmt-body\">");
var id=parseInt(this.getID("m").replace("m",""));
var _15a=this.getConfig("ownerId");
XN.APP.status.fireEvent("ILikeInit",html,type,id,_15a,_154,_155);
html.push("<div class=\"statuscmtlist nomore\">");
html.push("<div style=\"display:none;\" id=\""+this.getID("replyList")+"\">");
html.push("</div>");
html.push("<div id=\""+this.getID("reply_editor")+"\" class=\"statuscmtitem reply-adding\">");
html.push("<div>");
if(!this.isProfile()){
html.push("<span id=\""+this.getID("user_head")+"\" style=\"display:none;background-image: url("+XN.user.tinyPic+");\" class=\"minfriendpic\"></span>");
}
html.push("<textarea id=\""+this.getID("input")+"\" stats=\"NF_Re\" class=\"input-text archive-inp\" type=\"text\" value=\"\" style=\"overflow-y:auto;height:16px;\" cols=\"30\" rows=\"1\"></textarea>");
html.push("</div>");
var _15b="";
if(this.config["feedType"]&&this.emoListID[this.config["feedType"]]){
_15b="<a href=\"#emotion\" id=\""+this.getID("addEmoBtn")+"\" class=\"newsfeed-emo\">\u8868\u60c5</a>";
}
html.push(["<div class=\"reply-nav clearfix\" style=\"display:none;\" id=\""+this.getID("buttons")+"\">","<span class=\"replyAll clearfix\">",_15b,"<input style=\"display:none;\" class=\"input-button\" id=\""+this.getID("submit")+"\" type=\"submit\" value=\"\u56de\u590d\" />&nbsp;","<span style=\"display:none;\" id=\""+this.getID("word_counter")+"\" class=\"mincmtcount\">0/70</span>","<span style=\"display:none;\" id=\""+this.getID("replyallc")+"\">","<input type=\"checkbox\" name=\""+this.getID("replyall")+"\" id=\""+this.getID("replyall")+"\"/>","<label for=\""+this.getID("replyall")+"\">\u56de\u590d\u6240\u6709\u4eba</label>","</span>","</span>","</div>"].join(""));
html.push("</div>");
html.push("</div>");
html.push("</div>");
html.push("</div>");
this.getEl("feedbody").innerHTML=html.join("");
this.renderReplys(obj,true);
this.attachEvent(type);
if(this.getConfig("showMore")&&!this.loadFromJSON){
this.showMore();
}else{
this.hideMore();
}
this.show(this.getConfig("showMore")?"advance":"simple");
},renderReplys:function(obj,init){
var This=this;
var _15f=obj.length;
var html=[];
function addSpeClass(i){
if(i>0&&i<_15f-1){
return "more";
}
return "";
}
XN.array.each(obj,function(i,v){
html.push("<div id=\"status_reply_"+v.id+"\" class=\"statuscmtitem "+addSpeClass(i)+"\">");
if(This.isHostId(v.ubid)||This.canDel()){
html.push("<span class=\"share-n-hide float-right\"><a class=\"x-to-hide\" href=\"#nogo\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').del('"+v.ubid+"','"+v.id+"');\"> </a></span>");
}
if(init&&XN.string.startsWith(window.location.href,"http://home")){
html.push("<a style=\"float:left;\" target=\"_blank\" href=\"http://"+XN.env.domain+"/profile.do?id="+v.ubid+"&ref="+XN.app.status.getProfileRef()+"\"><img needclip=\"1\" width=\"30\" height=\"30\" src=\"http://s.xnimg.cn/a.gif\" onload=\"feed_img_delay_load(this, 's');\" lala=\""+v.replyer_tinyurl+"\" /></a>");
}else{
html.push("<a class=\"minfriendpic\" target=\"_blank\" style=\"background-image: url("+v.replyer_tinyurl+")\" href=\"http://"+XN.env.domain+"/profile.do?id="+v.ubid+"&ref="+XN.app.status.getProfileRef()+"\"></a>");
}
html.push("<p class=\"replybody\">");
html.push("<a class=\"replyername\" target=\"_blank\" href=\"http://"+XN.env.domain+"/profile.do?id="+v.ubid+"&ref="+XN.app.status.getProfileRef()+"\">"+v.ubname+"</a><span class=\"time\">"+v.replyTime+"</span><br/>");
html.push("<span class=\"replycontent\">"+v.replyContent+"</span>");
if(!This.isHostId(v.ubid)&&(This.getConfig("type")!=="page")){
html.push("<a href=\"#nogo\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').replyTo( '"+v.id+"','"+v.ubid+"','"+ecd(v.ubname)+"');\">\u56de\u590d</a>");
}
html.push("</p>");
html.push("</div>");
if(i==0&&This._replyCount>2){
var _164="\u663e\u793a\u5168\u90e8";
if(This._replyCount>=100){
if(This.getConfig("type")=="page"){
_164="\u663e\u793a"+This._replyCount+"\u6761\u4e2d\u7684\u6700\u65b0";
}else{
_164="\u663e\u793a\u6700\u65b0";
}
}
html.push("<div id=\""+This.getID("show_more_link")+"\" class=\"statuscmtitem showmorereply\">");
html.push("<a href=\"#nogo\" onclick=\"getReplyEditor('"+This.getConfig("idx")+"','"+This.getConfig("delFlag")+"').showMore();\">"+_164+"<span id=\""+This.getID("counter_m")+"\">"+Math.min(This._replyCount,100)+"</span>\u6761</a>");
html.push("</div>");
}
});
if(obj.length){
this.getEl("replyList").show();
}
this.getEl("replyList").show();
this.getEl("replyList").innerHTML=html.join("");
if(XN.browser.IE&&document.body.id=="profile"){
XN.ui.refreshAll();
}
},attachEvent:function(){
var This=this;
this.getEl("input").addEvent("focus",function(){
if(This.getEl("input").value==This.getTip("inputTip")){
This.resetInput();
}
This.editMode();
});
this.getEl("input").addEvent("blur",function(){
var v=This.getEl("input").value;
if(v!==""&&v!=This.getTip("inputTip")){
return;
}
This.simpleMode();
});
this.getEl("submit").addEvent("click",function(){
var v=This.getEl("input").value;
if(v===""||v==This.getTip("inputTip")){
return;
}
This.sendReply();
});
this._inputHelper=new XN.form.help(this.getEl("input")).onEsc(function(){
This.hide();
if(ns._emoFlyer){
This.hideEmoFlyer();
}
}).countSize(this.getID("word_counter"),this.getConfig("maxlength")).setDefaultValue(this.getTip("inputTip"));
XN.EVENT.addEvent(this.getEl("input"),"keydown",function(e){
e=e||window.event;
if(e.keyCode==13){
This.sendReply();
}
});
XN.event.addEvent(this.getEl("input"),"keyup",function(e){
This.saveInputPos();
});
XN.event.addEvent(this.getEl("input"),"mouseup",function(e){
This.saveInputPos();
});
if(!XN.browser.WebKit){
XN.event.addEvent(this.getEl("input"),"focus",function(e){
This.saveInputPos();
});
}
XN.event.addEvent(this.getEl("replyall"),"click",function(e){
if(This.getEl("replyall").checked){
This.replyToAll();
}else{
This.clearReply();
}
});
if(this.config["feedType"]&&this.emoListID[this.config["feedType"]]){
XN.event.addEvent(this.getEl("addEmoBtn"),"click",function(e){
This.showEmoFlyer();
});
}
},emoListID:{"status":1,"blog":2,"photo":2,"album":2},getNewsFeedEmoJsonCommon:function(){
var url="http://status."+XN.env.domain+"/getubblist.do?type=9";
new XN.net.xmlhttp({url:url,method:"GET",onSuccess:function(r){
XN.app.status.emoJsonForNewsFeedCommon=r.responseText;
XN.log("common emo json:"+XN.app.status.emoJsonForNewsFeedCommon);
},onError:XN.func.empty});
},getNewsFeedEmoJsonStatus:function(){
var url="http://status."+XN.env.domain+"/getdoingubblist.do";
new XN.net.xmlhttp({url:url,method:"GET",onSuccess:function(r){
XN.app.status.emoJsonForNewsFeedStatus=r.responseText;
XN.log("status emo json:"+XN.app.status.emoJsonForNewsFeedStatus);
},onError:XN.func.empty});
},getEmoList:function(){
var _172="",type=this.config["feedType"];
if(this.emoListID[type]==1){
if($("status_emotions")){
_172="<ul class=\"emotion\">";
_172+=$("status_emotions").innerHTML;
_172+="</ul>";
}else{
if($("home")){
XN.widgets.publisher.statusEditor.loadRealEmotion();
_172=$("publisher_emotion").innerHTML;
}else{
if(!XN.app.status.emoJsonForNewsFeedStatus){
return false;
}
var _emo=XN.json.parse(XN.app.status.emoJsonForNewsFeedStatus).ubbList;
_172="<ul class=\"emotion\">";
for(var i=0;i<_emo.length;i++){
_172+="<li><a href=\"#nogo\"><img src=\"http://xnimg.cn"+_emo[i].src+"\" title=\""+_emo[i].alt+"\" title=\""+_emo[i].alt+"\" emotion=\""+_emo[i].ubb+"\"></a>";
}
_172+="</ul>";
}
}
}else{
if(this.emoListID[type]==2){
if(!XN.app.status.emoJsonForNewsFeedCommon){
return false;
}
var _emo=XN.json.parse(XN.app.status.emoJsonForNewsFeedCommon).ubbList;
_172="<ul class=\"emotion\">";
for(var i=0;i<_emo.length;i++){
if(_emo[i].types==0){
continue;
}
_172+="<li><a href=\"#nogo\"><img src=\"http://xnimg.cn"+_emo[i].src+"\" title=\""+_emo[i].alt+"\" title=\""+_emo[i].alt+"\" emotion=\""+_emo[i].ubb+"\"></a>";
}
_172+="</ul>";
}
}
return {"id":this.emoListID[type],"list":_172};
},showEmoFlyer:function(){
var _176=this.getEl("input"),This=this,type=this.config["feedType"];
this._inputHelper.focus();
if(!ns._emoFlyer){
ns._emoFlyer={};
}
var _179=this.getEmoList(type);
if(!_179){
XN.Do.showError("\u83b7\u53d6\u8868\u60c5\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u518d\u8bd5!","\u51fa\u9519\u4e86",3);
return;
}
if(!ns._emoFlyer[_179.id]){
ns._emoFlyer[_179.id]=new XN.ui.fixPositionElement({tagName:"div",alignType:"3-2",offsetY:-1});
ns._emoFlyer[_179.id].setContent(_179.list);
ns._emoFlyer[_179.id].container.className="newsfeed-reply-emotions";
XN.event.addEvent(ns._emoFlyer[_179.id].container,"click",function(e){
XN.event.stop(e||window.event);
});
}
ns._emoFlyer[_179.id].alignWith=_176;
ns._emoFlyer[_179.id].refresh();
ns._emoFlyer[_179.id].show();
this.clearEmoParseHook();
ns._parseEmoTmpFunc=function(e){
This._parseEmotion(e,This);
};
XN.event.addEvent(ns._emoFlyer[_179.id].container,"mousedown",ns._parseEmoTmpFunc);
},hideEmoFlyer:function(){
for(p in ns._emoFlyer){
try{
ns._emoFlyer[p].hide();
}
catch(e){
}
}
},clearEmoParseHook:function(){
if(!ns._emoFlyer||!ns._parseEmoTmpFunc){
return;
}
for(p in ns._emoFlyer){
try{
XN.event.delEvent(ns._emoFlyer[p].container,"mousedown",ns._parseEmoTmpFunc);
}
catch(e){
}
}
},_parseEmotion:function(e,This){
XN.event.stop(e||window.event);
var img=XN.event.element(e);
if(img.tagName.toLowerCase()=="li"||img.tagName.toLowerCase()=="a"){
img=img.getElementsByTagName("img")[0];
}
if(img&&img.tagName.toLowerCase()=="img"){
var pos=This._inputHelper.cursorPos,_180=This.getEl("input"),code=img.getAttribute("emotion");
_180.value=_180.value.slice(0,pos.start)+code+_180.value.slice(pos.end);
This.getEl("input").blur();
if(XN.browser.IE){
setTimeout(function(){
This._inputHelper.focus(pos.start+code.length);
This.saveInputPos();
},0);
}else{
This._inputHelper.focus(pos.start+code.length);
This.saveInputPos();
}
}
},resetInput:function(){
this.getEl("input").disabled=false;
this.getEl("input").value="";
this.resetInputCounter();
},saveInputPos:function(){
this._inputHelper.cursorPos=this._inputHelper.cursorPosition();
},resetInputCounter:function(){
var _182=this.getEl("word_counter");
_182.innerHTML=this.getEl("input").value.length+"/"+this.getConfig("maxlength");
_182.delClass("full");
},_modeTimer:null,_firstFocus:true,editMode:function(){
if(this._modeTimer){
clearTimeout(this._modeTimer);
this._modeTimer=null;
}
if(!this.isProfile()){
this.getEl("reply_editor").addClass("actived");
this.getEl("user_head").show();
}
this.getEl("input").disabled=false;
this.getEl("input").style.color="#333";
this.getEl("input").style.height="32px";
this.getEl("input").style.border="1px solid #5D74A2";
this.enableSubmit();
this.getEl("submit").value="\u56de\u590d";
this.getEl("submit").show();
this.getEl("word_counter").show();
if(this._replyCount&&!this.isProfile()&&XN.config.status.enableReplyAll){
this.getEl("replyallc").show();
}
this.resetInputCounter();
this.getEl("buttons").show();
},simpleMode:function(){
var This=this;
if(this._modeTimer){
clearTimeout(this._modeTimer);
this._modeTimer=null;
}
this._modeTimer=setTimeout(function(){
if(!This.getEl("input")){
return;
}
This.getEl("buttons").hide();
if(!This.isProfile()){
This.getEl("reply_editor").delClass("actived");
This.getEl("user_head").hide();
}
This.getEl("input").disabled=false;
This.getEl("input").style.height="16px";
This.getEl("submit").hide();
This.getEl("word_counter").hide();
This.getEl("input").style.border="1px solid #BDC7D8";
if(XN.config.status.enableReplyAll){
This.getEl("replyallc").hide();
}
},200);
if(ns._emoFlyer){
this.hideEmoFlyer();
}
},loadingMode:function(){
this.disableSubmit();
this.getEl("submit").value=this.getTip("sending");
this.getEl("input").disabled=true;
},changeMode:function(){
if(this.view=="reply"){
this.hide();
}else{
this.show();
}
},show:function(mode){
mode=mode||"advance";
this.view="reply";
this._replyData=null;
this.getEl("feedbody").show();
this.getEl("replyKey").innerHTML="\u6536\u8d77\u56de\u590d";
if(mode=="advance"){
this.getEl("input").focus();
this.getEl("input").style.color="#333";
this.showMore();
this.saveInputPos();
}
},hide:function(){
var _185;
if(this._replyCount==0){
_185="";
}else{
if(this._replyCount>=100&&this.getConfig("type")!=="page"){
_185="100+\u6761";
}else{
_185=this._replyCount+"\u6761";
}
}
this.view="close";
this.resetInput();
this.getEl("feedbody").hide();
this.getEl("replyKey").innerHTML="<span id=\""+this.getID("replyCount")+"\">"+_185+"</span>\u56de\u590d";
this.clearReply();
}};
XN.EVENT.enableCustomEvent(ns.replyEditor.prototype);
})(XN.APP.status);
getReplyOfDoingFromJSON=function(json,_187,_188,_189,type,_18b,_18c,_18d){
var func=XN.browser.IE6?XN.dom.ready:function(s){
s();
};
func(function(){
json.length=parseInt(_189,0);
if(isNaN(json.length)){
json.length=0;
}
var _190=json.type||"";
var _191={doingId:_187,hostId:_188,delFlag:_18c||"f",type:type,showMore:false,fromId:_18b,feedType:_190};
if(XN.app.status.crossDomain){
$extend(_191,{loadReplyURI:"http://status."+XN.env.domain+"/feedcommentretrieve.do",sendReplyURI:"http://status."+XN.env.domain+"/feedcommentreply.do",delReplyURI:"http://status."+XN.env.domain+"/feedcommentdelete.do"});
}
json.isOpenReply=_18d===false?false:true;
new XN.app.status.replyEditor(_191).loadJSON(json);
});
};
setCursor2Start=function(_192){
if(_192.setSelectionRange){
_192.setSelectionRange(0,0);
}else{
if(_192.createTextRange){
var _193=_192.createTextRange();
_193.collapse(true);
_193.moveEnd("character",0);
_193.moveStart("character",0);
_193.select();
}
}
_192.focus();
};
forwardDoing=function(_194,_195,type){
type=type||"status";
if(XN.string.isBlank(_194)&&XN.string.isBlank(_195)){
return;
}
var _197=[];
_197["id"]=_194;
_197["owner"]=_195;
_197["ref"]=type;
var self=arguments.callee;
try{
self.request.abort();
}
catch(e){
}
XN.dom.ready(function(){
window.scrollTo(0,0);
var _199=$("currentStatus");
var _19a=_199.innerHTML;
_199.innerHTML="<span id=\"temp-loading\">\u52a0\u8f7d\u4e2d&nbsp;<img src=\""+XN.env.staticRoot+"imgpro/bg/indicator_blue_small.gif\" /></span>";
self.request=new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/doing/fwdinfo.do",data:XN.array.toQueryString(_197),method:"get",onSuccess:function(r){
_199.innerHTML="";
var rt=XN.json.parse(r.responseText);
if(rt.code==0&&$("publisher_statusInput")){
var _19d=$("publisher_statusInput");
if(rt.userName==undefined){
XN.DO.showError("\u8f6c\u53d1\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u91cd\u8bd5");
return;
}
var _19e="\u8f6c\u81ea"+rt.userName+": "+rt.status;
if(_19e.length>140){
_19e=_19e.slice(0,137)+"...";
}
_19d.value=_19e;
XN.APP.status.setForwardTrue(_194,_195,type);
var pb=XN.widgets.publisher;
if(rt.readonly){
pb.statusEditor.getEl("input").disabled=true;
pb.statusEditor._effect("open");
pb.statusEditor._inputHelper.limitCheck();
var old=pb.statusEditor._aEffect.onComplete;
pb.statusEditor._aEffect.onComplete=function(){
This.hideEmotion();
pb.statusEditor._aEffect.onComplete=old;
};
}else{
pb.statusEditor.getEl("input").disabled=false;
}
if(rt.url){
pb.init();
pb.addEvent("tabOpen",function(){
this.delEvent("tabOpen",arguments.callee);
this.getEl("share_title").value=decodeURIComponent(rt.url);
this.getEl("share_title").setAttribute("readOnly",true);
});
setCursor2Start($("publisher_statusInput"));
setTimeout(function(){
pb.openTab(pb._tab.shareLink);
_199.innerHTML=_19a;
},0);
}else{
}
_199.innerHTML=_19a;
setCursor2Start($("publisher_statusInput"));
}else{
if(rt.code==10){
XN.DO.showError("\u4e0d\u80fd\u8f6c\u53d1\u81ea\u5df1\u7684\u72b6\u6001");
}else{
XN.DO.showError(rt.msg);
}
}
},onError:function(){
XN.DO.showError("\u52a0\u8f7d\u5931\u8d25");
}});
});
};
getReplyOfTheDoing=function(_1a1,_1a2,_1a3,_1a4,auto,type,_1a7,_1a8){
var func=XN.browser.IE6?XN.dom.ready:function(s){
s();
};
func(function(){
try{
XN.app.status.notify.del(_1a1);
}
catch(e){
}
var ed=getReplyEditor(_1a1,_1a4);
if(ed){
try{
var ce=ed.getEl("input").value;
ed.changeMode();
return;
}
catch(e){
}
}
var _1ad=!(auto||false);
if(!_1a8){
_1a8="";
}
if($("pageStatus")){
_1a8="status";
}
XN.log("feedtype:"+_1a8);
var _1ae={doingId:_1a1,hostId:_1a3,delFlag:_1a4,showMore:_1ad,ownerId:_1a2,type:type,fromId:_1a7,feedType:_1a8};
if(XN.app.status.crossDomain){
$extend(_1ae,{loadReplyURI:"http://status."+XN.env.domain+"/feedcommentretrieve.do",sendReplyURI:"http://status."+XN.env.domain+"/feedcommentreply.do",delReplyURI:"http://status."+XN.env.domain+"/feedcommentdelete.do"});
}
new XN.app.status.replyEditor(_1ae).load();
});
};
getReplyOfDoingFromJSON4Page=function(json,_1b0,_1b1,_1b2,_1b3,_1b4){
json.length=parseInt(_1b2,0);
if(isNaN(json.length)){
json.length=0;
}
var _1b5={doingId:_1b0,hostId:_1b1,delFlag:"f",type:"page",showMore:false};
$extend(_1b5,{loadReplyURI:(_1b4?"http://org.":"http://page.")+XN.env.domain+"/doing/replyList",sendReplyURI:(_1b4?"http://org.":"http://page.")+XN.env.domain+"/doing/reply",delReplyURI:(_1b4?"http://org.":"http://page.")+XN.env.domain+"/doing/delReply"});
json.isOpenReply=_1b3===false?false:true;
new XN.app.status.replyEditor(_1b5).loadJSON(json);
};
getReplyOfTheDoing4Page=function(_1b6,_1b7,_1b8,_1b9,auto,_1bb){
var ed=getReplyEditor(_1b6,_1b9);
if(ed){
try{
ed.changeMode();
return;
}
catch(e){
}
}
var _1bd=!(auto||false);
var _1be={doingId:_1b6,hostId:_1b8,delFlag:_1b9,showMore:_1bd,type:"page",ownerId:_1b7};
$extend(_1be,{loadReplyURI:(_1bb?"http://org.":"http://page.")+XN.env.domain+"/doing/replyList",sendReplyURI:(_1bb?"http://org.":"http://page.")+XN.env.domain+"/doing/reply",delReplyURI:(_1bb?"http://org.":"http://page.")+XN.env.domain+"/doing/delReply"});
new XN.app.status.replyEditor(_1be).load();
};
function replyDelete(ele){
var url,p={},tip;
var ars=arguments;
if(ars[2]){
url="http://status."+XN.env.domain+"/doing/deleteReply.do";
p["replyId"]=ars[2];
p["doingId"]=ars[1];
tip="\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u56de\u590d\u5417?";
}else{
url="http://status."+XN.env.domain+"/doing/deleteDoing.do";
p["id"]=ars[1];
if(ars[3]){
p["ownerid"]=ars[3];
}
tip="\u786e\u5b9a\u8981\u5220\u9664\u8fd9\u6761\u72b6\u6001\u5417?";
}
function onSuccess(){
XN.Element.hide($(ele),"fade");
}
function del(){
new XN.NET.xmlhttp({url:url,data:XN.ARRAY.toQueryString(p),onComplete:onSuccess});
}
XN.DO.confirm({message:tip,callBack:function(r){
if(r){
del();
}
}});
}
function delMyDoing(obj,_1c6){
replyDelete(obj,_1c6);
}
function sudoDelDoing(obj,_1c8,_1c9){
replyDelete(obj,_1c8,null,_1c9);
}
delMyRpDoing=function(el,_1cb,rid){
replyDelete(el,_1cb,rid);
};
XN.APP.status.getVideoScale=function(url){
if(/tudou/i.test(url)){
return [400,300];
}else{
if(/youtube/i.test(url)){
return [425,355];
}else{
if(/youku/i.test(url)){
return [480,400];
}else{
if(/sina/i.test(url)){
return [480,370];
}else{
if(/qq/i.test(url)){
return [456,362];
}else{
if(/mofile/i.test(url)){
return [480,395];
}else{
if(/ku6/i.test(url)){
return [460,390];
}else{
if(/openv/i.test(url)){
return [500,460];
}
}
}
}
}
}
}
}
};
function playStatusVideo(sid,url,el){
url=decodeURIComponent(url);
var _1d1=XN.APP.status.getVideoScale(url);
var html=XN.Template.flash({width:_1d1[0],height:_1d1[1],filename:url});
var p=el.parentNode;
if(!$("media"+sid)||(p.id&&p.id=="currentStatus")||(p&&/currentStatus/.test(p.className))){
XN.DO.alert({title:"\u72b6\u6001",message:"<center style=\"padding:10px\">"+html+"</center>",width:_1d1[0]+80,button:"\u5173\u95ed",callBack:function(){
this.body.setContent("");
},noHeader:true});
}else{
if(/^\S*$/.test($("media"+sid).innerHTML)){
$("media"+sid).innerHTML="<div class=\"feedmediabox\">"+html+"</div>";
if(el){
$(el).addClass("expand");
}
}else{
$("media"+sid).innerHTML="";
if(el){
el.delClass("expand");
}
}
}
}
function playStatusAudio(sid,url,el){
var html;
if(/mp3$/i.test(url)){
html=XN.Template.flashPlayer({filename:url});
}else{
html=XN.Template.mediaPlayer({filename:url});
}
var p=el.parentNode;
if(!$("media"+sid)||(p.id&&p.id=="currentStatus")||(p&&/currentStatus/.test(p.className))){
XN.DO.alert({title:"\u72b6\u6001",message:"<center style=\"padding:10px\">"+html+"</center>",width:500,button:"\u5173\u95ed",callBack:function(){
this.body.setContent("");
},noHeader:true});
}else{
if(/^\S*$/.test($("media"+sid).innerHTML)){
$("media"+sid).innerHTML="<div class=\"feedmediabox\">"+html+"</div>";
if(el){
$(el).addClass("expand");
}
}else{
$("media"+sid).innerHTML="";
if(el){
el.delClass("expand");
}
}
}
}
function $CursorPosition(_1d9){
var _1da=0,end=0;
if(typeof (_1d9.selectionStart)=="number"){
_1da=_1d9.selectionStart;
end=_1d9.selectionEnd;
}else{
if(document.selection){
var _1dc=document.selection.createRange();
if(_1dc.parentElement()==_1d9){
var _1dd=document.body.createTextRange();
_1dd.moveToElementText(_1d9);
for(_1da=0;_1dd.compareEndPoints("StartToStart",_1dc)<0;_1da++){
_1dd.moveStart("character",1);
}
for(var i=0;i<=_1da;i++){
if(_1d9.value.charAt(i)=="\n"){
_1da++;
}
}
var _1dd=document.body.createTextRange();
_1dd.moveToElementText(_1d9);
for(end=0;_1dd.compareEndPoints("StartToEnd",_1dc)<0;end++){
_1dd.moveStart("character",1);
}
for(var i=0;i<=end;i++){
if(_1d9.value.charAt(i)=="\n"){
end++;
}
}
}
}
}
return {"start":_1da,"end":end,"item":[_1da,end]};
}
XN.dom.ready(function(){
if(!$("pageStatus")){
XN.app.status.replyEditor.prototype.getNewsFeedEmoJsonCommon();
}
if(!$("status_emotions")&&!$("home")){
XN.app.status.replyEditor.prototype.getNewsFeedEmoJsonStatus();
}
if(!$("pageStatus")||!XN.BROWSER.IE){
return;
}
document.body.style.zoom=1.1;
document.body.style.zoom="";
});
(function(ns){
ns.miniFeed=function(_1e0){
if(!_1e0){
_1e0={};
}
if(!_1e0.IDframe){
_1e0={IDsubmit:"mini_submit",IDinput:"mini_statusInput",IDinputContent:"mini_statusInput",IDcurrentStatus:"mini_currentFeed",IDupdateTime:"mini_statusUpdateTime",IDspecial:"mini_commendStatus",IDemotion:"mini_emotion",IDemoPan:"mini_emotions",IDemoBtn:"mini_emo_btn",IDframe:"mini_frame",IDcounter:"mini_statusCount",IDerr:"mini_err",IDmsg:"mini_msg",CFGshowMax:false,TIPinputDefault:"\u4f60\u6b63\u5728\u5e72\u561b?",CFGshowError:false};
this.params=_1e0;
}
$extend(this,_1e0);
};
ns.miniFeed.prototype={skin:"http://s.xnimg.cn/csspro/module/status.css?ver=7",action:"http://status."+XN.env.domain+"/publisher/minifeed.do",msg:{mfBuildFail:"\u62b1\u6b49\uff0c\u670d\u52a1\u51fa\u9519\uff0c\u8bf7\u5237\u65b0\u9875\u9762\u540e\u518d\u8bd5\u3002"},block:[],init:function(fn){
var This=this;
if(!this.initialized){
this.initialized=true;
if(this.standAlong){
this.addEvent("skinLoaded",function(){
This._loadSkeleton();
});
this._loadSkin();
}else{
This._loadSkeleton();
}
This.addEvent("skeletonLoaded",function(){
$(this.params.IDemotion).delClass("emotions");
This.statusEditor=new XN.APP.status.editor(This.params);
This.bindEvent();
This.fireEvent("miniInitOver");
});
}
},bindEvent:function(){
var This=this;
var em=$(this.IDemBtn);
if(em){
XN.event.addEvent(em,"click",function(e){
This.statusEditor.advancedMode();
});
}
if(this.statusEditor){
this.statusEditor.addEvent("beforeUpdate",function(){
This._beforeUpdate();
});
this.statusEditor.addEvent("updateSuccess",function(msg,send,_1e8){
This._updateSuccess(msg,send,_1e8);
This.fireEvent("miniUpdateSus",_1e8);
});
this.statusEditor.addEvent("updateError",function(r){
This._updateError();
This.fireEvent("miniUpdateError",r);
});
}
},_loadSkeleton:function(){
var This=this;
var p={useCache:true};
new XN.net.xmlhttp({url:this.action,data:XN.array.toQueryString(p),onSuccess:function(r){
var temp=$element("div");
var txt=r.responseText;
temp.innerHTML=txt;
temp.id=This.IDframe;
temp.className="publisher";
document.body.appendChild(temp);
This.initPopup();
This.fireEvent("skeletonLoaded");
}});
},_beforeUpdate:function(){
this._disable();
},_updateSuccess:function(msg,send,_1f1){
this._reset();
},_updateError:function(){
this._reset();
},_reset:function(){
var _1f2=$(this.IDsubmit);
_1f2.delClass("disabled");
},_disable:function(){
var _1f3=$(this.IDsubmit);
_1f3.addClass("disabled");
_1f3.disable=false;
var inpt=$(this.IDinput);
inpt.disable=false;
},initPopup:function(){
var This=this;
this.popInited=true;
this.pan=XN.DO.alert({title:"\u53d1\u5e03\u72b6\u6001",width:600,height:100,message:$(this.IDframe),params:{showCloseButton:true}});
var p=this.pan;
p.footer.hide();
},_skeleton:function(p){
},show:function(){
if(!this.popInited){
return;
}
XN.dom.disable();
this.pan.show();
if($(this.IDframe)){
$(this.IDframe).show();
}
if(this.statusEditor){
this.statusEditor.getEl("input").disabled=false;
this.statusEditor.hideErr();
this.statusEditor.hideMsg();
}
},hide:function(){
if(this.pan){
this.pan.hide();
}
},setStatus:function(_1f8,rt){
this.readonly=rt.readonly;
var _1fa=this.statusEditor.getEl("input");
_1fa.value=_1f8;
this.statusEditor._inputHelper.limitCheck();
if(rt.readonly){
_1fa.disabled=true;
this.statusEditor.simpleMode();
var t=$(this.statusEditor.IDemoBtn);
if(t){
t.hide();
}
}else{
this.statusEditor.advancedMode();
var t=$(this.statusEditor.IDemoBtn);
if(t){
t.show();
}
}
setCursor2Start(this.statusEditor.getEl("input"));
},_loadSkin:function(){
var This=this;
XN.loadFile(this.skin,function(){
This.fireEvent("skinLoaded");
});
},_standAlong:function(fn){
var This=this;
}};
})(XN.widgets);
XN.event.enableCustomEvent(XN.widgets.miniFeed.prototype);
(function(ns){
ns.FowardManager={fowardDoing:function(_200,_201,type){
type=type||"status";
if(XN.string.isBlank(_200)&&XN.string.isBlank(_201)){
return;
}
var _203=[];
_203["id"]=_200;
_203["owner"]=_201;
_203["ref"]=type;
var self=arguments.callee;
try{
self.request.abort();
}
catch(e){
}
this.fireEvent("beforeFwd");
var This=this;
XN.dom.ready(function(){
self.request=new XN.net.xmlhttp({url:"http://status."+XN.env.domain+"/doing/fwdinfo.do",data:XN.array.toQueryString(_203),method:"get",onSuccess:function(r){
var rt=XN.json.parse(r.responseText);
if(rt.code==0){
if(rt.userName==undefined){
XN.DO.showError("\u8f6c\u53d1\u5931\u8d25\uff0c\u8bf7\u7a0d\u5019\u91cd\u8bd5");
return;
}
var _208="\u8f6c\u81ea"+rt.userName+": "+rt.status;
if(_208.length>140){
_208=_208.slice(0,137)+"...";
}
XN.APP.status.setForwardTrue(_200,_201,type);
This.fireEvent("fwdSus",_208,rt);
}else{
if(rt.code==10){
XN.DO.showError("\u4e0d\u80fd\u8f6c\u53d1\u81ea\u5df1\u7684\u72b6\u6001");
}else{
XN.DO.showError(rt.msg);
}
}
},onError:function(){
XN.DO.showError("\u52a0\u8f7d\u5931\u8d25");
}});
});
}};
})(XN.widgets);
XN.event.enableCustomEvent(XN.widgets.FowardManager);
XN.dom.ready(function(){
var regx=/http:\/\/status\.renren\.com/;
var href=document.location.href;
var _20b=false;
if(regx.test(href)){
_20b=true;
}
window.minifeed=new XN.widgets.miniFeed();
if(!_20b){
minifeed.standAlong=true;
}
window.fwdmgr=XN.widgets.FowardManager;
fwdmgr.addEvent("fwdSus",function(_20c,rt){
if(!minifeed.initialized){
minifeed.init();
minifeed.addEvent("miniInitOver",function(){
minifeed.show();
minifeed.setStatus(_20c,rt);
});
}else{
minifeed.show();
minifeed.setStatus(_20c,rt);
}
});
minifeed.addEvent("miniUpdateSus",function(){
var me=minifeed.statusEditor;
me.showMsg("<span id=\"mini_msg_ok\" style=\"background:rgb(255,255,150);\">\u53d1\u5e03\u6210\u529f!</span>");
var m=$("mini_msg_ok");
setTimeout(function(){
XN.Effect.gradient(m,255,255,150,function(){
m.style.backgroundColor="transparent";
me.hideMsg();
setTimeout(function(){
minifeed.hide();
},500);
});
},500);
});
minifeed.addEvent("miniUpdateError",function(r){
var me=minifeed.statusEditor;
me.getEl("submit").addClass("disabled");
me.simpleMode();
me.showErr(r);
if(minifeed.readonly){
me.getEl("submit").delClass("disabled");
me.getEl("submit").disabled=false;
me.getEl("input").disabled=true;
setTimeout(function(){
me.hideErr();
},2000);
return;
}
setTimeout(function(){
me.getEl("submit").delClass("disabled");
me.getEl("submit").disabled=false;
me.getEl("input").disabled=false;
me._inputHelper.focus();
},2000);
});
window.a_fowardDoing=function(_212,_213){
fwdmgr.fowardDoing(_212,_213);
};
});
XN.namespace("ui.tooltip");
XN.ui.tooltip=function(_214){
if(_214){
$extend(this,_214);
}
this.init();
};
XN.ui.tooltip.ids=0;
XN.ui.tooltip.prototype={init:function(){
var that=this;
var div=$element("div");
div.id="tooltip_"+XN.ui.tooltip.ids++;
var ds=div.style;
ds.background="#fff9d7";
ds.border="solid 1px #d7b013";
ds.padding="3px 15px 3px 3px";
div.innerHTML=this.msg||"";
var a=$element("a");
var as=a.style;
a.className="x-to-hide";
as.position="absolute";
as.top="0";
as.right="0";
as.cursor="pointer";
if(this.cookie){
var c=this.cookie;
XN.event.addEvent(a,"click",function(e){
e=e||window.event;
XN.event.stop(e);
XN.cookie.set(c.key,c.value,c.expire||10000);
that.tip.hide();
});
}
var _21c=$element("div");
var das=_21c.style;
das.background="url(http://s.xnimg.cn/imgpro/arrow/tip-arrow-down.png?ver=2) no-repeat";
das.height="6px";
das.width="11px";
das.position="absolute";
das.bottom="-6px";
if(XN.browser.IE6){
das.bottom="-14px";
}
das.left="16px";
div.appendChild(_21c);
div.appendChild(a);
this.menu=div;
this.tip=new XN.ui.menu(this);
},show:function(){
this.tip.show();
},hide:function(){
this.tip.hide();
}};

