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

📄 oebar.js

📁 论坛BBS
💻 JS
字号:
/*
##############################################
#     BigMole Dynamic Discussion Board 2.0     #
#     By Emil A Eklund (http://BigMole.5188.org/contact.html#emil)      #
#    and Erik Arvidson (http://BigMole.5188.org/contact.html#erik)     #
#              April 24, 1999                #
##############################################
# Feel free to use this script for personal  #
# and non-profit organisation's websites,    #
# as long as you're giving us credits for it #
# in other words, not removing nur modifying #
# this notice in any of the files it apperes #
##############################################
#   For comercial use contact Emil or Erik   #
##############################################
*/


document.onmouseover = oeBarHandleOver;
document.onmouseout = oeBarHandleOut;
document.onmousedown = oeBarHandleDown;
document.onmouseup = oeBarHandleUp;
document.onclick = oeBarHandleClick;

window.onresize = new Function("checkScroll(oeBarContainer)");
window.onload   = initOeBarPrime;



function initOeBarPrime() {
	document.body.onselectstart = new Function ("return false");
	checkScroll(oeBarContainer);
	selectRightItem();
}

function selectRightItem() {
	if (!parent.trLoaded || parent.treeframe.document.readyState != "complete")
		window.setTimeout("selectRightItem()", 100);
	else {
		var el;
		var gr = parent.treeframe.document.body.group;
		var divs = document.all.tags("DIV");
		
		for (var i=0; i<divs.length; i++) {
//			alert(divs[i].getAttribute("onclick"));
			if (divs[i].getAttribute("onclick") != null	&& divs[i].getAttribute("onclick").toString().indexOf(gr) != -1) {

				document.body.selectedItem = divs[i];
				oeBarSelect(divs[i]);
				break;
			}
		}

	}
}


function loadTree(group) {
	
	if (!parent.trLoaded || !parent.mLoaded || !parent.tLoaded || !parent.treeframe.document.body)
		window.setTimeout("loadTree('" + group + "')", 100);
	else {
		var pwd = parent.treeframe.document.body.password;
		
		if (pwd == null){
			parent.treeframe.document.body.group=group;
			parent.treeframe.isOvertsfdata("data/"+group+"/"+"l1.xml");
			}
			
			//location = cgiFile + "?action=tree&group=" + group;
		else{parent.treeframe.document.body.group=group;
			parent.treeframe.location = cgiFile + "?action=admintree&group=" + group + "&pwd=" + pwd;}
		var md = parent.messageframe.document;
		md.frames[0].location = startMessageURL;
		md.all.subject.innerHTML = "&nbsp;";
		md.all.email.innerHTML = "&nbsp;";
		md.all.date.innerHTML = "&nbsp;";

		var td = parent.toolframe.document;
		parent.toolframe.disable(td.all.followUpButton);
		parent.toolframe.disable(td.all.replyToAuthorButton);
		window.clearTimeout(parent.treeframe.currentMessageTimer);
		
	}
}

function oeBarHandleClick() {
	el = getReal(window.event.srcElement, "tagName", "DIV");
		
	if (el.className == "oeBarButton") {
		if (document.body.selectedItem == null) {
			document.body.selectedItem = el;
			oeBarSelect(el);
		}
		else if (document.body.selectedItem != el) {
			oeBarUnSelect(document.body.selectedItem);
			document.body.selectedItem = el;
			oeBarSelect(el);
		}
	}
}	

function oeBarHandleOver() {
	var fromEl = getReal(window.event.fromElement, "tagName", "DIV");
	var toEl = getReal(window.event.toElement, "tagName", "DIV");
	if (fromEl == toEl) return;
	
	el = toEl;
	
	if (el.className == "scrollButton" || el.className == "oeBarButton")
		oeBarRaise(el);
}

function oeBarHandleOut() {
	var fromEl = getReal(window.event.fromElement, "tagName", "DIV");
	var toEl = getReal(window.event.toElement, "tagName", "DIV");
	if (fromEl == toEl) return;
	
	el = fromEl;

	if (el.className == "scrollButton" || el.className == "oeBarButton") {
		oeBarFlat(el);
		window.clearTimeout(scrollTimer);
	}
		
}

function oeBarHandleDown() {
	el = getReal(window.event.srcElement, "tagName", "DIV");
		
	if (el.className == "scrollButton") {
		var type = el.getAttribute("type");
		var container = el.getAttribute("for");
		oeBarLower(el);
		scrollContainer(document.all(container), type);
	}
	
	if (el.className == "oeBarButton")
		oeBarLower(el);
}

function oeBarHandleUp() {
	el = getReal(window.event.srcElement, "tagName", "DIV");
		
	if (el.className == "scrollButton") {
		oeBarRaise(el);
		window.clearTimeout(scrollTimer);
	}
	
	if (el.className == "oeBarButton") {
		oeBarRaise(el);

	}
}

// the following five functions describes the behavior of the *buttons*
function oeBarRaise(el) {
	with (el.style) {
		borderWidth		= "1px";
		borderStyle		= "outset";
		borderColor		= "buttonhighlight";
		borderTop		= "1px solid threedlightshadow";
		borderLeft		= "1px solid threedlightshadow";
		borderRight		= "1px solid threeddarkshadow";
		borderBottom	= "1px solid threeddarkshadow";
		padding			= paddingOrg;
	}
}

function oeBarLower(el) {
	with (el.style) {
		borderWidth		= "1px";
		borderStyle		= "inset";
		borderTop		= "1px solid threeddarkshadow";
		borderLeft		= "1px solid threeddarkshadow";
		borderRight		= "1px solid threedlightshadow";
		borderBottom	= "1px solid threedlightshadow";
		paddingLeft		= paddingOrg + 1;
		paddingTop		= paddingOrg + 1;
		paddingRight	= paddingOrg - 1;
		paddingBottom	= paddingOrg - 1;
	}
}

function oeBarFlat(el) {
	with (el.style) {
		border =		"1px solid buttonshadow";
		padding =		paddingOrg;
	}
}

function oeBarSelect(el) {
	el.style.background = "highlight";
	el.style.color = "highlighttext";
}

function oeBarUnSelect(el) {
	el.style.background = "buttonshadow";
	el.style.color = "window";
}

function checkScroll(el) {
	var ub = document.all(el.getAttribute("upbutton"));
	var db = document.all(el.getAttribute("downbutton"));
	var p = el.parentElement;
	var top = el.style.pixelTop;
	var bottom = el.offsetHeight + top - p.clientHeight;
	
	if (el.offsetHeight > p.clientHeight) {
		if (top < 0 && bottom < 0)
			setBottom(el,0);

		if (ub != null) {
			if (top < 0)
				ub.style.display = "block";
			else
				ub.style.display = "none";
		}
		if (db != null) {
			if (bottom > 0)
				db.style.display = "block";
			else
				db.style.display = "none";
		}
	}
	else {
		setTop(el, 0);
		if (db != null)
			db.style.display = "none";
		if (ub != null)
			ub.style.display = "none";
	}
	
	db.style.top = el.parentElement.clientHeight - db.offsetHeight;
}

function setTop(el, y) {
	if (y <= 0) {
		el.style.pixelTop = y;
		el.style.clip = "rect(" + -y + "," +  el.parentElement.clientWidth +
							"," + (el.parentElement.clientHeight + -y) + "," + 0 + ")";
	}
}

function setBottom(el, y) {
	if (y >= 0) {
		var ph = el.parentElement.clientHeight;
		var top = el.offsetHeight - ph - y;
		el.style.pixelTop = -top;
		el.style.clip = "rect(" + top + "," + el.parentElement.clientWidth +
							"," + (el.offsetHeight) + "," + 0 + ")";
	}
}

function scrollContainer(el, type) {
	var p = el.parentElement;
	var oldTop = el.style.pixelTop;
	var top = (type == "down") ? oldTop - scrollAmount : oldTop + scrollAmount;
	var bottom = el.offsetHeight + top - p.clientHeight;
	
	if (type=="down" && bottom < 0)
		setBottom(el,0);
	if (type=="up" && top > 0)
		setTop(el,0);
	else if ((top < scrollAmount && type=="up") || (type=="down" && bottom > -scrollAmount)) {
		setTop(el, top);
	}
	
	checkScroll(el);
	window.clearTimeout(scrollTimer);
	scrollTimer = window.setTimeout("scrollContainer(document.all('" + el.id + "'),'" + type + "')", scrollInterval);
}

⌨️ 快捷键说明

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