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

📄 cal.js

📁 噶额外噶外骨骼感广泛高热感 就 啊啊
💻 JS
📖 第 1 页 / 共 3 页
字号:
	var prevYYYY = prevMMYYYY[1]; 
 
	var nextMMYYYY = Calendar.calc_month_year(this.gMonth, this.gYear, 1); 
	var nextMM = nextMMYYYY[0]; 
	var nextYYYY = nextMMYYYY[1]; 
 
	this.wwrite("<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0'><TR><TD ALIGN=center>"); 
 
	this.wwrite("<FONT COLOR=#838357 FACE='" + fontface + "' SIZE=2>" + 
			"[<A HREF=\"" + 
			"javascript:" + this.WHO + "Build(" + 
			"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)-1) + "', '" + this.gFormat + "', '" + this.gType + "'" + 
			");\"><<<\/A>]</FONT></TD><TD ALIGN=center>"); 
	this.wwrite("<FONT COLOR=#838357 FACE='" + fontface + "' SIZE=2>" + 
			"[<A HREF=\"" + 
			"javascript:" + this.WHO + "Build(" + 
			"'" + this.gReturnItem + "', '" + prevMM + "', '" + prevYYYY + "', '" + this.gFormat + "', '" + this.gType + "'" + 
			");\"><<\/A>]</FONT></TD><TD ALIGN=center>"); 
 <!--	this.wwrite("<FONT COLOR=#838357 FACE='" + fontface + "' SIZE=2>" + --> 
	<!--		"[<A HREF=\"javascript:window.print();\">" +--> 
	<!--		"Print</A>]</FONT></TD><TD ALIGN=center>");--> 
	this.wwrite("<FONT COLOR=#838357 FACE='" + fontface + "' SIZE=2>" + 
			"[<A HREF=\"" + 
			"javascript:" + this.WHO + "Build(" + 
			"'" + this.gReturnItem + "', '" + gNow.getMonth() + "', '" + gNow.getFullYear() + "', '" + this.gFormat + "', '" + this.gType + "'" + 
			");\">Today<\/A>]</FONT></TD><TD ALIGN=center>"); 
	this.wwrite("<FONT COLOR=#838357 FACE='" + fontface + "' SIZE=2>" + 
			"[<A HREF=\"" + 
			"javascript:" + this.WHO + "Build(" + 
			"'" + this.gReturnItem + "', '" + nextMM + "', '" + nextYYYY + "', '" + this.gFormat + "', '" + this.gType + "'" + 
			");\">><\/A>]</FONT></TD><TD ALIGN=center>"); 
	this.wwrite("<FONT COLOR=#838357 FACE='" + fontface + "' SIZE=2>" + 
			"[<A HREF=\"" + 
			"javascript:" + this.WHO + "Build(" + 
			"'" + this.gReturnItem + "', '" + this.gMonth + "', '" + (parseInt(this.gYear)+1) + "', '" + this.gFormat + "', '" + this.gType + "'" + 
			");\">>><\/A>]</FONT></TD></TR></TABLE><BR>"); 
 
	<!-- Get the complete calendar code for the month..--> 
	vCode = this.getMonthlyCalendarCode(); 
	this.wwrite(vCode); 
 
	this.wwrite("</TD></TR></TABLE></TD></TR></TABLE>"); 
 
	this.wwrite("</font></body></html>"); 
 
	if (this.gType == "POPUP") 
		this.gWinCal.document.close(); 
 
	if (this.gType == "INLINE") 
		Calendar.Lwwrite(this.codeINLINE, this.INLINE); 
} 
 
 
function Calendar_Close(pType, pINLINE) { 
	if (pType == "POPUP") 
		ggWinCal.close(); 
	if (pType == "INLINE") 
		Calendar.Lwwrite(Calendar.gInitText, pINLINE) 
} 
 
Calendar.prototype.showY = function() { 
	var vCode = ""; 
	var i; 
	var vr, vc, vx, vy;             <!-- Row, Column, X-coord, Y-coord--> 
	var vxf = 285;                  <!-- X-Factor--> 
	var vyf = 200;                  <!-- Y-Factor--> 
	var vxm = 10;                   <!-- X-margin--> 
	var vym;                                <!-- Y-margin--> 
	if (isIE)       vym = 75; 
	else if (isNav) vym = 25; 
 
	this.gWinCal.document.open(); 
 
	this.wwrite("<html>"); 
	this.wwrite("<head><title>Calendar</title>"); 
	this.wwrite("<style type='text/css'>\n<!--"); 
	for (i=0; i<12; i++) { 
		vc = i % 3; 
		if (i>=0 && i<= 2)      vr = 0; 
		if (i>=3 && i<= 5)      vr = 1; 
		if (i>=6 && i<= 8)      vr = 2; 
		if (i>=9 && i<= 11)     vr = 3; 
 
		vx = parseInt(vxf * vc) + vxm; 
		vy = parseInt(vyf * vr) + vym; 
 
		this.wwrite(".lclass" + i + " {position:absolute;top:" + vy + ";left:" + vx + ";}"); 
	} 
	this.wwrite("-->\n</style>"); 
 
	if (this.gType == "POPUP") 
		this.wwrite("<script language='javascript'>" +  
			"function onClickFn(pday) {\n" + 
			this.onclickfn() + "}\n<\/script>"); 
	else 
		orig_onClickFnCode = this.onclickfn(); 
 
	this.wwrite("</head>"); 
 
	this.wwrite("<FONT FACE='" + fontface + "' SIZE=2><B>"); 
 
	this.wwrite("Year : " + this.gYear); 
	this.wwrite("</B><BR>"); 
 
	<!-- Show navigation buttons--> 
	var prevYYYY = parseInt(this.gYear) - 1; 
	var nextYYYY = parseInt(this.gYear) + 1; 
 
	this.wwrite("<TABLE WIDTH='100%' BORDER=1 CELLSPACING=0 CELLPADDING=0 BGCOLOR='#e0e0e0'><TR><TD ALIGN=center>"); 
	this.wwrite("[<A HREF=\"" + 
			"javascript:window.opener.Build(" + 
			"'" + this.gReturnItem + "', null, '" + prevYYYY + "', '" + this.gFormat + "'" + 
			");" + 
			"\" alt='Prev Year'><<<\/A>]</TD><TD ALIGN=center>"); 
	this.wwrite("[<A HREF=\"javascript:window.print();\">Print</A>]</TD><TD ALIGN=center>"); 
	this.wwrite("[<A HREF=\"" + 
			"javascript:window.opener.Build(" +  
			"'" + this.gReturnItem + "', null, '" + nextYYYY + "', '" + this.gFormat + "'" + 
			");" + 
			"\">>><\/A>]</TD></TR></TABLE><BR>"); 
 
	<!-- Get the complete calendar code for each month..--> 
	var j; 
	for (i=11; i>=0; i--) { 
		if (isIE) 
				this.wwrite("<DIV ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">"); 
		else if (isNav) 
				this.wwrite("<LAYER ID=\"layer" + i + "\" CLASS=\"lclass" + i + "\">"); 
 
		this.gMonth = i; 
		this.gMonthName = Calendar.get_month(this.gMonth); 
		vCode = this.getMonthlyCalendarCode(); 
		this.wwrite(this.gMonthName + "/" + this.gYear + "<BR>"); 
		this.wwrite(vCode); 
 
		if (isIE) 
				this.wwrite("</DIV>"); 
		else if (isNav) 
				this.wwrite("</LAYER>"); 
	} 
 
	this.wwrite("</font><BR></body></html>"); 
	this.gWinCal.document.close(); 
} 
 
 
Calendar.prototype.cal_header = function() { 
	var vCode = ""; 
 
	vCode = vCode + "<TR>"; 
	vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Sun</B></FONT></TD>"; 
	vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Mon</B></FONT></TD>"; 
	vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Tue</B></FONT></TD>"; 
	vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Wed</B></FONT></TD>"; 
	vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Thu</B></FONT></TD>"; 
	vCode = vCode + "<TD WIDTH='14%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Fri</B></FONT></TD>"; 
	vCode = vCode + "<TD WIDTH='16%'><FONT SIZE='2' FACE='" + fontface + "' COLOR='" + this.gHeaderColor + "'><B>Sat</B></FONT></TD>"; 
	vCode = vCode + "</TR>"; 
 
	return vCode; 
} 
 
Calendar.prototype.cal_data = function() { 
	var vDate = new Date(); 
	vDate.setDate(1); 
	vDate.setMonth(this.gMonth); 
	vDate.setFullYear(this.gYear); 
 
	var vFirstDay = vDate.getDay(); 
	var vDay=1; 
	var vLastDay=Calendar.get_daysofmonth(this.gMonth, this.gYear); 
	var vOnLastDay=0; 
	var vCode = ""; 
 
	var linkText = ""; 
	var linkCloseText = ""; 
 
 
 <!--	Get day for the 1st of the requested month/year..--> 
	<!--Place as many blank cells before the 1st day of the month as necessary.--> 
 
	vCode = vCode + "<TR>"; 
	for (i=0; i<vFirstDay; i++) { 
			vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(i) + "><FONT SIZE='2' FACE='" + fontface + "'> </FONT></TD>"; 
	} 
 
	<!-- If closeable...--> 
	if (this.closeable) { 
		closecodeP = ((this.gType=="POPUP") ? "window.close();" : ""); 
		closecodeI = "Calendar.Close(\"" + this.gType + "\", \"" + this.INLINE + "\"); "; 
	} else { 
		closecodeP = ""; 
		closecodeI = "void(0);' "; 
	} 
 
	var whois = this.WHO +  
				((this.gType == "POPUP") ? "document." : "window.document.") +  
				this.gReturnItem + ".value"; 
 
	<!-- Write rest of the 1st week--> 
	for (j=vFirstDay; j<7; j++) { 
		vDate.setDate(vDay); 
		if ((this.gAllowWeekends == "No" && Calendar.isWeekend(j)) ||  
			(vDate < v_SelectAfter)) { 
					linkText = ""; 
					linkCloseText = ""; 
		} else { 
			linkText = "<A HREF='javascript:" + closecodeI + "' " + 
				"onClick=\"onClickFn('" + 
				 
				((this.returnData == "Date") ?  
				this.format_data(vDay) :  
				this.format_dow(vDay)) + 
				 
				"');" +  
				closecodeP + 
				"\">"; 
			linkCloseText = "<\/A>"; 
		} 
 
		vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) +  
				"><FONT SIZE='2' FACE='" + fontface + "'>" +  
				linkText + 
				this.format_day(vDay) +  
				linkCloseText +  
				"</FONT></TD>"; 
		vDay = vDay + 1; 
	} 
	vCode = vCode + "</TR>"; 
 
	<!-- Write the rest of the weeks--> 
	for (k=2; k<7; k++) { 
		vCode = vCode + "<TR>"; 
 
		for (j=0; j<7; j++) { 
			vDate.setDate(vDay); 
			if ((this.gAllowWeekends == "No" && Calendar.isWeekend(j)) || 
				(vDate < v_SelectAfter)) { 
					linkText = ""; 
					linkCloseText = ""; 
			} else { 
				linkText = "<A HREF='javascript:" + closecodeI + "' " + 
					"onClick=\"onClickFn('" +  
 
					((this.returnData == "Date") ?  
					this.format_data(vDay) :  
					this.format_dow(vDay)) +  
				 
					"');" +  
					closecodeP + 
					"\">"; 
				linkCloseText = "<\/A>"; 
			} 
 
			vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j) +  
					"><FONT SIZE='2' FACE='" + fontface + "'>" +  
					linkText +  
					this.format_day(vDay) + 
					linkCloseText + 
					"</FONT></TD>"; 
			vDay = vDay + 1; 
 
			if (vDay > vLastDay) { 
				vOnLastDay = 1; 
				break; 
			} 
		} 
 
		if (j == 6) 
			vCode = vCode + "</TR>"; 
		if (vOnLastDay == 1) 
			break; 
	} 
 
	<!-- Fill up the rest of last week with proper blanks, so that we get proper square blocks--> 
	for (m=1; m<(7-j); m++) { 
		if (this.gYearly) 
			vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j+m) + 
				"><FONT SIZE='2' FACE='" + fontface + "' COLOR='gray'> </FONT></TD>"; 
		else 
			vCode = vCode + "<TD WIDTH='14%'" + this.write_weekend_string(j+m) +  
				"><FONT SIZE='2' FACE='" + fontface + "' COLOR='gray'>" + m + "</FONT></TD>"; 
	} 
 
	return vCode; 
} 
 
Calendar.prototype.format_day = function(vday) { 
	var highDate; 
	if (this.gCurrentDate != "NONE") 
		highDate = this.gCurrentDate; 
	else 
		highDate = gNow; 
 
	var vNowDay = highDate.getDate(); 
	var vNowMonth = highDate.getMonth(); 
	var vNowYear = highDate.getFullYear(); 
 
	if (vday == vNowDay && this.gMonth == vNowMonth && this.gYear == vNowYear) 
			return ("<FONT COLOR=\"RED\"><B>" + vday + "</B></FONT>"); 
	else 
			return (vday); 
} 
 
Calendar.prototype.write_weekend_string = function(vday) { 
	var i; 
 
	<!-- Return special formatting for the weekend day.--> 
	if (Calendar.isWeekend(vday)) 

		return (" BGCOLOR=\"" + weekendColor + "\""); 
 
	return ""; 
} 
 
Calendar.prototype.format_data = function(p_day) { 
	var vData; 
	var vMonth = 1 + this.gMonth; 
	vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth; 
	var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase(); 
	var vFMon = Calendar.get_month(this.gMonth).toUpperCase(); 
	var vY4 = new String(this.gYear); 
	var vY2 = new String(this.gYear.substr(2,2)); 
	var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day; 
	var vDOW = Calendar.get_dow(new Date(vDD + "/" + vMonth + "/" + vY4).getDay()); 
 
	switch (this.gFormat) { 
			case "MM\/DD\/YYYY" : 
				vData = vMonth + "\/" + vDD + "\/" + vY4; 
				break; 
			case "MM\/DD\/YY" : 
				vData = vMonth + "\/" + vDD + "\/" + vY2; 
				break; 
			case "MM-DD-YYYY" : 
				vData = vMonth + "-" + vDD + "-" + vY4; 
				break; 
			case "MM-DD-YY" : 
				vData = vMonth + "-" + vDD + "-" + vY2; 
				break; 
 
			case "DD\/MON\/YYYY" : 
				vData = vDD + "\/" + vMon + "\/" + vY4; 
				break; 
			case "DD\/MON\/YY" : 
				vData = vDD + "\/" + vMon + "\/" + vY2; 
				break; 
			case "DD-MON-YYYY" : 
				vData = vDD + "-" + vMon + "-" + vY4; 
				break; 
			case "DD-MON-YY" : 
				vData = vDD + "-" + vMon + "-" + vY2; 
				break; 
 
			case "DD\/MONTH\/YYYY" : 
				vData = vDD + "\/" + vFMon + "\/" + vY4; 
				break; 
			case "DD\/MONTH\/YY" : 
				vData = vDD + "\/" + vFMon + "\/" + vY2; 
				break; 
			case "DD-MONTH-YYYY" : 
				vData = vDD + "-" + vFMon + "-" + vY4; 
				break; 
			case "DD-MONTH-YY" : 
				vData = vDD + "-" + vFMon + "-" + vY2; 
				break; 
			case "MONTH DD, YYYY" : 
				vData = vFMon + " " + vDD + ", " + vY4; 
				break; 
			case "DD\/MM\/YYYY" : 
				vData = vDD + "\/" + vMonth + "\/" + vY4; 
				break; 
			case "DD\/MM\/YY" : 
				vData = vDD + "\/" + vMonth + "\/" + vY2; 
				break; 
			case "DD-MM-YYYY" : 
				vData = vDD + "-" + vMonth + "-" + vY4; 
				break; 
			case "DD-MM-YY" : 
				vData = vDD + "-" + vMonth + "-" + vY2; 
				break; 
			case "DOW, DD-MON-YY" : 
				vData = vDOW + ", " + vDD + "-" + vMon + "-" + vY2; 
				break; 
			default : 
				vData =  vDD+ "\/" + vMonth + "\/" + vY4; 
	} 
 
	return vData; 
} 
 
Calendar.prototype.format_dow = function(p_day) { 
	var vData; 
	var vMonth = 1 + this.gMonth; 
 
	vMonth = (vMonth.toString().length < 2) ? "0" + vMonth : vMonth; 
	var vMon = Calendar.get_month(this.gMonth).substr(0,3).toUpperCase(); 
	var vFMon = Calendar.get_month(this.gMonth).toUpperCase(); 
	var vY4 = new String(this.gYear); 
	var vDD = (p_day.toString().length < 2) ? "0" + p_day : p_day; 
 
	var vDate = new Date(vDD + "\/" + vMonth + "\/" + vY4); 
	vData = Calendar.get_dow(vDate.getDay()); 
	 
	return vData; 
} 
 
 
<!--Calendar Writing Functions--> 
 
Calendar.prototype.wwrite = function(wtext) { 
	if (this.gType == "POPUP") 
		this.gWinCal.document.writeln(wtext); 
	else { 
		<!-- Keep adding to the codeINLINE variable.--> 

⌨️ 快捷键说明

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