⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 outlookbartree.js

📁 很不错的公文流转系统
💻 JS
📖 第 1 页 / 共 2 页
字号:
function init()
{
 	for (var i = 0; i < this.URLEntry.length; i++) 
	{
	    if (this.URLEntry[i].type == "open_folder") 
		{
			if (i == this.URLEntry.length-1 ) 
			{
				this.URLEntry[i].toggle(1,0);
			}
			else
			{
				this.URLEntry[i].toggle(0,0);
			}
			this.URLEntry[i].init();
		}
	}
}


function change_location(imagename)
{
	cur_name = imagename;
	if (document[old_cur_name]) 
	{
		document[old_cur_name].src="/Images/Moff.gif";
	}
	if (document[cur_name]) 
	{
		document[cur_name].src="/Images/Mon.gif";
	}
	old_cur_name = cur_name;
	return true;
}


//以下为生成OutlookBar的代码

var ImgNo=0;

function changeBorder(ob,type)
{

	if(type==1)
	{
		ob.style.borderLeft="1px solid #FFFFFF";
		ob.style.borderTop="1px solid #FFFFFF";
		ob.style.borderRight="1px solid #000000";
		ob.style.borderBottom="1px solid #000000";
	}
	else if (type==0)
	{
		ob.style.borderLeft="1px solid "+bgColor;
		ob.style.borderTop="1px solid "+bgColor;
		ob.style.borderRight="1px solid "+bgColor;
		ob.style.borderBottom="1px solid "+bgColor;
	}
	else
	{
		ob.style.borderLeft="1px solid #000000";
		ob.style.borderTop="1px solid #000000";
		ob.style.borderRight="1px solid #FFFFFF";
		ob.style.borderBottom="1px solid #FFFFFF";
	}
}


function showitem(item)
{
	for (j=0;j<item.URLEntry.length;j++)
	{
		document.write("<tr><td align='center'>");
		document.write("<span class=smallFont style=\"cursor:hand\"><img name='PIC' src='"+item.URLEntry[j].imgsrc+"' onclick=\"thsclicked(this,'"+item.URLEntry[j].URL+"')\" onmouseover='changeBorder(this,1);' onmouseout='changeBorder(this,0);' onmousedown='changeBorder(this,2);' style='border: 1 solid "+bgColor+"'></span>");
		document.write("</td></tr>");
		document.write("<tr><td height='18' align='center'>");
		document.write("<span class=smallFont><a onFocus='this.blur()'>"+item.URLEntry[j].name+"</a></span>");
		document.write("</td></tr>");
		document.write("<tr><td height='6' align='center'>");
		document.write("</td></tr>");
	}
}

function switchoutlookBar(number)
{
	var i = outlookbar.opentitle;//原打开栏号
	outlookbar.opentitle=number;//设置现将要打开的栏号
	var id1,id2,id1b,id2b
	if (number!=i && outlooksmoothstat==0)
	{
		if (number!=-1)
		{
			if (i==-1)
			{
				id2="blankdiv";
				id2b="blankdiv";
			}
			else
			{
				id2="outlookdiv"+i;
				id2b="outlookdivin"+i;

				//未选中的 BAR的样式
				document.all("outlooktitle"+i).style.background="#eeddaa";
				document.all("outlooktitle"+i).style.color="#000000";
				document.all("outlooktitle"+i).style.textalign="center";
			}

			id1="outlookdiv"+number;
			id1b="outlookdivin"+number;

			//选中的BAR的样式
			document.all("outlooktitle"+number).style.background="#FFCC66";
			document.all("outlooktitle"+number).style.color="#0000ff";
			document.all("outlooktitle"+number).style.textalign="center";
			smoothout(id1,id2,id1b,id2b,0);
		}
		else
		{
			document.all("blankdiv").style.display="";
			document.all("blankdiv").sryle.height="100%";
			document.all("outlookdiv"+i).style.display="none";
			document.all("outlookdiv"+i).style.height="0%";

			document.all("outlooktitle"+i).style.background="#C0C0C0";
			document.all("outlooktitle"+i).style.color="#000000";
			document.all("outlooktitle"+i).style.textalign="center";
		}
	}
}

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;
			//clearTimeout();
			outlooksmoothstat=0;
			document.all(id1b).style.overflow="auto";
			document.all(id2).style.display="none";
		}
	}
}

function getOutLine()
{
	outline="<table "+outlookbar.otherclass+" OnSelectStart=\"return false;\">";
	for (i=0;i<(outlookbar.titlelist.length);i++)
	{
		outline+="<tr><td height='18' name=outlooktitle"+i+" id=outlooktitle"+i+" ";		
		if (i!=outlookbar.opentitle) 
			outline+=" nowrap align=center style='cursor:hand;background-color:#eeddaa;color:#000000;height:18;border-left: 1 solid #FFFFFF; border-right: 1 solid #000000; border-top: 1 solid #FFFFFF; border-bottom: 1 solid #000000' ";
			//outline+=" nowrap align=center style='cursor:hand;background-color:#6699FF;color:#000000;height:18;border-left: 1 solid #FFFFFF; border-right: 1 solid #000000; border-top: 1 solid #FFFFFF; border-bottom: 1 solid #000000' ";
		else
			outline+=" nowrap align=center style='cursor:hand;background-color:#FFCC66;color:#0000ff;height:18;border-left: 1 solid #FFFFFF; border-right: 1 solid #000000; border-top: 1 solid #FFFFFF; border-bottom: 1 solid #000000' ";

		outline+=outlookbar.titlelist[i].otherclass;
		outline+=" onclick='switchoutlookBar("+i+")'><span class=smallFont>";
		outline+=outlookbar.titlelist[i].title+"</span></td></tr>";
		outline+="<tr><td name=outlookdiv"+i+" valign=middle align=center  id=outlookdiv"+i+" style='width:100%"
		if (i!=outlookbar.opentitle) 
			outline+=";display:none;height:0%;";
		else
			outline+=";display:;height:100%;";

		outline+="'><div name=outlookdivin"+i+" id=outlookdivin"+i+" style='overflow:auto;width:100%;height:100%'>";
		outline+="<table border='0' cellspacing='0' cellpadding='0' width='100%' style='font-size: 9pt' OnSelectStart=\"return false;\">";
		outline+="<tr><td anlign='left'>";
		document.write(outline);
		level=0;
		//设置根
		ROOTNODE= eval(outlookbar.titlelist[i].id);
		setType(ROOTNODE);
		countLevel(ROOTNODE);
		if (level>1)
		{
			displayRoot();
			showRoot();
		}
		else
		{
			showitem(ROOTNODE);
		}

		outline="";
		outline+="</td></tr>";

		outline+="</table>";
		
		outline+="</div></td></tr>"
	}
	
	outline+="</table>"
	document.write(outline);
	//return outline

}

function showpage()
{
	var outline="";
	writeStyle();
	outline+="<table border=0 width=100% cellspacing=0 cellpadding=0 height=100% style='font-size: 9pt' OnSelectStart='return false;'>\n";

    outline+="<tr><td width=100% id='outLookBarShow' name='outLookBarShow' valign='top' height='100%' align='center'>\n";

	outline+="<div id=outLookBarDiv name=outLookBarDiv style='width=100%;height:100%'>"
	document.write(outline);
	outline="";
	outline+=outlookbar.getOutLine();
	outline="";
	outline+="</div>";
	outline+="</td></tr></table>";
	

	document.write(outline);
}

function writeStyle()
{
	var stylestr="";
	stylestr+="<style>\n";
	stylestr+=".navPoint\n";
	stylestr+="{\n";
	stylestr+="font-family: Webdings;\n";
	stylestr+="font-size:9pt;\n";
	stylestr+="color:white;\n";
	stylestr+="cursor:hand;\n";
	stylestr+="}\n";

	stylestr+="td.td1{ color:black;font:9pt 宋体;background-color:#4eff99 }\n";
	stylestr+="td.td2{ color:black;font:9pt 宋体;background-color: }\n";

	stylestr+="td{ color:black;font:9pt 宋体;background-color:}\n";
	
	stylestr+="A.newclass:link {text-decoration:none;color:#001aff;font-size:9pt}\n";
	stylestr+="A.newclass:visited {text-decoration:none;color:#336666;font-size:9pt}\n";
	stylestr+="A.newclass:active {text-decoration:none;color:#001aff;font-size:9pt}\n";
	stylestr+="A.newclass:hover{text-decoration:underline;color:#001aff;font-size:9pt}\n";
	stylestr+="a:link{text-decoration:none;font:9pt 宋体, MS Song; color:#001aff}\n";
	stylestr+="a:visited{text-decoration:none;font:9pt 宋体, MS Song; color:#001aff}\n";
	stylestr+="a:hover	{text-decoration:none;font:9pt 宋体, MS Song; color:red}\n";
	stylestr+="table{ font:9pt 宋体; color:black }\n";
	stylestr+="hr{ height:1 }\n";
	stylestr+="p{ font:9pt 宋体;color:black }\n";
	stylestr+="</style>\n";

	document.write(stylestr);
}

function theitem(intitle,instate,inkey,inid)
{
	this.state=instate;
	this.otherclass=" nowrap style='font-size: 9pt'";
	this.key=inkey;
	this.title=intitle;
	this.id=inid;
}

function addtitle(intitle,inid)
{
	outlookbar.itemlist[outlookbar.titlelist.length]=new Array();
	outlookbar.titlelist[outlookbar.titlelist.length]=new theitem(intitle,1,0,inid);
	/*	if (outlookbar.titlelist.length != (outlookbar.starttitle+1)) 
	outlookbar.titlelist[outlookbar.titlelist.length-1].otherclass=" nowrap align=center style='cursor:hand;background-color:#C0C0C0;color:white;height:5;border:1 solid navy' ";
	else
	outlookbar.titlelist[outlookbar.titlelist.length-1].otherclass=" nowrap align=center style='cursor:hand;background-color:#C1E0FF;color:#C0C0C0;height:5;border:1 solid white' ";
	*/	
	return(outlookbar.titlelist.length-1);
}

function additem(intitle,parentid,inkey)
{
	if (parentid>=0 && parentid<=outlookbar.titlelist.length)
	{
		outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length]=new theitem(intitle,2,inkey);
		outlookbar.itemlist[parentid][outlookbar.itemlist[parentid].length-1].otherclass=" nowrap align=left style='backgroundColor:blue;height:18;font-size: 9pt' ";
		return(outlookbar.itemlist[parentid].length-1);
	}
	else
		additem=-1;
}

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='0' style='height:100%;width:100%;font-size: 9pt' valign=middle align=center ";
	this.addtitle=addtitle;
	this.additem=additem;
	this.starttitle=0;
	this.showpage=showpage;
	this.getOutLine=getOutLine;
	this.opentitle=this.starttitle;
	this.reflesh=outreflesh;
	this.timedalay=0;
	this.inc=20;
}

function outreflesh()
{
	document.all("outLookBarDiv").innerHTML=outlookbar.getOutLine();
}

function locatefold(foldname)
{
	for (var i=0;i<outlookbar.titlelist.length;i++)
	if(foldname==outlookbar.titlelist[i].title)
	{
		outlookbar.starttitle=i;
		outlookbar.opentitle=i;
	}
}

var outlookbar=new outlook();
var tempinnertext1,tempinnertext2,outlooksmoothstat;
outlooksmoothstat = 0;
var t;

function AddTitleItem(Id,ParentId,ChName,URL,imgsrc)
{

	if(ParentId=="0")
	{
		eval("outlookbar.addtitle('"+ChName+"','"+Id+"');");
		
		eval(Id+"=new URLEntry('"+imgsrc+"','"+ChName+"','"+""+"','"+URL+"','"+Id+"','');");
}
else
{
		eval(Id+"=new URLEntry('"+imgsrc+"','"+ChName+"','"+""+"','"+URL+"','"+Id+"','');");
		eval(ParentId+".addURLEntry("+Id+");");
	}
}
var globalObj;
function thsclicked(ths,src)
	{
		if (globalObj)
		{
			changeBorder(globalObj,0);
			//globalObj.disabled=false;
		}
		changeBorder(ths,2);
		//ths.disabled=true;
		parent.MainFrame.location.href=src;
		globalObj=ths;
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -