/**
* TODO 系统全局js配置
*
* @author lynn.chen
* @version TODO 添加版本
* @since 2014年11月25日 上午10:23:54
*/
//jBox控件按钮国际化
if(typeof(jBoxConfig) != "undefined")
{
jBoxConfig.defaults = {
buttons: { 'OK': "ok", 'Cancel': "cancel" }
};
jBoxConfig.languageDefaults = {
close: 'Close', /* 窗口右上角关闭按钮提示 */
ok: 'OK', /* $.jBox.prompt() 系列方法的“确定”按钮文字 */
yes: 'Yes', /* $.jBox.warning() 方法的“是”按钮文字 */
no: 'No', /* $.jBox.warning() 方法的“否”按钮文字 */
cancel: 'Cancel' /* $.jBox.confirm() 和 $.jBox.warning() 方法的“取消”按钮文字 */
};
$.jBox.setDefaults(jBoxConfig);
}
//系统信息配置类
var sysCfg =
{
dhxSkin : "dhx_web",
rootPath : "",
treeImgPath: "/public/controls/dhtmlx/skins/web/imgs/dhxtree_web/",//树图片路径
devMode : "false" == "true",
dhxShortDateFmt : "%Y-%m-%d",
dhxLongDateFmt : "%Y-%m-%d %H:%i:%s",
sysShortDateFmt : "yyyy-MM-dd",
sysLongDateFmt : "yyyy-MM-dd HH:mm:ss",
ret : "ret",
msg : "msg",
data : "data",
success : "ok",
error : "400",
warning : "500",
ptimeout: 3000, //add by larry 2015-02-15
enableRTL:"false",
dateType:"0",//日历类型,0-公历,1-波斯(伊朗)日历
prefix : /^https:/.test(window.location.href)? "https://":"http://"
};
//消息控件的使用类型的类
var msgType =
{
info : "info",
success : "success",
warning : "warning",
error : "error",
loading : "loading"
};
//许可错误编码
var licenseErrorCode={
"1" : {text : "The information used to activate the license is incorrect or incomplete.(Error code : 1)", reason : "1. The information filled in the online or offline activation page is incorrect, incomplete or can't be decoded.", steps : "1. Fill in the activation information and try again.
2. If the previous method doesn't solve the problem, please contact our technical support or sales staff."},
"2" : {text : "The email has been used to register other licenses.(Error code : 2)", reason : "The email has been used to register the license: {0}.", steps : "1. Try using a new email address.
2. If the previous method doesn't solve the problem, please contact our technical support or sales staff."},
"3" : {text : "The license has been activated previously.(Error code : 3)", reason : "1. The SN file has been activated on another computer.
2. The hardware information in the SN file does not match the current computer or the hardware information of the current computer has changed recently.", steps : "1. Confirm whether the SN file has been used before and was not used in the current computer.
2. Confirm whether the hardware changed recently.
3. Get the SN file and try again.
4. If your computer is a virtual machine, please inform us promptly.
5. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"4" : {text : "Data was lost during online activation.(Error code : 4)", reason : "During the online activation process, the data was tampered, resulting invalid parameters.", steps : "1. Click the [Activate] button and try again.
2. Try the [Offline Activation].
3. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"E0005" : {text : "The software version you have installed is not recommended.(Error code : E0005)", reason : "The software version you have installed is obsolete or may have problems, so it is no longer recommended.", steps : "1. Visit to the official website to download the latest update package to upgrade the current installed version or download the latest installation package, uninstall the current version and install the new version.
2. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"E0006" : {text : "Unable to connect to the license server because of local network problems.(Error code : E0006)", reason : "1. The computer is not connected to the network.
2. There are problems in the network environment.
3. A firewall is blocking the connection.
4. Check whether you are using a proxy server.", steps : "1. Use the network diagnostic tool in the system for network diagnosis.
2. Check whether a firewall is blocking the connection.
3. Don't use a proxy server, this may create conflicts.
4. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"E0007" : {text : "An error occurred while importing the SN file.(Error code : E0007)", reason : "1. The SN file was tampered.
2. The SN file data was lost during the process.
3. The uploaded file is not a SN file, please confirm.", steps : "1. Restore modifications made to the SN file.
2. Confirm you are using an original SN file.
3. Try the offline activation method.
4. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"E0008" : {text : "An error occurred during the license file import process.(Error code : E0008)", reason : "1. The license file was tampered.
2. The license file data was lost during the process.
3 The uploaded file is not a license file.", steps : "1. Restore modifications made to the license file.
2. Confirm you are using a valid license file.
3. Try the offline activation method.
4. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"E0009" : {text : "Request to the license server timeout.(Error code : E0009)", reason : "1. Network bandwith is low.
2. Network connection was interrupted.", steps : "1. Check the network enviroment or change to another network and try again.
2. If the previous methods don't solve the problem, please contact our technical support or sales staff."},
"E0010" : {text : "The license you imported is the activation {1} of {0} which does not apply to the software you are currently using.(Error code : E0010)", reason : "The license you imported is the activation {1} of {0} which does not apply to the software you are currently using.", steps : "You are currently using {0}, please reapply for a {0} license."},
"E0011" : {text : "This license is invalid.(Error code : E0011)", reason : "1. The license has been set as invalid in the license server.
2. The license has been deleted by the administrator because the server was changed.
3.The language of installation package is not matched with the license.", steps : "1. Reapply for the correct license file and try again.
2. If the previous method doesn't solve the problem, please contact our technical support or sales staff."}
}
//dhtmlx时间控件国际化
dhtmlXCalendarObject.prototype.langData["zk"] =
{
dateformat: sysCfg.dhxLongDateFmt,
monthesFNames: ["January","February","March","April","May","June","July","August","September","October","November","December"],
monthesSNames: ["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"],
daysFNames: ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],
daysSNames: ["Su","Mo","Tu","We","Th","Fr","Sa"],
weekstart: 1,
weekname: "w"
};
//dhtmlx时间控件默认语言包
dhtmlXCalendarObject.prototype.lang="zk";
//防止退格键退出系统
$(document).keydown(function(e)
{
var doPrevent;
if (e.keyCode == 8)
{
var d = e.srcElement || e.target;
if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA')
{
doPrevent = d.readOnly || d.disabled;
}
else
{
doPrevent = true;
}
}
else
{
doPrevent = false;
}
if (doPrevent)
{
return false;
//e.preventDefault();
}
});
function doIEBrowserPrompt()
{
if(window == window.top && "true" == "true")
{
var ieVersion = parseInt($.browser.version.split(".")[0]);
if ($.browser.msie && ieVersion < 11)
{
var ieBrowserPrompt = "Your browser version is too low (IE{0} or IE{1} kernel), it may affect your normal use, please upgrade immediately to IE11+ version, or use other browsers: Firefox, Chrome!".format(ieVersion, ieVersion);
$('body').prepend('