-
Notifications
You must be signed in to change notification settings - Fork 30
/
meeting.ejs
41 lines (33 loc) · 1.14 KB
/
meeting.ejs
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
<%- include('includes/header') %>
<% if (!meeting_over) { %>
<h2>Meeting</h2>
<div class="row space-between">
<div>Start: <time><%= meeting.start_time %></time></div>
<div id="message"></div>
<div>End: <time><%= meeting.end_time %></time></div>
</div>
<div id="ot_embed_demo_container"><%- embed_code %></div>
<div class="text-center">
<p><a class="button primary" href="/">Exit</a></p>
</div>
<script>
window.addEventListener('load', function () {
var message_container = document.getElementById('message');
var end_time = Date.parse("<%= meeting.end_time %>");
var time_left = end_time - Date.now();
var update_time_remaining = function () {
var remaining = Math.round((end_time - Date.now()) / 60000);
message_container.innerHTML = '<p><strong>Time left: ' + remaining + ' minute(s).</strong></p>';
};
update_time_remaining();
setInterval(update_time_remaining, 60000);
setTimeout(function () {
window.location.reload();
}, time_left);
});
</script>
<% } else { %>
<p><strong>Meeting is over.</strong></p>
<p><a href="/" class="button">Exit</a></p>
<% } %>
<%- include('includes/footer') %>