-
Notifications
You must be signed in to change notification settings - Fork 3
/
presenter.html
160 lines (134 loc) · 3.22 KB
/
presenter.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
<!DOCTYPE html>
<html>
<head>
<title>Presenter View</title>
<style>
html{
color:#333;
font-family: sans-serif;
}
#information {
text-align: center;
font-size: 1.5em;
padding: 4px;
}
#val_time, #val_pagethis, #val_pagecount {
font-weight: bold;
}
#notes{
clear: both;
padding: 4px;
margin-top: 10px;
border-top: 3px solid #ccc;
height: 50px;
font-size: 1.5em;
}
#pane{
margin-top: 10px;
font-size: 1.4em;
}
#time{
float: left;
text-align: center;
font-size: 3em;
width: 22%;
margin-top: 1em;
}
#slideleft, #slideright {
float: left;
padding: 4px;
width: 38%;
}
#val_slideleft, #val_slideright{
max-width: 100%;
}
#datetime{
font-size: 0.5em;
}
</style>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script>
var uren = 0;
var seconden = 0;
var clock = 0;
var previousslide = 0;
var refreshtime = 1000;
var isPaused = false;
function display_clock(){
uren = Math.floor(clock/60);
seconden = clock - uren*60;
seconden = (seconden < 10) ? "0" + seconden : seconden;
$("#val_time").text(uren + ":" + seconden);
}
function update_clock(){
setTimeout ("update_clock()", 1000);
clock = clock + 1;
// console.log(clock);
display_clock();
}
function display_time(){
var currentTime = new Date();
var hours = currentTime.getHours();
var minutes = currentTime.getMinutes();
var seconds = currentTime.getSeconds();
if (minutes < 10){
minutes = "0" + minutes;
}
if (seconds < 10){
seconds = "0" + seconds;
}
$("#datetime").text(hours + ":" + minutes + ":" + seconds);
};
function make_call(){
$.ajaxSetup({'beforeSend': function(xhr){
if (xhr.overrideMimeType){
xhr.overrideMimeType("text/plain");
}
}
});
$.getJSON("./json.txt",
function(data){
$("#val_pagethis").text(data.current_page);
$("#val_pagecount").text(data.page_count);
$("#notes").html(data.notes);
if (previousslide != data.current_page){
clock = data.current_time;
$("#val_slideleft").attr("src", "./slides/slide-"+(data.current_page-1)+".png");
if (data.current_page < data.page_count)
$("#val_slideright").attr("src", "./slides/slide-"+(data.current_page)+".png");
$("#val_text").text(" ");
}
previousslide = data.current_page;
display_clock();
display_time();
});
setTimeout ("make_call()", refreshtime);
}
$(document).ready(function(){
make_call();
update_clock();
});
</script>
</head>
<body>
<div id="information">
Currently at slide
<span id="val_pagethis">?</span> of <span id="val_pagecount">?</span>
</div>
<div id="pane">
<div id="slideleft">
Current slide:<br>
<img id="val_slideleft" src="./slides/slide-0.png">
</div>
<div id="time">
<span id="val_time">?</span><br>
<span id="datetime">?</span>
</div>
<div id="slideright">
Next slide:<br>
<img id="val_slideright" src="./slides/slide-1.png">
</div>
</div>
<div id="notes"></div>
</body>
</html>