/
check.html
66 lines (58 loc) · 1.64 KB
/
check.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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<title>3Dmol.js Tests</title>
<script src="../build/3Dmol.js"></script>
<script>
var testNum=1;
const totalTest=64;
function setTest(num) {
testNum = num;
if(testNum>totalTest) testNum = 1;
if(testNum < 1) testNum = totalTest;
var testCase="check/test"+testNum.toString()+".html";
document.getElementById('check').src=testCase;
$('#current').val(testNum);
}
function next(){
testNum++;
setTest(testNum);
}
function prev(){
testNum--;
setTest(testNum);
}
function changetest(e) {
if(e.keyCode === 13){ //enter
var t = $('#current').val();
if($.isNumeric(t)) {
setTest(t);
}
}
return false; //prevent propagation
}
$(document).ready(function() {
$('#total').text(totalTest.toString());
setTest(1);
});
</script>
<style>
table td { text-align: center; }
table th {padding-top: 1em;}
</style>
</head>
<body>
<table >
<tr>
<div align="center">
<iframe id="check" src="about:blank" frameborder=0 height=600px width=900px scrolling=no seamless=seamless></iframe>
<br>
<button type="button" onclick="prev()">prev</button>
<input type="text" name="current" id="current" size="2" onkeypress='changetest(event)'> / <span id="total"></span>
<button type="button" onclick="next()">next</button>
</div>
</tr>
</table>
</body>
</html>