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

📄 dateout.js

📁 最好用的站点内容管理系统 全部源代码都有
💻 JS
📖 第 1 页 / 共 5 页
字号:
document.writeln("		return el;");
document.writeln("	} else if (typeof el.parentNode.month != \"undefined\") {");
document.writeln("		return el.parentNode;");
document.writeln("	}");
document.writeln("	return null;");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.findYear = function(el) {");
document.writeln("	if (typeof el.year != \"undefined\") {");
document.writeln("		return el;");
document.writeln("	} else if (typeof el.parentNode.year != \"undefined\") {");
document.writeln("		return el.parentNode;");
document.writeln("	}");
document.writeln("	return null;");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.showMonthsCombo = function () {");
document.writeln("	var cal = Calendar._C;");
document.writeln("	if (!cal) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	var cal = cal;");
document.writeln("	var cd = cal.activeDiv;");
document.writeln("	var mc = cal.monthsCombo;");
document.writeln("	if (cal.hilitedMonth) {");
document.writeln("		Calendar.removeClass(cal.hilitedMonth, \"hilite\");");
document.writeln("	}");
document.writeln("	if (cal.activeMonth) {");
document.writeln("		Calendar.removeClass(cal.activeMonth, \"active\");");
document.writeln("	}");
document.writeln("	var mon = cal.monthsCombo.getElementsByTagName(\"div\")[cal.date.getMonth()];");
document.writeln("	Calendar.addClass(mon, \"active\");");
document.writeln("	cal.activeMonth = mon;");
document.writeln("	mc.style.left = cd.offsetLeft + \"px\";");
document.writeln("	mc.style.top = (cd.offsetTop + cd.offsetHeight) + \"px\";");
document.writeln("	mc.style.display = \"block\";");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.showYearsCombo = function (fwd) {");
document.writeln("	var cal = Calendar._C;");
document.writeln("	if (!cal) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	var cal = cal;");
document.writeln("	var cd = cal.activeDiv;");
document.writeln("	var yc = cal.yearsCombo;");
document.writeln("	if (cal.hilitedYear) {");
document.writeln("		Calendar.removeClass(cal.hilitedYear, \"hilite\");");
document.writeln("	}");
document.writeln("	if (cal.activeYear) {");
document.writeln("		Calendar.removeClass(cal.activeYear, \"active\");");
document.writeln("	}");
document.writeln("	cal.activeYear = null;");
document.writeln("	var Y = cal.date.getFullYear() + (fwd ? 1 : -1);");
document.writeln("	var yr = yc.firstChild;");
document.writeln("	var show = false;");
document.writeln("	for (var i = 12; i > 0; --i) {");
document.writeln("		if (Y >= cal.minYear && Y <= cal.maxYear) {");
document.writeln("			yr.firstChild.data = Y;");
document.writeln("			yr.year = Y;");
document.writeln("			yr.style.display = \"block\";");
document.writeln("			show = true;");
document.writeln("		} else {");
document.writeln("			yr.style.display = \"none\";");
document.writeln("		}");
document.writeln("		yr = yr.nextSibling;");
document.writeln("		Y += fwd ? 2 : -2;");
document.writeln("	}");
document.writeln("	if (show) {");
document.writeln("		yc.style.left = cd.offsetLeft + \"px\";");
document.writeln("		yc.style.top = (cd.offsetTop + cd.offsetHeight) + \"px\";");
document.writeln("		yc.style.display = \"block\";");
document.writeln("	}");
document.writeln("};");
document.writeln("");
document.writeln("\/\/ event handlers");
document.writeln("");
document.writeln("Calendar.tableMouseUp = function(ev) {");
document.writeln("	var cal = Calendar._C;");
document.writeln("	if (!cal) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	if (cal.timeout) {");
document.writeln("		clearTimeout(cal.timeout);");
document.writeln("	}");
document.writeln("	var el = cal.activeDiv;");
document.writeln("	if (!el) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	var target = Calendar.getTargetElement(ev);");
document.writeln("	Calendar.removeClass(el, \"active\");");
document.writeln("	if (target == el || target.parentNode == el) {");
document.writeln("		Calendar.cellClick(el);");
document.writeln("	}");
document.writeln("	var mon = Calendar.findMonth(target);");
document.writeln("	var date = null;");
document.writeln("	if (mon) {");
document.writeln("		date = new Date(cal.date);");
document.writeln("		if (mon.month != date.getMonth()) {");
document.writeln("			date.setMonth(mon.month);");
document.writeln("			cal.setDate(date);");
document.writeln("			cal.dateClicked = false;");
document.writeln("			cal.callHandler();");
document.writeln("		}");
document.writeln("	} else {");
document.writeln("		var year = Calendar.findYear(target);");
document.writeln("		if (year) {");
document.writeln("			date = new Date(cal.date);");
document.writeln("			if (year.year != date.getFullYear()) {");
document.writeln("				date.setFullYear(year.year);");
document.writeln("				cal.setDate(date);");
document.writeln("				cal.dateClicked = false;");
document.writeln("				cal.callHandler();");
document.writeln("			}");
document.writeln("		}");
document.writeln("	}");
document.writeln("	with (Calendar) {");
document.writeln("		removeEvent(document, \"mouseup\", tableMouseUp);");
document.writeln("		removeEvent(document, \"mouseover\", tableMouseOver);");
document.writeln("		removeEvent(document, \"mousemove\", tableMouseOver);");
document.writeln("		cal._hideCombos();");
document.writeln("		_C = null;");
document.writeln("		return stopEvent(ev);");
document.writeln("	}");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.tableMouseOver = function (ev) {");
document.writeln("	var cal = Calendar._C;");
document.writeln("	if (!cal) {");
document.writeln("		return;");
document.writeln("	}");
document.writeln("	var el = cal.activeDiv;");
document.writeln("	var target = Calendar.getTargetElement(ev);");
document.writeln("	if (target == el || target.parentNode == el) {");
document.writeln("		Calendar.addClass(el, \"hilite active\");");
document.writeln("		Calendar.addClass(el.parentNode, \"rowhilite\");");
document.writeln("	} else {");
document.writeln("		Calendar.removeClass(el, \"active\");");
document.writeln("		Calendar.removeClass(el, \"hilite\");");
document.writeln("		Calendar.removeClass(el.parentNode, \"rowhilite\");");
document.writeln("	}");
document.writeln("	var mon = Calendar.findMonth(target);");
document.writeln("	if (mon) {");
document.writeln("		if (mon.month != cal.date.getMonth()) {");
document.writeln("			if (cal.hilitedMonth) {");
document.writeln("				Calendar.removeClass(cal.hilitedMonth, \"hilite\");");
document.writeln("			}");
document.writeln("			Calendar.addClass(mon, \"hilite\");");
document.writeln("			cal.hilitedMonth = mon;");
document.writeln("		} else if (cal.hilitedMonth) {");
document.writeln("			Calendar.removeClass(cal.hilitedMonth, \"hilite\");");
document.writeln("		}");
document.writeln("	} else {");
document.writeln("		var year = Calendar.findYear(target);");
document.writeln("		if (year) {");
document.writeln("			if (year.year != cal.date.getFullYear()) {");
document.writeln("				if (cal.hilitedYear) {");
document.writeln("					Calendar.removeClass(cal.hilitedYear, \"hilite\");");
document.writeln("				}");
document.writeln("				Calendar.addClass(year, \"hilite\");");
document.writeln("				cal.hilitedYear = year;");
document.writeln("			} else if (cal.hilitedYear) {");
document.writeln("				Calendar.removeClass(cal.hilitedYear, \"hilite\");");
document.writeln("			}");
document.writeln("		}");
document.writeln("	}");
document.writeln("	return Calendar.stopEvent(ev);");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.tableMouseDown = function (ev) {");
document.writeln("	if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) {");
document.writeln("		return Calendar.stopEvent(ev);");
document.writeln("	}");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.calDragIt = function (ev) {");
document.writeln("	var cal = Calendar._C;");
document.writeln("	if (!(cal && cal.dragging)) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	var posX;");
document.writeln("	var posY;");
document.writeln("	if (Calendar.is_ie) {");
document.writeln("		posY = window.event.clientY + document.body.scrollTop;");
document.writeln("		posX = window.event.clientX + document.body.scrollLeft;");
document.writeln("	} else {");
document.writeln("		posX = ev.pageX;");
document.writeln("		posY = ev.pageY;");
document.writeln("	}");
document.writeln("	cal.hideShowCovered();");
document.writeln("	var st = cal.element.style;");
document.writeln("	st.left = (posX - cal.xOffs) + \"px\";");
document.writeln("	st.top = (posY - cal.yOffs) + \"px\";");
document.writeln("	return Calendar.stopEvent(ev);");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.calDragEnd = function (ev) {");
document.writeln("	var cal = Calendar._C;");
document.writeln("	if (!cal) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	cal.dragging = false;");
document.writeln("	with (Calendar) {");
document.writeln("		removeEvent(document, \"mousemove\", calDragIt);");
document.writeln("		removeEvent(document, \"mouseover\", stopEvent);");
document.writeln("		removeEvent(document, \"mouseup\", calDragEnd);");
document.writeln("		tableMouseUp(ev);");
document.writeln("	}");
document.writeln("	cal.hideShowCovered();");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.dayMouseDown = function(ev) {");
document.writeln("	var el = Calendar.getElement(ev);");
document.writeln("	if (el.disabled) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	var cal = el.calendar;");
document.writeln("	cal.activeDiv = el;");
document.writeln("	Calendar._C = cal;");
document.writeln("	if (el.navtype != 300) with (Calendar) {");
document.writeln("		addClass(el, \"hilite active\");");
document.writeln("		addEvent(document, \"mouseover\", tableMouseOver);");
document.writeln("		addEvent(document, \"mousemove\", tableMouseOver);");
document.writeln("		addEvent(document, \"mouseup\", tableMouseUp);");
document.writeln("	} else if (cal.isPopup) {");
document.writeln("		cal._dragStart(ev);");
document.writeln("	}");
document.writeln("	if (el.navtype == -1 || el.navtype == 1) {");
document.writeln("		cal.timeout = setTimeout(\"Calendar.showMonthsCombo()\", 250);");
document.writeln("	} else if (el.navtype == -2 || el.navtype == 2) {");
document.writeln("		cal.timeout = setTimeout((el.navtype > 0) ? \"Calendar.showYearsCombo(true)\" : \"Calendar.showYearsCombo(false)\", 250);");
document.writeln("	} else {");
document.writeln("		cal.timeout = null;");
document.writeln("	}");
document.writeln("	return Calendar.stopEvent(ev);");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.dayMouseDblClick = function(ev) {");
document.writeln("	Calendar.cellClick(Calendar.getElement(ev));");
document.writeln("	if (Calendar.is_ie) {");
document.writeln("		document.selection.empty();");
document.writeln("	}");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.dayMouseOver = function(ev) {");
document.writeln("	var el = Calendar.getElement(ev);");
document.writeln("	if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) {");
document.writeln("		return false;");
document.writeln("	}");
document.writeln("	if (el.ttip) {");
document.writeln("		if (el.ttip.substr(0, 1) == \"_\") {");
document.writeln("			var date = null;");
document.writeln("			with (el.calendar.date) {");
document.writeln("				date = new Date(getFullYear(), getMonth(), el.caldate);");
document.writeln("			}");
document.writeln("			el.ttip = date.print(el.calendar.ttDateFormat) + el.ttip.substr(1);");

⌨️ 快捷键说明

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