-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathanswers.html
52 lines (47 loc) · 1.49 KB
/
answers.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
<!DOCTYPE html>
<html>
<head>
<title>{{ project }}</title>
<!-- A modified version of Twitters Bootstrap CSS with auto-globbing of inputs disabled -->
<link rel="stylesheet" href="/static/twitter.css">
<link rel="stylesheet" href="/google-code-prettify/prettify.css">
<style type="text/css">
html,body {
height: 100%;
}
p {
font-size: 15px;
}
code {
background: whiteSmoke;
}
</style>
<script src="/static/storage.js" type="text/javascript"></script>
<script src="/static/{{ project }}.js" type="text/javascript"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function main() {
// TODO(jmcgill): Show open answers.
var innerHTML = "";
for (var i = 0; i < toc.length; ++i) {
innerHTML += toc[i] + ' <a href="#" onclick="foo(\'' + toc[i] + '\')">Open answer</a><br>';
}
document.getElementById('container').innerHTML = innerHTML;
}
function foo(name) {
$.post("/answers/open", { project: "{{ project }}", name: name }, function(data) {
alert(data);
});
}
function clear_answers() {
$.post("/answers/clear", { project: "{{ project }}" }, function(data) {
alert(data);
});
}
</script>
</head>
<body onload="main()">
<a href="#" onclick="clear_answers()">Clear All</a>
<div id="container"></div>
</body>
</html>