diff options
Diffstat (limited to 'js')
-rw-r--r-- | js/CGP-async.js | 21 | ||||
-rw-r--r-- | js/CGP-sync.js | 21 | ||||
-rw-r--r-- | js/CGP.js | 22 |
3 files changed, 42 insertions, 22 deletions
diff --git a/js/CGP-async.js b/js/CGP-async.js new file mode 100644 index 0000000..4976509 --- /dev/null +++ b/js/CGP-async.js | |||
@@ -0,0 +1,21 @@ | |||
1 | function draw(id) { | ||
2 | var rrdgraph = prepare_draw(id); | ||
3 | |||
4 | try { | ||
5 | rrdgraph.graph_paint_async(); | ||
6 | } catch (e) { | ||
7 | alert(e+"\n"+e.stack); | ||
8 | } | ||
9 | } | ||
10 | |||
11 | function drawAll() | ||
12 | { | ||
13 | var list=[]; | ||
14 | var a=document.getElementsByClassName('rrd'); | ||
15 | for (var i=0,l=a.length;i<l;i++) | ||
16 | { | ||
17 | draw(a[i].getAttribute('id')) | ||
18 | } | ||
19 | } | ||
20 | |||
21 | window.onload = drawAll() | ||
diff --git a/js/CGP-sync.js b/js/CGP-sync.js new file mode 100644 index 0000000..01f6b19 --- /dev/null +++ b/js/CGP-sync.js | |||
@@ -0,0 +1,21 @@ | |||
1 | function draw(id) { | ||
2 | var rrdgraph = prepare_draw(id); | ||
3 | |||
4 | try { | ||
5 | rrdgraph.graph_paint(); | ||
6 | } catch (e) { | ||
7 | alert(e+"\n"+e.stack); | ||
8 | } | ||
9 | } | ||
10 | |||
11 | function drawAll() | ||
12 | { | ||
13 | var list=[]; | ||
14 | var a=document.getElementsByClassName('rrd'); | ||
15 | for (var i=0,l=a.length;i<l;i++) | ||
16 | { | ||
17 | draw(a[i].getAttribute('id')) | ||
18 | } | ||
19 | } | ||
20 | |||
21 | window.onload = drawAll() | ||
@@ -106,25 +106,3 @@ function prepare_draw(id) { | |||
106 | 106 | ||
107 | return rrdgraph; | 107 | return rrdgraph; |
108 | } | 108 | } |
109 | |||
110 | function draw(id) { | ||
111 | var rrdgraph = prepare_draw(id); | ||
112 | |||
113 | try { | ||
114 | rrdgraph.graph_paint(); | ||
115 | } catch (e) { | ||
116 | alert(e+"\n"+e.stack); | ||
117 | } | ||
118 | } | ||
119 | |||
120 | function drawAll() | ||
121 | { | ||
122 | var list=[]; | ||
123 | var a=document.getElementsByClassName('rrd'); | ||
124 | for (var i=0,l=a.length;i<l;i++) | ||
125 | { | ||
126 | draw(a[i].getAttribute('id')) | ||
127 | } | ||
128 | } | ||
129 | |||
130 | window.onload = drawAll() | ||