/[pdpsoft]/trunk/nl.nikhef.ndpf.tools/network-stats-mashup/index.php
ViewVC logotype

Diff of /trunk/nl.nikhef.ndpf.tools/network-stats-mashup/index.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1656 by aramv, Fri Apr 23 15:18:37 2010 UTC revision 1657 by aramv, Thu Apr 29 16:00:54 2010 UTC
# Line 60  constituent_images["<?=$constituent->tru Line 60  constituent_images["<?=$constituent->tru
60    
61    /* pre-loads all the graphs into an array that we can use to splice them back into the DOM */    /* pre-loads all the graphs into an array that we can use to splice them back into the DOM */
62    function pre_cache_images(){    function pre_cache_images(){
63        var id;
64      for(id in images){      for(id in images){
65        images_pre_cache[id] = new Image();        images_pre_cache[id] = new Image();
66        images_pre_cache[id].src = images[id];        images_pre_cache[id].src = images[id];
67      }      }
68    
69      for(id in constituent_images){      for(id in constituent_images){
70        daily_img = constituent_images[id][0]        daily_img = constituent_images[id][0];
71        weekly_img = constituent_images[id][1]        weekly_img = constituent_images[id][1];
72        images_pre_cache[weekly_img] = new Image();        images_pre_cache[weekly_img] = new Image();
73        images_pre_cache[weekly_img].src = weekly_img        images_pre_cache[weekly_img].src = daily_img;
74        images_pre_cache[daily_img] = new Image();        images_pre_cache[daily_img] = new Image();
75        images_pre_cache[daily_img].src = weekly_img        images_pre_cache[daily_img].src = weekly_img;
76      }      }
77    }    }
78    
79    /* callback for onmouseover event of areas */    /* callback for onmouseover event of areas */
80    function show_graph(url){    function show_graph(url){
81      snippet = document.getElementById('graph_div');      snippet = document.getElementById('info_div');
82      snippet.innerHTML = snippets_by_url[url];      snippet.innerHTML = snippets_by_url[url];
83    }    }
84    
# Line 90  constituent_images["<?=$constituent->tru Line 91  constituent_images["<?=$constituent->tru
91      wga.href = url;      wga.href = url;
92      dgi.src = constituent_images[url][0];      dgi.src = constituent_images[url][0];
93      wgi.src = constituent_images[url][1];      wgi.src = constituent_images[url][1];
94        <?php
95          if(is_mobile()){
96        ?>
97          switch_clicks('a');
98        <?php
99        }
100        ?>
101      }
102    
103    
104      function switch_clicks(type){
105        var areas = document.getElementsByTagName(type);
106        for(idx in areas){
107          areas[idx].onclick = new Function('return false;');
108          areas[idx].ondblclick = new Function('window.location = "' + areas[idx].href+'";');
109        }
110    }    }
111    
112    // javascript end -->    // javascript end -->
# Line 114  constituent_images["<?=$constituent->tru Line 131  constituent_images["<?=$constituent->tru
131        ?>        ?>
132      </p>      </p>
133    </div>    </div>
134    <div class="info_div">    <div id="info_div">
135      <noscript>      <noscript>
136        <p>        <p>
137          Please enable javascript to see graphs when hovering over trunks.          Please enable javascript to see graphs when hovering over trunks.
138        </p>        </p>
139      </noscript>      </noscript>
     <div id="graph_div">  
     </div>  
140    </div>    </div>
141    <div class="clear">&nbsp;</div>    <div class="clear">&nbsp;</div>
142    <div class="links_div">    <div class="links_div">
# Line 145  pre_cache_images(); Line 160  pre_cache_images();
160  ?>  ?>
161    var loader_chain = window.onload;    var loader_chain = window.onload;
162    window.onload = function(){    window.onload = function(){
163      var areas = document.getElementsByTagName('area');      switch_clicks('area');
     for(idx in areas){  
       areas[idx].onclick = new Function('return false;');  
       areas[idx].ondblclick = new Function('window.location = "' + areas[idx].href+'";');  
     }  
164      loader_chain();      loader_chain();
165    }    }
166  <?php  <?php

Legend:
Removed from v.1656  
changed lines
  Added in v.1657

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28