-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathideation.html
176 lines (155 loc) · 6.78 KB
/
ideation.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Storm</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/github-dark.css">
<link rel="stylesheet" href="stylesheets/custom.css">
<script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="javascripts/main.js"></script>
<script src="javascripts/util.js"></script>
<script src="javascripts/clock.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<div class="container">
<div id="topbar">
<span id="goal"></span>
</div>
<div id="sidebar">
<div id="clock">--:--</div>
<div id="definition" class="stage">1) Definition</div>
<div id="ideation" class="stage active">2) Ideation</div>
<div id="discussion" class="stage">3) Discussion</div>
<div id="election" class="stage">4) Election</div>
<div id="decision" class="stage">5) Decision</div>
<div class="criteria-list">
Criteria
<ol>
<li id="criteria1">one</li>
<li id="criteria2">two</li>
<li id="criteria3">three</li>
</ol>
</div>
</div>
<div id="main" class="scrollable">
<div id="section-title" class="section-title">Ideation</div>
<div id="overview">
Brainstorm as many ideas as you can! When time runs out, all ideas will be shared with the group. Feel free to propose crazy ideas because they will always be anonymous. These ideas will be automatically submitted when the timer hits zero.
</div>
<br>
<form onsubmit="return submitToFirebase(event)">
<label>Title</label>
<input type="text" id="title1"><br><br>
<label>Description</label>
<textarea id="description1" rows="5" cols="70"></textarea><br><br>
<label>Title</label>
<input type="text" id="title2"><br><br>
<label>Description</label>
<textarea id="description2" rows="5" cols="70"></textarea><br><br>
<label>Title</label>
<input type="text" id="title3"><br><br>
<label>Description</label>
<textarea id="description3" rows="5" cols="70"></textarea><br><br>
<label>Title</label>
<input type="text" id="title4"><br><br>
<label>Description</label>
<textarea id="description4" rows="5" cols="70"></textarea><br><br>
<label>Title</label>
<input type="text" id="title5"><br><br>
<label>Description</label>
<textarea id="description5" rows="5" cols="70"></textarea><br><br>
<br><p>These ideas will be automatically submitted when the timer hits zero.</p>
</form>
<br><br>
<div class="section-title">Previous Ideas</div>
<div id="previous-ideas"></div>
<script>
var numOldIdeas = 0;
var key = getFirebaseKey();
var ref = new Firebase(getSessionUrl(key));
ref.once("value", function(snapshot) {
var session = snapshot.val();
initIdeationClock(session.date, session.time, session.duration);
$("#goal").html(session.goal);
$("#criteria1").html(session.criteria1);
$("#criteria2").html(session.criteria2);
$("#criteria3").html(session.criteria3);
if (session.ideas) {
numOldIdeas = session.ideas.length;
for (i = 0; i < session.ideas.length; i++) {
if (session.ideas[i]) {
$("#previous-ideas").append(
"<div class='old-idea-information'>"
+"<div class='vote-title'>"+session.ideas[i].title+"</div>"
+ session.ideas[i].description
+"</div>"
);
}
}
}
}, function (errorObject) {
console.log("The read failed: " + errorObject.code);
});
function submitToFirebase() {
var title1 = $('#title1').val();
var title2 = $('#title2').val();
var title3 = $('#title3').val();
var title4 = $('#title4').val();
var title5 = $('#title5').val();
var description1 = $('#description1').val();
var description2 = $('#description2').val();
var description3 = $('#description3').val();
var description4 = $('#description4').val();
var description5 = $('#description5').val();
var key = getFirebaseKey();
var ref = new Firebase(getIdeasUrl(key));
// submit ideas to the database
ref.transaction(function(currentData) {
if (currentData === null)
currentData = [];
if (title1 || description1)
currentData.push({title: title1, description: description1});
if (title2 || description2)
currentData.push({title: title2, description: description2});
if (title3 || description3)
currentData.push({title: title3, description: description3});
if (title4 || description4)
currentData.push({title: title4, description: description4});
if (title5 || description5)
currentData.push({title: title5, description: description5});
return currentData;
},
onSubmitToFirebaseComplete);
return false;
}
function onSubmitToFirebaseComplete(error, committed, snapshot) {
if (error || !committed) {
alert("Sorry, an error occurred");
}
else {
var round = 1;
if (window.location.href.indexOf("round=2") > -1)
round = 2;
// redirect to the discussion page
if (isDeployed()) {
window.location.replace("http://www.willhennessy.com/storm/discussion?round="+round+"&numIdeasCompleted="+numOldIdeas+"&session="+getFirebaseKey());
} else {
window.location.replace("/Users/willhennessy/Documents/CS%20598%20-%20Social/storm/discussion.html?round="+round+"&numIdeasCompleted="+numOldIdeas+"&session="+getFirebaseKey());
}
}
}
</script>
</div>
</div>
<div class="wrapper">
</div>
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
</body>
</html>