summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/javascript/traffic_graph.js
blob: 4970f25832afa35b6d1362caf55c658b32a29795 (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
61
62
63
64
function trafficshowDiv(incDiv,swapButtons){
		//appear element
	selectedDiv = incDiv + "graphdiv";
	jQuery('#' + selectedDiv).effect('blind',{mode:'show'},1000);      
	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";
	jQuery('#' + selectedDiv).effect('blind',{mode:'hide'},1000);
	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 = "refreshInterval";
	graphsdisplayed += ",refreshInterval=";
	graphsdisplayed += d.getElementById(selectIntLink).value;
	
	selectIntLink = "traffic_graphs-config";
	textlink = d.getElementById(selectIntLink);
	textlink.value = graphsdisplayed;
}
OpenPOWER on IntegriCloud