summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/javascript/traffic_graph.js
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/widgets/javascript/traffic_graph.js')
-rw-r--r--usr/local/www/widgets/javascript/traffic_graph.js60
1 files changed, 60 insertions, 0 deletions
diff --git a/usr/local/www/widgets/javascript/traffic_graph.js b/usr/local/www/widgets/javascript/traffic_graph.js
new file mode 100644
index 0000000..8ee192a
--- /dev/null
+++ b/usr/local/www/widgets/javascript/traffic_graph.js
@@ -0,0 +1,60 @@
+function trafficshowDiv(incDiv,swapButtons){
+ //appear element
+ selectedDiv = incDiv + "graphdiv";
+ Effect.BlindDown(selectedDiv, {duration:1});
+ showSave();
+ d = document;
+ if (swapButtons){
+ selectIntLink = selectedDiv + "-min";
+ textlink = d.getElementById(selectIntLink);
+ textlink.style.display = "inline";
+
+ selectIntLink = selectedDiv + "-open";
+ textlink = d.getElementById(selectIntLink);
+ textlink.style.display = "none";
+ }
+ selectIntLink = incDiv + "_graph-config";
+ textlink = d.getElementById(selectIntLink);
+ textlink.value = "show";
+ updateGraphDisplays();
+}
+
+function trafficminimizeDiv(incDiv,swapButtons){
+ //fade element
+ selectedDiv = incDiv + "graphdiv";
+ Effect.BlindUp(selectedDiv, {duration:1});
+ showSave();
+ d = document;
+ if (swapButtons){
+ selectIntLink = selectedDiv + "-open";
+ textlink = d.getElementById(selectIntLink);
+ textlink.style.display = "inline";
+
+ selectIntLink = selectedDiv + "-min";
+ textlink = d.getElementById(selectIntLink);
+ textlink.style.display = "none";
+ }
+ selectIntLink = incDiv + "_graph-config";
+ textlink = d.getElementById(selectIntLink);
+ textlink.value = "hide";
+ updateGraphDisplays();
+}
+
+function updateGraphDisplays(){
+ var graphs = document.getElementsByClassName('graphsettings');
+ var graphsdisplayed = "";
+ var firstprint = false;
+ d = document;
+ for (i=0; i<graphs.length; i++){
+ if (firstprint)
+ graphsdisplayed += ",";
+ var graph = graphs[i].id;
+ graphsdisplayed += graph + ":";
+ textlink = d.getElementById(graph).value;
+ graphsdisplayed += textlink;
+ firstprint = true;
+ }
+ selectIntLink = "traffic_graphs-config";
+ textlink = d.getElementById(selectIntLink);
+ textlink.value = graphsdisplayed;
+} \ No newline at end of file
OpenPOWER on IntegriCloud