diff --git a/src/messenger/webim/js/164/users.js b/src/messenger/webim/js/164/users.js index 307b2c8a..1064fa1a 100644 --- a/src/messenger/webim/js/164/users.js +++ b/src/messenger/webim/js/164/users.js @@ -7,29 +7,29 @@ */ Ajax.PeriodicalUpdater=Class.create(); Class.inherit(Ajax.PeriodicalUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.onComplete=this.requestComplete.bind(this);this._options.onException=this.handleException.bind(this);this._options.onTimeout=this.handleTimeout.bind(this);this._options.timeout=5E3;this.frequency=this._options.frequency||2;this.updater={};this.update()},handleException:function(){this._options.handleError&&this._options.handleError("offline, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this), -1E3)},handleTimeout:function(){this._options.handleError&&this._options.handleError("timeout, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},stopUpdate:function(){if(this.updater._options)this.updater._options.onComplete=void 0;clearTimeout(this.timer)},update:function(){if(this._options.updateParams)this._options.parameters=this._options.updateParams();this.updater=new Ajax.Request(this._options.url,this._options)},requestComplete:function(a){try{var b=Ajax.getXml(a); -b?(this._options.updateContent||Ajax.emptyFunction)(b):this._options.handleError&&this._options.handleError("reconnecting")}catch(c){}this.timer=setTimeout(this.update.bind(this),this.frequency*1E3)}}); -var HtmlGenerationUtils={popupLink:function(a,b,c,d,f,g,j){return'"+d+""},generateOneRowTable:function(a){return''+a+"
"},viewOpenCell:function(a,b,c,d,f,g,j,n,m,o){var g= -2,b=b+"?thread="+c,e="";e+=f||d?HtmlGenerationUtils.popupLink(n||!d?b:b+"&viewonly=true",localized[f?0:1],"ImCenter"+c,a,640,480,null):''+a+"";e+="";f&&(e+='',e+=HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,''+localized[0]+'',640,480,null),e+="",g++);d&&(e+='',e+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+ -c,''+localized[1]+'',640,480,null),e+="",g++);m&&(e+='',e+=HtmlGenerationUtils.popupLink(o+"?thread="+c,localized[6],"ImTracked"+c,''+localized[6]+'',640,480,null),e+="",g++);j!=""&&(e+='', -e+=j.length>30?j.substring(0,30)+"...":j,e+="");return HtmlGenerationUtils.generateOneRowTable(e)},banCell:function(a,b){return''+HtmlGenerationUtils.popupLink(webimRoot+"/operator/ban.php?"+(b?"id="+b:"thread="+a),localized[2],"ban"+a,''+localized[2]+'',720,480,null)+""},viewVisOpenCell:function(a,b,c,d,f){var g="";g+=f?HtmlGenerationUtils.popupLink(b+"?visitor="+c,localized[7],"ImCenter"+ -c,a,640,480,null):''+a+"";g+="";g+='';a=HtmlGenerationUtils.popupLink(d+"?visitor="+c,localized[6],"ImTracked"+c,''+localized[6]+'',640,480,null);a=a.replace("scrollbars=0","scrollbars=1");g+=a;g+="";return HtmlGenerationUtils.generateOneRowTable(g)}};Ajax.ThreadListUpdater=Class.create(); +1E3)},handleTimeout:function(){this._options.handleError&&this._options.handleError("timeout, reconnecting");this.stopUpdate();this.timer=setTimeout(this.update.bind(this),1E3)},stopUpdate:function(){if(this.updater._options)this.updater._options.onComplete=void 0;clearTimeout(this.timer)},update:function(){if(this._options.updateParams)this._options.parameters=this._options.updateParams();this.updater=new Ajax.Request(this._options.url,this._options)},requestComplete:function(a){try{var c=Ajax.getXml(a); +c?(this._options.updateContent||Ajax.emptyFunction)(c):this._options.handleError&&this._options.handleError("reconnecting")}catch(b){}this.timer=setTimeout(this.update.bind(this),1E3*this.frequency)}}); +var HtmlGenerationUtils={popupLink:function(a,c,b,d,g,h,i){return'"+d+""},generateOneRowTable:function(a){return''+a+"
"},viewOpenCell:function(a,c,b,d,g,h,i,l,k,n){var h= +2,c=c+"?thread="+b,e="",e=g||d?e+HtmlGenerationUtils.popupLink(l||!d?c:c+"&viewonly=true",localized[g?0:1],"ImCenter"+b,a,640,480,null):e+(''+a+""),e=e+"";g&&(e=e+''+HtmlGenerationUtils.popupLink(c,localized[0],"ImCenter"+b,''+localized[0]+'',640,480,null),e+="",h++);d&&(e=e+''+HtmlGenerationUtils.popupLink(c+"&viewonly=true",localized[1],"ImCenter"+ +b,''+localized[1]+'',640,480,null),e+="",h++);k&&(e=e+''+HtmlGenerationUtils.popupLink(n+"?thread="+b,localized[6],"ImTracked"+b,''+localized[6]+'',640,480,null),e+="",h++);""!=i&&(e=e+('')+ +(30");return HtmlGenerationUtils.generateOneRowTable(e)},banCell:function(a,c){return''+HtmlGenerationUtils.popupLink(webimRoot+"/operator/ban.php?"+(c?"id="+c:"thread="+a),localized[2],"ban"+a,''+localized[2]+'',720,480,null)+""},viewVisOpenCell:function(a,c,b,d,g){var h="",h=g?h+HtmlGenerationUtils.popupLink(c+"?visitor="+b,localized[7],"ImCenter"+ +b,a,640,480,null):h+(''+a+""),h=h+'',a=HtmlGenerationUtils.popupLink(d+"?visitor="+b,localized[6],"ImTracked"+b,''+localized[6]+'',640,480,null),a=a.replace("scrollbars=0","scrollbars=1");return HtmlGenerationUtils.generateOneRowTable(h+a+"")}};Ajax.ThreadListUpdater=Class.create(); Class.inherit(Ajax.ThreadListUpdater,Ajax.Base,{initialize:function(a){this.setOptions(a);this._options.updateParams=this.updateParams.bind(this);this._options.handleError=this.handleError.bind(this);this._options.updateContent=this.updateContent.bind(this);this._options.lastrevision=0;this.threadTimers={};this.delta=0;this.t=this._options.table;this.t2=this._options.visitors_table;this.periodicalUpdater=new Ajax.PeriodicalUpdater(this._options);this.old_visitors={};this.visitors={};this.visitorTimers= -{}},updateParams:function(){return"since="+this._options.lastrevision+"&status="+this._options.istatus+(this._options.showonline?"&showonline=1":"")+(this._options.showvisitors?"&showvisitors=1":"")},setStatus:function(a){this._options.status.innerHTML=a},handleError:function(a){this.setStatus(a)},updateThread:function(a){function b(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d}for(var c,d,f,g=!1,j=!1,n=!1,m=null,o=null,e=0;e"+NodeUtils.getNodeValue(a,"useragent")+"";m!=null&&(r=""+NodeUtils.getNodeValue(a,"reason")+"");n&&(r+=HtmlGenerationUtils.banCell(c,o));r=HtmlGenerationUtils.generateOneRowTable(r);a=CommonUtils.getRow("t"+d,this.t);n=CommonUtils.getRow("t"+d+"end",this.t);if(e!=null&&(e.rowIndex<=a.rowIndex||e.rowIndex>=n.rowIndex))this.t.deleteRow(e.rowIndex),e=this.threadTimers[c]= -null;if(e==null){if(e=this.t.insertRow(a.rowIndex+1),e.className=m=="blocked"&&d!="chat"?"ban":"in"+d,e.id="thr"+c,this.threadTimers[c]=[p,s,d],CommonUtils.insertCell(e,"name","visitor",null,null,HtmlGenerationUtils.viewOpenCell(l,this._options.agentservl,c,g,j,m,u,d!="chat",this._options.showvisitors,this._options.trackedservl)),CommonUtils.insertCell(e,"contid","visitor","center",null,q),CommonUtils.insertCell(e,"state","visitor","center",null,f),CommonUtils.insertCell(e,"op","visitor","center", -null,t),CommonUtils.insertCell(e,"time","visitor","center",null,this.getTimeSince(p)),CommonUtils.insertCell(e,"wait","visitor","center",null,d!="chat"?this.getTimeSince(s):"-"),CommonUtils.insertCell(e,"etc","visitor","center",null,r),d=="wait"||d=="prio")return!0}else this.threadTimers[c]=[p,s,d],e.className=m=="blocked"&&d!="chat"?"ban":"in"+d,b(this.t,e,"name",HtmlGenerationUtils.viewOpenCell(l,this._options.agentservl,c,g,j,m,u,d!="chat",this._options.showvisitors,this._options.trackedservl)), -b(this.t,e,"contid",q),b(this.t,e,"state",f),b(this.t,e,"op",t),b(this.t,e,"time",this.getTimeSince(p)),b(this.t,e,"wait",d!="chat"?this.getTimeSince(s):"-"),b(this.t,e,"etc",r);return!1}},updateQueueMessages:function(){function a(a,b){var c=$(b),j=$(b+"end");if(c==null||j==null)return!1;return c.rowIndex+1=60&&(c=Math.floor(b/60),b%=60,b<10&&(b="0"+b),c+=":");return c+b+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(this.threadTimers[a]!=null){var b=this.threadTimers[a],c=CommonUtils.getRow("thr"+a,this.t);if(c!=null){var d=function(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d};d(this.t,c,"time",this.getTimeSince(b[0]));d(this.t,c,"wait",b[2]!="chat"?this.getTimeSince(b[1]):"-")}}},updateThreads:function(a){var b= -!1,c=NodeUtils.getAttrValue(a,"time"),d=NodeUtils.getAttrValue(a,"revision");if(c)this.delta=(new Date).getTime()-c;if(d)this._options.lastrevision=d;for(c=0;c '+g}}b.innerHTML=c.join(", ")}},updateVisitorsTimers:function(){for(var a in this.visitorTimers)if(this.visitorTimers[a]!=null){var b=this.visitorTimers[a],c=CommonUtils.getRow("vis"+ -a,this.t2);if(c!=null){var d=function(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d};d(this.t2,c,"time",this.getTimeSince(b[0]));d(this.t2,c,"modified",this.getTimeSince(b[1]));b[2]!=null&&d(this.t2,c,"invitationtime",this.getTimeSince(b[2]))}}},updateVisitor:function(a){function b(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d}for(var c,d=0;d=p.rowIndex))this.t2.deleteRow(d.rowIndex),d=this.visitorTimers[c]=null;d==null?(d=this.t2.insertRow(a.rowIndex+1),d.id="vis"+c,this.visitorTimers[c]=[n,m,q],CommonUtils.insertCell(d,"username","visitor",null,null,HtmlGenerationUtils.viewVisOpenCell(g,this._options.inviteservl,c,this._options.trackedservl,l==null)),CommonUtils.insertCell(d,"addr","visitor","center",null,f),CommonUtils.insertCell(d, -"time","visitor","center",null,this.getTimeSince(n)),CommonUtils.insertCell(d,"modified","visitor","center",null,this.getTimeSince(m)),CommonUtils.insertCell(d,"operator","visitor","center",null,l!=null?l:"-"),CommonUtils.insertCell(d,"invitationtime","visitor","center",null,l!=null?this.getTimeSince(q):"-"),CommonUtils.insertCell(d,"invitations","visitor","center",null,o+" / "+e),CommonUtils.insertCell(d,"useragent","visitor","center",null,j)):(this.visitorTimers[c]=[n,m,q],b(this.t2,d,"username", -HtmlGenerationUtils.viewVisOpenCell(g,this._options.inviteservl,c,this._options.trackedservl,l==null)),b(this.t2,d,"addr",f),b(this.t2,d,"operator",l!=null?l:"-"),b(this.t2,d,"time",this.getTimeSince(n)),b(this.t2,d,"modified",this.getTimeSince(m)),b(this.t2,d,"invitationtime",l!=null?this.getTimeSince(q):"-"),b(this.t2,d,"invitations",o+" / "+e),b(this.t2,d,"useragent",j));this.visitors[c]=1;return!1},removeOldVisitors:function(){for(id in this.old_visitors)if(this.visitors[id]===void 0){var a=CommonUtils.getRow("vis"+ -id,this.t2);a&&this.t2.deleteRow(a.rowIndex);this.visitorTimers[id]=null}},updateVisitorsList:function(a){var b=$("visstatustd");if(b)b.innerHTML=a>0?"":this._options.novisitors,b.height=a>0?5:30},updateVisitors:function(a){this.old_visitors=this.visitors;this.visitors={};for(var b=0,c=0;c"+NodeUtils.getNodeValue(a,"useragent")+"";null!=k&&(o=""+NodeUtils.getNodeValue(a,"reason")+"");l&&(o+=HtmlGenerationUtils.banCell(b,n));o=HtmlGenerationUtils.generateOneRowTable(o);a=CommonUtils.getRow("t"+d,this.t);l=CommonUtils.getRow("t"+d+"end",this.t);if(null!=e&&(e.rowIndex<=a.rowIndex||e.rowIndex>=l.rowIndex))this.t.deleteRow(e.rowIndex),e=this.threadTimers[b]= +null;if(null==e){if(e=this.t.insertRow(a.rowIndex+1),e.className="blocked"==k&&"chat"!=d?"ban":"in"+d,e.id="thr"+b,this.threadTimers[b]=[j,p,d],CommonUtils.insertCell(e,"name","visitor",null,null,HtmlGenerationUtils.viewOpenCell(f,this._options.agentservl,b,h,i,k,r,"chat"!=d,this._options.showvisitors,this._options.trackedservl)),CommonUtils.insertCell(e,"contid","visitor","center",null,m),CommonUtils.insertCell(e,"state","visitor","center",null,g),CommonUtils.insertCell(e,"op","visitor","center", +null,q),CommonUtils.insertCell(e,"time","visitor","center",null,this.getTimeSince(j)),CommonUtils.insertCell(e,"wait","visitor","center",null,"chat"!=d?this.getTimeSince(p):"-"),CommonUtils.insertCell(e,"etc","visitor","center",null,o),"wait"==d||"prio"==d)return!0}else this.threadTimers[b]=[j,p,d],e.className="blocked"==k&&"chat"!=d?"ban":"in"+d,c(this.t,e,"name",HtmlGenerationUtils.viewOpenCell(f,this._options.agentservl,b,h,i,k,r,"chat"!=d,this._options.showvisitors,this._options.trackedservl)), +c(this.t,e,"contid",m),c(this.t,e,"state",g),c(this.t,e,"op",q),c(this.t,e,"time",this.getTimeSince(j)),c(this.t,e,"wait","chat"!=d?this.getTimeSince(p):"-"),c(this.t,e,"etc",o);return!1}},updateQueueMessages:function(){function a(a,b){var c=$(b),i=$(b+"end");return null==c||null==i?!1:c.rowIndex+1a&&(a="0"+a);60<=c&&(b=Math.floor(c/60),c%=60,10>c&&(c="0"+c),b+=":");return b+c+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(null!=this.threadTimers[a]){var c=this.threadTimers[a],b=CommonUtils.getRow("thr"+a,this.t);if(null!=b){var d=this.getTimeSince(c[0]),g=CommonUtils.getCell("time",b,this.t);if(g)g.innerHTML=d;c="chat"!=c[2]?this.getTimeSince(c[1]):"-";if(b=CommonUtils.getCell("wait",b,this.t))b.innerHTML=c}}},updateThreads:function(a){var c= +!1,b=NodeUtils.getAttrValue(a,"time"),d=NodeUtils.getAttrValue(a,"revision");if(b)this.delta=(new Date).getTime()-b;if(d)this._options.lastrevision=d;for(b=0;b '+h}}c.innerHTML=b.join(", ")}},updateVisitorsTimers:function(){for(var a in this.visitorTimers)if(null!=this.visitorTimers[a]){var c=this.visitorTimers[a],b=CommonUtils.getRow("vis"+ +a,this.t2);if(null!=b){var d=function(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d};d(this.t2,b,"time",this.getTimeSince(c[0]));d(this.t2,b,"modified",this.getTimeSince(c[1]));null!=c[2]&&d(this.t2,b,"invitationtime",this.getTimeSince(c[2]))}}},updateVisitor:function(a){function c(a,b,c,d){if(a=CommonUtils.getCell(c,b,a))a.innerHTML=d}for(var b,d=0;d=j.rowIndex))this.t2.deleteRow(d.rowIndex),d=this.visitorTimers[b]=null;null==d?(d=this.t2.insertRow(a.rowIndex+1),d.id="vis"+b,this.visitorTimers[b]=[l,k,m],CommonUtils.insertCell(d,"username","visitor",null,null,HtmlGenerationUtils.viewVisOpenCell(h,this._options.inviteservl,b,this._options.trackedservl,null==f)),CommonUtils.insertCell(d,"addr","visitor","center",null,g),CommonUtils.insertCell(d, +"time","visitor","center",null,this.getTimeSince(l)),CommonUtils.insertCell(d,"modified","visitor","center",null,this.getTimeSince(k)),CommonUtils.insertCell(d,"operator","visitor","center",null,null!=f?f:"-"),CommonUtils.insertCell(d,"invitationtime","visitor","center",null,null!=f?this.getTimeSince(m):"-"),CommonUtils.insertCell(d,"invitations","visitor","center",null,n+" / "+e),CommonUtils.insertCell(d,"useragent","visitor","center",null,i)):(this.visitorTimers[b]=[l,k,m],c(this.t2,d,"username", +HtmlGenerationUtils.viewVisOpenCell(h,this._options.inviteservl,b,this._options.trackedservl,null==f)),c(this.t2,d,"addr",g),c(this.t2,d,"operator",null!=f?f:"-"),c(this.t2,d,"time",this.getTimeSince(l)),c(this.t2,d,"modified",this.getTimeSince(k)),c(this.t2,d,"invitationtime",null!=f?this.getTimeSince(m):"-"),c(this.t2,d,"invitations",n+" / "+e),c(this.t2,d,"useragent",i));this.visitors[b]=1;return!1},removeOldVisitors:function(){for(id in this.old_visitors)if(void 0===this.visitors[id]){var a=CommonUtils.getRow("vis"+ +id,this.t2);a&&this.t2.deleteRow(a.rowIndex);this.visitorTimers[id]=null}},updateVisitorsList:function(a){var c=$("visstatustd");if(c)c.innerHTML=0> pending.menu.show=Show menu >> pending.popup_notification=A new visitor is waiting for an answer. +pending.status.away=Away +pending.status.online=Up to date pending.status.setaway=Set status as "Away" pending.status.setonline=Set status as "Available" pending.table.ban=Ban this visitor diff --git a/src/messenger/webim/locales/ru/properties b/src/messenger/webim/locales/ru/properties index 730e4841..d30f5be7 100644 --- a/src/messenger/webim/locales/ru/properties +++ b/src/messenger/webim/locales/ru/properties @@ -375,6 +375,8 @@ page_settings.tab.invitationthemes= pending.menu.hide=Спрятать меню >> pending.menu.show=Показать меню >> pending.popup_notification=Новый посетитель ожидает ответа. +pending.status.away=Отошел +pending.status.online=Доступен pending.status.setaway=Выставить статус "Отошел" pending.status.setonline=Выставить статус "Доступен" pending.table.ban=Пометить посетителя как нежелательного diff --git a/src/messenger/webim/view/pending_users.php b/src/messenger/webim/view/pending_users.php index ccaa812e..877143bf 100644 --- a/src/messenger/webim/view/pending_users.php +++ b/src/messenger/webim/view/pending_users.php @@ -36,7 +36,9 @@ var localized = new Array( "", "", "", - "" + "", + "", + "" ); var updaterOptions = { url:"/operator/update.php",wroot:"",