📄 monitorstatic.js
字号:
obj.top = pageYOffset + y;
}
else if (Sys.DOM)
{
obj.left = pageXOffset + x + 'px';
obj.top = pageYOffset + y + 'px';
}
};
function InviteWindow_show()
{
if(getCookie("hasVisited")!=null&&getCookie("hasVisited")=="true"&&this.operatorInvite&&preferences["invite_auto"]==2){
return;
}
this.showInvite = true;
if (Sys.IE)
{
document.all.InviteWindow.style.visibility = 'visible';
}
else if (Sys.NS)
{
document.layers.InviteWindow.visibility = 'visible';
}
else if (Sys.DOM)
{
Sys.getObj('InviteWindow').style.visibility = 'visible';
}
};
function InviteWindow_hide()
{
this.showInvite = false;
if (Sys.IE)
{
document.all.InviteWindow.style.visibility = 'hidden';
}
else if (Sys.NS)
{
document.layers.InviteWindow.visibility = 'hidden';
}
else if (Sys.DOM)
{
Sys.getObj('InviteWindow').style.visibility = 'hidden';
}
};
function InviteWindow_accept()
{
this.hide();
if(this.isauto){
this.parentObject.onIconClick();
}else{
this.parentObject.onInviteWindowAccept();
}
};
function InviteWindow_refuse()
{
this.hide();
if(!this.isauto)
this.parentObject.onInviteWindowRefuse();
};
function VisitServer(inLogger, inPreferences, inVisitClient, inSendDriver)
{
this.logger = inLogger;
this.preferences = inPreferences;
this.visitClient = inVisitClient;
this.sendDriver = inSendDriver;
this.visitServerTimer = null;
this.refuseInvite = VisitServer_refuseInvite;
this.acceptInvite = VisitServer_acceptInvite;
this.initiatedChat = VisitServer_initiatedChat;
this.getAcceptInviteUrl = VisitServer_getAcceptInviteUrl;
this.getInitiatedChatUrl = VisitServer_getInitiatedChatUrl;
this.getCallUrl = VisitServer_getCallUrl;
this.start = VisitServer_start;
this.stop = VisitServer_stop;
}
function VisitServer_getCallUrl()
{
var openUrl = this.preferences["protocol"] + "://" + this.preferences["baseUrl"] + this.preferences["baseWebapp"]+ this.preferences["baseChatHtmlDir"] +"/chatbox.jsp?"+getGid()+getParam()+getTrustfulVisitorInfo();
openUrl += "&companyID=" + this.preferences["companyID"]+"&";
if(this.preferences["skin"] != null)
openUrl += "&skin=" + this.preferences["skin"];
if(this.preferences["chatBanner"] != null)
openUrl += "&chatBanner=" + this.preferences["chatBanner"];
if(this.preferences["chatBannerLink"] != null)
openUrl += "&chatBannerLink=" + this.preferences["chatBannerLink"];
if(typeof live800_configContent != "undefined" && live800_configContent != null)
openUrl += "&configID=" + live800_configID;
return openUrl+getEnterUrl();
}
function VisitServer_getInitiatedChatUrl()
{
var openUrl = this.preferences["protocol"] + "://" + this.preferences["baseUrl"] + this.preferences["baseWebapp"] + this.preferences["baseChatHtmlDir"] +"/chatbox.jsp?"+getGid()+"&companyID=" + this.preferences["companyID"] +"&chatType=2";
if(typeof this.preferences["configID"] != "undefined" && this.preferences["configID"] != null && this.preferences["configID"] != "")
{
openUrl += "&configID=" + this.preferences["configID"];
}
if(this.preferences["skin"] != null)
openUrl += "&skin=" + this.preferences["skin"];
if(this.preferences["chatBanner"] != null)
openUrl += "&chatBanner=" + this.preferences["chatBanner"];
if(this.preferences["chatBannerLink"] != null)
openUrl += "&chatBannerLink=" + this.preferences["chatBannerLink"];
if(typeof live800_configContent != "undefined" && live800_configContent != null)
openUrl += "&configID=" + live800_configID;
return openUrl+getEnterUrl()+"&"+getTrustfulVisitorInfo();
};
function VisitServer_getAcceptInviteUrl()
{
var openUrl = this.preferences["protocol"] + "://" + this.preferences["baseUrl"] + live800_baseWebApp+"/SurferServer?&cmd=102";
openUrl += "&accept=1";
openUrl += "&visitorIDInSession=" + this.preferences["visitorIDInSession"];
openUrl += "&companyID=" + this.preferences["companyID"];
if(typeof this.preferences["configID"] != "undefined" && this.preferences["configID"] != null && this.preferences["configID"] !="")
openUrl += "&configID=" + live800_configID;
if(typeof live800_configContent != "undefined" && live800_configContent != null)
openUrl += "&configID=" + live800_configID;
return openUrl+"&"+getGid()+getParam()+getTrustfulVisitorInfo();
};
function VisitServer_start()
{
//this.visitServerTimer = setTimeout('globalVisitServer.getConfigInServer()',100);
};
function VisitServer_stop()
{
clearTimeout(this.visitServerTimer);
};
function VisitServer_refuseInvite()
{
var params = new Array();
params[0] = "companyID=" + this.preferences["companyID"];
params[1] = "accept=0";
var rpcMethod = new RpcMethod("SurferServer", "102", params, 0, null, null);
this.sendDriver.execute(rpcMethod);
};
function VisitServer_acceptInvite()
{
var params = new Array();
params[0] = "companyID=" + this.preferences["companyID"];
params[1] = "accept=1";
var rpcMethod = new RpcMethod("SurferServer", "102", params, 0, null, null);
this.sendDriver.execute(rpcMethod);
};
function VisitServer_initiatedChat()
{
var params = new Array();
params[0] = "companyID=" + this.preferences["companyID"];
var rpcMethod = new RpcMethod("SurferServer", "109", params, 0, null, null);
this.sendDriver.execute(rpcMethod);
}
function VisitServer_call()
{
};
function VisitHandle(inLogger, inPreferences, inVisitClient, inWindow, inInviteWindow, inIcon)
{
this.logger = inLogger;
this.preferences = inPreferences;
this.visitClient = inVisitClient;
this.visitWindow = inWindow;
this.visitDocument = inWindow.document;
this.inviteWindow = inInviteWindow;
this.icon = inIcon;
this.inviteWindow.parentObject = this;
if(this.icon != null)
this.icon.parentObject = this;
this.chatWindow = null;
this.showInvite = VisitHandle_showInvite;
this.hideInvite = VisitHandle_hideInvite;
this.openInitiatedChat = VisitHandle_openInitiatedChat;
this.reloadIcon = VisitHandle_reloadIcon;
this.onInviteWindowAccept = VisitHandle_onInviteWindowAccept;
this.onInviteWindowRefuse = VisitHandle_onInviteWindowRefuse;
this.onIconClick = VisitHandle_onIconClick;
this.initListener = VisitHandle_initListener;
this.initListener();
}
function VisitHandle_onIconClick()
{
var openUrl = this.visitClient.getCallUrl();
var winAttr = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=541,height=401';
if (typeof(this.chatWindow) == "undefined"||this.chatWindow==null)
{
this.chatWindow = window.open(openUrl, 'chatbox'+ this.preferences["companyID"], winAttr);
}
try
{
this.chatWindow.focus();
this.chatWindow.opener=window;
}
catch(e)
{
this.chatWindow = window.open(openUrl, 'chatbox'+ this.preferences["companyID"], winAttr);
}
return false;
}
function VisitHandle_onInviteWindowAccept()
{
var openUrl = this.visitClient.getAcceptInviteUrl();
var winAttr = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=541,height=401';
this.chatWindow = window.open(openUrl, 'chatbox'+ this.preferences["companyID"], winAttr);
try
{
this.chatWindow.focus();
this.chatWindow.opener=window;
}
catch(e)
{
this.chatWindow = window.open(openUrl, 'chatbox'+ this.preferences["companyID"], winAttr);
}
return false;
};
function VisitHandle_onInviteWindowRefuse()
{
this.visitClient.refuseInvite();
};
function VisitHandle_showInvite()
{
this.inviteWindow.operatorInvite=false;
this.visitWindow.focus();
this.inviteWindow.show();
this.inviteWindow.isauto = false;
this.inviteWindow.operatorInvite=true;
};
function VisitHandle_hideInvite()
{
this.inviteWindow.hide();
};
function VisitHandle_openInitiatedChat()
{
//this.visitClient.initiatedChat();
var openUrl = this.visitClient.getInitiatedChatUrl();
var winAttr = 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=541,height=401';
try
{
this.chatWindow = window.open(openUrl, 'chatbox'+ this.preferences["companyID"], winAttr);
this.chatWindow.focus();
this.chatWindow.opener=window;
}
catch(e)
{
/*for must initiated chat*/
openUrl += '&blocked=1';
window.location = openUrl;
}
return false;
};
function VisitHandle_reloadIcon()
{
var live800iconList = document.getElementsByName("live800icon");
if(live800iconList == null) return;
for(i=0; i<live800iconList.length; i++)
{
temp = live800iconList[i].src ;
temp += "&rpcImageId=" + (new Date()).getTime();
live800iconList[i].src = temp;
}
};
function VisitHandle_initListener()
{
this.visitClient.addMessageListener(this);
};
if(live800_companyID == null || live800_companyID == ""){alert("miss companyID");}
else
{
preferences = new Array();
preferences["companyID"] = live800_companyID;
preferences["float"] = (typeof live800_float != "undefined" ? live800_float : "1");
preferences["iconIndex"] = (typeof live800_iconIndex !="undefined" ? live800_iconIndex : "0");
preferences["online"] = (typeof live800_online !="undefined" ? live800_online : null);
preferences["offline"] = (typeof live800_offline !="undefined" ? live800_offline : null);
preferences["floatToRight"] = (typeof live800_floatToRight !="undefined" ? live800_floatToRight : "1");
preferences["skin"] = (typeof live800_skin !="undefined" ? live800_skin : "0");
preferences["chatBanner"] = (typeof live800_chatBanner !="undefined" ? live800_chatBanner : null);
preferences["chatBannerLink"] = (typeof live800_chatBannerLink !="undefined" ? live800_chatBannerLink : null);
preferences["status"] = (typeof live800_status !="undefined" ? live800_status : null);
if(typeof live800_configContent != "undefined")
{
params = Sys.urlToParams(live800_configContent);
preferences["configID"] = live800_configID;
preferences["invite_auto"] = (typeof params["live800_invite_auto"] !="undefined" ? params["live800_invite_auto"] : 1);
preferences["invite_delay"] = (typeof params["live800_invite_delay"] !="undefined" ? params["live800_invite_delay"] : 10);
preferences["invite_title"] = (typeof params["live800_invite_title"] !="undefined" ? params["live800_invite_title"] : unescape("Live800%u7F51%u7AD9%u5728%u7EBF%u5BA2%u670D%u7CFB%u7EDF"));
preferences["invite_style"] = (typeof params["live800_invite_style"] !="undefined" ? params["live800_invite_style"] : null);
preferences["invite_top"] = (typeof params["live800_invite_top"] !="undefined" ? params["live800_invite_top"] : 0);
}
else
{
preferences["configID"] = 1;
preferences["invite_auto"] = 1;
preferences["invite_delay"] = 10;
preferences["invite_style"]=null;
preferences["invite_top"]=0;
preferences["invite_title"] = unescape("Live800%u7F51%u7AD9%u5728%u7EBF%u5BA2%u670D%u7CFB%u7EDF");
}
preferences["protocol"] = "http";
preferences["baseUrl"] = live800_baseUrl;
preferences["baseHtmlUrl"] =live800_baseHtmlUrl;
preferences["baseWebapp"] = live800_baseWebApp;
preferences["baseChatHtmlDir"] = live800_baseChatHtmlDir;
preferences["visitorIDInSession"] = preferences["companyID"] + "chater";
var globalLogger = new Logger();
var globalSendDriver = new SendDriver(globalLogger, preferences);
var globalReceiveDriver = new ReceiveDriver(globalLogger, preferences);
var globalVisitClient = new VisitClient(globalLogger, preferences, globalReceiveDriver, globalSendDriver);
var globalVisitServer = globalVisitClient.visitServer;
var globalIcon = null;
if(typeof live800_configContent == "undefined")
{
if(preferences["float"]=="1")
{
globalIcon = globalFloatIcon = new FloatIcon(globalLogger, preferences, globalVisitClient, window);
}
else
{
globalIcon = globalStaticIcon = new StaticIcon(globalLogger, preferences, globalVisitClient, window);
}
globalIcon.start();
}
/*var live800_configContent to detect is a a version 3 live800 js*/
var globalInviteWindow = new InviteWindow(globalLogger, preferences, globalVisitClient, window);
var globalVisitHandle = new VisitHandle(globalLogger, preferences, globalVisitClient, window, globalInviteWindow, globalIcon);
globalVisitClient.start();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -