-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.html
91 lines (87 loc) · 3.46 KB
/
main.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
80
81
82
83
84
85
86
87
88
89
90
91
<html>
<head>
<script type="text/javascript" src="scripts/init_page.js"></script>
<script type="text/javascript" src="scripts/question_node.js"></script>
<script type="text/javascript" src="scripts/volunteer_position.js"></script>
<script type="text/javascript">
function doYes(){
var answer = window.currentNode.GetYes();
handleNode(answer)
}
function doBack(){
if(window.nodes.length == 1){
window.alert("cannot go back from the start!");
} else if (document.getElementById("result")){
var mainDiv = document.getElementById("main_div");
mainDiv.removeChild(document.getElementById("result"));
if(document.getElementById("div_email_addr")){
mainDiv.removeChild(document.getElementById("div_email_addr"));
}
if(document.getElementById("position_description")){
mainDiv.removeChild(document.getElementById("position_description"));
}
if(document.getElementById("reset_page_div")){
mainDiv.removeChild(document.getElementById("reset_page_div"));
}
mainDiv.appendChild(window.mainTable);
} else {
window.nodes.pop();
window.currentNode = window.nodes[window.nodes.length-1];
updateQuestionText();
}
}
function doNo(){
var answer = window.currentNode.GetNo();
handleNode(answer);
}
function updateQuestionText(){
var questionText = document.getElementById("question_text");
questionText.innerHTML = window.currentNode.GetQuestion();
}
function handleNode(answer){
if(answer instanceof VolunteerPosition){
//document.write("You'll be a great " + answer.name + " because " + answer.description);
answer.createNode();
} else if (answer instanceof QuestionNode){
window.currentNode = answer;
updateQuestionText();
}
window.nodes.push(currentNode);
}
</script>
</head>
<body>
<div id="main_div">
<table height="100%" width="100%" align="center" id="main_table">
<!-- <tr><td colspan="3"> </td> -->
<tr><td colspan="3" align="center" id="question_cell"><h2 id="question_text">Does this shit work?</h2></td></tr>
<tr>
<td id="yes" ><a href=# onclick="doYes()"><img src="images/yes.jpg"></a></td>
<td style="width:20%;"> </td>
<td id="no" ><a href=# onclick="doNo()"><img src="images/no.jpg"></a></td>
</tr>
</table>
</div>
<div id="VC_Footer">
<p>
<a href=# onclick="doBack()">Or, maybe you'd like to go back to your previous quesiton?</a>
</p>
<p>
Confused about anything you see here? Did you find an error or a dead link? You might want to visit the <a href="http://wiki.burningflipside.com/wiki/Volunteer_Coordinator">Volunteer Coordinator page on Pyropedia</a> or email the volunteer team at <a href="mailto:[email protected]">[email protected]</a>
</p>
</div>
<script type="text/javascript">
window.nodes = new Array();
init_page();
updateQuestionText();
window.nodes.push(window.currentNode);
function reload(){
location.reload();
}
function image_not_found(){
var imageNode = document.getElementById("volunteer_image");
imageNode.src = "images/lostimage.png";
imageNode.style.width="470px";
}
</script>
</html>