-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloggedin.html
More file actions
256 lines (238 loc) · 9.71 KB
/
loggedin.html
File metadata and controls
256 lines (238 loc) · 9.71 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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html>
<head>
<title>OpenARMS</title>
<!-- Bootstrap -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<!--link href="css/main.min.css" rel="stylesheet" media="screen"-->
<link rel="stylesheet/less" type="text/css" href="less/main.less">
</head>
<body>
<div class="navbar navbar-static-top">
<div class="navbar-inner">
<a class="brand" href="index.html">OpenARMS</a>
<ul class="nav pull-right">
<li class="divider-vertical"></li>
<li><a href="index.html">Logout</a></li>
</ul>
</div>
</div>
<div class="container">
<div class="row" id="polls">
<div class="span4" id="created-polls">
<h3>Created</h3>
<table id="created-polls" class="table well table-striped table-condensed">
<tr>
<th>Question</th>
<th>Token</th>
<th class="activate">Activate</th>
</tr>
<tr class="poll">
<td class="question">Hvad er spørgsmålet?</td>
<td class="token">AGN3N5</td>
<td class="activate"><a href="#" class="btn btn-small"><i class="icon-play" /></a></td>
</tr>
<tr>
<td colspan="3" class="hint"><small>Created today at 10:12</small></td>
</tr>
<tr class="poll">
<td class="question">Dette er et andet, lidt længere spørgsmål!</td>
<td class="token">JNDONE</td>
<td class="activate"><a href="#" class="btn btn-small"><i class="icon-play" /></a></td>
</tr>
<tr>
<td colspan="3" class="hint"><small>Created yesterday at 12:53</small></td>
</tr>
</table>
</div>
<div class="span4" id="active-polls">
<h3>Active</h3>
<table id="active-polls" class="table well table-striped table-condensed">
<tr>
<th>Question</th>
<th>Token</th>
<th class="deactivate">Stop</th>
</tr>
<tr class="poll">
<td class="question">Hvad kom først?</td>
<td class="token">NC98ED</td>
<td class="deactivate"><a href="#" class="btn btn-small"><i class="icon-stop" /></a></td>
</tr>
<tr>
<td colspan="3" class="hint">
<div class="progress progress-striped active">
<div class="bar" style="width: 10%;"></div>
</div>
<small>2 minutes og 23 seconds left.</small>
</td>
</tr>
</table>
</div>
<div class="span4" id="closed-polls">
<h3>History</h3>
<table id="history-polls" class="table well table-striped table-condensed">
<tr>
<th>Question</th>
<th>Token</th>
<th class="reactivate">Reactivate</th>
</tr>
<tr class="poll">
<td class="question">Et gammelt spørgsmål, med en masse interessante svar.</td>
<td class="token">MNF938</td>
<td class="reactivate"><a href="#" class="btn btn-small"><i class="icon-repeat" /></a></td>
</tr>
<tr class="poll">
<td class="question">Et andet gammelt spørgsmål.</td>
<td class="token">912DFB</td>
<td class="reactivate"><a href="#" class="btn btn-small"><i class="icon-repeat" /></a></td>
</tr>
<tr class="poll">
<td class="question">Det tredje og sidste gamle spørgsmål.</td>
<td class="token">DANG03</td>
<td class="reactivate"><a href="#" class="btn btn-small"><i class="icon-repeat" /></a></td>
</tr>
<tr>
<td class="see-all" colspan="3"><small><a href="#">Click to see all</a></small></td>
</tr>
</table>
</div>
</div>
<div class="row">
<div class="span12">
<h3>Create poll</h3>
<form class="well" id="create-poll">
<input type="text" name="question" placeholder="Question">
<span class="help-block">Click the advanced button below, to get a rich text field for the question.</span>
<div class="poll-choices">
<h4>Provide the voter <span>2</span> choices</h4>
<div class="input-prepend">
<span class="add-on">#1</span>
<input type="text" placeholder="A">
</div><div class="input-prepend">
<span class="add-on">#2</span>
<input type="text" placeholder="B">
</div><div class="input-prepend">
<span class="add-on">#3</span>
<input type="text" placeholder="C">
</div></div>
<span class="help-block">Click the faded choice to add more.</span>
<div class="form-actions">
<button type="submit" class="btn btn-primary"><i class="icon-plus icon-white"></i> Create question</button>
<button type="button" class="btn">Advanced mode</button>
<button type="button" class="btn">Cancel</button>
</div>
</form>
</div>
</div>
</div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="js/bootstrap.min.js"></script>
<!-- Uncomment the following line, once in production -->
<script src="js/less-1.3.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
// This method updates span* classes of a Twitter Bootstrap row.
$.fn.tbUpdateCellClasses = function () {
// Find all other elements in the row.
var $cellElements = this.children("*:visible");
// Remove any relevant span class.
$cellElements.removeClass("span3 span4 span6 span12");
// Are any elements in the visible? and are this number representable?
if($cellElements.size() > 0 && 12 % $cellElements.size() == 0) {
var spanValue = 12 / $cellElements.size();
$cellElements.addClass("span"+spanValue);
} else if (12 % $cellElements.size() == 0) {
console.error("Hmm, it looks like 12 is not divisible by the number of elements.");
}
};
// Fades out a cell in a Twitter Bootstrap row and calls the tbUpdateCellClasses method in the row.
$.fn.tbToggleCell = function(hide) {
$this = $(this); // This could be a single element.
if(hide == undefined) {
hide = $this.is(":visible");
}
// Fade out the element to be toggled.
if( hide ) {
$this.fadeOut("fast", function() {
$this.parent().tbUpdateCellClasses();
});
} else {
$this.fadeIn("fast");
$this.parent().tbUpdateCellClasses();
}
};
});
</script>
<script type="text/javascript">
$(function() {
function addPollOption($pollChoices) {
var n = $pollChoices.find(".input-prepend").length + 1;
if(n < 27) {
// Replace this with template engine code.
$inputPrepend = $('<div class="input-prepend">');
$inputSpan = $('<span class="add-on"></span>').text("#"+n);
$input = $('<input id="prependedInput" type="text">').attr('placeholder', String.fromCharCode(64+n));
$inputPrepend.append($inputSpan, $input);
$pollChoices.append($inputPrepend);
$pollChoices.find("h4 span").text(n-1);
}
}
// When the last choice is clicked, another choice is added.
$(".poll-choices .input-prepend:last-child").live('click', function() {
if($("input", this).val() == "") {
addPollOption($(this).closest(".poll-choices"));
}
}).find("input").live('focus', function() {
if($(this).val() == "") {
addPollOption($(this).closest(".poll-choices"));
}
});
// Simulations
// When a poll is clicked, change to the char view.
$(".poll").live('click', function(e) {
location.href="poll.html";
});
$(".poll .btn").live('click', function(e) {
// To stop it from triggering the .poll click event.
e.stopPropagation();
});
// Active poll simulation - START
$(".progress").data('value', 10);
// This updates the value of a progress bar.
function updateProgress($progress) {
var value = $progress.data('value');
$(".bar", $progress).css('width', value+"%");
}
// Add a procent every second.
setInterval(function(){
var $progress = $(".progress");
var value = $progress.data('value');
value += 1;
value = value > 100 ? 100 : value;
$progress.data('value', value);
updateProgress($progress);
}, 1000);
// Active poll simulation - END
// Keys to help debugging effects - START
$(document.body).keyup(function(e) {
// Initialize the variable to hold the element being toggled.
if(e.which == 49) { // 1
$("#created-polls").tbToggleCell();
} else if(e.which == 50) { // 2
$("#active-polls").tbToggleCell();
} else if(e.which == 51) { // 3
$("#closed-polls").tbToggleCell();
} else if(e.which == 52) { // 4
$("#polls").children().tbToggleCell(true);
} else if(e.which == 53) { // 5
$("#polls").children().tbToggleCell(false);
}
});
// Keys to help debugging effects - END
});
</script>
</body>
</html>