-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbenchmark.php
More file actions
executable file
·102 lines (100 loc) · 3.05 KB
/
benchmark.php
File metadata and controls
executable file
·102 lines (100 loc) · 3.05 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<!doctype html><html><head>
<?php include'imports.php'?>
<script src="//cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
<style>
h1{background:white}
div.bm {
border:1px solid #ccc;
margin:1px;
padding:1px;
}
div.card {margin:10px}
pre.prettyprint {border:none;margin:1px;padding:1px}
</style>
</head><body><center>
<!--sidebar--><?php include'sidebar.php'?>
<!--NAVBAR--><?php include"navbar.php"?>
<!--TITLE--><h1><a href=development.php>
<?php write('#dev')?></a> ›
<?php write('#Benchmarking summary')?>
</h1>
<!--root-->
<div id=root style="text-align:left">
<div style="margin-top:1em;text-align:center">
<button onclick=foldAll()>
<?php write('#Fold all')?>
</button>
<button onclick=unfoldAll()>
<?php write('#Expand all')?>
</button>
<script>
function unfoldAll() {
var elements=document.querySelectorAll('div.card.folded');
for(var i=0;i<elements.length;i++)
elements[i].classList.remove('folded');
}
function foldAll() {
var elements=document.querySelectorAll('div.card');
for(var i=0;i<elements.length;i++)
elements[i].classList.add('folded');
}
</script>
</div>
<script>
var Bm = {};
Bm.getCodes = function(prefix)
{
var codes = new Array();
for(var f in RefValues)
if(f.search("^"+prefix)>-1)
codes.push(f);
return codes
}
function printDiv(prefix) {
var stage;
switch(prefix) {
case "wsa": stage=translate("Abstraction");break;
case "wst": stage=translate("Treatment");break;
case "wsd": stage=translate("Distribution");break;
case "wwc": stage=translate("Collection");break;
case "wwt": stage=translate("Treatment");break;
case "wwd": stage=translate("Discharge");break;
case "wsg": stage=translate("Water");break;
case "wwg": stage=translate("Waste");break;
}
document.write("<div class='card '>"+
"<div class=menu onclick=this.parentNode.classList.toggle('folded')><button></button> "+
stage+"</span></div>"+
"");
var codes = Bm.getCodes(prefix);
codes.forEach(function(code) {
document.write("<div class='card folded'>"+
"<div class=menu onclick=this.parentNode.classList.toggle('folded')><button></button> "+
translate(code+"_descr")+
" (<a href='variable.php?id="+code+"' onclick=\"event.stopPropagation()\">"+code+"</a>) "+
"</span></div>"+
"<pre class='prettyprint'>"+
RefValues[code].toString()+
"</pre>"+
"</div>")
});
if(codes.length==0){document.write('empty')}
document.write("</div>")
}
function printLevel(prefixArray,name)
{
document.write("<div class='card'>"+
"<div class=menu onclick=this.parentNode.classList.toggle('folded')><button></button> "+
name+"</span></div>");
prefixArray.forEach(function(prefix){printDiv(prefix)});
document.write("</div>")
}
function printAll()
{
printLevel(['wsa','wst','wsd'],translate("Water"));
printLevel(['wwc','wwt','wwd'],translate("Waste"));
}
</script>
<script>printAll()</script>
</div>
<!--CURRENT JSON--><?php include'currentJSON.php'?>