summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/javascript/traffic_graph.js
blob: 8ee192a28b6dedf444e61e5bce96f9f106e9f21f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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;
}
OpenPOWER on IntegriCloud