-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunner.html
More file actions
53 lines (46 loc) · 1.54 KB
/
runner.html
File metadata and controls
53 lines (46 loc) · 1.54 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
<html>
<head>
<title>Euler test runner</title>
<script text="text/javascript" src="qunit/qunit.js" id="qunitscr"></script>
<link rel="stylesheet" href="qunit/qunit.css"></link>
<script type="text/javascript">
var QueryString = function () {
// This function is anonymous, is executed immediately and
// the return value is assigned to QueryString!
var query_string = {};
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
} ();
(function loadEuler() {
var nStr = QueryString.euler;
if (nStr) {
while (nStr.length < 3) nStr = "0" + nStr;
var js = "p" + nStr + ".js";
var scr = document.createElement("script");
scr.type = "text/javascript";
scr.src = js;
var head = document.getElementsByTagName("head")[0];
head.insertBefore(scr, head.firstChild);
}
})();
</script>
</head>
<body>
<div id="qunit" />
</body>
</html>