📄 all.js
字号:
{
if (oEvent.preventDefault)
{
oEvent.preventDefault();
}
else
{
oEvent.returnValue = false;
}
}
function fLoadJsFile(file, checked, doc) {
doc = doc ? doc : document;
if (checked) {
var s = GelTags("script", doc);
for (var i = s.length - 1; i >= 0; i--) {
if (s[i].src.indexOf(file) != -1) return;
}
}
var o = doc.createElement("script");
o.language = "javascript";
o.src = file;
var h = GelTags("head", doc)[0];
if (h) h.appendChild(o);
}
function fLoadCssFile(file, checked, doc) {
doc = doc ? doc : document;
if (checked) {
var s = GelTags("link", doc);
for (var i = s.length - 1; i >= 0; i--) {
if (s[i].href.indexOf(file) != -1) return;
}
}
var o = doc.createElement("link");
o.type = "text/css";
o.rel = "stylesheet";
o.href = file;
var h = GelTags("head", doc)[0];
if (h) h.appendChild(o);
}
function fReplaceCssFile(pattern, file, doc)
{
if (!pattern) return;
doc = doc ? doc : document;
var s = GelTags("link", doc);
for (var i = s.length - 1; i >= 0; i--)
{
if (s[i].href.indexOf(pattern) != -1)
{
s[i].parentNode.removeChild(s[i]);
}
}
if (file) fLoadCssFile(file, false, doc);
}
function fIsInObj(nObj, oObj) {
if (typeof(oObj) == "string" ? nObj.id == oObj : nObj == oObj) return true;
var p = nObj.parentNode;
if(p) return fIsInObj(p, oObj);
return false;
}
//object rewrite --> for ie active problom
function fParamsInTag(o) {
var c = "";
var p = GelTags("PARAM", o);
for (var i = p.length - 1; i >= 0; i--) {
c += p[i].outerHTML;
}
return c;
}
function fTagRewrite(tag, doc) {
var o = GelTags(tag, doc);
for (var i = o.length - 1; i >= 0; i--) {
o[i].outerHTML = o[i].outerHTML.split(">")[0] + ">" + fParamsInTag(o[i]) /*+ o[i].innerHTML*/ + "</" + o[i].tagName + ">";
}
}
function fObjectActive(doc) {
if (gIsIE) {
fTagRewrite("embed", doc);
fTagRewrite("object", doc);
}
}
//quick replace
function StrReplace(s, o, d) {
return s.replace(new RegExp(o), d);
}
//textarea api
function PutTextareaValue(o, val) {
if (o.tagName != "TEXTAREA" && o.tagName != "textarea") return false;
o.innerText != null ? o.innerText = val : o.value = val;
return true;
}
function GetTextareaValue(o) {
if (o.tagName != "TEXTAREA" && o.tagName != "textarea") return null;
return o.value;
}
//other api
function ScrollIntoMidView(obj, container, bforce, win) {
if (!container) container = (win ? win : window).document.body;
var ot = 0;
for (var o = obj; o && o != container;o = o.offsetParent) ot += o.offsetTop;
var h = ot - container.scrollTop;
if (bforce || h < 0 || h + obj.offsetHeight > container.clientHeight) {
container.scrollTop = ot - (container.clientHeight - obj.offsetHeight) / 2
}
}
//
if(!Function.prototype.apply) {
Function.prototype.apply = function (obj, argu) {
if (obj) obj._caller = this;
var argus = new Array();
for (var i=0;i<argu.length;i++) {
argus[i] = "argu[" + i + "]";
}
var r;
eval("r = " + (obj ? ("obj._caller(" + argus.join(",") + ");") : ("this(" + argus.join(",") + ");")));
return r;
};
}
if(!Array.prototype.push) {
Array.prototype.push=function() {
for(var i=0;i<arguments.length;i++) {
this[this.length]=arguments[i];
}
}
}
//出错显示函数 -- 取代alert的显示
//mbtype消息框类型,默认为提示提示框
//mbtype success 成功
// 空 错误
// moduel 弹出框
function fMessageBox(msg, mbtype, bHide, hidetime, dialogTitle, win) {
try
{
win = win ? win : window;
if (msg == null)
{
var oMsgObj = S("msg_txt", win) ? S("msg_txt", win) : S("msg_txt", GetActionWin());
if (oMsgObj)
{
var txt = oMsgObj.innerText == null ? oMsgObj.textContent : oMsgObj.innerText;
if (txt)
{
return setTimeout(function(){fMessageBox(oMsgObj.innerHTML.replace(/<script .*>(.|\n)*<\/script>/ig, ""), mbtype, bHide, hidetime, dialogTitle, win);}, 0);
}
}
return;
}
if (!msg)
{
return;
}
if (mbtype == "dialog")
{
GetActionWin().document.body.innerHTML = "";
return ModelDialog(1, dialogTitle ? dialogTitle : "确认",
"<div style='padding:10px 0 5px 10px;text-align:left;'>" +
"<img src='"+GetPath("image", true)+"ico_question.gif' align='absmiddle' style='float:left;margin:5px 0 0 10px;'>" +
"<div style='width:300px;height:80px;overflow:hidden;'><table width=300px height=80px><tr><td>" + msg + "</td></tr></table></div>" +
"</div>" +
"<div style='text-align:right;padding:0 10px 10px 0;'>" +
"<input class='wd2 btn' type=button id=confirm value=确认>" +
"</div>", "confirm", ["confirm"],[function(){HideModelDialog();}]);
}
top.bMessageBoxHide = bHide;
var actionBody = GetActionWin().document.body;
var divstyle = (mbtype=="success"?"msg":"errmsg");
actionBody.innerHTML =
"<body>" +
"<link rel='stylesheet' type='text/css' href='"+GetPath("css", true)+"comm.css' />" +
"<link rel='stylesheet' type='text/css' href='"+GetPath("css", true)+"skin"+GetPath("skin")+".css' />" +
'<div id="msg" class="'+divstyle+'" style="' + ((hidetime == 0 && bHide) ? "display:none;" : "") + '">' + msg + '</div>' +
"</body>";
actionBody.className = "";
actionBody.style.margin = "0";
actionBody.style.backgroundColor = "transparent";
actionBody.style.textAlign = "center";
if(bHide && hidetime != 0)
{
if (top.msgBoxTimer)
{
top.clearInterval(top.msgBoxTimer);
top.msgBoxTimer = null;
}
top.msgBoxTimer = top.setInterval("top.clearInterval(top.msgBoxTimer);top.msgBoxTimer=null;top.HiddenMsg();", hidetime ? hidetime : 5000);
}
}
catch(e)
{
var w = S("actionFrame", GetTopWin());
if (w)
{
w.src = "about:blank";
showError("未知错误");
}
else
{
//暂时为read_note特殊处理,显示不存在的note的错误提示
var m = S("msg_txt");
if(m) m.style.display = "block";
}
}
}
function showError(err, dtime) {
fMessageBox(err, "", true, dtime? dtime:5000);
}
function showInfo(info, dtime) {
fMessageBox(info, "success", true, dtime? dtime:5000);
}
function HiddenMsg() {
Show(S("msg",GetActionWin()), false);
}
function ShowMsg() {
Show(S("msg",GetActionWin()), true);
}
//maximize
function IsMaximizeMainFrame() {
var o = S("mainFrame", top);
if (!o) return false;
return o.parentNode.style.marginLeft == "6px";
}
function MaximizeMainFrame(bMax) {
bMax = bMax != null ? bMax : 1;
var o = S("mainFrame", top);
var img = S("img_line", top);
if (!o || !img)
{
return false;
}
o = o.parentNode;
bMax = bMax == 2 ? (o.style.marginLeft == "6px" ? 0 : 1) : bMax;
o.style.marginLeft = bMax ? "6px" : (gIsIE ? "188px" : "191px");
Show(S("leftFrame", top).parentNode, !bMax);
Show(img, !bMax);
return true;
}
function GetHttpProcesser()
{
var httpProcesser = top.gCurHttpProcesser;
httpProcesser = httpProcesser == null ? 0 : httpProcesser;
top.gCurHttpProcesser = (httpProcesser + 1) % 10;
try
{
if (top.gHttpProcesserContainer[httpProcesser] != null)
{
delete top.gHttpProcesserContainer[httpProcesser];
}
}
catch (e)
{
top.gHttpProcesserContainer = {};
}
top.gHttpProcesserContainer[httpProcesser] = new Image();
return top.gHttpProcesserContainer[httpProcesser];
}
function RunUrlWithSid(param)
{
try
{
var obj = GetHttpProcesser();
if (obj) obj.src = param + "&sid="+GetSid() + "&r=" + Math.random();
}
catch(e){}
}
function RecodeComposeStatus(actionId, mailid, failCode, isMust)
{
if (!top.gSendTimeStart || !top.gSendTimeStart.valueOf)
{
if (isMust)
{
var time = 0;
}
else
{
return;
}
}
else
{
var time = (new Date()).valueOf() - top.gSendTimeStart.valueOf();
top.gSendTimeStart = null;
}
RunUrlWithSid("/cgi-bin/getinvestigate?stat=compose_send&t="+time+"&actionId="+actionId+"&mailid="+(mailid == null ? "" : mailid) + "&isActivex=" + (top.isUseActiveXCompose ? 1 : 0) + "&failCode=" + (failCode == null ? "" : failCode));
top.isUseActiveXCompose = false;
}
function ReloadFrm(frm) {
frm.location = frm.location.href;
}
function ReloadAllFrm(bReloadTop, bReloadTemp, bReloadLeft, bReloadMain) {
if(bReloadTop==null || bReloadTop) setTimeout("ReloadFrm(GetTopWin())",0);
if(bReloadTemp==null || bReloadTemp) setTimeout("ReloadFrm(GetTempWin())",0);
if(bReloadLeft==null || bReloadLeft) setTimeout("ReloadFrm(GetLeftWin())",0);
if(bReloadMain==null || bReloadMain) setTimeout("ReloadFrm(GetMainWin())",0);
}
function ReloadFrmLeftMain(bReloadLeft, bReloadMain) {
ReloadAllFrm(false, false, bReloadLeft, bReloadMain);
}
function ReloadFrmLeftMainNewWin(bReloadLeft,bReloadMain) {
var op = top.opener;
var hf = op ? (op.GetMainWin ? op.GetMainWin().location.href : "") : "";
if (hf.indexOf("readmail") != -1) {
op.top.GoUrlMainFrm("/cgi-bin/mail_list?sid="+ GetSid());
}
else if (hf.indexOf("mail_list") != -1) {
op.top.ReloadFrmLeftMain();
}
}
function GoUrlMainFrm(url, bReloadLeft) {
GetMainWin().location.href = url;
if(bReloadLeft==null || bReloadLeft==true)
{
setTimeout("ReloadFrm(GetLeftWin())",0);
}
}
function HtmlDecode(s) {
return (s == null)?s:s.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&").replace(/"/g,"\"");
}
function HtmlEncode(s) {
return (s == null)?s:s.replace(/&/g,"&").replace(/\"/g,""").replace(/</g,"<").replace(/>/g,">");
}
//editor api
function TextToHtml(content) {
//the attr of innerHTML in firefox is diff in ie
var res = "<DIV>" + content.replace((content.indexOf("<BR>") >= 0)? /<BR>/ig: /\n/g, "</DIV><DIV>") + "</DIV>";
res = res.replace(new RegExp("\x0D","g"), "");
res = res.replace(new RegExp("\x20","g"), " ");
res = res.replace(new RegExp("(<DIV><\/DIV>)*$","g"), "");
return res.replace(/<DIV><\/DIV>/g, "<DIV> </DIV>");
}
function HtmlToText(content) {
//function for firefox
//manal change div,p,br
var res = content.replace(/<\/div>/ig, "\n");
res = res.replace(/<\/p>/ig, "\n");
return res.replace(/<br>/ig, "\n");
}
//do post finish check
function ActionFinishCheck()
{
if (GetCookieFlags("CCSHOW")[4] == "1")
{
SetCookieFlag("CCSHOW",4,"0");
S("actionFrame", GetTopWin()).src = "about:blank";
return;
}
ErrorProcess();
var isErrResponse = false;
try
{
var f = F("actionFrame", GetTopWin());
var b = f.document.body;
isErrResponse = !(f.location.href == "about:blank" || b.className != "" || b.style.cssText != "");
b.style.backgroundColor = "transparent";
b.style.margin = "0";
b.style.padding = "0";
InitPageEvent(f);
}
catch(e)
{
isErrResponse = true;
}
if (isErrResponse)
{
S("actionFrame", GetTopWin()).src = "about:blank";
setTimeout(function(){showError(msgLinkErr);}, 0);
}
}
function DoSendFinishCheck(frameObj)
{
if (!frameObj.id)
{
return;
}
var isErrResponse = false;
try
{
var f = F(frameObj.id);
var b = f.document.body;
isErrResponse = !(f.location.href == "about:blank" || b.className != "" || b.style.cssText != "");
}
catch(e)
{
isErrResponse = true;
}
if (isErrResponse)
{
RecodeComposeStatus(2, null, 0);
frameObj.src = "about:blank";
ErrorProcess();
fMessageBox("由于网络原因,邮件发送失败!", "dialog", true, 0, "失败信息");
}
}
function SubmitToActionFrm(oForm) {
try {
oForm.submit();
return true;
} catch(e) {
showError(e.message);
return false;
}
}
function AfterAutoSave(attachlist, mailid, msg, notDisable) {
if (mailid == "" || !mailid) return ;
var mF = top.GetMainWin();
var files = attachlist.split(" |");
var fileCtls = new Array();
for (var i = 0; i < mF.AttachID; i++) {
var tmp = mF.Gel("Uploader" + i);
if (tmp != null && !tmp.disabled && tmp.value != "")
fileCtls.push(tmp);
}
var len = files.length - 1;
var len2 = fileCtls.length;
for (var i = 0; i < len; i++) {
var isExist = false;
for (var j = 0; j <= i && j < len2; j++) {
if (!fileCtls[j].disabled && fileCtls[j].value.indexOf(files[i]) != -1) {
fileCtls[j].disabled = true;
isExist = true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -