Changeset 16591 for schedule


Ignore:
Timestamp:
06/02/13 15:54:37 (11 years ago)
Author:
tanio
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedule/Module/calendar.php

    r16590 r16591  
    9797                <script type="text/javascript">
    9898                               
    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                                         {
    105                                                 testXMLData(i, source);
    106                                         }
    107                                 }
    108 
    109                                 function testXMLData(index, source)
    110                                 {
    111                                         var testXML;
    112                                         testXML = new XMLHttpRequest();
    113                                         //NOTE: previous errors on the request was caused by appending "http://www.fact-project.org"
    114                                         testXML.open("GET","/smartfact/index.php?source="+escape(source[index])+"&time="+year+"-"+month+"-"+day,true);
    115                                         dataSource = new Array();
    116                                         testXML.onload=function() {
    117                                                 if (testXML.status==200)
    118                                                 {
    119                                                         line=testXML.responseText.split('\n');
    120                                                         dataSource.push(line);
    121                                                         if (dataSource.length == source.length)
    122                                                                 {
    123                                                                 displayXMLData(dataSource, source); //this will be called when the last data from the list is read
    124                                                                 }
    125                                                 }
    126                                         testXML.send();
    127                                 }
    128 
    129                                 function displayXMLData(dataSource, source)
    130                                 {
    131                                         //This function splits the lines of data per data source
    132                                         var dataGraph = new Array(source.length);
    133                                         for (i=0; i<source.length; i++)
    134                                         {
    135                                                 dataGraph[i] = new Array(); //dataGraph contains the individual points for each source i
    136                                                 for(row=0;row<dataSource[i].length;row++)
    137                                                 {
    138                                                         rows=line[row].split(',');
    139                                                         dataGraph[i].push(rows[4]);
    140                                                         $('#data').append(i + ' GRAPH DATA ' + dataGraph[i]);
    141                                                 }
    142                                         }
    143                                 }
    14499
    145100                 CAL.addEventListener("onSelect", function(){
     
    148103                                                        year =this.selection.print("%Y").join("\n");   
    149104                                                        //document.getElementById('data').innerHTML="Calendar selected! ";
    150                                                          testData();                   
     105                                                         //testData();                   
    151106                               
    152107                });
Note: See TracChangeset for help on using the changeset viewer.