📄 dateout.js
字号:
document.writeln("<style type=\"text\/css\" title=\"\">");
document.writeln("");
document.writeln("\/*弹出日历*\/");
document.writeln("\/* The main calendar widget. DIV containing a table. *\/");
document.writeln(".calendar { position: relative; display: none; border: 1px solid #000; font-size: 11px; color: #000; cursor: default; background: #E3EBF6;font-family: tahoma,verdana,sans-serif;}");
document.writeln(".calendar table { border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff; border-left: 1px solid #fff; font-size: 11px;color: #000;cursor: default;background: #E3EBF6;font-family: tahoma,verdana,sans-serif;}");
document.writeln("\/* Header part -- contains navigation buttons and day names. *\/");
document.writeln(".calendar .button { text-align: center; padding: 1px;border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff; border-left: 1px solid #fff; font-weight:bold;}\/* \"<<\", \"<\", \">\", \">>\" buttons have this class *\/");
document.writeln(".calendar thead .title {font-weight: bold;padding: 1px;border: 1px solid #fff;background: #99B2D3;color: #fff;text-align: center;");
document.writeln("} \/* This holds the current \"month, year\" *\/");
document.writeln(".calendar thead .headrow { }\/* Row <TR> containing navigation buttons *\/");
document.writeln(".calendar thead .daynames { }\/* Row <TR> containing the day names *\/");
document.writeln(".calendar thead .name { border-bottom: 1px solid #fff; padding: 2px;text-align: center;background: #CBD7E6;}\/* Cells <TD> containing the day names *\/");
document.writeln(".calendar thead .weekend { color: #f00;}\/* How a weekend day name shows in header *\/");
document.writeln(".calendar thead .hilite { border-top: 2px solid #fff;border-right: 2px solid #fff;border-bottom: 2px solid #fff;border-left: 2px solid #fff; padding: 0px;background: #ffffff;}\/* How do the buttons in header appear when hover *\/");
document.writeln(".calendar thead .active { padding: 2px 0px 0px 2px;border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff; border-left: 1px solid #fff;background: #b8c0c4;}\/* Active (pressed) buttons in header *\/");
document.writeln("\/* The body part -- contains all the days in month. *\/");
document.writeln(".calendar tbody .day { width: 2em;text-align: right;padding: 2px 4px 2px 2px;}\/* Cells <TD> containing month days dates *\/");
document.writeln(".calendar table .wn {padding: 2px 3px 2px 2px;border-right: 1px solid #fff;background: #CBD7E6;}");
document.writeln(".calendar tbody .rowhilite td {background: #d8e4e0;}");
document.writeln(".calendar tbody .rowhilite td.wn {background: #c8d4d0;}");
document.writeln(".calendar tbody td.hilite {padding: 1px 3px 1px 1px;border: 1px solid;border-color: #fff #fff #fff #fff;} \/* Hovered cells <TD> *\/");
document.writeln(".calendar tbody td.active { padding: 2px 2px 0px 2px; border: 1px solid; border-color: #fff #fff #fff #fff;}\/* Active (pressed) cells <TD> *\/");
document.writeln(".calendar tbody td.selected { font-weight: bold;padding: 2px 2px 0px 2px;border: 1px solid;border-color: #fff #fff #fff #fff; background: #d8e0e4;}\/* Cell showing selected date *\/");
document.writeln(".calendar tbody td.weekend { color: #f00;} \/* Cells showing weekend days *\/");
document.writeln(".calendar tbody td.today { ont-weight: bold;color: #00f;}\/* Cell showing today date *\/");
document.writeln(".calendar tbody .disabled { color: #999; }");
document.writeln(".calendar tbody .emptycell {visibility: hidden;} \/* Empty cells (the best is to hide them) *\/");
document.writeln(".calendar tbody .emptyrow { display: none;}\/* Empty row (some months need less than 6 rows) *\/");
document.writeln("\/* The footer part -- status bar and \"Close\" button *\/");
document.writeln(".calendar tfoot .footrow { }\/* The <TR> in footer (only one right now) *\/");
document.writeln(".calendar tfoot .ttip { background: #CBD7E6;padding: 1px;border: 1px solid #fff; background: #99B2D3;color: #fff;text-align: center;}\/* Tooltip (status bar) cell <TD> *\/");
document.writeln(".calendar tfoot .hilite {border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff;border-left: 1px solid #fff; padding: 1px;background: #d8e0e4;} \/* Hover style for buttons in footer *\/");
document.writeln(".calendar tfoot .active { padding: 2px 0px 0px 2px;border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff; border-left: 1px solid #fff;}\/* Active (pressed) style for buttons in footer *\/");
document.writeln("\/* Combo boxes (menus that display months\/years for direct selection) *\/");
document.writeln(".combo {position: absolute;display: none;width: 4em;top: 0px;left: 0px;cursor: default;border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff;border-left: 1px solid #fff;background: #d8e0e4;font-size: smaller;padding: 1px;}");
document.writeln(".combo .label {text-align: center;padding:1px;}");
document.writeln(".combo .active {background: #E3EBF6;padding: 0px;border-top: 1px solid #fff;border-right: 1px solid #fff;border-bottom: 1px solid #fff;border-left: 1px solid #fff;}");
document.writeln(".combo .hilite {background: #048;color: #aef;}");
document.writeln("");
document.writeln("<\/style>");
document.writeln("<script type=\"text\/javascript\" >");
document.writeln("\/* Copyright Mihai Bazon, 2002, 2003 | http:\/\/students.infoiasi.ro\/~mishoo");
document.writeln(" * ---------------------------------------------------------------------------");
document.writeln(" *");
document.writeln(" * The DHTML Calendar, version 0.9.3 \"It\'s still alive & keeps rocking\"");
document.writeln(" *");
document.writeln(" * Details and latest version at:");
document.writeln(" * http:\/\/students.infoiasi.ro\/~mishoo\/site\/calendar.epl");
document.writeln(" *");
document.writeln(" * Feel free to use this script under the terms of the GNU Lesser General");
document.writeln(" * Public License, as long as you do not remove or alter this notice.");
document.writeln(" *\/");
document.writeln("");
document.writeln("\/\/ $Id: calendar.js,v 1.11 2003\/07\/08 18:51:41 mishoo Exp $");
document.writeln("");
document.writeln("\/** The Calendar object constructor. *\/");
document.writeln("var Calendar = function (mondayFirst, dateStr, onSelected, onClose) {");
document.writeln(" \/\/ member variables");
document.writeln(" this.activeDiv = null;");
document.writeln(" this.currentDateEl = null;");
document.writeln(" this.checkDisabled = null;");
document.writeln(" this.timeout = null;");
document.writeln(" this.onSelected = onSelected || null;");
document.writeln(" this.onClose = onClose || null;");
document.writeln(" this.dragging = false;");
document.writeln(" this.hidden = false;");
document.writeln(" this.minYear = 1970;");
document.writeln(" this.maxYear = 2050;");
document.writeln(" this.dateFormat = Calendar._TT[\"DEF_DATE_FORMAT\"];");
document.writeln(" this.ttDateFormat = Calendar._TT[\"TT_DATE_FORMAT\"];");
document.writeln(" this.isPopup = true;");
document.writeln(" this.weekNumbers = true;");
document.writeln(" this.mondayFirst = mondayFirst;");
document.writeln(" this.dateStr = dateStr;");
document.writeln(" this.ar_days = null;");
document.writeln(" \/\/ HTML elements");
document.writeln(" this.table = null;");
document.writeln(" this.element = null;");
document.writeln(" this.tbody = null;");
document.writeln(" this.firstdayname = null;");
document.writeln(" \/\/ Combo boxes");
document.writeln(" this.monthsCombo = null;");
document.writeln(" this.yearsCombo = null;");
document.writeln(" this.hilitedMonth = null;");
document.writeln(" this.activeMonth = null;");
document.writeln(" this.hilitedYear = null;");
document.writeln(" this.activeYear = null;");
document.writeln(" \/\/ Information");
document.writeln(" this.dateClicked = false;");
document.writeln("");
document.writeln(" \/\/ one-time initializations");
document.writeln(" if (!Calendar._DN3) {");
document.writeln(" \/\/ table of short day names");
document.writeln(" var ar = new Array();");
document.writeln(" for (var i = 8; i > 0;) {");
document.writeln(" ar[--i] = Calendar._DN[i].substr(0, 3);");
document.writeln(" }");
document.writeln(" Calendar._DN3 = ar;");
document.writeln(" \/\/ table of short month names");
document.writeln(" ar = new Array();");
document.writeln(" for (var i = 12; i > 0;) {");
document.writeln(" ar[--i] = Calendar._MN[i].substr(0, 3);");
document.writeln(" }");
document.writeln(" Calendar._MN3 = ar;");
document.writeln(" }");
document.writeln("};");
document.writeln("");
document.writeln("\/\/ ** constants");
document.writeln("");
document.writeln("\/\/\/ \"static\", needed for event handlers.");
document.writeln("Calendar._C = null;");
document.writeln("");
document.writeln("\/\/\/ detect a special case of \"web browser\"");
document.writeln("Calendar.is_ie = ( \/msie\/i.test(navigator.userAgent) &&");
document.writeln(" !\/opera\/i.test(navigator.userAgent) );");
document.writeln("");
document.writeln("\/\/ short day names array (initialized at first constructor call)");
document.writeln("Calendar._DN3 = null;");
document.writeln("");
document.writeln("\/\/ short month names array (initialized at first constructor call)");
document.writeln("Calendar._MN3 = null;");
document.writeln("");
document.writeln("\/\/ BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate");
document.writeln("\/\/ library, at some point.");
document.writeln("");
document.writeln("Calendar.getAbsolutePos = function(el) {");
document.writeln(" var r = { x: el.offsetLeft, y: el.offsetTop };");
document.writeln(" if (el.offsetParent) {");
document.writeln(" var tmp = Calendar.getAbsolutePos(el.offsetParent);");
document.writeln(" r.x += tmp.x;");
document.writeln(" r.y += tmp.y;");
document.writeln(" }");
document.writeln(" return r;");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.isRelated = function (el, evt) {");
document.writeln(" var related = evt.relatedTarget;");
document.writeln(" if (!related) {");
document.writeln(" var type = evt.type;");
document.writeln(" if (type == \"mouseover\") {");
document.writeln(" related = evt.fromElement;");
document.writeln(" } else if (type == \"mouseout\") {");
document.writeln(" related = evt.toElement;");
document.writeln(" }");
document.writeln(" }");
document.writeln(" while (related) {");
document.writeln(" if (related == el) {");
document.writeln(" return true;");
document.writeln(" }");
document.writeln(" related = related.parentNode;");
document.writeln(" }");
document.writeln(" return false;");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.removeClass = function(el, className) {");
document.writeln(" if (!(el && el.className)) {");
document.writeln(" return;");
document.writeln(" }");
document.writeln(" var cls = el.className.split(\" \");");
document.writeln(" var ar = new Array();");
document.writeln(" for (var i = cls.length; i > 0;) {");
document.writeln(" if (cls[--i] != className) {");
document.writeln(" ar[ar.length] = cls[i];");
document.writeln(" }");
document.writeln(" }");
document.writeln(" el.className = ar.join(\" \");");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.addClass = function(el, className) {");
document.writeln(" Calendar.removeClass(el, className);");
document.writeln(" el.className += \" \" + className;");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.getElement = function(ev) {");
document.writeln(" if (Calendar.is_ie) {");
document.writeln(" return window.event.srcElement;");
document.writeln(" } else {");
document.writeln(" return ev.currentTarget;");
document.writeln(" }");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.getTargetElement = function(ev) {");
document.writeln(" if (Calendar.is_ie) {");
document.writeln(" return window.event.srcElement;");
document.writeln(" } else {");
document.writeln(" return ev.target;");
document.writeln(" }");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.stopEvent = function(ev) {");
document.writeln(" if (Calendar.is_ie) {");
document.writeln(" window.event.cancelBubble = true;");
document.writeln(" window.event.returnValue = false;");
document.writeln(" } else {");
document.writeln(" ev.preventDefault();");
document.writeln(" ev.stopPropagation();");
document.writeln(" }");
document.writeln(" return false;");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.addEvent = function(el, evname, func) {");
document.writeln(" if (el.attachEvent) { \/\/ IE");
document.writeln(" el.attachEvent(\"on\" + evname, func);");
document.writeln(" } else if (el.addEventListener) { \/\/ Gecko \/ W3C");
document.writeln(" el.addEventListener(evname, func, true);");
document.writeln(" } else { \/\/ Opera (or old browsers)");
document.writeln(" el[\"on\" + evname] = func;");
document.writeln(" }");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.removeEvent = function(el, evname, func) {");
document.writeln(" if (el.detachEvent) { \/\/ IE");
document.writeln(" el.detachEvent(\"on\" + evname, func);");
document.writeln(" } else if (el.removeEventListener) { \/\/ Gecko \/ W3C");
document.writeln(" el.removeEventListener(evname, func, true);");
document.writeln(" } else { \/\/ Opera (or old browsers)");
document.writeln(" el[\"on\" + evname] = null;");
document.writeln(" }");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.createElement = function(type, parent) {");
document.writeln(" var el = null;");
document.writeln(" if (document.createElementNS) {");
document.writeln(" \/\/ use the XHTML namespace; IE won\'t normally get here unless");
document.writeln(" \/\/ _they_ \"fix\" the DOM2 implementation.");
document.writeln(" el = document.createElementNS(\"http:\/\/www.w3.org\/1999\/xhtml\", type);");
document.writeln(" } else {");
document.writeln(" el = document.createElement(type);");
document.writeln(" }");
document.writeln(" if (typeof parent != \"undefined\") {");
document.writeln(" parent.appendChild(el);");
document.writeln(" }");
document.writeln(" return el;");
document.writeln("};");
document.writeln("");
document.writeln("\/\/ END: UTILITY FUNCTIONS");
document.writeln("");
document.writeln("\/\/ BEGIN: CALENDAR STATIC FUNCTIONS");
document.writeln("");
document.writeln("\/** Internal -- adds a set of events to make some element behave like a button. *\/");
document.writeln("Calendar._add_evs = function(el) {");
document.writeln(" with (Calendar) {");
document.writeln(" addEvent(el, \"mouseover\", dayMouseOver);");
document.writeln(" addEvent(el, \"mousedown\", dayMouseDown);");
document.writeln(" addEvent(el, \"mouseout\", dayMouseOut);");
document.writeln(" if (is_ie) {");
document.writeln(" addEvent(el, \"dblclick\", dayMouseDblClick);");
document.writeln(" el.setAttribute(\"unselectable\", true);");
document.writeln(" }");
document.writeln(" }");
document.writeln("};");
document.writeln("");
document.writeln("Calendar.findMonth = function(el) {");
document.writeln(" if (typeof el.month != \"undefined\") {");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -