apply patch by Andrew Armstrong: available operators list (revised); remove odd eval code in common.js

git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@767 c66351dc-e62f-0410-b875-e3a5c0b9693f
This commit is contained in:
Evgeny Gryaznov 2010-04-25 23:28:05 +00:00
parent 59e5325785
commit 3903449edc
18 changed files with 156 additions and 82 deletions

View File

@ -594,6 +594,13 @@ table.awaiting td.visitor {
text-decoration: underline; text-decoration: underline;
} }
/* online operators */
#onlineoperators {
padding-right: 10px;
float: right;
}
/* search */ /* search */
#searchtext { #searchtext {

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -9,7 +9,7 @@ var Class={create:function(){return function(){this.initialize.apply(this,argume
Function.prototype.bindAsEventListener=function(a){var b=this;return function(c){b.call(a,c||window.event)}};Number.prototype.toColorPart=function(){var a=this.toString(16);if(this<16)return"0"+a;return a};var Try={these:function(){for(var a,b=0;b<arguments.length;b++){var c=arguments[b];try{a=c();break}catch(d){}}return a}},PeriodicalExecuter=Class.create(); Function.prototype.bindAsEventListener=function(a){var b=this;return function(c){b.call(a,c||window.event)}};Number.prototype.toColorPart=function(){var a=this.toString(16);if(this<16)return"0"+a;return a};var Try={these:function(){for(var a,b=0;b<arguments.length;b++){var c=arguments[b];try{a=c();break}catch(d){}}return a}},PeriodicalExecuter=Class.create();
PeriodicalExecuter.prototype={initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1E3)},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;this.callback()}finally{this.currentlyExecuting=false}}}; PeriodicalExecuter.prototype={initialize:function(a,b){this.callback=a;this.frequency=b;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){setInterval(this.onTimerEvent.bind(this),this.frequency*1E3)},onTimerEvent:function(){if(!this.currentlyExecuting)try{this.currentlyExecuting=true;this.callback()}finally{this.currentlyExecuting=false}}};
function findObj(a){var b;if(!(b=document[a])&&document.all)b=document.all[a];if(!b&&document.getElementById)b=document.getElementById(a);if(!b&&!document.all&&document.getElementsByName){b=document.getElementsByName(a);if(b.length==0)return null;if(b.length==1)return b[0]}return b}if(!Array.prototype.push)Array.prototype.push=function(){for(var a=this.length,b=0;b<arguments.length;b++)this[a+b]=arguments[b];return this.length}; function findObj(a){var b;if(!(b=document[a])&&document.all)b=document.all[a];if(!b&&document.getElementById)b=document.getElementById(a);if(!b&&!document.all&&document.getElementsByName){b=document.getElementsByName(a);if(b.length==0)return null;if(b.length==1)return b[0]}return b}if(!Array.prototype.push)Array.prototype.push=function(){for(var a=this.length,b=0;b<arguments.length;b++)this[a+b]=arguments[b];return this.length};
function $(){for(var a=[],b=0;b<arguments.length;b++){var c=arguments[b];if(typeof c=="string")c=findObj(c);if(arguments.length==1)return c;a.push(c)}return a}if(!Function.prototype.apply)Function.prototype.apply=function(a,b){var c=[];a||(a=window);b||(b=[]);for(var d=0;d<b.length;d++)c[d]="params["+d+"]";a.$apply$=this;b=eval("obj.$apply$("+c.join(", ")+")");a.$apply$=null;return b}; function $(){for(var a=[],b=0;b<arguments.length;b++){var c=arguments[b];if(typeof c=="string")c=findObj(c);if(arguments.length==1)return c;a.push(c)}return a}
var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest})||false},getXml:function(a){if(a&&a.status>=200&&a.status<300)if((a=a.responseXML)&&a.documentElement)return a.documentElement;return null},getError:function(a){return a.statusText||"connection error N"+a.status},emptyFunction:function(){}};Ajax.Base=function(){}; var Ajax={getTransport:function(){return Try.these(function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")},function(){return new XMLHttpRequest})||false},getXml:function(a){if(a&&a.status>=200&&a.status<300)if((a=a.responseXML)&&a.documentElement)return a.documentElement;return null},getError:function(a){return a.statusText||"connection error N"+a.status},emptyFunction:function(){}};Ajax.Base=function(){};
Ajax.Base.prototype={setOptions:function(a){this._options={_method:"post",asynchronous:true,parameters:""}.extend(a||{})},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},responseIsSuccess:function(){var a=this.getStatus();return!a||a>=200&&a<300},responseIsFailure:function(){return!this.responseIsSuccess()}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"]; Ajax.Base.prototype={setOptions:function(a){this._options={_method:"post",asynchronous:true,parameters:""}.extend(a||{})},getStatus:function(){try{return this.transport.status||0}catch(a){return 0}},responseIsSuccess:function(){var a=this.getStatus();return!a||a>=200&&a<300},responseIsFailure:function(){return!this.responseIsSuccess()}};Ajax.Request=Class.create();Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Class.inherit(Ajax.Request,Ajax.Base,{initialize:function(a,b){this.transport=Ajax.getTransport();this.setOptions(b);this.transportTimer={};this.finished=false;this.request(a)},request:function(a){var b=this._options.parameters||"";if(b.length>0)b+="&_=";try{if(this._options._method=="get"&&b.length>0)a+="?"+b;this.transport.open(this._options._method.toUpperCase(),a,this._options.asynchronous);if(this._options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);if(this._options.timeout)this.transportTimer= Class.inherit(Ajax.Request,Ajax.Base,{initialize:function(a,b){this.transport=Ajax.getTransport();this.setOptions(b);this.transportTimer={};this.finished=false;this.request(a)},request:function(a){var b=this._options.parameters||"";if(b.length>0)b+="&_=";try{if(this._options._method=="get"&&b.length>0)a+="?"+b;this.transport.open(this._options._method.toUpperCase(),a,this._options.asynchronous);if(this._options.asynchronous){this.transport.onreadystatechange=this.onStateChange.bind(this);if(this._options.timeout)this.transportTimer=
@ -18,10 +18,10 @@ setTimeout(this.handleTimeout.bind(this),this._options.timeout)}this.setRequestH
clearTimeout(this.transportTimer);(this._options.onComplete||Ajax.emptyFunction)(this.transport)}}catch(b){this.dispatchException(b)}this.transport.onreadystatechange=Ajax.emptyFunction}},dispatchException:function(a){(this._options.onException||Ajax.emptyFunction)(this,a)}}); clearTimeout(this.transportTimer);(this._options.onComplete||Ajax.emptyFunction)(this.transport)}}catch(b){this.dispatchException(b)}this.transport.onreadystatechange=Ajax.emptyFunction}},dispatchException:function(a){(this._options.onException||Ajax.emptyFunction)(this,a)}});
var EventHelper={register:function(a,b,c){var d=a[b];a[b]=typeof d!="function"?c:function(){d();c()}}},Behaviour={list:[],register:function(a){Behaviour.list.push(a)},init:function(){EventHelper.register(window,"onload",function(){Behaviour.apply()})},apply:function(){for(h=0;sheet=Behaviour.list[h];h++)for(selector in sheet)if(list=document.getElementsBySelector(selector))for(i=0;element=list[i];i++)sheet[selector](element)}};Behaviour.init(); var EventHelper={register:function(a,b,c){var d=a[b];a[b]=typeof d!="function"?c:function(){d();c()}}},Behaviour={list:[],register:function(a){Behaviour.list.push(a)},init:function(){EventHelper.register(window,"onload",function(){Behaviour.apply()})},apply:function(){for(h=0;sheet=Behaviour.list[h];h++)for(selector in sheet)if(list=document.getElementsBySelector(selector))for(i=0;element=list[i];i++)sheet[selector](element)}};Behaviour.init();
function getAllChildren(a){return a.all?a.all:a.getElementsByTagName("*")} function getAllChildren(a){return a.all?a.all:a.getElementsByTagName("*")}
document.getElementsBySelector=function(a){if(!document.getElementsByTagName)return[];a=a.split(" ");for(var b=new Array(document),c=0;c<a.length;c++){token=a[c].replace(/^\s+/,"").replace(/\s+$/,"");if(token.indexOf("#")>-1){var d=token.split("#"),e=d[0];b=document.getElementById(d[1]);if(b==null||e&&b.nodeName.toLowerCase()!=e)return[];b=new Array(b)}else if(token.indexOf(".")>-1){d=token.split(".");e=d[0];d=d[1];e||(e="*");for(var l=[],j=0,m=0;m<b.length;m++){var g;g=e=="*"?getAllChildren(b[m]): document.getElementsBySelector=function(a){if(!document.getElementsByTagName)return[];a=a.split(" ");for(var b=new Array(document),c=0;c<a.length;c++){token=a[c].replace(/^\s+/,"").replace(/\s+$/,"");if(token.indexOf("#")>-1){var d=token.split("#"),e=d[0];b=document.getElementById(d[1]);if(b==null||e&&b.nodeName.toLowerCase()!=e)return[];b=new Array(b)}else if(token.indexOf(".")>-1){d=token.split(".");e=d[0];d=d[1];e||(e="*");for(var j=[],l=0,m=0;m<b.length;m++){var g;g=e=="*"?getAllChildren(b[m]):
b[m].getElementsByTagName(e);if(g!=null)for(var o=0;o<g.length;o++)l[j++]=g[o]}b=[];for(j=e=0;j<l.length;j++)if(l[j].className&&l[j].className.match(new RegExp("\\b"+d+"\\b")))b[e++]=l[j]}else{if(!b[0])return;e=token;l=[];for(m=j=0;m<b.length;m++){g=b[m].getElementsByTagName(e);for(o=0;o<g.length;o++)l[j++]=g[o]}b=l}}return b}; b[m].getElementsByTagName(e);if(g!=null)for(var o=0;o<g.length;o++)j[l++]=g[o]}b=[];for(l=e=0;l<j.length;l++)if(j[l].className&&j[l].className.match(new RegExp("\\b"+d+"\\b")))b[e++]=j[l]}else{if(!b[0])return;e=token;j=[];for(m=l=0;m<b.length;m++){g=b[m].getElementsByTagName(e);for(o=0;o<g.length;o++)j[l++]=g[o]}b=j}}return b};
var NodeUtils={getNodeValue:function(a,b){a=a.getElementsByTagName(b);if(a.length==0)return"";a=a[0].childNodes;b="";for(i=0;i<a.length;i++)b+=a[i].nodeValue;return b},getNodeText:function(a){a=a.childNodes;var b="";for(i=0;i<a.length;i++)b+=a[i].nodeValue;return b},getAttrValue:function(a,b){for(k=0;k<a.attributes.length;k++)if(a.attributes[k].nodeName==b)return a.attributes[k].nodeValue;return null}},CommonUtils={getRow:function(a,b){var c=b.rows[a];if(c!=null)return c;if(b.rows.head!=null)return null; var NodeUtils={getNodeValue:function(a,b){a=a.getElementsByTagName(b);if(a.length==0)return"";a=a[0].childNodes;b="";for(i=0;i<a.length;i++)b+=a[i].nodeValue;return b},getNodeText:function(a){a=a.childNodes;var b="";for(i=0;i<a.length;i++)b+=a[i].nodeValue;return b},getAttrValue:function(a,b){for(k=0;k<a.attributes.length;k++)if(a.attributes[k].nodeName==b)return a.attributes[k].nodeValue;return null}},CommonUtils={getRow:function(a,b){var c=b.rows[a];if(c!=null)return c;if(b.rows.head!=null)return null;
for(k=0;k<b.rows.length;k++)if(b.rows[k].id==a)return b.rows[k];return null},getCell:function(a,b,c){var d=b.cells[a];if(d!=null)return d;if(c.rows.head!=null)return null;for(k=0;k<b.cells.length;k++)if(b.cells[k].id==a)return b.cells[k];return null},insertCell:function(a,b,c,d,e,l){a=a.insertCell(-1);a.id=b;if(d)a.align=d;a.className=c;if(e)a.height=e;a.innerHTML=l}}; for(k=0;k<b.rows.length;k++)if(b.rows[k].id==a)return b.rows[k];return null},getCell:function(a,b,c){var d=b.cells[a];if(d!=null)return d;if(c.rows.head!=null)return null;for(k=0;k<b.cells.length;k++)if(b.cells[k].id==a)return b.cells[k];return null},insertCell:function(a,b,c,d,e,j){a=a.insertCell(-1);a.id=b;if(d)a.align=d;a.className=c;if(e)a.height=e;a.innerHTML=j}};
function getWavMimeType(){var a="application/x-mplayer2",b=navigator.userAgent.toLowerCase();if(navigator.mimeTypes&&b.indexOf("windows")==-1)if(navigator.mimeTypes["audio/mpeg"].enabledPlugin||b.indexOf("opera")>=0)a="audio/mpeg";return a} function getWavMimeType(){var a="application/x-mplayer2",b=navigator.userAgent.toLowerCase();if(navigator.mimeTypes&&b.indexOf("windows")==-1)if(navigator.mimeTypes["audio/mpeg"].enabledPlugin||b.indexOf("opera")>=0)a="audio/mpeg";return a}
function playSound(a){var b=document.getElementById("player");b&&b.parentNode.removeChild(b);b=document.body.appendChild(document.createElement("div"));var c=navigator.userAgent.toLowerCase();b.innerHTML=c.indexOf("safari")==-1&&c.indexOf("windows")!=-1?'<embed type="'+getWavMimeType()+'" src="'+a+'" loop="0" autostart="1" width="0" height="0">':'<div style="position: static; width: 0px; height: 0px"><embed type="'+getWavMimeType()+'" src="'+a+'" hidden="true" loop="false" autostart="true"></div>'} function playSound(a){var b=document.getElementById("player");b&&b.parentNode.removeChild(b);b=document.body.appendChild(document.createElement("div"));var c=navigator.userAgent.toLowerCase();b.innerHTML=c.indexOf("safari")==-1&&c.indexOf("windows")!=-1?'<embed type="'+getWavMimeType()+'" src="'+a+'" loop="0" autostart="1" width="0" height="0">':'<div style="position: static; width: 0px; height: 0px"><embed type="'+getWavMimeType()+'" src="'+a+'" hidden="true" loop="false" autostart="true"></div>'}
function htmlescape(a){return a.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace('"',"&quot;")}; function htmlescape(a){return a.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace('"',"&quot;")};

View File

@ -9,18 +9,19 @@ 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), 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=undefined;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); 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=undefined;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);
if(b)(this._options.updateContent||Ajax.emptyFunction)(b);else this._options.handleError&&this._options.handleError("reconnecting")}catch(c){}this.timer=setTimeout(this.update.bind(this),this.frequency*1E3)}}); if(b)(this._options.updateContent||Ajax.emptyFunction)(b);else 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,e,l,j){return'<a href="'+a+'"'+(j!=null?' class="'+j+'"':"")+' target="_blank" title="'+b+'" onclick="this.newWindow = window.open(\''+a+"', '"+c+"', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width="+e+",height="+l+",resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;\">"+d+"</a>"},generateOneRowTable:function(a){return'<table class="inner"><tr>'+a+"</tr></table>"},viewOpenCell:function(a,b,c,d,e,l,j,m){l= var HtmlGenerationUtils={popupLink:function(a,b,c,d,e,j,l){return'<a href="'+a+'"'+(l!=null?' class="'+l+'"':"")+' target="_blank" title="'+b+'" onclick="this.newWindow = window.open(\''+a+"', '"+c+"', 'toolbar=0,scrollbars=0,location=0,status=1,menubar=0,width="+e+",height="+j+",resizable=1');this.newWindow.focus();this.newWindow.opener=window;return false;\">"+d+"</a>"},generateOneRowTable:function(a){return'<table class="inner"><tr>'+a+"</tr></table>"},viewOpenCell:function(a,b,c,d,e,j,l,m){j=
2;b=b+"?thread="+c;var g="<td>";g+=e||d?HtmlGenerationUtils.popupLink(m||!d?b:b+"&viewonly=true",localized[e?0:1],"ImCenter"+c,a,640,480,null):'<a href="#">'+a+"</a>";g+="</td>";if(e){g+='<td class="icon">';g+=HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,'<img src="'+webimRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',640,480,null);g+="</td>";l++}if(d){g+='<td class="icon">';g+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+ 2;b=b+"?thread="+c;var g="<td>";g+=e||d?HtmlGenerationUtils.popupLink(m||!d?b:b+"&viewonly=true",localized[e?0:1],"ImCenter"+c,a,640,480,null):'<a href="#">'+a+"</a>";g+="</td>";if(e){g+='<td class="icon">';g+=HtmlGenerationUtils.popupLink(b,localized[0],"ImCenter"+c,'<img src="'+webimRoot+'/images/tbliclspeak.gif" width="15" height="15" border="0" alt="'+localized[0]+'">',640,480,null);g+="</td>";j++}if(d){g+='<td class="icon">';g+=HtmlGenerationUtils.popupLink(b+"&viewonly=true",localized[1],"ImCenter"+
c,'<img src="'+webimRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',640,480,null);g+="</td>";l++}if(j!=""){g+='</tr><tr><td class="firstmessage" colspan="'+l+'"><a href="javascript:void(0)" title="'+j+'" onclick="alert(this.title);return false;">';g+=j.length>30?j.substring(0,30)+"...":j;g+="</a></td>"}return HtmlGenerationUtils.generateOneRowTable(g)},banCell:function(a,b){return'<td class="icon">'+HtmlGenerationUtils.popupLink(webimRoot+"/operator/ban.php?"+ c,'<img src="'+webimRoot+'/images/tbliclread.gif" width="15" height="15" border="0" alt="'+localized[1]+'">',640,480,null);g+="</td>";j++}if(l!=""){g+='</tr><tr><td class="firstmessage" colspan="'+j+'"><a href="javascript:void(0)" title="'+l+'" onclick="alert(this.title);return false;">';g+=l.length>30?l.substring(0,30)+"...":l;g+="</a></td>"}return HtmlGenerationUtils.generateOneRowTable(g)},banCell:function(a,b){return'<td class="icon">'+HtmlGenerationUtils.popupLink(webimRoot+"/operator/ban.php?"+
(b?"id="+b:"thread="+a),localized[2],"ban"+a,'<img src="'+webimRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',720,480,null)+"</td>"}};Ajax.ThreadListUpdater=Class.create(); (b?"id="+b:"thread="+a),localized[2],"ban"+a,'<img src="'+webimRoot+'/images/ban.gif" width="15" height="15" border="0" alt="'+localized[2]+'">',720,480,null)+"</td>"}};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.periodicalUpdater=new Ajax.PeriodicalUpdater(this._options)},updateParams:function(){return"since="+this._options.lastrevision+"&status="+this._options.istatus}, 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.periodicalUpdater=new Ajax.PeriodicalUpdater(this._options)},updateParams:function(){return"since="+this._options.lastrevision+"&status="+this._options.istatus+
setStatus:function(a){this._options.status.innerHTML=a},handleError:function(a){this.setStatus(a)},updateThread:function(a){function b(s,w,x,y){if(s=CommonUtils.getCell(x,w,s))s.innerHTML=y}for(var c,d,e,l=false,j=false,m=false,g=null,o=null,f=0;f<a.attributes.length;f++){var n=a.attributes[f];if(n.nodeName=="id")c=n.nodeValue;else if(n.nodeName=="stateid")d=n.nodeValue;else if(n.nodeName=="state")e=n.nodeValue;else if(n.nodeName=="canopen")j=true;else if(n.nodeName=="canview")l=true;else if(n.nodeName== (this._options.showonline?"&showonline=1":"")},setStatus:function(a){this._options.status.innerHTML=a},handleError:function(a){this.setStatus(a)},updateThread:function(a){function b(s,w,x,y){if(s=CommonUtils.getCell(x,w,s))s.innerHTML=y}for(var c,d,e,j=false,l=false,m=false,g=null,o=null,f=0;f<a.attributes.length;f++){var n=a.attributes[f];if(n.nodeName=="id")c=n.nodeValue;else if(n.nodeName=="stateid")d=n.nodeValue;else if(n.nodeName=="state")e=n.nodeValue;else if(n.nodeName=="canopen")l=true;else if(n.nodeName==
"canban")m=true;else if(n.nodeName=="ban")g=n.nodeValue;else if(n.nodeName=="banid")o=n.nodeValue}f=CommonUtils.getRow("thr"+c,this.t);if(d=="closed"){f&&this.t.deleteRow(f.rowIndex);this.threadTimers[c]=null}else{n=NodeUtils.getNodeValue(a,"name");var t=NodeUtils.getNodeValue(a,"addr"),q=NodeUtils.getNodeValue(a,"time"),u=NodeUtils.getNodeValue(a,"agent"),r=NodeUtils.getNodeValue(a,"modified"),v=NodeUtils.getNodeValue(a,"message"),p="<td>"+NodeUtils.getNodeValue(a,"useragent")+"</td>";if(g!=null)p= "canview")j=true;else if(n.nodeName=="canban")m=true;else if(n.nodeName=="ban")g=n.nodeValue;else if(n.nodeName=="banid")o=n.nodeValue}f=CommonUtils.getRow("thr"+c,this.t);if(d=="closed"){f&&this.t.deleteRow(f.rowIndex);this.threadTimers[c]=null}else{n=NodeUtils.getNodeValue(a,"name");var t=NodeUtils.getNodeValue(a,"addr"),q=NodeUtils.getNodeValue(a,"time"),u=NodeUtils.getNodeValue(a,"agent"),r=NodeUtils.getNodeValue(a,"modified"),v=NodeUtils.getNodeValue(a,"message"),p="<td>"+NodeUtils.getNodeValue(a,
"<td>"+NodeUtils.getNodeValue(a,"reason")+"</td>";if(m)p+=HtmlGenerationUtils.banCell(c,o);p=HtmlGenerationUtils.generateOneRowTable(p);a=CommonUtils.getRow("t"+d,this.t);m=CommonUtils.getRow("t"+d+"end",this.t);if(f!=null&&(f.rowIndex<=a.rowIndex||f.rowIndex>=m.rowIndex)){this.t.deleteRow(f.rowIndex);f=this.threadTimers[c]=null}if(f==null){f=this.t.insertRow(a.rowIndex+1);f.className=g=="blocked"&&d!="chat"?"ban":"in"+d;f.id="thr"+c;this.threadTimers[c]=new Array(q,r,d);CommonUtils.insertCell(f, "useragent")+"</td>";if(g!=null)p="<td>"+NodeUtils.getNodeValue(a,"reason")+"</td>";if(m)p+=HtmlGenerationUtils.banCell(c,o);p=HtmlGenerationUtils.generateOneRowTable(p);a=CommonUtils.getRow("t"+d,this.t);m=CommonUtils.getRow("t"+d+"end",this.t);if(f!=null&&(f.rowIndex<=a.rowIndex||f.rowIndex>=m.rowIndex)){this.t.deleteRow(f.rowIndex);f=this.threadTimers[c]=null}if(f==null){f=this.t.insertRow(a.rowIndex+1);f.className=g=="blocked"&&d!="chat"?"ban":"in"+d;f.id="thr"+c;this.threadTimers[c]=new Array(q,
"name","visitor",null,null,HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,l,j,g,v,d!="chat"));CommonUtils.insertCell(f,"contid","visitor","center",null,t);CommonUtils.insertCell(f,"state","visitor","center",null,e);CommonUtils.insertCell(f,"op","visitor","center",null,u);CommonUtils.insertCell(f,"time","visitor","center",null,this.getTimeSince(q));CommonUtils.insertCell(f,"wait","visitor","center",null,d!="chat"?this.getTimeSince(r):"-");CommonUtils.insertCell(f,"etc","visitor","center", r,d);CommonUtils.insertCell(f,"name","visitor",null,null,HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,j,l,g,v,d!="chat"));CommonUtils.insertCell(f,"contid","visitor","center",null,t);CommonUtils.insertCell(f,"state","visitor","center",null,e);CommonUtils.insertCell(f,"op","visitor","center",null,u);CommonUtils.insertCell(f,"time","visitor","center",null,this.getTimeSince(q));CommonUtils.insertCell(f,"wait","visitor","center",null,d!="chat"?this.getTimeSince(r):"-");CommonUtils.insertCell(f,
null,p);if(d=="wait"||d=="prio")return true}else{this.threadTimers[c]=new Array(q,r,d);f.className=g=="blocked"&&d!="chat"?"ban":"in"+d;b(this.t,f,"name",HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,l,j,g,v,d!="chat"));b(this.t,f,"contid",t);b(this.t,f,"state",e);b(this.t,f,"op",u);b(this.t,f,"time",this.getTimeSince(q));b(this.t,f,"wait",d!="chat"?this.getTimeSince(r):"-");b(this.t,f,"etc",p)}return false}},updateQueueMessages:function(){function a(d,e){d=$(e);e=$(e+"end");if(d== "etc","visitor","center",null,p);if(d=="wait"||d=="prio")return true}else{this.threadTimers[c]=new Array(q,r,d);f.className=g=="blocked"&&d!="chat"?"ban":"in"+d;b(this.t,f,"name",HtmlGenerationUtils.viewOpenCell(n,this._options.agentservl,c,j,l,g,v,d!="chat"));b(this.t,f,"contid",t);b(this.t,f,"state",e);b(this.t,f,"op",u);b(this.t,f,"time",this.getTimeSince(q));b(this.t,f,"wait",d!="chat"?this.getTimeSince(r):"-");b(this.t,f,"etc",p)}return false}},updateQueueMessages:function(){function a(d,e){d=
null||e==null)return false;return d.rowIndex+1<e.rowIndex}var b=$("statustd");if(b){var c=a(this.t,"twait")||a(this.t,"tprio")||a(this.t,"tchat");b.innerHTML=c?"":this._options.noclients;b.height=c?5:30}},getTimeSince:function(a){a=Math.floor(((new Date).getTime()-a-this.delta)/1E3);var b=Math.floor(a/60),c="";a%=60;if(a<10)a="0"+a;if(b>=60){c=Math.floor(b/60);b%=60;if(b<10)b="0"+b;c=c+":"}return c+b+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(this.threadTimers[a]!=null){var b= $(e);e=$(e+"end");if(d==null||e==null)return false;return d.rowIndex+1<e.rowIndex}var b=$("statustd");if(b){var c=a(this.t,"twait")||a(this.t,"tprio")||a(this.t,"tchat");b.innerHTML=c?"":this._options.noclients;b.height=c?5:30}},getTimeSince:function(a){a=Math.floor(((new Date).getTime()-a-this.delta)/1E3);var b=Math.floor(a/60),c="";a%=60;if(a<10)a="0"+a;if(b>=60){c=Math.floor(b/60);b%=60;if(b<10)b="0"+b;c=c+":"}return c+b+":"+a},updateTimers:function(){for(var a in this.threadTimers)if(this.threadTimers[a]!=
this.threadTimers[a],c=CommonUtils.getRow("thr"+a,this.t);if(c!=null){function d(e,l,j,m){if(e=CommonUtils.getCell(j,l,e))e.innerHTML=m}d(this.t,c,"time",this.getTimeSince(b[0]));d(this.t,c,"wait",b[2]!="chat"?this.getTimeSince(b[1]):"-")}}},updateContent:function(a){var b=false;if(a.tagName=="threads"){var 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<a.childNodes.length;c++){d=a.childNodes[c]; null){var b=this.threadTimers[a],c=CommonUtils.getRow("thr"+a,this.t);if(c!=null){function d(e,j,l,m){if(e=CommonUtils.getCell(l,j,e))e.innerHTML=m}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=false,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<a.childNodes.length;c++){d=a.childNodes[c];if(d.tagName==
if(d.tagName=="thread")if(this.updateThread(d))b=true}this.updateQueueMessages();this.updateTimers();this.setStatus(this._options.istatus?"Away":"Up to date");if(b){playSound(webimRoot+"/sounds/new_user.wav");window.focus();updaterOptions.showpopup&&alert(localized[5])}}else a.tagName=="error"?this.setStatus(NodeUtils.getNodeValue(a,"descr")):this.setStatus("reconnecting")}}); "thread")if(this.updateThread(d))b=true}this.updateQueueMessages();this.updateTimers();this.setStatus(this._options.istatus?"Away":"Up to date");if(b){playSound(webimRoot+"/sounds/new_user.wav");window.focus();updaterOptions.showpopup&&alert(localized[5])}},updateOperators:function(a){var b=$("onlineoperators");if(b){for(var c=[],d=0;d<a.childNodes.length;d++){var e=a.childNodes[d];if(e.tagName=="operator"){var j=NodeUtils.getAttrValue(e,"name");e=NodeUtils.getAttrValue(e,"away")!=null;c[c.length]=
'<img src="'+webimRoot+"/images/op"+(e?"away":"online")+'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+j}}b.innerHTML=c.join(", ")}},updateContent:function(a){if(a.tagName=="update")for(var b=0;b<a.childNodes.length;b++){var c=a.childNodes[b];if(c.tagName=="threads")this.updateThreads(c);else c.tagName=="operators"&&this.updateOperators(c)}else a.tagName=="error"?this.setStatus(NodeUtils.getNodeValue(a,"descr")):this.setStatus("reconnecting")}});
function togglemenu(){if($("sidebar")&&$("wcontent")&&$("togglemenu"))if($("wcontent").className=="contentnomenu"){$("sidebar").style.display="block";$("wcontent").className="contentinner";$("togglemenu").innerHTML=localized[4]}else{$("sidebar").style.display="none";$("wcontent").className="contentnomenu";$("togglemenu").innerHTML=localized[3]}}var webimRoot="";Behaviour.register({"#togglemenu":function(a){a.onclick=function(){togglemenu()}}}); function togglemenu(){if($("sidebar")&&$("wcontent")&&$("togglemenu"))if($("wcontent").className=="contentnomenu"){$("sidebar").style.display="block";$("wcontent").className="contentinner";$("togglemenu").innerHTML=localized[4]}else{$("sidebar").style.display="none";$("wcontent").className="contentnomenu";$("togglemenu").innerHTML=localized[3]}}var webimRoot="";Behaviour.register({"#togglemenu":function(a){a.onclick=function(){togglemenu()}}});
EventHelper.register(window,"onload",function(){webimRoot=updaterOptions.wroot;new Ajax.ThreadListUpdater({table:$("threadlist"),status:$("connstatus"),istatus:0}.extend(updaterOptions||{}));updaterOptions.havemenu||togglemenu()}); EventHelper.register(window,"onload",function(){webimRoot=updaterOptions.wroot;new Ajax.ThreadListUpdater({table:$("threadlist"),status:$("connstatus"),istatus:0}.extend(updaterOptions||{}));updaterOptions.havemenu||togglemenu()});

View File

@ -15,7 +15,7 @@
//- localized //- localized
//- onComplete, obj, params, $apply$ //- onComplete
//- threadParams, servl, frequency, user, threadid, token, cssfile //- threadParams, servl, frequency, user, threadid, token, cssfile
//- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl, istatus //- updaterOptions, url, company, agentservl, noclients, wroot, havemenu, showpopup, ignorectrl, istatus
@ -150,24 +150,6 @@ function $() {
return elems; 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 = { var Ajax = {
getTransport: function() { getTransport: function() {
return Try.these( return Try.these(

View File

@ -125,7 +125,7 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
}, },
updateParams: function() { 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) { setStatus: function(msg) {
@ -281,31 +281,66 @@ Class.inherit( Ajax.ThreadListUpdater, Ajax.Base, {
} }
}, },
updateContent: function(root) { updateThreads: function(root) {
var newAdded = false; var newAdded = false;
if( root.tagName == 'threads' ) { var _time = NodeUtils.getAttrValue(root, "time");
var _time = NodeUtils.getAttrValue(root, "time"); var _revision = NodeUtils.getAttrValue(root, "revision" );
var _revision = NodeUtils.getAttrValue(root, "revision" );
if( _time ) if( _time )
this.delta = (new Date()).getTime() - _time; this.delta = (new Date()).getTime() - _time;
if( _revision ) if( _revision )
this._options.lastrevision = _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;
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] =
'<img src="'+webimRoot+'/images/op'+(isAway ? 'away' : 'online')+
'.gif" width="12" height="12" border="0" alt="'+localized[1]+'"> '+ name;
}
div.innerHTML = names.join(', ');
},
updateContent: function(root) {
if( root.tagName == 'update' ) {
for( var i = 0; i < root.childNodes.length; i++ ) { for( var i = 0; i < root.childNodes.length; i++ ) {
var node = root.childNodes[i]; var node = root.childNodes[i];
if( node.tagName == 'thread' )
if( this.updateThread(node) ) if (node.tagName == 'threads') {
newAdded = true; this.updateThreads(node);
} } else if (node.tagName == 'operators') {
this.updateQueueMessages(); this.updateOperators(node);
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]);
} }
} }
} else if( root.tagName == 'error' ) { } else if( root.tagName == 'error' ) {

View File

@ -582,6 +582,7 @@ $settings = array(
'surveyaskgroup' => '1', 'surveyaskgroup' => '1',
'surveyaskmessage' => '0', 'surveyaskmessage' => '0',
'enablepopupnotification' => '0', 'enablepopupnotification' => '0',
'showonlineoperators' => '0',
'enablecaptcha' => '0', 'enablecaptcha' => '0',
'online_timeout' => 30, /* Timeout (in seconds) when online operator becomes offline */ 'online_timeout' => 30, /* Timeout (in seconds) when online operator becomes offline */

View File

@ -61,6 +61,31 @@ function operator_by_id($id) {
return $operator; 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,$jabber,$password,$localename,$commonname,$notify) { function update_operator($operatorid,$login,$email,$jabber,$password,$localename,$commonname,$notify) {
$link = connect(); $link = connect();
$query = sprintf( $query = sprintf(

View File

@ -473,6 +473,8 @@ settings.popup_notification.description=Small dialog appears to attract your att
settings.popup_notification=Enable "Popup dialog notification of the new visitor". settings.popup_notification=Enable "Popup dialog notification of the new visitor".
settings.saved=Changes saved settings.saved=Changes saved
settings.sendmessagekey=Send messages with: 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.description=Show/hide department selection field in the survey
settings.survey.askgroup=Allows visitor to choose department/group settings.survey.askgroup=Allows visitor to choose department/group
settings.survey.askmail.description=Show/hide email field in the survey settings.survey.askmail.description=Show/hide email field in the survey

View File

@ -463,6 +463,8 @@ settings.popup_notification.description=
settings.popup_notification=Показывать небольшой диалог при появлении новых посетителей в очереди. settings.popup_notification=Показывать небольшой диалог при появлении новых посетителей в очереди.
settings.saved=Изменения сохранены settings.saved=Изменения сохранены
settings.sendmessagekey=Посылать сообщение по: settings.sendmessagekey=Посылать сообщение по:
settings.show_online_operators.description=Может замедлить обновление списка
settings.show_online_operators=Показывать доступных операторов на странице ожидающих посетителей
settings.survey.askgroup.description=Показать/спрятать выбор группы в диалоге перед началом чата settings.survey.askgroup.description=Показать/спрятать выбор группы в диалоге перед началом чата
settings.survey.askgroup=Позволять посетителю выбирать группу операторов settings.survey.askgroup=Позволять посетителю выбирать группу операторов
settings.survey.askmail.description=Показать/спрятать поле ввода адреса электронной почты settings.survey.askmail.description=Показать/спрятать поле ввода адреса электронной почты

View File

@ -32,7 +32,7 @@ $options = array(
'enableban', 'usercanchangename', 'enablegroups', 'enablestatistics', 'enablejabber', 'enableban', 'usercanchangename', 'enablegroups', 'enablestatistics', 'enablejabber',
'enablessl', 'forcessl', 'enablessl', 'forcessl',
'enablepresurvey', 'surveyaskmail', 'surveyaskgroup', 'surveyaskmessage', 'enablepresurvey', 'surveyaskmail', 'surveyaskgroup', 'surveyaskmessage',
'enablepopupnotification', 'enablepopupnotification', 'showonlineoperators',
'enablecaptcha'); 'enablecaptcha');
loadsettings(); loadsettings();

View File

@ -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 = array();
$page['allowedAgents'] = get_operators(); $page['allowedAgents'] = operator_get_all();
$page['canmodify'] = is_capable($can_administrate, $operator); $page['canmodify'] = is_capable($can_administrate, $operator);
setlocale(LC_TIME, getstring("time.locale")); setlocale(LC_TIME, getstring("time.locale"));

View File

@ -141,7 +141,6 @@ function print_pending_threads($groupids,$since) {
mysql_close($link); mysql_close($link);
start_xml_output();
echo "<threads revision=\"$revision\" time=\"".time()."000\">"; echo "<threads revision=\"$revision\" time=\"".time()."000\">";
foreach( $output as $thr ) { foreach( $output as $thr ) {
print myiconv($webim_encoding,"utf-8",$thr); print myiconv($webim_encoding,"utf-8",$thr);
@ -149,8 +148,26 @@ function print_pending_threads($groupids,$since) {
echo "</threads>"; echo "</threads>";
} }
function print_operators() {
echo "<operators>";
$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 "<operator name=\"$name\"$away/>";
}
echo "</operators>";
}
$since = verifyparam( "since", "/^\d{1,9}$/", 0); $since = verifyparam( "since", "/^\d{1,9}$/", 0);
$status = verifyparam( "status", "/^\d{1,2}$/", 0); $status = verifyparam( "status", "/^\d{1,2}$/", 0);
$showonline = verifyparam( "showonline", "/^1$/", 0);
$link = connect(); $link = connect();
loadsettings_($link); loadsettings_($link);
@ -159,7 +176,14 @@ if(!isset($_SESSION['operatorgroups'])) {
} }
mysql_close($link); mysql_close($link);
$groupids = $_SESSION['operatorgroups']; $groupids = $_SESSION['operatorgroups'];
start_xml_output();
echo '<update>';
if($showonline) {
print_operators();
}
print_pending_threads($groupids,$since); print_pending_threads($groupids,$since);
echo '</update>';
notify_operator_alive($operator['operatorid'], $status); notify_operator_alive($operator['operatorid'], $status);
exit; exit;

View File

@ -38,6 +38,7 @@ $page['havemenu'] = isset($_GET['nomenu']) ? "0" : "1";
$page['showpopup'] = $settings['enablepopupnotification'] == '1' ? "1" : "0"; $page['showpopup'] = $settings['enablepopupnotification'] == '1' ? "1" : "0";
$page['frequency'] = $settings['updatefrequency_operator']; $page['frequency'] = $settings['updatefrequency_operator'];
$page['istatus'] = $status; $page['istatus'] = $status;
$page['showonline'] = $settings['showonlineoperators'] == '1' ? "1" : "0";
prepare_menu($operator); prepare_menu($operator);
start_html_output(); start_html_output();

View File

@ -76,9 +76,9 @@ require_once('inc_errors.php');
<?php echo htmlspecialchars(topage($a['vclocalename'])) ?> / <?php echo htmlspecialchars(topage($a['vccommonname'])) ?> <?php echo htmlspecialchars(topage($a['vclocalename'])) ?> / <?php echo htmlspecialchars(topage($a['vccommonname'])) ?>
</td> </td>
<td class="notlast"> <td class="notlast">
<?php if(is_online($a)) { ?> <?php if(operator_is_available($a)) { ?>
<?php echo getlocal("page_agents.isonline") ?> <?php echo getlocal("page_agents.isonline") ?>
<?php } else if(is_away($a)) { ?> <?php } else if(operator_is_away($a)) { ?>
<?php echo getlocal("page_agents.isaway") ?> <?php echo getlocal("page_agents.isaway") ?>
<?php } else { ?> <?php } else { ?>
<?php echo date_to_text(time() - $a['time']) ?> <?php echo date_to_text(time() - $a['time']) ?>

View File

@ -186,6 +186,15 @@ require_once('inc_errors.php');
<br clear="all"/> <br clear="all"/>
</div> </div>
<div class="field">
<div class="flabel"><?php echo getlocal('settings.show_online_operators') ?></div>
<div class="fvalue">
<input type="checkbox" name="showonlineoperators" value="on"<?php echo form_value_cb('showonlineoperators') ? " checked=\"checked\"" : "" ?>/>
</div>
<div class="fdescr"> &mdash; <?php echo getlocal('settings.show_online_operators.description') ?></div>
<br clear="all"/>
</div>
<div class="field"> <div class="field">
<div class="flabel"><?php echo getlocal('settings.leavemessage_captcha') ?></div> <div class="flabel"><?php echo getlocal('settings.leavemessage_captcha') ?></div>
<div class="fvalue"> <div class="fvalue">

View File

@ -39,7 +39,7 @@ var localized = new Array(
var updaterOptions = { var updaterOptions = {
url:"<?php echo $webimroot ?>/operator/update.php",wroot:"<?php echo $webimroot ?>", url:"<?php echo $webimroot ?>/operator/update.php",wroot:"<?php echo $webimroot ?>",
agentservl:"<?php echo $webimroot ?>/operator/agent.php", frequency:<?php echo $page['frequency'] ?>, istatus:<?php echo $page['istatus'] ?>, agentservl:"<?php echo $webimroot ?>/operator/agent.php", frequency:<?php echo $page['frequency'] ?>, istatus:<?php echo $page['istatus'] ?>,
noclients:"<?php echo getlocal("clients.no_clients") ?>", havemenu: <?php echo $page['havemenu'] ?>, showpopup: <?php echo $page['showpopup'] ?> }; noclients:"<?php echo getlocal("clients.no_clients") ?>", havemenu: <?php echo $page['havemenu'] ?>, showpopup: <?php echo $page['showpopup'] ?>, showonline: <?php echo $page['showonline'] ?> };
//--></script> //--></script>
<script type="text/javascript" language="javascript" src="<?php echo $webimroot ?>/js/<?php echo $jsver ?>/users.js"></script> <script type="text/javascript" language="javascript" src="<?php echo $webimroot ?>/js/<?php echo $jsver ?>/users.js"></script>
<?php <?php
@ -96,6 +96,11 @@ function tpl_content() { global $page, $webimroot;
<?php } ?> <?php } ?>
</div> </div>
<?php if($page['showonline'] == "1") { ?>
<div id="onlineoperators">
</div>
<?php } ?>
<?php <?php
} /* content */ } /* content */