📄 outlook.js
字号:
// Withub Court System 2002
// outlook bar lib functions
// rewrited by d2yh
// mailto:d2yh@hotmail.com
function theitem(intitle,instate,inkey,sitename) {
this.title = intitle; //
this.state = instate; // 1 表示 标题按钮 2 表示 选项按钮
this.key = inkey; // 0 表示 引用原文 1 表示 生成链接 2 表示 使用javascript方法
this.site = sitename; //
this.otherclass = " nowrap "; //
}
function outlook() {
this.titlelist = new Array();
this.itemlist = new Array();
this.divstyle = "style='height:100%;width:100%;overflow:auto;' align='center'";
this.otherclass= "border=0 cellspacing='0' cellpadding='2' style='height:100%;width:100%' valign='middle' align='center' ";
this.addtitle = addtitle;
this.additem = additem;
this.starttitle= -1;
this.show = show;
this.getOutLine= getOutLine;
this.opentitle = this.starttitle;
this.reflesh = outreflesh;
this.timedelay = 50;
this.inc = 10;
}
function showitem(id,name,sitename) {
if(id==0) {
// 当id==0时,直接输出sitename供程序员直接编辑HTML格式的sitename字符串
return sitename;
}
if(name.length<7) {
name = " " + name;
} else {
name = " " + name;
}
if(id==1) {
return "<TABLE style='BORDER-TOP-WIDTH:0px; BORDER-LEFT-WIDTH:0px; BORDER-BOTTOM-WIDTH:0px; BORDER-RIGHT-WIDTH:0px' cellSpacing=1 cellPadding=1 width=100% border=0><TBODY>"
+ "<TR><TD onmouseover=\"this.bgColor='#ffff99';this.style.color='red';\" onmouseout=\"this.bgColor='';this.style.color='';\" bgColor=''>"
+ "<DIV style='CURSOR:hand;' align=left onclick=\"javascript:parent.frames['ajbl_right'].location.href='"+sitename+"';return false;\">"+name+"</DIV>"
+ "</TD></TR></TBODY></TABLE>";
} else if(id==2) {
return "<TABLE style='BORDER-TOP-WIDTH:0px; BORDER-LEFT-WIDTH:0px; BORDER-BOTTOM-WIDTH:0px; BORDER-RIGHT-WIDTH:0px' cellSpacing=1 cellPadding=1 width=100% border=0><TBODY>"
+ "<TR><TD onmouseover=\"this.bgColor='#ffff99';this.style.color='red';\" onmouseout=\"this.bgColor='';this.style.color='';\" bgColor=''>"
+ "<DIV style='CURSOR:hand;' align=left onclick=\"javascript:"+sitename+";return false;\">"+name+"</DIV>"
+ "</TD></TR></TBODY></TABLE>";
}
return "";
}
function addtitle(intitle) {
var t;
t = outlookbar.titlelist.length;
outlookbar.titlelist[t]= new theitem(intitle,1,0,"");
outlookbar.itemlist[t] = new Array();
return t;
}
function additem(intitle,parentid,inkey,sitename) {
if (parentid<0 || parentid>outlookbar.titlelist.length) {
return -1;
} else {
var t;
t = outlookbar.itemlist[parentid].length;
outlookbar.itemlist[parentid][t] = new theitem(intitle,2,inkey,sitename);
outlookbar.itemlist[parentid][t].otherclass = " nowrap align='left' style='backgroundColor:blue;height:5;' ";
return t;
}
}
function switchoutlookBar(newnum) {
var oldnum = outlookbar.opentitle; // oldnum 是 当前 打开的页编号
outlookbar.opentitle=newnum; // newnum 是 将要 打开的页编号
var id1,id1b; // newnum 所指向的 outlookdiv* 和 outlookdivin* 的对象名
var id2,id2b; // oldnum 所指向的 outlookdiv* 和 outlookdivin* 的对象名
if (newnum!=oldnum && outlooksmoothstat==0){
if (newnum!=-1) {
if (oldnum==-1) {
id2 ="blankdiv";
id2b="blankdivin";
} else {
id2 ="outlookdiv"+oldnum;
id2b="outlookdivin"+oldnum;
document.all("outlooktitle"+oldnum).style.borderLeft = "1px solid buttonhighlight";
document.all("outlooktitle"+oldnum).style.borderTop = "1px solid buttonhighlight";
document.all("outlooktitle"+oldnum).style.borderRight = "1px solid black";
document.all("outlooktitle"+oldnum).style.borderBottom= "1px solid black";
document.all("outlooktitle"+oldnum).style.background = "#99ccff";
document.all("outlooktitle"+oldnum).style.color = "ButtonText";
}
id1="outlookdiv"+newnum;
id1b="outlookdivin"+newnum;
document.all("outlooktitle"+newnum).style.borderLeft = "1px solid buttonhighlight";
document.all("outlooktitle"+newnum).style.borderTop = "1px solid buttonhighlight";
document.all("outlooktitle"+newnum).style.borderRight = "1px solid black";
document.all("outlooktitle"+newnum).style.borderBottom= "1px solid black";
document.all("outlooktitle"+newnum).style.background = "#0099cc";
document.all("outlooktitle"+newnum).style.color = "#ffffff";
smoothout(id1,id2,id1b,id2b,0);
} else { // new==-1
document.all("outlookdiv"+oldnum).style.display = "none";
document.all("outlookdiv"+oldnum).style.height = "0%";
document.all("outlooktitle"+oldnum).style.border = "1px solid buttonhighlight";
document.all("outlooktitle"+oldnum).style.background= "#99ccff";
document.all("outlooktitle"+oldnum).style.color = "white";
document.all("blankdiv").style.display = "";
document.all("blankdiv").sryle.height = "100%";
}
}
}
function smoothout(id1,id2,id1b,id2b,stat) {
if(stat==0){
tempinnertext1 = document.all(id1b).innerHTML;
tempinnertext2 = document.all(id2b).innerHTML;
document.all(id1b).innerHTML = "";
document.all(id2b).innerHTML = "";
outlooksmoothstat = 1;
document.all(id1b).style.overflow="hidden";
document.all(id2b).style.overflow="hidden";
document.all(id1).style.height ="0%";
document.all(id1).style.display="";
setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+outlookbar.inc+")",outlookbar.timedalay);
} else {
stat+=outlookbar.inc;
if (stat>100) stat=100;
document.all(id1).style.height=stat+"%";
document.all(id2).style.height=(100-stat)+"%";
if (stat<100) {
setTimeout("smoothout('"+id1+"','"+id2+"','"+id1b+"','"+id2b+"',"+stat+")",outlookbar.timedalay);
} else {
document.all(id1b).innerHTML = tempinnertext1;
document.all(id2b).innerHTML = tempinnertext2;
outlooksmoothstat = 0;
document.all(id1b).style.overflow = "auto";
document.all(id2).style.display = "none";
}
}
}
function getOutLine() {
var outline;
outline = "<table "+outlookbar.otherclass+">";
for (i=0; i<(outlookbar.titlelist.length); i++) {
outline += "<tr><td name='outlooktitle"+i+"' id='outlooktitle"+i+"'"
+ " nowrap align='center' " + outlookbar.titlelist[i].otherclass
+ "style='cursor:hand;font-size:12px;height:5;textalign:center;border-left:1 solid buttonhighlight;border-top:1 solid buttonhighlight;border-right:1 solid black;border-bottom:1 solid black;"
+ (i==outlookbar.opentitle ? "background-color:#0099cc;color:white;" : "background-color:#99ccff;color:black;") // 如果是当前打开的标题,那么背景色略有不同
+ "'"
+ " onclick='switchoutlookBar("+i+");'>";
outline += "<span style='font-size:12px'>" + outlookbar.titlelist[i].title+"</span>";
outline += "</td></tr>";
outline += "<tr><td name='outlookdiv"+i+"' id='outlookdiv"+i+"'"
+ " valign='top' align='center' style='width:100%;"
+ ( i==outlookbar.opentitle ? "display:;height:100%;" : "display:none;height:0%;" )
+ "'>";
outline += "<div name='outlookdivin"+i+"' id='outlookdivin"+i+"' style='overflow:auto;width:100%;height:100%'>";
for (j=0; j<outlookbar.itemlist[i].length; j++){
outline += showitem(outlookbar.itemlist[i][j].key,outlookbar.itemlist[i][j].title,outlookbar.itemlist[i][j].site);
}
outline += "</div>";
outline += "</td></tr>";
}
outline += "<tr><td name='blankdiv' id='blankdiv' valign='top' align='center' style='height:100%;width:100%;"
+ (outlookbar.opentitle!=-1 ? "display:none;" : "display:;")
+ "'>";
outline += "<div name='blankdivin' id='blankdivin' style='overflow:auto;width:100%;height:100%;'></div>";
outline += "</td></tr>";
outline += "</table>";
return outline;
}
function show() {
var outline;
outline = "<div id='outLookBarDiv' name='outLookBarDiv' style='width=100%;height:100%;'>"
outline += outlookbar.getOutLine();
outline += "</div>";
document.write(outline);
}
function outreflesh() {
document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();
}
var tempinnertext1,tempinnertext2; //
var outlooksmoothstat = 0; // 移动状态 0 表示空闲 1 表示移动中
// ButtonFace #FFCC00
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -