mirror of
https://github.com/Mibew/i18n.git
synced 2025-01-24 06:10:28 +03:00
6f5074deba
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@483 c66351dc-e62f-0410-b875-e3a5c0b9693f
1 line
6.9 KiB
JavaScript
1 line
6.9 KiB
JavaScript
sq.wh=mn.nn();mn.sn(sq.wh,sq.lq,{qn:function(pq){this.oq(pq);this.pq.onComplete=this.ft.on(this);this.pq.jr=this.gt.on(this);this.pq.hr=this._q.on(this);this.pq.timeout=(3453+1547);this.frequency=(this.pq.frequency||2);this.at={} ;this._t();} ,gt:function(mu,nu){if(this.pq.ou)this.pq.ou("offline, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),(756+244));} ,_q:function(mu){if(this.pq.ou)this.pq.ou("timeout, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),01750);} ,ru:function(){if(this.at.pq)this.at.pq.onComplete=undefined;clearTimeout(this.su);} ,_t:function(){if(this.pq.xh)this.pq.fq=(this.pq.xh)();this.at=new sq.vq(this.pq.url,this.pq);} ,ft:function(fu){try{var ku=sq.uq(fu);if(ku){(this.pq.lu||sq.kq)(ku);} else{if(this.pq.ou)this.pq.ou("reconnecting");} } catch(e){} this.su=setTimeout(this._t.on(this),this.frequency*(980+20));} } );var yh={zh:function(link,title,$h,_h,width,height,mi){return'<a href="'+link+'"'+(mi!=null?' class="'+mi+'"':'')+' target="_blank" title="'+title+'" onclick="this.newWindow = window.open(\''+link+'\', \''+$h+'\', \'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width='+width+',height='+height+',resizable=1\');this.newWindow.focus();this.newWindow.opener=window;return false;">'+_h+'</a>';} ,ni:function(content){return'<table class="inner"><tr>'+content+'</tr></table>';} ,qi:function(ri,si,id,ti,ui,hi,yt,ii){var ji=2;var link=si+"?thread="+id;var ki='<td>';if(ui||ti){ki+=yh.zh((ii||!ti)?link:link+"&viewonly=true",localized[ui?0:1],"ImCenter"+id,ri,01200,0740,null);} else{ki+='<a href="#">'+ri+'</a>';} ki+='</td>';if(ui){ki+='<td class="icon">';ki+=yh.zh(link,localized[0],"ImCenter"+id,'<img src="'+qh+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',0x280,(412+68),null);ki+='</td>';ji++;} if(ti){ki+='<td class="icon">';ki+=yh.zh(link+"&viewonly=true",localized[1],"ImCenter"+id,'<img src="'+qh+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',(509+131),0x1e0,null);ki+='</td>';ji++;} if(yt!=""){ki+='</tr><tr><td class="firstmessage" colspan="'+ji+'"><a href="javascript:void(0)" title="'+yt+'" onclick="alert(this.title);return false;">';ki+=yt.length>0x1e?yt.substring(0,(18+12))+'...':yt;ki+='</a></td>';} return yh.ni(ki);} ,li:function(id,oi){return'<td class="icon">'+yh.zh(qh+'/operator/ban.php?'+(oi?'id='+oi:'thread='+id),localized[2],"ban"+id,'<img src="'+qh+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',0x2d0,0740,null)+'</td>';} } ;sq.pi=mn.nn();mn.sn(sq.pi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.xh=this.xh.on(this);this.pq.ou=this.ou.on(this);this.pq.lu=this.lu.on(this);this.pq.di=0;this.ei=new Object();this.fi=0;this.t=this.pq.gi;this.ai=new sq.wh(this.pq);} ,xh:function(){return"company="+this.pq.company+"&since="+this.pq.di;} ,qu:function(du){this.pq.status.innerHTML=du;} ,ou:function(s){this.qu(s);} ,bi:function(ih){var id,ci,vi,ti=false,ui=false,wi=false,hi=null,oi=null;for(var i=0;i<ih.attributes.length;i++){var xi=ih.attributes[i];if(xi.nodeName=="id")id=xi.nodeValue;else if(xi.nodeName=="stateid")ci=xi.nodeValue;else if(xi.nodeName=="state")vi=xi.nodeValue;else if(xi.nodeName=="canopen")ui=true;else if(xi.nodeName=="canview")ti=true;else if(xi.nodeName=="canban")wi=true;else if(xi.nodeName=="ban")hi=xi.nodeValue;else if(xi.nodeName=="banid")oi=xi.nodeValue;} function yi(ds,zi,id,$i){var ws=ls.fs(id,zi,ds);if(ws)ws.innerHTML=$i;} var zi=ls.os("thr"+id,this.t);if(ci=="closed"){if(zi){this.t.deleteRow(zi.rowIndex);} this.ei[id]=null;return;} var _i=qs.rs(ih,"name");var mj=qs.rs(ih,"addr");var nj=qs.rs(ih,"time");var qj=qs.rs(ih,"agent");var rj=qs.rs(ih,"modified");var yt=qs.rs(ih,"message");var sj='<td>'+qs.rs(ih,"useragent")+'</td>';if(hi!=null){sj='<td>'+qs.rs(ih,"reason")+'</td>';} if(wi){sj+=yh.li(id,oi);} sj=yh.ni(sj);var tj=ls.os("t"+ci,this.t);var uj=ls.os("t"+ci+"end",this.t);if(zi!=null&&(zi.rowIndex<=tj.rowIndex||zi.rowIndex>=uj.rowIndex)){this.t.deleteRow(zi.rowIndex);this.ei[id]=null;zi=null;} if(zi==null){zi=this.t.insertRow(tj.rowIndex+1);zi.className=(hi=="blocked"&&ci!="chat")?"ban":"in"+ci;zi.id="thr"+id;this.ei[id]=new Array(nj,rj,ci);ls.insertCell(zi,"name","visitor",null,null,yh.qi(_i,this.pq.agentservl,id,ti,ui,hi,yt,ci!='chat'));ls.insertCell(zi,"contid","visitor","center",null,mj);ls.insertCell(zi,"state","visitor","center",null,vi);ls.insertCell(zi,"op","visitor","center",null,qj);ls.insertCell(zi,"time","visitor","center",null,this.hj(nj));ls.insertCell(zi,"wait","visitor","center",null,(ci!='chat'?this.hj(rj):'-'));ls.insertCell(zi,"etc","visitor","center",null,sj);if(ci=='wait'||ci=='prio')return true;} else{this.ei[id]=new Array(nj,rj,ci);zi.className=(hi=="blocked"&&ci!="chat")?"ban":"in"+ci;yi(this.t,zi,"name",yh.qi(_i,this.pq.agentservl,id,ti,ui,hi,yt,ci!='chat'));yi(this.t,zi,"contid",mj);yi(this.t,zi,"state",vi);yi(this.t,zi,"op",qj);yi(this.t,zi,"time",this.hj(nj));yi(this.t,zi,"wait",(ci!='chat'?this.hj(rj):'-'));yi(this.t,zi,"etc",sj);} return false;} ,ij:function(){function jj(t,id){var tj=$(id);var uj=$(id+"end");if(tj==null||uj==null){return false;} return tj.rowIndex+1<uj.rowIndex;} var kj=$("statustd");if(kj){var lj=jj(this.t,"twait")||jj(this.t,"tprio")||jj(this.t,"tchat");kj.innerHTML=lj?"":this.pq.noclients;kj.height=lj?(4+1):(19+11);} } ,hj:function(oj){var pj=Math.floor(((new Date()).getTime()-oj-this.fi)/01750);var dj=Math.floor(pj/(49+11));var ej="";pj=pj%0x3c;if(pj<(8+2))pj="0"+pj;if(dj>=(40+20)){var fj=Math.floor(dj/(40+20));dj=dj%0x3c;if(dj<012)dj="0"+dj;ej=fj+":";} return ej+dj+":"+pj;} ,gj:function(){for(var i in this.ei){if(this.ei[i]!=null){var value=this.ei[i];var zi=ls.os("thr"+i,this.t);if(zi!=null){function yi(ds,zi,id,$i){var ws=ls.fs(id,zi,ds);if(ws)ws.innerHTML=$i;} yi(this.t,zi,"time",this.hj(value[0]));yi(this.t,zi,"wait",(value[2]!='chat'?this.hj(value[1]):'-'));} } } } ,lu:function(aj){var bj=false;if(aj.tagName=='threads'){var cj=qs.ks(aj,"time");var vj=qs.ks(aj,"revision");if(cj)this.fi=(new Date()).getTime()-cj;if(vj)this.pq.di=vj;for(var i=0;i<aj.childNodes.length;i++){var ih=aj.childNodes[i];if(ih.tagName=='thread')if(this.bi(ih))bj=true;} this.ij();this.gj();this.qu("Up to date");if(bj){$s(qh+'/sounds/new_user.wav');window.focus();if(updaterOptions.showpopup){alert(localized[(3+2)]);} } } else if(aj.tagName=='error'){this.qu(qs.rs(aj,"descr"));} else{this.qu("reconnecting");} } } );function wj(){if($("sidebar")&&$("wcontent")&&$("togglemenu")){if($("wcontent").className=="contentnomenu"){$("sidebar").style.display="block";$("wcontent").className="contentinner";$("togglemenu").innerHTML=localized[(1+3)];} else{$("sidebar").style.display="none";$("wcontent").className="contentnomenu";$("togglemenu").innerHTML=localized[3];} } } er.lr({'#togglemenu':function(ch){ch.onclick=function(){wj();} ;} } );var qh="";kr.lr(window,'onload',function(){qh=updaterOptions.wroot;new sq.pi(({gi:$("threadlist"),status:$("connstatus")} ).un(updaterOptions||{} ));if(!updaterOptions.havemenu){wj();} } ); |