//---------------------------------------------------------------- // 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){ continue; } if (!dict.item(keys[i])) continue; &n