Changeset 16580 for schedule/Module/calendar.php
- Timestamp:
- 06/02/13 15:48:30 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
schedule/Module/calendar.php
r16578 r16580 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 <style type="text/css"> 16 <!-- <script src="js/xmlrequest.js"></script> 17 --> 18 <style type="text/css"> 18 19 .highlight { color: #0f0 !important; font-weight: bold; } 19 20 .highlight2 { color: #0f0 !important; font-weight: bold; } … … 96 97 <script type="text/javascript">//<![CDATA[ 97 98 99 function testData() 100 { 101 //calls the xml request in a loop based on the current sources 102 var source = ['Mrk 421','Mrk 501']; 103 for (i = 0; i<source.length; i++) { 104 testXMLData(i, source); 105 } 106 } 107 108 function testXMLData(index, source) 109 { 110 var testXML; 111 testXML = new XMLHttpRequest(); 112 //NOTE: previous errors on the request was caused by appending "http://www.fact-project.org" 113 testXML.open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true); 114 dataSource = new Array(); 115 testXML.onload=function() { 116 if (testXML.status==200) 117 { 118 line=testXML.responseText.split('\n'); 119 dataSource.push(line); 120 if (dataSource.length == source.length) 121 displayXMLData(dataSource, source); //this will be called when the last data from the list is read 122 } 123 testXML.send(); 124 } 125 126 function displayXMLData(dataSource, source) 127 { 128 //This function splits the lines of data per data source 129 var dataGraph = new Array(source.length); 130 for (i=0; i<source.length; i++) { 131 dataGraph[i] = new Array(); //dataGraph contains the individual points for each source i 132 for(row=0;row<dataSource[i].length;row++) 133 { 134 rows=line[row].split(','); 135 dataGraph[i].push(rows[4]); 136 $('#data').append(i + ' GRAPH DATA ' + dataGraph[i]); 137 } 138 } 139 } 140 98 141 CAL.addEventListener("onSelect", function(){ 99 142 day =this.selection.print("%d").join("\n");
Note:
See TracChangeset
for help on using the changeset viewer.