-
Notifications
You must be signed in to change notification settings - Fork 0
/
results.html
79 lines (77 loc) · 3.51 KB
/
results.html
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
<html>
<head>
<!--<link rel="stylesheet" type="text/css" href="static/tablesort.css">-->
<link rel="stylesheet" type="text/css" href="static/lookup.css">
<script type="text/javascript" charset="utf8" src="static/jquery.js"></script>
<!--<script type="text/javascript">var jqMenu = $.noConflict();</script>
<script type="text/javascript" src="static/cdsmenu.min.js"></script>
<script type="text/javascript" src="static/jstorage.min.js"></script>
<script type="text/javascript" charset="utf8" src="static/jquery.js"></script>
<script type="text/javascript" charset="utf8" src="static/viz2.js"></script>-->
<script type="text/javascript" language="javascript" class="init">
function divbuild(label, prefix, text){
var div = document.getElementById(label);
if (div.innerHTML == ''){
document.getElementById(label).innerHTML = prefix + text;
} else {
document.getElementById(label).innerHTML += ', ' + text;
}
}
jQuery(window).load(function(){
var catalogs = [%s];
var counter = catalogs.length;
for (var i = 0; i < catalogs.length; i++) {
var div = document.createElement('span');
div.id = 'wait-'+catalogs[i];
div.innerHTML = catalogs[i];
div.style.margin = '10px';
document.getElementById('pending_content').appendChild(div);
var params = {catalog: catalogs[i]};
jQuery.post('get_info', params,
function(response){
var name = "";
if (response[0] == '0'){
divbuild('notcovered', 'Not covered by: ', response.substring(1));
name = response.substring(1);
}
else if (response[0] == '1'){
divbuild('nodata', 'No data from: ', response.substring(1));
name = response.substring(1);
}
else{
document.getElementById("result").innerHTML += response;
name = this.data.split('=')[1];
}
var div = document.getElementById('wait-'+name);
div.outerHTML = "";
delete div;
counter -= 1;
if (counter == 0){
$("div#pending").remove();
}
});
};
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.display === "block") {
content.style.display = "none";
} else {
content.style.display = "block";
}
});
}
});
</script>
</head>
<body>
<h2><div id="pending">Awaiting for data from: <div id="pending_content"></div></div></h2>
<h2><div id="notcovered"></div></h2>
<h2><div id="nodata"></div></h2>
<div id="result"></div>
<div id="error"></div>
</body>
</html>