Changeset 16573 for schedule/Module/calendar.php
- Timestamp:
- 06/02/13 12:45:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16559 r16573 12 12 <script src="Module/src/js/jscal2.js"></script> 13 13 <script src="Module/src/js/unicode-letter.js"></script> 14 <script src=" Module/Graph.js"></script>14 <script src="js/Graph.js"></script> 15 15 <script src="Module/src/js/lang/en.js"></script> 16 <script src="js/xmlrequest.js"></script> 16 17 <style type="text/css"> 17 18 .highlight { color: #0f0 !important; font-weight: bold; } … … 94 95 </script> 95 96 <script type="text/javascript">//<![CDATA[ 96 var index = 0;97 var xmlhttp = new Array();98 var testXML;99 var source = ['Mrk 421','Mrk 501'];100 var sourceData = [[]];101 var obj;102 var day;103 var year;104 var month;105 function getXML()106 {107 xmlhttp.push(new XMLHttpRequest());108 index = xmlhttp.length - 1;109 }110 111 function getXMLData()112 {113 getXML();114 xmlhttp[index].onload=xmlStateChange();115 97 116 xmlhttp[index].open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true);117 xmlhttp[index].send();118 }119 120 function xmlStateChange()121 {122 alert(index+" "+xmlhttp[index].readyState+" "+xmlhttp[index].status + " " + xmlhttp[index].statusText);123 if (xmlhttp[index].readyState==4 && xmlhttp[index].status==200)124 {125 //sourceData[index]= new Array(); //--> remove this if you use sourceData[[]]126 line=xmlhttp[index].responseText.split('\n');127 for(row=0;row<line.length;row++)128 {129 rows=line[row].split(',');130 sourceData[index].push(rows[4]);131 }132 }133 }134 135 136 function displayData() //--> you can use the content of this function in the event listener137 {138 for (i=0; i<source.length; i++)139 {140 getXMLData();141 //display source data here sourceData[i]142 document.getElementById('data').innerHTML=sourceData[i];143 }144 }145 146 function testData()147 {148 var url = "https://www.fact-project.org/smartfact/index.php?source=Mrk%20421&time=2012-12-10"149 testXML = new XMLHttpRequest();150 testXML.open("GET",url,true);151 alert ("test data");152 testXML.onload=function() {153 alert (" status: " + testXML.readyState + " " + testXML.status);154 if (testXML.status==200)155 {156 alert ("request ok");157 }158 else159 {160 alert("status: " + testXML.statusText + " " + testXML.status);161 }162 };163 164 testXML.send();165 }166 98 CAL.addEventListener("onSelect", function(){ 167 99 day =this.selection.print("%d").join("\n"); … … 169 101 year =this.selection.print("%Y").join("\n"); 170 102 //document.getElementById('data').innerHTML="Calendar selected! "; 171 172 alert ("event here"); 173 //testData(); 174 for (i=0; i<source.length; i++) 175 { 176 getXMLData(); 177 document.getElementById('data').innerHTML=sourceData[i]; 178 } 103 testData(); 104 179 105 }); 180 106
Note:
See TracChangeset
for help on using the changeset viewer.