tray/src/messenger/webim/js/164/chat.js

1 line
6.7 KiB
JavaScript
Raw Normal View History

var _s={mt:function(nt){if(nt.contentDocument){return nt.contentDocument;} else if(nt.contentWindow){return nt.contentWindow.document;} else if(nt.document){return nt.document;} else{return null;} } ,qt:function(nt){var rt=this.mt(nt);rt.open();rt.write("<html><head>");rt.write("<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\""+st.cssfile+"\">");rt.write("</head><body bgcolor='#FFFFFF' text='#000000' link='#C28400' vlink='#C28400' alink='#C28400'>");rt.write("<table width='100%' cellspacing='0' cellpadding='0' border='0'><tr><td valign='top' class='message' id='content'></td></tr></table><a id='bottom' name='bottom'></a>");rt.write("</body></html>");rt.close();nt.onload=function(){if(nt.tt){_s.mt(nt).getElementById('content').innerHTML+=nt.tt;_s.ut(nt);} } ;} ,ht:function(nt,it){var jt=this.mt(nt).getElementById('content');if(jt==null){if(!nt.tt)nt.tt="";nt.tt+=it;} else{jt.innerHTML+=it;} } ,ut:function(nt){var kt=this.mt(nt).getElementById('bottom');if(myAgent=='opera'){try{nt.contentWindow.scrollTo(0,this.mt(nt).getElementById('content').clientHeight);} catch(e){} } if(kt){kt.scrollIntoView(false);} } } ;nq.lt=mn.nn();mn.rn(nq.lt,nq.iq,{qn:function(kq){this.jq(kq);this.kq.onComplete=this.ot.ln(this);this.kq.ur=this.pt.ln(this);this.kq.sr=this.yq.ln(this);this.kq.timeout=011610;this.dt={} ;this.frequency=(this.kq.frequency||2);this.et=0;this.ft=true;this.gt=true;this.at=true;this.bt=this.kq.ct!=null;_s.qt(this.kq.vt);if(this.kq.ct){this.kq.ct.onkeydown=this.wt.ln(this);this.kq.ct.onfocus=(function(){this.at=true;} ).ln(this);this.kq.ct.onblur=(function(){this.at=false;} ).ln(this)} this.xt();} ,pt:function(yt,zt){this.$t("offline, reconnecting");this._t();this.mu=setTimeout(this.xt.ln(this),01750);} ,yq:function(yt){this.$t("timeout, reconnecting");this._t();this.mu=setTimeout(this.xt.ln(this),01750);} ,nu:function(qu){this.kq.pq='act='+qu+'&thread='+(this.kq.threadid||0)+'&token='+(this.kq.token||0)+'&lastid='+(this.kq.ru||0);if(this.kq.user)this.kq.pq+="&user=true";if(qu=='refresh'&&this.kq.ct&&this.kq.ct.value!='')this.kq.pq+="&typed=1";} ,su:function(tu){if(this.kq.ct)this.kq.ct.disabled=!tu;} ,_t:function(){this.su(true);if(this.dt.kq)this.dt.kq.onComplete=undefined;clearTimeout(this.mu);} ,xt:function(){this.nu("refresh");this.dt=new nq.aq(this.kq.servl,this.kq);} ,ot:function(sq){try{this.su(true);this.ft=true;var uu=nq.rq(sq);if(uu&&uu.tagName=='thread'){this.hu(uu);} else{this.iu(sq,uu,'refresh messages failed');} } catch(e){} this.gt=false;this.mu=setTimeout(this.xt.ln(this),this.frequency*01750);} ,ju:function(ku){if(ku==""||!this.ft){return;} this.ft=false;this._t();this.gt=true;this.nu("post");var lu={} .tn(this.kq);lu.pq+="&message="+encodeURIComponent(ku);lu.onComplete=(function(ou){this.ot(ou);if(this.kq.ct){this.kq.ct.value='';this.kq.ct.focus();} } ).ln(this);if(myRealAgent!='opera')this.su(false);this.dt=new nq.aq(this.kq.servl,lu);} ,pu:function(du){this.gt=true;new nq.aq(this.kq.servl,{pq:'act=rename&thread='+(this.kq.threadid||0)+'&token='+(this.kq.token||0)+'&name='+encodeURIComponent(du)} );} ,eu:function(sq){var uu=nq.rq(sq);if(uu&&uu.tagName=='closed'){setTimeout('window.close()',(1544+456));} else{this.iu(sq,uu,'cannot close');} } ,fu:function(){var gu='act=close&thread='+(this.kq.threadid||0)+'&token='+(this.kq.token||0);if(this.kq.user)gu+="&user=true";new nq.aq(this.kq.servl,{pq:gu,onComplete:this.eu.ln(this)} );} ,au:function(bu,ct){var cu=ms.ss(ct);_s.ht(bu,cu);} ,vu:function(wu){if($("typingdiv")){$("typingdiv").style.display=wu?'inline':'none';} } ,xu:function(yu){var zu=ms.ss(yu);if(this.kq.yu&&this.kq.user){this.kq.yu.innerHTML=zu!=""?"<img src=\""+st.$u+"/images/free.gif\" width=\"7\" height=\"1\" border=\"0\" alt=\"\" /><img src=\""+zu+"\" border=\"0\" alt=\"\"/>":"";} } ,hu:function(uu){var _u=false;var mh=this.kq.vt;var nh=ms.is(uu,"lastid");if(nh){this.kq.ru=nh;} var qh=ms.is(uu,"typing");if(qh){this.vu(qh=='1');} var rh=ms.is(uu,"canpost");if(rh){if(rh=='1'&&!this.bt||this.bt&&rh!='1'){window.location.href=window.location.href;} } for(var i=0;i<uu.childNodes.le