Changeset 16622 for schedule/Module/calendar.php
- Timestamp:
- 06/03/13 16:18:30 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16615 r16622 14 14 <!--<script src="js/chart.js"></script> --> 15 15 <script src="Module/src/js/lang/en.js"></script> 16 <!-- <script src="js/xmlrequest.js"></script> 17 --> 16 <script src="js/xmlrequest.js"></script> 18 17 <style type="text/css"> 19 18 .highlight { color: #0f0 !important; font-weight: bold; } … … 99 98 var year; 100 99 var month; 101 function testData()102 {103 //calls the xml request in a loop based on the current sources104 var source = ['Mrk 421','Mrk 501'];105 for (i = 0; i<source.length; i++)106 {107 alert (source[i]);108 testXMLData(i, source);109 //$('#data').append('1st'+source);110 }111 }112 113 function testXMLData(index, source)114 {115 alert("test XML Data");116 var testXML;117 //$('#data').append(' xmlData pass'+source+" "+index);118 testXML = new XMLHttpRequest();119 //NOTE: previous errors on the request was caused by appending "http://www.fact-project.org"120 testXML.open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true);121 dataSource = new Array();122 testXML.onload=function()123 {124 if (testXML.status==200)125 {126 alert("request ok");127 line=testXML.responseText.split('\n');128 dataSource.push(line);129 if (dataSource.length == source.length)130 {131 alert("new datasource");132 displayXMLData(dataSource, source); //this will be called when the last data from the list is read133 //$('#data').append('successfully load'+source +""+dataSource);134 }135 }136 else137 alert("status is " + testXML.status);138 139 };140 testXML.send();141 }142 143 function displayXMLData(dataSource, source)144 {145 //This function splits the lines of data per data source146 var dataGraph = new Array(source.length);147 for (i=0; i<source.length; i++)148 {149 dataGraph[i] = new Array(); //dataGraph contains the individual points for each source i150 for(row=0;row<dataSource[i].length;row++)151 {152 rows=line[row].split(',');153 dataGraph[i].push(rows[4]);154 }155 $('#data').append(i + ": " + source[i] + ' GRAPH DATA ' + dataGraph[i]);156 }157 }158 159 100 CAL.addEventListener("onSelect", function(){ 160 101 day =this.selection.print("%d").join("\n"); 161 102 month =this.selection.print("%m").join("\n"); 162 103 year =this.selection.print("%Y").join("\n"); 163 //document.getElementById('data').innerHTML="Calendar selected! ";164 //displayXMLData();165 alert("test data");166 104 testData(); 167 105
Note:
See TracChangeset
for help on using the changeset viewer.