带日期标注的日历控件
带日期标注的日历控件,带日期标注的日历控件
版 本:1.0
类 型:HTML Component
运行需求:IE 5(推荐IE5.5或更高版本)、MSXML、ASP或ASP.NET(后台)
费 用:免费
支 持:不提供支持
源 代 码:XML Scriptlet
------------------------------------------------------------------------
<public:attach event="oncontentready" onevent="init()"/
<public:property name="value" get="getValue" put="setValue"/
<public:property name="stringValue" get="getStringValue" /
<public:property name="mark" get="getCurrentMark" put="setCurrentMark" /
<public:property name="markList" get="getMarkList" /
<public:method name="refresh" /
<public:method name="addMark" /
<public:method name="removeMark" /
<public:method name="removeAllMark" /
<public:method name="loadMark" /
<public:method name="saveMark" /
<public:event name="onvaluechange" id="vlcg" /
<script language="JScript"
//----------------------------------------------------------------
// HTML Component : Calendar with date mark(带时间标注的日历控件)
//
// Version : 1.0
//
// Request : Microsoft IE 5 or up
//
// Author : JoJo
//
// Last Realse : 5/9/2001
//
// Copyright : Think Space Soft Tec
//
// Contact : thinkspace@163.net
//----------------------------------------------------------------
var date = new Date();
var activeDate = new Date();
var marklist = new ActiveXObject("Scripting.Dictionary");
function WriteXMLToDictionary(xmldoc,dict,rewrite){
var xnodelist = xmldoc.documentElement.selectNodes("Mark");
if (rewrite) dict.RemoveAll();
for (var i=0;i<xnodelist.length;i++){
var xnode = xnodelist.item(i);
var xdate = xnode.selectSingleNode("MarkDate");
var xnote = xnode.selectSingleNode("Note");
//alert(xdate.text + "," + xnote.text);
if (xdate.text && xnote.text){
dict.item(xdate.text) = xnote.text;
}
}
}
function postxml(xmldoc,url){
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.Open("POST",url,false);
xmlhttp.Send(xmldoc);
var xdoc = new ActiveXObject("Microsoft.XMLDom");
xdoc.async = false;
xdoc.loadXML(xmlhttp.responseText);
return !!xdoc.documentElement.text;
}
function saveMark(url){
var xmldoc = new ActiveXObject("Microsoft.XMLDom");
WriteDictionaryToXML(marklist,xmldoc);
if(postxml(xmldoc,url)){
refresh();
sendEvent();
return true;
}
return false;
}
function WriteDictionaryToXML(dict,xmldoc){
xmldoc.loadXML("<MarkList/");
var keys = (new VBArray(dict.Keys())).toArray();
for (var i=0;i<keys.length;i++){
try{
var d = new Date(keys[i]);
}catch(e){