From ed75f8df9fc46563d15b05eb0780058804a360db Mon Sep 17 00:00:00 2001 From: Evgeny Gryaznov Date: Fri, 24 Apr 2009 15:09:46 +0000 Subject: [PATCH] Ability to use Enter instead of Ctrl-Enter git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@484 c66351dc-e62f-0410-b875-e3a5c0b9693f --- src/messenger/webim/js/brws.js | 2 +- src/messenger/webim/js/chat.js | 2 +- src/messenger/webim/js/source/chat.js | 23 +++++++++++-------- src/messenger/webim/js/source/common.js | 2 +- src/messenger/webim/js/users.js | 2 +- src/messenger/webim/libs/chat.php | 17 ++++++++++++-- .../webim/styles/default/templates/chat.tpl | 2 +- .../webim/styles/original/templates/chat.tpl | 2 +- src/messenger/webim/view/gen_button.php | 2 +- 9 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/messenger/webim/js/brws.js b/src/messenger/webim/js/brws.js index 7affb202..4121bfdc 100644 --- a/src/messenger/webim/js/brws.js +++ b/src/messenger/webim/js/brws.js @@ -1 +1 @@ -var myAgent="";var xj=0;var myRealAgent="";function yj(){var zj=["opera","msie","safari","firefox","netscape","mozilla"];var qj=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'){tt.contentWindow.scrollTo(0,this.st(tt).getElementById('content').clientHeight);} else 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),(667+333));} ,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*01750);} ,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()',(1926+74));} 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)/01750;ju=ju+", "+jh+" secs";if(jh>(6+4)){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();} } } ,$t:function(k){if(k){oh=k.ctrlKey;k=k.which;} else{k=event.keyCode;oh=event.ctrlKey;} if(this.pq.yt&&((k==015&&(oh||myRealAgent=='opera'))||(k==(9+1)))){var ph=this.pq.yt.value;if(myRealAgent=='opera'){ph=ph.replace(/[\r\n]+$/,'');} this.pu(ph);return false;} return true;} ,ou:function(hq,ku,dh){if(ku&&ku.tagName=='error'){this.qu(qs.rs(ku,"descr"));} else{this.qu("reconnecting");} } ,eh:function(k){if($("engineinfo")){$("engineinfo").style.display='inline';$("engineinfo").innerHTML=k;} } ,qu:function(k){if(this.fh)clearTimeout(this.fh);this.eh(k);this.fh=setTimeout(this.kh.on(this),07640);} ,kh:function(){$("engineinfo").style.display='none';} } );var it={gh:{} ,ah:function(){it.gh.gu($('uname').value);$('changename1').style.display='none';$('changename2').style.display='inline';$('unamelink').innerHTML=nt($('uname').value);} ,bh:function(){$('changename1').style.display='inline';$('changename2').style.display='none';} } ;er.lr({'#postmessage a':function(ch){ch.onclick=function(){var yt=$('msgwnd');if(yt)it.gh.pu(yt.value);} ;} ,'a#sndmessagelnk':function(ch){if(myRealAgent=='opera'){ch.innerHTML=ch.innerHTML.replace('Ctrl-','');} } ,'select#predefined':function(ch){ch.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(ch){ch.onclick=function(){it.bh();return false;} ;} ,'div#changename1 a':function(ch){ch.onclick=function(){it.ah();return false;} ;} ,'div#changename1 input#uname':function(ch){ch.onkeydown=function(e){var or=e||event;if(or.keyCode==(12+1)){it.ah();} } ;} ,'a#refresh':function(ch){ch.onclick=function(){it.gh.ru();it.gh._t();} ;} ,'a#togglesound':function(ch){ch.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 vh=$('msgwnd');if(vh)vh.focus();} ;} ,'a.closethread':function(ch){ch.onclick=function(){it.gh.cu();} ;} } );kr.lr(window,'onload',function(){it.qh=threadParams.wroot;it.cssfile=threadParams.cssfile;it.gh=new sq.et(({zt:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),mh:$("avatarwnd"),yt:$("msgwnd")} ).un(threadParams||{} ));} ); \ No newline at end of file +var rt={st:function(tt){if(tt.contentDocument){return tt.contentDocument;} else if(tt.contentWindow){return tt.contentWindow.document;} else if(tt.document){return tt.document;} else{return null;} } ,ut:function(tt){var ht=this.st(tt);ht.open();ht.write("");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),(667+333));} ,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*01750);} ,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()',(1926+74));} 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)/01750;ju=ju+", "+jh+" secs";if(jh>(6+4)){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==015&&(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==(11+2)){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/source/chat.js b/src/messenger/webim/js/source/chat.js index caf6c83b..ce2164d9 100644 --- a/src/messenger/webim/js/source/chat.js +++ b/src/messenger/webim/js/source/chat.js @@ -41,9 +41,13 @@ var FrameUtils = { scrollDown: function(frm) { var vbottom = this.getDocument(frm).getElementById('bottom'); if( myAgent == 'opera' ) { - frm.contentWindow.scrollTo(0,this.getDocument(frm).getElementById('content').clientHeight); - } else if( vbottom ) + try { + frm.contentWindow.scrollTo(0,this.getDocument(frm).getElementById('content').clientHeight); + } catch(e) {} + } + if( vbottom ) { vbottom.scrollIntoView(false); + } } }; @@ -250,11 +254,15 @@ Class.inherit( Ajax.ChatThreadUpdater, Ajax.Base, { } }, + isSendkey: function(ctrlpressed, key) { + return ((key==13 && (ctrlpressed || this._options.ignorectrl)) || (key==10)); + }, + handleKeyDown: function(k) { if( k ){ ctrl=k.ctrlKey;k=k.which; } else { k=event.keyCode;ctrl=event.ctrlKey; } - if( this._options.message && ((k==13 && (ctrl || myRealAgent == 'opera')) || (k==10)) ) { + if( this._options.message && this.isSendkey(ctrl, k) ) { var mmsg = this._options.message.value; - if( myRealAgent == 'opera' ) { + if( this._options.ignorectrl ) { mmsg = mmsg.replace(/[\r\n]+$/,''); } this.postMessage( mmsg ); @@ -315,11 +323,6 @@ Behaviour.register({ Chat.threadUpdater.postMessage(message.value); }; }, - 'a#sndmessagelnk' : function(el) { - if( myRealAgent == 'opera' ) { - el.innerHTML = el.innerHTML.replace('Ctrl-',''); - } - }, 'select#predefined' : function(el) { el.onchange = function() { var message = $('msgwnd'); @@ -382,5 +385,5 @@ Behaviour.register({ EventHelper.register(window, 'onload', function(){ Chat.webimRoot = threadParams.wroot; Chat.cssfile = threadParams.cssfile; - Chat.threadUpdater = new Ajax.ChatThreadUpdater(({container:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}).extend( threadParams || {} )); + Chat.threadUpdater = new Ajax.ChatThreadUpdater(({ignorectrl:-1,container:myRealAgent=='safari'?self.frames[0]:$("chatwnd"),avatar:$("avatarwnd"),message:$("msgwnd")}).extend( threadParams || {} )); }); \ No newline at end of file diff --git a/src/messenger/webim/js/source/common.js b/src/messenger/webim/js/source/common.js index ea2e5e39..b239ccd3 100644 --- a/src/messenger/webim/js/source/common.js +++ b/src/messenger/webim/js/source/common.js @@ -12,7 +12,7 @@ //- onComplete, obj, params, $apply$ //- threadParams, servl, frequency, user, threadid, token, cssfile -//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup +//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl var Class = { diff --git a/src/messenger/webim/js/users.js b/src/messenger/webim/js/users.js index d956dab9..7299dafb 100644 --- a/src/messenger/webim/js/users.js +++ b/src/messenger/webim/js/users.js @@ -1 +1 @@ -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''+_h+'';} ,ni:function(content){return''+content+'
';} ,qi:function(ri,si,id,ti,ui,hi,yt,ii){var ji=2;var link=si+"?thread="+id;var ki='';if(ui||ti){ki+=yh.zh((ii||!ti)?link:link+"&viewonly=true",localized[ui?0:1],"ImCenter"+id,ri,01200,0740,null);} else{ki+=''+ri+'';} ki+='';if(ui){ki+='';ki+=yh.zh(link,localized[0],"ImCenter"+id,''+localized[0]+'',0x280,(412+68),null);ki+='';ji++;} if(ti){ki+='';ki+=yh.zh(link+"&viewonly=true",localized[1],"ImCenter"+id,''+localized[1]+'',(509+131),0x1e0,null);ki+='';ji++;} if(yt!=""){ki+='';ki+=yt.length>0x1e?yt.substring(0,(18+12))+'...':yt;ki+='';} return yh.ni(ki);} ,li:function(id,oi){return''+yh.zh(qh+'/operator/ban.php?'+(oi?'id='+oi:'thread='+id),localized[2],"ban"+id,''+localized[2]+'',0x2d0,0740,null)+'';} } ;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';if(hi!=null){sj=''+qs.rs(ih,"reason")+'';} 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=(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'+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,01200,0740,null);} else{pi+=''+ui+'';} pi+='';if(ji){pi+='';pi+=_h.mi(link,localized[0],"ImCenter"+id,''+localized[0]+'',0x280,0x1e0,null);pi+='';oi++;} if(ii){pi+='';pi+=_h.mi(link+"&viewonly=true",localized[1],"ImCenter"+id,''+localized[1]+'',0x280,(337+143),null);pi+='';oi++;} if(yt!=""){pi+='';pi+=yt.length>(27+3)?yt.substring(0,(29+1))+'...':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]+'',0x2d0,0740,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"company="+this.pq.company+"&since="+this.pq.gi;} ,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/(49+11));gj=gj%0x3c;if(gj<(8+2))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 diff --git a/src/messenger/webim/styles/original/templates/chat.tpl b/src/messenger/webim/styles/original/templates/chat.tpl index c2e77063..dc8cf843 100644 --- a/src/messenger/webim/styles/original/templates/chat.tpl +++ b/src/messenger/webim/styles/original/templates/chat.tpl @@ -8,7 +8,7 @@ diff --git a/src/messenger/webim/view/gen_button.php b/src/messenger/webim/view/gen_button.php index 8645ade0..95231e97 100644 --- a/src/messenger/webim/view/gen_button.php +++ b/src/messenger/webim/view/gen_button.php @@ -79,7 +79,7 @@ require_once('inc_errors.php');
-
+