From 7de97c2a683404072ea0a47b08635c1e4cad8dfc Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Mon, 21 Feb 2011 01:02:39 +0100 Subject: [PATCH] apply patch by Andrew Armstrong: available operators list (revised); remove odd eval code in common.js; fix obfuscation --- src/messenger/compile_js | 2 +- src/messenger/webim/default.css | 7 ++ src/messenger/webim/images/opaway.gif | Bin 0 -> 3480 bytes src/messenger/webim/images/oponline.gif | Bin 0 -> 3481 bytes src/messenger/webim/js/163/brws.js | 1 - src/messenger/webim/js/163/chat.js | 1 - src/messenger/webim/js/163/common.js | 1 - src/messenger/webim/js/163/users.js | 1 - src/messenger/webim/js/164/brws.js | 1 + src/messenger/webim/js/164/chat.js | 1 + src/messenger/webim/js/164/common.js | 1 + src/messenger/webim/js/{163 => 164}/ie.js | 0 src/messenger/webim/js/{163 => 164}/locale.js | 0 src/messenger/webim/js/{163 => 164}/update.js | 0 src/messenger/webim/js/164/users.js | 1 + src/messenger/webim/js/source/JSO.java | 2 +- src/messenger/webim/js/source/build.xml | 2 +- src/messenger/webim/js/source/common.js | 20 +---- src/messenger/webim/js/source/users.js | 77 +++++++++++++----- src/messenger/webim/libs/common.php | 3 +- src/messenger/webim/libs/operator.php | 25 ++++++ src/messenger/webim/locales/en/properties | 2 + src/messenger/webim/locales/ru/properties | 2 + src/messenger/webim/operator/features.php | 2 +- src/messenger/webim/operator/operators.php | 22 +---- src/messenger/webim/operator/update.php | 26 +++++- src/messenger/webim/operator/users.php | 1 + src/messenger/webim/view/agents.php | 6 +- src/messenger/webim/view/features.php | 9 ++ src/messenger/webim/view/pending_users.php | 7 +- 30 files changed, 148 insertions(+), 75 deletions(-) create mode 100644 src/messenger/webim/images/opaway.gif create mode 100644 src/messenger/webim/images/oponline.gif delete mode 100644 src/messenger/webim/js/163/brws.js delete mode 100644 src/messenger/webim/js/163/chat.js delete mode 100644 src/messenger/webim/js/163/common.js delete mode 100644 src/messenger/webim/js/163/users.js create mode 100644 src/messenger/webim/js/164/brws.js create mode 100644 src/messenger/webim/js/164/chat.js create mode 100644 src/messenger/webim/js/164/common.js rename src/messenger/webim/js/{163 => 164}/ie.js (100%) rename src/messenger/webim/js/{163 => 164}/locale.js (100%) rename src/messenger/webim/js/{163 => 164}/update.js (100%) create mode 100644 src/messenger/webim/js/164/users.js diff --git a/src/messenger/compile_js b/src/messenger/compile_js index 459de7d1..79b63a56 100755 --- a/src/messenger/compile_js +++ b/src/messenger/compile_js @@ -1,5 +1,5 @@ #!/bin/sh cd webim/js/source -/usr/local/ant/bin/ant +ant rm -rf bin diff --git a/src/messenger/webim/default.css b/src/messenger/webim/default.css index 237fc974..e4508727 100644 --- a/src/messenger/webim/default.css +++ b/src/messenger/webim/default.css @@ -555,6 +555,13 @@ table.awaiting td.visitor { text-decoration: underline; } +/* online operators */ + +#onlineoperators { + padding-right: 10px; + float: right; +} + /* search */ #searchtext { diff --git a/src/messenger/webim/images/opaway.gif b/src/messenger/webim/images/opaway.gif new file mode 100644 index 0000000000000000000000000000000000000000..e905691806859ad59efecf5a67cf5141a20fcaaf GIT binary patch literal 3480 zcmbW42UHVT7l7YP8Y$F--a>EE1p9jh>PPTB;+O~<)*Om^71wd<4e;+O9fF) zYnC*Jh7J_l4_1TGV)fB7(pZ`1`#Qz>2BZ1*W%Fm&AOIjH0Eq)g20-%iko5p51;`F# zWG6r>HIQ0>)R`mo06C?8RgTdAN9(o0(exK=JhD@l#L^FB0G3gno(Vw%TcL;!Yw?!=gH;p|5=yVbN4 zgWq-Eoxkf+8vtO;qRH9zT^CyoK<6d^6z+f5Y3~C-G9Q4B>pwh@oM^`+2!&~Orl#51 z*(N+L+eDPnZ}N`@-z@(cept^$wBEPm(OtQ5tjuH~U6fUJYI15OBA{oavDjR?@qh2* zfAaiG#~<@+&Hd)%SV?AL-!evACDHC&*2GqseC$*|5r8sKiz(aL4;p-HVV|n zc|coX0;I0f0Or?0fJLZefQj0R4nf~4=SvI&qPH(xed_DhM;RUe(*8#Sm!VxagBMR1 z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L5^kM4P&`G-gf`pY3YjiWzJ==m8RbYXA1jm)ff&CP(E`^nx%RVdmj zG0~P$M>Y){$j24p<9eGIb~Q6;?d=Skd(C)dIZZ|R=1fClc`VJ_#|I}VpPx^J3w=oB Qtv*EJc9$I$OlM&KZ%3Vs00000 literal 0 HcmV?d00001 diff --git a/src/messenger/webim/images/oponline.gif b/src/messenger/webim/images/oponline.gif new file mode 100644 index 0000000000000000000000000000000000000000..ea245356e451d1cece0a1ebcca6452606544de94 GIT binary patch literal 3481 zcmbW4XH-+!7J$#aX#^5l0@4Y+NmU>;DWM8TuYwSg5JCwMx)l*oih_tp69usV3YMXW z4G~0?K~Vt}bwC~>>Nq%x4K?pZ)>7VEYi8bh`^R42*=O&2_TBrOyUulSbEaC*34j1b zz;`JEpcH@_0QkVVT;KYnvgcXzHK(lt5NQesYo9rsBkO zUEAyCzJ&|dK3u&1=`x?sU(9+@t9(M^0k8%t{4Z`any-t4i?NZh2>=9F4-PjG76%}K zo61A%l;Dt13T_C%01vRh7yvpWCCSsz*o&4eT_rMo)chTjo z&-boD(t|&3KZAeT66*n=&LhPs`Du%)1fXL(05T7M+SCsLAeIY2`>iD}BrVu6F{!CZ zmWGBI85sr~7Q;YL(I4`U4nI8q8kVeQAXx85@hFb0XnIO>i6e_Kt%IFb!UUIq)7VKoEq3 zh!6>qg_I!;NDnfBsL(3N3G#q^p%5q%VnbXg4cZ88g9@Qis0yls8lltBIp_*B01ZR@ z2hb!m3;hXwhEXs9Cc}!bCTs{(VSCse_J_k^Hk=HvhjZcGa0OfspMcxpEAUNt1fGCj z!t*GA5xb)ouEcTp3lSEx^DESiL-p!LyK zXjgOqnt@J6Z$=lPtI)^M?dV?gUGyY+4*d;7#3*3&FqRlMOfZIx$-v}c$}vYVZJ0jH z2xc1d9*f0FW3{m6SXXQaHWs@9TZBD;ZN+wDhp|)Gc^nQWi_^o|;Jk2jTq-UPSBX1; zyNtVoo5p<<5)o1sG7)kX3KilCcrQE?pM@{RH{iSQ zx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CsFOyy_ zyvqAs;`f@@+OL24!|sp4x!}3!H@r9eKa1YVzCHGC<-4AF@A)V16W%X;DEKJ*@%Sg| zr~c1DpJx^_zTm!8eAW5d_09d;BYpz%*CDu#BR@^Z{Tb_LS6k9=M3K|ESu%F0o4HHM zz)XBI1c?kTk{+vi{pto{wt)PMp2 literal 0 HcmV?d00001 diff --git a/src/messenger/webim/js/163/brws.js b/src/messenger/webim/js/163/brws.js deleted file mode 100644 index 4121bfdc..00000000 --- a/src/messenger/webim/js/163/brws.js +++ /dev/null @@ -1 +0,0 @@ -var myAgent="";var $j=0;var myRealAgent="";function _j(){var mk=["opera","msie","safari","firefox","netscape","mozilla"];var tj=navigator.userAgent.toLowerCase();for(var i=0;i");ht.write("");ht.write("");ht.write("
");ht.write("");ht.close();tt.onload=function(){if(tt.jt){rt.st(tt).getElementById('content').innerHTML+=tt.jt;rt.kt(tt);} } ;} ,lt:function(tt,ot){var pt=this.st(tt).getElementById('content');if(pt==null){if(!tt.jt)tt.jt="";tt.jt+=ot;} else{pt.innerHTML+=ot;} } ,kt:function(tt){var dt=this.st(tt).getElementById('bottom');if(myAgent=='opera'){try{tt.contentWindow.scrollTo(0,this.st(tt).getElementById('content').clientHeight);} catch(e){} } if(dt){dt.scrollIntoView(false);} } } ;sq.et=mn.nn();mn.sn(sq.et,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=0x1388;this.at={} ;this.frequency=(this.pq.frequency||2);this.bt=0;this.ct=true;this.vt=true;this.wt=true;this.xt=this.pq.yt!=null;rt.ut(this.pq.zt);if(this.pq.yt){this.pq.yt.onkeydown=this.$t.on(this);this.pq.yt.onfocus=(function(){this.wt=true;} ).on(this);this.pq.yt.onblur=(function(){this.wt=false;} ).on(this)} this._t();} ,gt:function(mu,nu){this.qu("offline, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),01750);} ,_q:function(mu){this.qu("timeout, reconnecting");this.ru();this.su=setTimeout(this._t.on(this),(620+380));} ,tu:function(uu){this.pq.fq='act='+uu+'&thread='+(this.pq.threadid||0)+'&token='+(this.pq.token||0)+'&lastid='+(this.pq.hu||0);if(this.pq.user)this.pq.fq+="&user=true";if(uu=='refresh'&&this.pq.yt&&this.pq.yt.value!='')this.pq.fq+="&typed=1";} ,iu:function(ju){if(this.pq.yt)this.pq.yt.disabled=!ju;} ,ru:function(){this.iu(true);if(this.at.pq)this.at.pq.onComplete=undefined;clearTimeout(this.su);} ,_t:function(){this.tu("refresh");this.at=new sq.vq(this.pq.servl,this.pq);} ,ft:function(hq){try{this.iu(true);this.ct=true;var ku=sq.uq(hq);if(ku&&ku.tagName=='thread'){this.lu(ku);} else{this.ou(hq,ku,'refresh messages failed');} } catch(e){} this.vt=false;this.su=setTimeout(this._t.on(this),this.frequency*(775+225));} ,pu:function(du){if(du==""||!this.ct){return;} this.ct=false;this.ru();this.vt=true;this.tu("post");var eu={} .un(this.pq);eu.fq+="&message="+encodeURIComponent(du);eu.onComplete=(function(fu){this.ft(fu);if(this.pq.yt){this.pq.yt.value='';this.pq.yt.focus();} } ).on(this);if(myRealAgent!='opera')this.iu(false);this.at=new sq.vq(this.pq.servl,eu);} ,gu:function(au){this.vt=true;new sq.vq(this.pq.servl,{fq:'act=rename&thread='+(this.pq.threadid||0)+'&token='+(this.pq.token||0)+'&name='+encodeURIComponent(au)} );} ,bu:function(hq){var ku=sq.uq(hq);if(ku&&ku.tagName=='closed'){setTimeout('window.close()',(1224+776));} else{this.ou(hq,ku,'cannot close');} } ,cu:function(){var vu='act=close&thread='+(this.pq.threadid||0)+'&token='+(this.pq.token||0);if(this.pq.user)vu+="&user=true";new sq.vq(this.pq.servl,{fq:vu,onComplete:this.bu.on(this)} );} ,wu:function(xu,yt){var yu=qs.us(yt);rt.lt(xu,yu);} ,zu:function($u){if($("typingdiv")){$("typingdiv").style.display=$u?'inline':'none';} } ,_u:function(mh){var nh=qs.us(mh);if(this.pq.mh&&this.pq.user){this.pq.mh.innerHTML=nh!=""?"\"\"\"\"/":"";} } ,lu:function(ku){var rh=false;var sh=this.pq.zt;var th=qs.ks(ku,"lastid");if(th){this.pq.hu=th;} var uh=qs.ks(ku,"typing");if(uh){this.zu(uh=='1');} var hh=qs.ks(ku,"canpost");if(hh){if(hh=='1'&&!this.xt||this.xt&&hh!='1'){window.location.href=window.location.href;} } for(var i=0;i=0){var ju="updated";if(this.bt>0){var jh=((new Date()).getTime()-this.bt)/(892+108);ju=ju+", "+jh+" secs";if(jh>012){alert(ju);} } this.bt=(new Date()).getTime();this.qu(ju);} else{this.kh();} if(rh){rt.kt(this.pq.zt);if(!this.vt){var lh=$('soundimg');if(lh==null||lh.className.match(new RegExp("\\bisound\\b"))){$s(it.qh+'/sounds/new_message.wav');} } if(!this.wt){window.focus();} } } ,oh:function(ph,dh){return((dh==(12+1)&&(ph||this.pq.ignorectrl))||(dh==012));} ,$t:function(k){if(k){eh=k.ctrlKey;k=k.which;} else{k=event.keyCode;eh=event.ctrlKey;} if(this.pq.yt&&this.oh(eh,k)){var fh=this.pq.yt.value;if(this.pq.ignorectrl){fh=fh.replace(/[\r\n]+$/,'');} this.pu(fh);return false;} return true;} ,ou:function(hq,ku,gh){if(ku&&ku.tagName=='error'){this.qu(qs.rs(ku,"descr"));} else{this.qu("reconnecting");} } ,ah:function(k){if($("engineinfo")){$("engineinfo").style.display='inline';$("engineinfo").innerHTML=k;} } ,qu:function(k){if(this.bh)clearTimeout(this.bh);this.ah(k);this.bh=setTimeout(this.kh.on(this),07640);} ,kh:function(){$("engineinfo").style.display='none';} } );var it={ch:{} ,vh:function(){it.ch.gu($('uname').value);$('changename1').style.display='none';$('changename2').style.display='inline';$('unamelink').innerHTML=nt($('uname').value);} ,wh:function(){$('changename1').style.display='inline';$('changename2').style.display='none';} } ;er.lr({'#postmessage a':function(xh){xh.onclick=function(){var yt=$('msgwnd');if(yt)it.ch.pu(yt.value);} ;} ,'select#predefined':function(xh){xh.onchange=function(){var yt=$('msgwnd');if(this.selectedIndex!=0){yt.value=this.options[this.selectedIndex].innerText||this.options[this.selectedIndex].innerHTML;} this.selectedIndex=0;yt.focus();} ;} ,'div#changename2 a':function(xh){xh.onclick=function(){it.wh();return false;} ;} ,'div#changename1 a':function(xh){xh.onclick=function(){it.vh();return false;} ;} ,'div#changename1 input#uname':function(xh){xh.onkeydown=function(e){var or=e||event;if(or.keyCode==015){it.vh();} } ;} ,'a#refresh':function(xh){xh.onclick=function(){it.ch.ru();it.ch._t();} ;} ,'a#togglesound':function(xh){xh.onclick=function(){var lh=$('soundimg');if(!lh){return;} if(lh.className.match(new RegExp("\\bisound\\b"))){lh.className="tplimage inosound";} else{lh.className="tplimage isound";} var yh=$('msgwnd');if(yh)yh.focus();} ;} ,'a.closethread':function(xh){xh.onclick=function(){it.ch.cu();} ;} } );kr.lr(window,'onload',function(){it.qh=threadParams.wroot;it.cssfile=threadParams.cssfile;it.ch=new sq.et(({ignorectrl:-1,zt:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),mh:$("avatarwnd"),yt:$("msgwnd")} ).un(threadParams||{} ));} ); \ No newline at end of file diff --git a/src/messenger/webim/js/163/common.js b/src/messenger/webim/js/163/common.js deleted file mode 100644 index c17803e6..00000000 --- a/src/messenger/webim/js/163/common.js +++ /dev/null @@ -1 +0,0 @@ -var mn={nn:function(){return function(){this.qn.rn(this,arguments);} ;} ,sn:function(tn,parent,body){Object.un(Object.un(tn.prototype,parent.prototype),body);} } ;Object.un=function(hn,jn){for(kn in jn){hn[kn]=jn[kn];} return hn;} ;Object.prototype.un=function(ln){return Object.un.rn(this,[this,ln]);} ;Function.prototype.on=function(ln){var pn=this;return function(){return pn.rn(ln,arguments);} } ;Function.prototype.dn=function(ln){var pn=this;return function(event){pn.call(ln,event||window.event);} } ;Number.prototype.en=function(){var fn=this.toString((11+5));if(this<(13+3))return'0'+fn;return fn;} ;var gn={an:function(){var returnValue;for(var i=0;i=(161+39)&&hq.status<(247+53)){var iq=hq.responseXML;if(iq&&iq.documentElement)return iq.documentElement;} return null;} ,jq:function(hq){return hq.statusText||"connection error N"+hq.status;} ,kq:function(){} } ;sq.lq=function(){} ;sq.lq.prototype={oq:function(pq){this.pq={dq:'post',eq:true,fq:''} .un(pq||{} );} ,gq:function(){try{return this.aq.status||0;} catch(e){return 0} } ,bq:function(){var status=this.gq();return!status||(status>=0310&&status<0x12c);} ,cq:function(){return!this.bq();} } ;sq.vq=mn.nn();sq.vq.wq=['Uninitialized','Loading','Loaded','Interactive','Complete'];mn.sn(sq.vq,sq.lq,{qn:function(url,pq){this.aq=sq.tq();this.oq(pq);this.xq={} ;this.yq=false;this.zq(url);} ,zq:function(url){var fq=this.pq.fq||'';if(fq.length>0)fq+='&_=';try{if(this.pq.dq=='get'&&fq.length>0)url+='?'+fq;this.aq.open(this.pq.dq.toUpperCase(),url,this.pq.eq);if(this.pq.eq){this.aq.onreadystatechange=this.$q.on(this);if(this.pq.timeout){this.xq=setTimeout(this._q.on(this),this.pq.timeout);} } this.mr();var nr=this.pq.qr?this.pq.qr:fq;this.aq.send(this.pq.dq=='post'?nr:null);} catch(e){this.rr(e);} } ,mr:function(){var sr=['X-Requested-With','XMLHttpRequest'];if(this.pq.dq=='post'){sr.$n('Content-type','application/x-www-form-urlencoded');if(this.aq.overrideMimeType&&(navigator.userAgent.match("/Gecko\/(\d{4} )/")||[0,03725])[1]<(1793+212))sr.$n('Connection','close');} if(this.pq.sr)sr.$n.rn(sr,this.pq.sr);for(var i=0;i-1){var yr=token.split('#');var zr=yr[0];var id=yr[1];var element=document.getElementById(id);if(element==null||zr&&element.nodeName.toLowerCase()!=zr){return new Array();} xr=new Array(element);continue;} if(token.indexOf('.')>-1){var yr=token.split('.');var zr=yr[0];var $r=yr[1];if(!zr){zr='*';} var _r=new Array;var ms=0;for(var h=0;h=0)ys="audio/mpeg";} return ys;} function $s(_s){var mt=document.getElementById("player");if(mt){mt.parentNode.removeChild(mt);} mt=document.body.appendChild(document.createElement("div"));var zs=navigator.userAgent.toLowerCase();if(zs.indexOf('safari')==-1&&zs.indexOf('windows')!=-1){mt.innerHTML='';} else{mt.innerHTML='
';} } function nt(qt){return qt.replace('&','&').replace('<','<').replace('>','>').replace('"','"');} \ No newline at end of file diff --git a/src/messenger/webim/js/163/users.js b/src/messenger/webim/js/163/users.js deleted file mode 100644 index b209f5e6..00000000 --- a/src/messenger/webim/js/163/users.js +++ /dev/null @@ -1 +0,0 @@ -sq.zh=mn.nn();mn.sn(sq.zh,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=(4693+307);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),(832+168));} ,_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.$h)this.pq.fq=(this.pq.$h)();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*(704+296));} } );var _h={mi:function(link,title,ni,qi,width,height,ri){return''+qi+'';} ,si:function(content){return''+content+'
';} ,ti:function(ui,hi,id,ii,ji,ki,yt,li){var oi=2;var link=hi+"?thread="+id;var pi='';if(ji||ii){pi+=_h.mi((li||!ii)?link:link+"&viewonly=true",localized[ji?0:1],"ImCenter"+id,ui,(501+139),(295+185),null);} else{pi+=''+ui+'';} pi+='';if(ji){pi+='';pi+=_h.mi(link,localized[0],"ImCenter"+id,''+localized[0]+'',01200,(437+43),null);pi+='';oi++;} if(ii){pi+='';pi+=_h.mi(link+"&viewonly=true",localized[1],"ImCenter"+id,''+localized[1]+'',(485+155),(375+105),null);pi+='';oi++;} if(yt!=""){pi+='';pi+=yt.length>036?yt.substring(0,(19+11))+'...':yt;pi+='';} return _h.si(pi);} ,di:function(id,ei){return''+_h.mi(qh+'/operator/ban.php?'+(ei?'id='+ei:'thread='+id),localized[2],"ban"+id,''+localized[2]+'',01320,(417+63),null)+'';} } ;sq.fi=mn.nn();mn.sn(sq.fi,sq.lq,{qn:function(pq){this.oq(pq);this.pq.$h=this.$h.on(this);this.pq.ou=this.ou.on(this);this.pq.lu=this.lu.on(this);this.pq.gi=0;this.ai=new Object();this.bi=0;this.t=this.pq.ci;this.vi=new sq.zh(this.pq);} ,$h:function(){return"since="+this.pq.gi+"&status="+this.pq.istatus;} ,qu:function(du){this.pq.status.innerHTML=du;} ,ou:function(s){this.qu(s);} ,wi:function(ih){var id,xi,yi,ii=false,ji=false,zi=false,ki=null,ei=null;for(var i=0;i';if(ki!=null){hj=''+qs.rs(ih,"reason")+'';} if(zi){hj+=_h.di(id,ei);} hj=_h.si(hj);var ij=ls.os("t"+xi,this.t);var jj=ls.os("t"+xi+"end",this.t);if(mj!=null&&(mj.rowIndex<=ij.rowIndex||mj.rowIndex>=jj.rowIndex)){this.t.deleteRow(mj.rowIndex);this.ai[id]=null;mj=null;} if(mj==null){mj=this.t.insertRow(ij.rowIndex+1);mj.className=(ki=="blocked"&&xi!="chat")?"ban":"in"+xi;mj.id="thr"+id;this.ai[id]=new Array(sj,uj,xi);ls.insertCell(mj,"name","visitor",null,null,_h.ti(qj,this.pq.agentservl,id,ii,ji,ki,yt,xi!='chat'));ls.insertCell(mj,"contid","visitor","center",null,rj);ls.insertCell(mj,"state","visitor","center",null,yi);ls.insertCell(mj,"op","visitor","center",null,tj);ls.insertCell(mj,"time","visitor","center",null,this.kj(sj));ls.insertCell(mj,"wait","visitor","center",null,(xi!='chat'?this.kj(uj):'-'));ls.insertCell(mj,"etc","visitor","center",null,hj);if(xi=='wait'||xi=='prio')return true;} else{this.ai[id]=new Array(sj,uj,xi);mj.className=(ki=="blocked"&&xi!="chat")?"ban":"in"+xi;_i(this.t,mj,"name",_h.ti(qj,this.pq.agentservl,id,ii,ji,ki,yt,xi!='chat'));_i(this.t,mj,"contid",rj);_i(this.t,mj,"state",yi);_i(this.t,mj,"op",tj);_i(this.t,mj,"time",this.kj(sj));_i(this.t,mj,"wait",(xi!='chat'?this.kj(uj):'-'));_i(this.t,mj,"etc",hj);} return false;} ,lj:function(){function oj(t,id){var ij=$(id);var jj=$(id+"end");if(ij==null||jj==null){return false;} return ij.rowIndex+1=074){var bj=Math.floor(gj/(46+14));gj=gj%0x3c;if(gj<012)gj="0"+gj;aj=bj+":";} return aj+gj+":"+fj;} ,cj:function(){for(var i in this.ai){if(this.ai[i]!=null){var value=this.ai[i];var mj=ls.os("thr"+i,this.t);if(mj!=null){function _i(ds,mj,id,nj){var ws=ls.fs(id,mj,ds);if(ws)ws.innerHTML=nj;} _i(this.t,mj,"time",this.kj(value[0]));_i(this.t,mj,"wait",(value[2]!='chat'?this.kj(value[1]):'-'));} } } } ,lu:function(vj){var wj=false;if(vj.tagName=='threads'){var xj=qs.ks(vj,"time");var yj=qs.ks(vj,"revision");if(xj)this.bi=(new Date()).getTime()-xj;if(yj)this.pq.gi=yj;for(var i=0;i");tt.write("");tt.write("");tt.write("
");tt.write("");tt.close();rt.onload=function(){if(rt.ht){nt.qt(rt).getElementById('content').innerHTML+=rt.ht;nt.it(rt);} } ;} ,jt:function(rt,kt){var lt=this.qt(rt).getElementById('content');if(lt==null){if(!rt.ht)rt.ht="";rt.ht+=kt;} else{lt.innerHTML+=kt;} } ,it:function(rt){var ot=this.qt(rt).getElementById('bottom');if(myAgent=='opera'){try{rt.contentWindow.scrollTo(0,this.qt(rt).getElementById('content').clientHeight);} catch(e){} } if(ot){ot.scrollIntoView(false);} } } ;nq.pt=mn.nn();mn.rn(nq.pt,nq.iq,{qn:function(kq){this.jq(kq);this.kq.onComplete=this.dt.ln(this);this.kq.ur=this.et.ln(this);this.kq.sr=this.yq.ln(this);this.kq.timeout=(3954+1046);this.ft={} ;this.frequency=(this.kq.frequency||2);this.gt=0;this.at=true;this.bt=true;this.ct=true;this.vt=this.kq.wt!=null;nt.st(this.kq.xt);if(this.kq.wt){this.kq.wt.onkeydown=this.yt.ln(this);this.kq.wt.onfocus=(function(){this.ct=true;} ).ln(this);this.kq.wt.onblur=(function(){this.ct=false;} ).ln(this)} this.zt();} ,et:function($t,_t){this.mu("offline, reconnecting");this.nu();this.qu=setTimeout(this.zt.ln(this),0x3e8);} ,yq:function($t){this.mu("timeout, reconnecting");this.nu();this.qu=setTimeout(this.zt.ln(this),0x3e8);} ,ru:function(su){this.kq.pq='act='+su+'&thread='+(this.kq.threadid||0)+'&token='+(this.kq.token||0)+'&lastid='+(this.kq.tu||0);if(this.kq.user)this.kq.pq+="&user=true";if(su=='refresh'&&this.kq.wt&&this.kq.wt.value!='')this.kq.pq+="&typed=1";} ,uu:function(hu){if(this.kq.wt)this.kq.wt.disabled=!hu;} ,nu:function(){this.uu(true);if(this.ft.kq)this.ft.kq.onComplete=undefined;clearTimeout(this.qu);} ,zt:function(){this.ru("refresh");this.ft=new nq.aq(this.kq.servl,this.kq);} ,dt:function(sq){try{this.uu(true);this.at=true;var iu=nq.rq(sq);if(iu&&iu.tagName=='thread'){this.ju(iu);} else{this.ku(sq,iu,'refresh messages failed');} } catch(e){} this.bt=false;this.qu=setTimeout(this.zt.ln(this),this.frequency*(973+27));} ,lu:function(ou){if(ou==""||!this.at){return;} this.at=false;this.nu();this.bt=true;this.ru("post");var pu={} .tn(this.kq);pu.pq+="&message="+encodeURIComponent(ou);pu.onComplete=(function(du){this.dt(du);if(this.kq.wt){this.kq.wt.value='';this.kq.wt.focus();} } ).ln(this);if(myRealAgent!='opera')this.uu(false);this.ft=new nq.aq(this.kq.servl,pu);} ,eu:function(fu){this.bt=true;new nq.aq(this.kq.servl,{pq:'act=rename&thread='+(this.kq.threadid||0)+'&token='+(this.kq.token||0)+'&name='+encodeURIComponent(fu)} );} ,gu:function(sq){var iu=nq.rq(sq);if(iu&&iu.tagName=='closed'){setTimeout('window.close()',0x7d0);} else{this.ku(sq,iu,'cannot close');} } ,au:function(){var bu='act=close&thread='+(this.kq.threadid||0)+'&token='+(this.kq.token||0);if(this.kq.user)bu+="&user=true";new nq.aq(this.kq.servl,{pq:bu,onComplete:this.gu.ln(this)} );} ,cu:function(vu,wt){var wu=ms.ss(wt);nt.jt(vu,wu);} ,xu:function(yu){if($("typingdiv")){$("typingdiv").style.display=yu?'inline':'none';} } ,zu:function($u){var _u=ms.ss($u);if(this.kq.$u&&this.kq.user){this.kq.$u.innerHTML=_u!=""?"\"\"\"\"/":"";} } ,ju:function(iu){var nh=false;var qh=this.kq.xt;var rh=ms.is(iu,"lastid");if(rh){this.kq.tu=rh;} var sh=ms.is(iu,"typing");if(sh){this.xu(sh=='1');} var th=ms.is(iu,"canpost");if(th){if(th=='1'&&!this.vt||this.vt&&th!='1'){window.location.href=window.location.href;} } for(var i=0;i=0){var hu="updated";if(this.gt>0){var hh=((new Date()).getTime()-this.gt)/(974+26);hu=hu+", "+hh+" secs";if(hh>(6+4)){alert(hu);} } this.gt=(new Date()).getTime();this.mu(hu);} else{this.ih();} if(nh){nt.it(this.kq.xt);if(!this.bt){var jh=$('soundimg');if(jh==null||jh.className.match(new RegExp("\\bisound\\b"))){ys(ut.mh+'/sounds/new_message.wav');} } if(!this.ct){window.focus();} } } ,kh:function(lh,oh){return((oh==(9+4)&&(lh||this.kq.ignorectrl))||(oh==012));} ,yt:function(k){if(k){ph=k.ctrlKey;k=k.which;} else{k=event.keyCode;ph=event.ctrlKey;} if(this.kq.wt&&this.kh(ph,k)){var dh=this.kq.wt.value;if(this.kq.ignorectrl){dh=dh.replace(/[\r\n]+$/,'');} this.lu(dh);return false;} return true;} ,ku:function(sq,iu,eh){if(iu&&iu.tagName=='error'){this.mu(ms.ns(iu,"descr"));} else{this.mu("reconnecting");} } ,fh:function(k){if($("engineinfo")){$("engineinfo").style.display='inline';$("engineinfo").innerHTML=k;} } ,mu:function(k){if(this.gh)clearTimeout(this.gh);this.fh(k);this.gh=setTimeout(this.ih.ln(this),0xfa0);} ,ih:function(){$("engineinfo").style.display='none';} } );var ut={ah:{} ,bh:function(){ut.ah.eu($('uname').value);$('changename1').style.display='none';$('changename2').style.display='inline';$('unamelink').innerHTML=_s($('uname').value);} ,ch:function(){$('changename1').style.display='inline';$('changename2').style.display='none';} } ;pr.ir({'#postmessage a':function(vh){vh.onclick=function(){var wt=$('msgwnd');if(wt)ut.ah.lu(wt.value);} ;} ,'select#predefined':function(vh){vh.onchange=function(){var wt=$('msgwnd');if(this.selectedIndex!=0){wt.value=this.options[this.selectedIndex].innerText||this.options[this.selectedIndex].innerHTML;} this.selectedIndex=0;wt.focus();} ;} ,'div#changename2 a':function(vh){vh.onclick=function(){ut.ch();return false;} ;} ,'div#changename1 a':function(vh){vh.onclick=function(){ut.bh();return false;} ;} ,'div#changename1 input#uname':function(vh){vh.onkeydown=function(e){var kr=e||event;if(kr.keyCode==(10+3)){ut.bh();} } ;} ,'a#refresh':function(vh){vh.onclick=function(){ut.ah.nu();ut.ah.zt();} ;} ,'a#togglesound':function(vh){vh.onclick=function(){var jh=$('soundimg');if(!jh){return;} if(jh.className.match(new RegExp("\\bisound\\b"))){jh.className="tplimage inosound";} else{jh.className="tplimage isound";} var wh=$('msgwnd');if(wh)wh.focus();} ;} ,'a.closethread':function(vh){vh.onclick=function(){ut.ah.au();} ;} } );hr.ir(window,'onload',function(){ut.mh=threadParams.wroot;ut.cssfile=threadParams.cssfile;ut.ah=new nq.pt(({ignorectrl:-1,xt:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),$u:$("avatarwnd"),wt:$("msgwnd")} ).tn(threadParams||{} ));} ); \ No newline at end of file diff --git a/src/messenger/webim/js/164/common.js b/src/messenger/webim/js/164/common.js new file mode 100644 index 00000000..0db0381a --- /dev/null +++ b/src/messenger/webim/js/164/common.js @@ -0,0 +1 @@ +var mn={nn:function(){return function(){this.qn.apply(this,arguments);} ;} ,rn:function(sn,parent,body){Object.tn(Object.tn(sn.prototype,parent.prototype),body);} } ;Object.tn=function(un,hn){for(jn in hn){un[jn]=hn[jn];} return un;} ;Object.prototype.tn=function(kn){return Object.tn.apply(this,[this,kn]);} ;Function.prototype.ln=function(kn){var on=this;return function(){return on.apply(kn,arguments);} } ;Function.prototype.pn=function(kn){var on=this;return function(event){on.call(kn,event||window.event);} } ;Number.prototype.dn=function(){var en=this.toString((11+5));if(this<(13+3))return'0'+en;return en;} ;var fn={gn:function(){var returnValue;for(var i=0;i=(127+73)&&sq.status<0454){var tq=sq.responseXML;if(tq&&tq.documentElement)return tq.documentElement;} return null;} ,uq:function(sq){return sq.statusText||"connection error N"+sq.status;} ,hq:function(){} } ;nq.iq=function(){} ;nq.iq.prototype={jq:function(kq){this.kq={lq:'post',oq:true,pq:''} .tn(kq||{} );} ,dq:function(){try{return this.eq.status||0;} catch(e){return 0} } ,fq:function(){var status=this.dq();return!status||(status>=0310&&status<(242+58));} ,gq:function(){return!this.fq();} } ;nq.aq=mn.nn();nq.aq.bq=['Uninitialized','Loading','Loaded','Interactive','Complete'];mn.rn(nq.aq,nq.iq,{qn:function(url,kq){this.eq=nq.qq();this.jq(kq);this.cq={} ;this.vq=false;this.wq(url);} ,wq:function(url){var pq=this.kq.pq||'';if(pq.length>0)pq+='&_=';try{if(this.kq.lq=='get'&&pq.length>0)url+='?'+pq;this.eq.open(this.kq.lq.toUpperCase(),url,this.kq.oq);if(this.kq.oq){this.eq.onreadystatechange=this.xq.ln(this);if(this.kq.timeout){this.cq=setTimeout(this.yq.ln(this),this.kq.timeout);} } this.zq();var $q=this.kq._q?this.kq._q:pq;this.eq.send(this.kq.lq=='post'?$q:null);} catch(e){this.mr(e);} } ,zq:function(){var nr=['X-Requested-With','XMLHttpRequest'];if(this.kq.lq=='post'){nr.zn('Content-type','application/x-www-form-urlencoded');if(this.eq.overrideMimeType&&(navigator.userAgent.match("/Gecko\/(\d{4} )/")||[0,(1984+21)])[1]<0x7d5)nr.zn('Connection','close');} if(this.kq.nr)nr.zn.apply(nr,this.kq.nr);for(var i=0;i-1){var wr=token.split('#');var xr=wr[0];var id=wr[1];var element=document.getElementById(id);if(element==null||xr&&element.nodeName.toLowerCase()!=xr){return new Array();} vr=new Array(element);continue;} if(token.indexOf('.')>-1){var wr=token.split('.');var xr=wr[0];var yr=wr[1];if(!xr){xr='*';} var zr=new Array;var $r=0;for(var h=0;h=0)ws="audio/mpeg";} return ws;} function ys(zs){var $s=document.getElementById("player");if($s){$s.parentNode.removeChild($s);} $s=document.body.appendChild(document.createElement("div"));var xs=navigator.userAgent.toLowerCase();if(xs.indexOf('safari')==-1&&xs.indexOf('windows')!=-1){$s.innerHTML='';} else{$s.innerHTML='
';} } function _s(mt){return mt.replace('&','&').replace('<','<').replace('>','>').replace('"','"');} \ No newline at end of file diff --git a/src/messenger/webim/js/163/ie.js b/src/messenger/webim/js/164/ie.js similarity index 100% rename from src/messenger/webim/js/163/ie.js rename to src/messenger/webim/js/164/ie.js diff --git a/src/messenger/webim/js/163/locale.js b/src/messenger/webim/js/164/locale.js similarity index 100% rename from src/messenger/webim/js/163/locale.js rename to src/messenger/webim/js/164/locale.js diff --git a/src/messenger/webim/js/163/update.js b/src/messenger/webim/js/164/update.js similarity index 100% rename from src/messenger/webim/js/163/update.js rename to src/messenger/webim/js/164/update.js diff --git a/src/messenger/webim/js/164/users.js b/src/messenger/webim/js/164/users.js new file mode 100644 index 00000000..d6e7e05b --- /dev/null +++ b/src/messenger/webim/js/164/users.js @@ -0,0 +1 @@ +nq.xh=mn.nn();mn.rn(nq.xh,nq.iq,{qn:function(kq){this.jq(kq);this.kq.onComplete=this.dt.ln(this);this.kq.ur=this.et.ln(this);this.kq.sr=this.yq.ln(this);this.kq.timeout=(4957+43);this.frequency=(this.kq.frequency||2);this.ft={} ;this.zt();} ,et:function($t,_t){if(this.kq.ku)this.kq.ku("offline, reconnecting");this.nu();this.qu=setTimeout(this.zt.ln(this),01750);} ,yq:function($t){if(this.kq.ku)this.kq.ku("timeout, reconnecting");this.nu();this.qu=setTimeout(this.zt.ln(this),(938+62));} ,nu:function(){if(this.ft.kq)this.ft.kq.onComplete=undefined;clearTimeout(this.qu);} ,zt:function(){if(this.kq.yh)this.kq.pq=(this.kq.yh)();this.ft=new nq.aq(this.kq.url,this.kq);} ,dt:function(du){try{var iu=nq.rq(du);if(iu){(this.kq.ju||nq.hq)(iu);} else{if(this.kq.ku)this.kq.ku("reconnecting");} } catch(e){} this.qu=setTimeout(this.zt.ln(this),this.frequency*(890+110));} } );var zh={$h:function(link,title,_h,mi,width,height,ni){return''+mi+'';} ,qi:function(content){return''+content+'
';} ,ri:function(si,ti,id,ui,hi,ii,wt,ji){var ki=2;var link=ti+"?thread="+id;var li='';if(hi||ui){li+=zh.$h((ji||!ui)?link:link+"&viewonly=true",localized[hi?0:1],"ImCenter"+id,si,(599+41),0x1e0,null);} else{li+=''+si+'';} li+='';if(hi){li+='';li+=zh.$h(link,localized[0],"ImCenter"+id,''+localized[0]+'',01200,0740,null);li+='';ki++;} if(ui){li+='';li+=zh.$h(link+"&viewonly=true",localized[1],"ImCenter"+id,''+localized[1]+'',0x280,0740,null);li+='';ki++;} if(wt!=""){li+='';li+=wt.length>(24+6)?wt.substring(0,0x1e)+'...':wt;li+='';} return zh.qi(li);} ,oi:function(id,pi){return''+zh.$h(mh+'/operator/ban.php?'+(pi?'id='+pi:'thread='+id),localized[2],"ban"+id,''+localized[2]+'',01320,0x1e0,null)+'';} } ;nq.di=mn.nn();mn.rn(nq.di,nq.iq,{qn:function(kq){this.jq(kq);this.kq.yh=this.yh.ln(this);this.kq.ku=this.ku.ln(this);this.kq.ju=this.ju.ln(this);this.kq.ei=0;this.fi=new Object();this.gi=0;this.t=this.kq.ai;this.bi=new nq.xh(this.kq);} ,yh:function(){return"since="+this.kq.ei+"&status="+this.kq.istatus+(this.kq.showonline?"&showonline=1":"");} ,mu:function(ou){this.kq.status.innerHTML=ou;} ,ku:function(s){this.mu(s);} ,ci:function(uh){var id,vi,wi,ui=false,hi=false,xi=false,ii=null,pi=null;for(var i=0;i';if(ii!=null){tj=''+ms.ns(uh,"reason")+'';} if(xi){tj+=zh.oi(id,pi);} tj=zh.qi(tj);var uj=js.ks("t"+vi,this.t);var hj=js.ks("t"+vi+"end",this.t);if($i!=null&&($i.rowIndex<=uj.rowIndex||$i.rowIndex>=hj.rowIndex)){this.t.deleteRow($i.rowIndex);this.fi[id]=null;$i=null;} if($i==null){$i=this.t.insertRow(uj.rowIndex+1);$i.className=(ii=="blocked"&&vi!="chat")?"ban":"in"+vi;$i.id="thr"+id;this.fi[id]=new Array(qj,sj,vi);js.insertCell($i,"name","visitor",null,null,zh.ri(mj,this.kq.agentservl,id,ui,hi,ii,wt,vi!='chat'));js.insertCell($i,"contid","visitor","center",null,nj);js.insertCell($i,"state","visitor","center",null,wi);js.insertCell($i,"op","visitor","center",null,rj);js.insertCell($i,"time","visitor","center",null,this.ij(qj));js.insertCell($i,"wait","visitor","center",null,(vi!='chat'?this.ij(sj):'-'));js.insertCell($i,"etc","visitor","center",null,tj);if(vi=='wait'||vi=='prio')return true;} else{this.fi[id]=new Array(qj,sj,vi);$i.className=(ii=="blocked"&&vi!="chat")?"ban":"in"+vi;zi(this.t,$i,"name",zh.ri(mj,this.kq.agentservl,id,ui,hi,ii,wt,vi!='chat'));zi(this.t,$i,"contid",nj);zi(this.t,$i,"state",wi);zi(this.t,$i,"op",rj);zi(this.t,$i,"time",this.ij(qj));zi(this.t,$i,"wait",(vi!='chat'?this.ij(sj):'-'));zi(this.t,$i,"etc",tj);} return false;} ,jj:function(){function kj(t,id){var uj=$(id);var hj=$(id+"end");if(uj==null||hj==null){return false;} return uj.rowIndex+1=(46+14)){var gj=Math.floor(ej/(40+20));ej=ej%074;if(ej<(6+4))ej="0"+ej;fj=gj+":";} return fj+ej+":"+dj;} ,aj:function(){for(var i in this.fi){if(this.fi[i]!=null){var value=this.fi[i];var $i=js.ks("thr"+i,this.t);if($i!=null){function zi(os,$i,id,_i){var cs=js.ds(id,$i,os);if(cs)cs.innerHTML=_i;} zi(this.t,$i,"time",this.ij(value[0]));zi(this.t,$i,"wait",(value[2]!='chat'?this.ij(value[1]):'-'));} } } } ,bj:function(cj){var vj=false;var wj=ms.is(cj,"time");var xj=ms.is(cj,"revision");if(wj)this.gi=(new Date()).getTime()-wj;if(xj)this.kq.ei=xj;for(var i=0;i '+name;} zj.innerHTML=$j.join(', ');} ,ju:function(cj){if(cj.tagName=='update'){for(var i=0;i - + diff --git a/src/messenger/webim/js/source/common.js b/src/messenger/webim/js/source/common.js index 983eef5a..b552f5c0 100644 --- a/src/messenger/webim/js/source/common.js +++ b/src/messenger/webim/js/source/common.js @@ -10,7 +10,7 @@ //- localized -//- onComplete, obj, params, $apply$ +//- onComplete, showonline //- threadParams, servl, frequency, user, threadid, token, cssfile //- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl, istatus @@ -145,24 +145,6 @@ function $() { return elems; } -if (!Function.prototype.apply) { - Function.prototype.apply = function(obj, params) { - var parameterStrings = new Array(); - if (!obj) obj = window; - if (!params) params = new Array(); - - for (var i = 0; i < params.length; i++) - parameterStrings[i] = 'params[' + i + ']'; - - obj.$apply$ = this; - var result = eval('obj.$apply$(' + - parameterStrings.join(', ') + ')'); - obj.$apply$ = null; - - return result; - }; -} - var Ajax = { getTransport: function() { return Try.these( diff --git a/src/messenger/webim/js/source/users.js b/src/messenger/webim/js/source/users.js index d02cc636..5ba79a8c 100644 --- a/src/messenger/webim/js/source/users.js +++ b/src/messenger/webim/js/source/users.js @@ -117,7 +117,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { }, updateParams: function() { - return "since=" + this._options.lastrevision + "&status=" + this._options.istatus; + return "since=" + this._options.lastrevision + "&status=" + this._options.istatus + (this._options.showonline ? "&showonline=1" : ""); }, setStatus: function(msg) { @@ -273,31 +273,66 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, { } }, - updateContent: function(root) { + updateThreads: function(root) { var newAdded = false; - if( root.tagName == 'threads' ) { - var _time = NodeUtils.getAttrValue(root, "time"); - var _revision = NodeUtils.getAttrValue(root, "revision" ); + var _time = NodeUtils.getAttrValue(root, "time"); + var _revision = NodeUtils.getAttrValue(root, "revision" ); + + if( _time ) + this.delta = (new Date()).getTime() - _time; + if( _revision ) + this._options.lastrevision = _revision; + + for( var i = 0; i < root.childNodes.length; i++ ) { + var node = root.childNodes[i]; + if( node.tagName == 'thread' ) + if( this.updateThread(node) ) + newAdded = true; + } + this.updateQueueMessages(); + this.updateTimers(); + this.setStatus(this._options.istatus ? "Away" : "Up to date"); + if( newAdded ) { + playSound(webimRoot+'/sounds/new_user.wav'); + window.focus(); + if(updaterOptions.showpopup) { + alert(localized[5]); + } + } + }, + + updateOperators: function(root) { + var div = $('onlineoperators'); + if (!div) + return; - if( _time ) - this.delta = (new Date()).getTime() - _time; - if( _revision ) - this._options.lastrevision = _revision; + var names = []; + + for( var i = 0; i < root.childNodes.length; i++ ) { + var node = root.childNodes[i]; + if(node.tagName != 'operator') + continue; + + var name = NodeUtils.getAttrValue(node, 'name'); + var isAway = NodeUtils.getAttrValue(node, 'away') != null; + + names[names.length] = + ''+localized[1]+' '+ name; + } + div.innerHTML = names.join(', '); + }, + + updateContent: function(root) { + if( root.tagName == 'update' ) { for( var i = 0; i < root.childNodes.length; i++ ) { var node = root.childNodes[i]; - if( node.tagName == 'thread' ) - if( this.updateThread(node) ) - newAdded = true; - } - this.updateQueueMessages(); - this.updateTimers(); - this.setStatus(this._options.istatus ? "Away" : "Up to date"); - if( newAdded ) { - playSound(webimRoot+'/sounds/new_user.wav'); - window.focus(); - if(updaterOptions.showpopup) { - alert(localized[5]); + + if (node.tagName == 'threads') { + this.updateThreads(node); + } else if (node.tagName == 'operators') { + this.updateOperators(node); } } } else if( root.tagName == 'error' ) { diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index 6bf1619c..dd7002d7 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -25,7 +25,7 @@ require_once(dirname(__FILE__).'/converter.php'); require_once(dirname(__FILE__).'/config.php'); $version = '1.6.4'; -$jsver = "163"; +$jsver = "164"; function myiconv($in_enc, $out_enc, $string) { global $_utf8win1251, $_win1251utf8; @@ -579,6 +579,7 @@ $settings = array( 'surveyaskgroup' => '1', 'surveyaskmessage' => '0', 'enablepopupnotification' => '0', + 'showonlineoperators' => '0', 'enablecaptcha' => '0', 'online_timeout' => 30, /* Timeout (in seconds) when online operator becomes offline */ diff --git a/src/messenger/webim/libs/operator.php b/src/messenger/webim/libs/operator.php index 9a1cbc67..9f98333f 100644 --- a/src/messenger/webim/libs/operator.php +++ b/src/messenger/webim/libs/operator.php @@ -61,6 +61,31 @@ function operator_by_id($id) { return $operator; } +function operator_get_all() { + $link = connect(); + + $query = "select operatorid, vclogin, vclocalename, vccommonname, istatus, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". + "from chatoperator order by vclogin"; + $operators = select_multi_assoc($query, $link); + mysql_close($link); + return $operators; +} + +function operator_is_online($operator) { + global $settings; + return $operator['time'] < $settings['online_timeout']; +} + +function operator_is_available($operator) { + global $settings; + return $operator['istatus'] == 0 && $operator['time'] < $settings['online_timeout'] ? "1" : ""; +} + +function operator_is_away($operator) { + global $settings; + return $operator['istatus'] != 0 && $operator['time'] < $settings['online_timeout'] ? "1" : ""; +} + function update_operator($operatorid,$login,$email,$password,$localename,$commonname) { $link = connect(); $query = sprintf( diff --git a/src/messenger/webim/locales/en/properties b/src/messenger/webim/locales/en/properties index f0a25ae3..50ec82f4 100644 --- a/src/messenger/webim/locales/en/properties +++ b/src/messenger/webim/locales/en/properties @@ -444,6 +444,8 @@ settings.popup_notification.description=Small dialog appears to attract your att settings.popup_notification=Enable "Popup dialog notification of the new visitor". settings.saved=Changes saved settings.sendmessagekey=Send messages with: +settings.show_online_operators.description=Can slow down the update rate of the list +settings.show_online_operators=Show online operators on "List of awaiting visitors" page settings.survey.askgroup.description=Show/hide department selection field in the survey settings.survey.askgroup=Allows visitor to choose department/group settings.survey.askmail.description=Show/hide email field in the survey diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties index aae108fc..a63178b2 100644 --- a/src/messenger/webim/locales/ru/properties +++ b/src/messenger/webim/locales/ru/properties @@ -436,6 +436,8 @@ settings.popup_notification.description= settings.popup_notification=Показывать небольшой диалог при появлении новых посетителей в очереди. settings.saved=Изменения сохранены settings.sendmessagekey=Посылать сообщение по: +settings.show_online_operators.description=Может замедлить обновление списка +settings.show_online_operators=Показывать доступных операторов на странице ожидающих посетителей settings.survey.askgroup.description=Показать/спрятать выбор группы в диалоге перед началом чата settings.survey.askgroup=Позволять посетителю выбирать группу операторов settings.survey.askmail.description=Показать/спрятать поле ввода адреса электронной почты diff --git a/src/messenger/webim/operator/features.php b/src/messenger/webim/operator/features.php index fecb1cd3..2a65d67c 100644 --- a/src/messenger/webim/operator/features.php +++ b/src/messenger/webim/operator/features.php @@ -32,7 +32,7 @@ $options = array( 'enableban', 'usercanchangename', 'enablegroups', 'enablestatistics', 'enablessl', 'forcessl', 'enablepresurvey', 'surveyaskmail', 'surveyaskgroup', 'surveyaskmessage', - 'enablepopupnotification', + 'enablepopupnotification', 'showonlineoperators', 'enablecaptcha'); loadsettings(); diff --git a/src/messenger/webim/operator/operators.php b/src/messenger/webim/operator/operators.php index 1c895401..0893034d 100644 --- a/src/messenger/webim/operator/operators.php +++ b/src/messenger/webim/operator/operators.php @@ -59,28 +59,8 @@ if( isset($_GET['act']) && $_GET['act'] == 'del' ) { } } -function is_online($operator) { - global $settings; - return $operator['istatus'] == 0 && $operator['time'] < $settings['online_timeout'] ? "1" : ""; -} - -function is_away($operator) { - global $settings; - return $operator['istatus'] != 0 && $operator['time'] < $settings['online_timeout'] ? "1" : ""; -} - -function get_operators() { - $link = connect(); - - $query = "select operatorid, vclogin, vclocalename, vccommonname, istatus, (unix_timestamp(CURRENT_TIMESTAMP)-unix_timestamp(dtmlastvisited)) as time ". - "from chatoperator order by vclogin"; - $operators = select_multi_assoc($query, $link); - mysql_close($link); - return $operators; -} - $page = array(); -$page['allowedAgents'] = get_operators(); +$page['allowedAgents'] = operator_get_all(); $page['canmodify'] = is_capable($can_administrate, $operator); setlocale(LC_TIME, getstring("time.locale")); diff --git a/src/messenger/webim/operator/update.php b/src/messenger/webim/operator/update.php index 22708474..e6fa3b18 100644 --- a/src/messenger/webim/operator/update.php +++ b/src/messenger/webim/operator/update.php @@ -140,7 +140,6 @@ function print_pending_threads($groupids,$since) { mysql_close($link); - start_xml_output(); echo ""; foreach( $output as $thr ) { print myiconv($webim_encoding,"utf-8",$thr); @@ -148,12 +147,37 @@ function print_pending_threads($groupids,$since) { echo ""; } +function print_operators() { + echo ""; + $operators = operator_get_all(); + $names = array(); + + foreach($operators as $operator) { + if (!operator_is_online($operator)) + continue; + + $name = htmlspecialchars(htmlspecialchars($operator['vclocalename'])); + $away = operator_is_away($operator) ? " away=\"1\"" : ""; + + echo ""; + } + echo ""; +} + $since = verifyparam( "since", "/^\d{1,9}$/", 0); $status = verifyparam( "status", "/^\d{1,2}$/", 0); +$showonline = verifyparam( "showonline", "/^1$/", 0); loadsettings(); $groupids = $_SESSION['operatorgroups']; + +start_xml_output(); +echo ''; +if($showonline) { + print_operators(); +} print_pending_threads($groupids,$since); +echo ''; notify_operator_alive($operator['operatorid'], $status); exit; diff --git a/src/messenger/webim/operator/users.php b/src/messenger/webim/operator/users.php index dba5593d..2f4c6270 100644 --- a/src/messenger/webim/operator/users.php +++ b/src/messenger/webim/operator/users.php @@ -46,6 +46,7 @@ $page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1"; $page['showpopup'] = $settings['enablepopupnotification'] == '1' ? "1" : "0"; $page['frequency'] = $settings['updatefrequency_operator']; $page['istatus'] = $status; +$page['showonline'] = $settings['showonlineoperators'] == '1' ? "1" : "0"; prepare_menu($operator); start_html_output(); diff --git a/src/messenger/webim/view/agents.php b/src/messenger/webim/view/agents.php index 18644d62..c91240ca 100644 --- a/src/messenger/webim/view/agents.php +++ b/src/messenger/webim/view/agents.php @@ -75,10 +75,10 @@ require_once('inc_errors.php'); / - - + + - + diff --git a/src/messenger/webim/view/features.php b/src/messenger/webim/view/features.php index 955d146c..211e0c79 100644 --- a/src/messenger/webim/view/features.php +++ b/src/messenger/webim/view/features.php @@ -184,6 +184,15 @@ require_once('inc_errors.php');
+
+
+
+ /> +
+
+
+
+
diff --git a/src/messenger/webim/view/pending_users.php b/src/messenger/webim/view/pending_users.php index fbd3b566..bdaf92fa 100644 --- a/src/messenger/webim/view/pending_users.php +++ b/src/messenger/webim/view/pending_users.php @@ -39,7 +39,7 @@ var localized = new Array( var updaterOptions = { url:"/operator/update.php",wroot:"", agentservl:"/operator/agent.php", frequency:, istatus:, - noclients:"", havemenu: , showpopup: }; + noclients:"", havemenu: , showpopup: , showonline: }; //-->
+ +
+
+ +