starterlog-theme 1.1.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +52 -8
- data/_layouts/slide.html +105 -0
- data/_pages/profile/index.html +1 -1
- data/_pages/start/index.html +7 -2
- data/assets/modules/reveal.js/.gitignore +13 -0
- data/assets/modules/reveal.js/.travis.yml +5 -0
- data/assets/modules/reveal.js/CONTRIBUTING.md +23 -0
- data/assets/modules/reveal.js/Gruntfile.js +187 -0
- data/assets/modules/reveal.js/LICENSE +19 -0
- data/assets/modules/reveal.js/README.md +1185 -0
- data/assets/modules/reveal.js/bower.json +27 -0
- data/assets/modules/reveal.js/css/print/paper.css +203 -0
- data/assets/modules/reveal.js/css/print/pdf.css +171 -0
- data/assets/modules/reveal.js/css/reveal.css +1365 -0
- data/assets/modules/reveal.js/css/reveal.scss +1446 -0
- data/assets/modules/reveal.js/css/theme/README.md +21 -0
- data/assets/modules/reveal.js/css/theme/beige.css +296 -0
- data/assets/modules/reveal.js/css/theme/black.css +292 -0
- data/assets/modules/reveal.js/css/theme/blood.css +315 -0
- data/assets/modules/reveal.js/css/theme/league.css +298 -0
- data/assets/modules/reveal.js/css/theme/moon.css +296 -0
- data/assets/modules/reveal.js/css/theme/night.css +290 -0
- data/assets/modules/reveal.js/css/theme/serif.css +292 -0
- data/assets/modules/reveal.js/css/theme/simple.css +295 -0
- data/assets/modules/reveal.js/css/theme/sky.css +299 -0
- data/assets/modules/reveal.js/css/theme/solarized.css +296 -0
- data/assets/modules/reveal.js/css/theme/source/beige.scss +39 -0
- data/assets/modules/reveal.js/css/theme/source/black.scss +49 -0
- data/assets/modules/reveal.js/css/theme/source/blood.scss +78 -0
- data/assets/modules/reveal.js/css/theme/source/league.scss +34 -0
- data/assets/modules/reveal.js/css/theme/source/moon.scss +57 -0
- data/assets/modules/reveal.js/css/theme/source/night.scss +34 -0
- data/assets/modules/reveal.js/css/theme/source/serif.scss +35 -0
- data/assets/modules/reveal.js/css/theme/source/simple.scss +43 -0
- data/assets/modules/reveal.js/css/theme/source/sky.scss +46 -0
- data/assets/modules/reveal.js/css/theme/source/solarized.scss +63 -0
- data/assets/modules/reveal.js/css/theme/source/white.scss +49 -0
- data/assets/modules/reveal.js/css/theme/template/mixins.scss +29 -0
- data/assets/modules/reveal.js/css/theme/template/settings.scss +43 -0
- data/assets/modules/reveal.js/css/theme/template/theme.scss +352 -0
- data/assets/modules/reveal.js/css/theme/white.css +292 -0
- data/assets/modules/reveal.js/demo.html +410 -0
- data/assets/modules/reveal.js/index.html +50 -0
- data/assets/modules/reveal.js/js/reveal.js +4961 -0
- data/assets/modules/reveal.js/lib/css/zenburn.css +80 -0
- data/assets/modules/reveal.js/lib/font/league-gothic/LICENSE +2 -0
- data/assets/modules/reveal.js/lib/font/league-gothic/league-gothic.css +10 -0
- data/assets/modules/reveal.js/lib/font/league-gothic/league-gothic.eot +0 -0
- data/assets/modules/reveal.js/lib/font/league-gothic/league-gothic.ttf +0 -0
- data/assets/modules/reveal.js/lib/font/league-gothic/league-gothic.woff +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/LICENSE +45 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
- data/assets/modules/reveal.js/lib/font/source-sans-pro/source-sans-pro.css +39 -0
- data/assets/modules/reveal.js/lib/js/classList.js +2 -0
- data/assets/modules/reveal.js/lib/js/head.min.js +9 -0
- data/assets/modules/reveal.js/lib/js/html5shiv.js +7 -0
- data/assets/modules/reveal.js/package.json +45 -0
- data/assets/modules/reveal.js/plugin/highlight/highlight.js +78 -0
- data/assets/modules/reveal.js/plugin/markdown/example.html +129 -0
- data/assets/modules/reveal.js/plugin/markdown/example.md +31 -0
- data/assets/modules/reveal.js/plugin/markdown/markdown.js +411 -0
- data/assets/modules/reveal.js/plugin/markdown/marked.js +6 -0
- data/assets/modules/reveal.js/plugin/math/math.js +67 -0
- data/assets/modules/reveal.js/plugin/multiplex/client.js +13 -0
- data/assets/modules/reveal.js/plugin/multiplex/index.js +64 -0
- data/assets/modules/reveal.js/plugin/multiplex/master.js +31 -0
- data/assets/modules/reveal.js/plugin/multiplex/package.json +19 -0
- data/assets/modules/reveal.js/plugin/notes-server/client.js +65 -0
- data/assets/modules/reveal.js/plugin/notes-server/index.js +69 -0
- data/assets/modules/reveal.js/plugin/notes-server/notes.html +585 -0
- data/assets/modules/reveal.js/plugin/notes/notes.html +609 -0
- data/assets/modules/reveal.js/plugin/notes/notes.js +145 -0
- data/assets/modules/reveal.js/plugin/print-pdf/print-pdf.js +51 -0
- data/assets/modules/reveal.js/plugin/search/search.js +196 -0
- data/assets/modules/reveal.js/plugin/zoom-js/zoom.js +288 -0
- data/assets/modules/reveal.js/test/examples/assets/image1.png +0 -0
- data/assets/modules/reveal.js/test/examples/assets/image2.png +0 -0
- data/assets/modules/reveal.js/test/examples/barebones.html +41 -0
- data/assets/modules/reveal.js/test/examples/embedded-media.html +49 -0
- data/assets/modules/reveal.js/test/examples/math.html +185 -0
- data/assets/modules/reveal.js/test/examples/slide-backgrounds.html +144 -0
- data/assets/modules/reveal.js/test/examples/slide-transitions.html +101 -0
- data/assets/modules/reveal.js/test/qunit-1.12.0.css +244 -0
- data/assets/modules/reveal.js/test/qunit-1.12.0.js +2212 -0
- data/assets/modules/reveal.js/test/simple.md +12 -0
- data/assets/modules/reveal.js/test/test-markdown-element-attributes.html +134 -0
- data/assets/modules/reveal.js/test/test-markdown-element-attributes.js +46 -0
- data/assets/modules/reveal.js/test/test-markdown-external.html +36 -0
- data/assets/modules/reveal.js/test/test-markdown-external.js +24 -0
- data/assets/modules/reveal.js/test/test-markdown-options.html +41 -0
- data/assets/modules/reveal.js/test/test-markdown-options.js +26 -0
- data/assets/modules/reveal.js/test/test-markdown-slide-attributes.html +128 -0
- data/assets/modules/reveal.js/test/test-markdown-slide-attributes.js +47 -0
- data/assets/modules/reveal.js/test/test-markdown.html +52 -0
- data/assets/modules/reveal.js/test/test-markdown.js +15 -0
- data/assets/modules/reveal.js/test/test-pdf.html +83 -0
- data/assets/modules/reveal.js/test/test-pdf.js +15 -0
- data/assets/modules/reveal.js/test/test.html +86 -0
- data/assets/modules/reveal.js/test/test.js +597 -0
- metadata +117 -10
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
|
|
6
|
+
<title>reveal.js - Slide Notes</title>
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
body {
|
|
10
|
+
font-family: Helvetica;
|
|
11
|
+
font-size: 18px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
#current-slide,
|
|
15
|
+
#upcoming-slide,
|
|
16
|
+
#speaker-controls {
|
|
17
|
+
padding: 6px;
|
|
18
|
+
box-sizing: border-box;
|
|
19
|
+
-moz-box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
#current-slide iframe,
|
|
23
|
+
#upcoming-slide iframe {
|
|
24
|
+
width: 100%;
|
|
25
|
+
height: 100%;
|
|
26
|
+
border: 1px solid #ddd;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#current-slide .label,
|
|
30
|
+
#upcoming-slide .label {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 10px;
|
|
33
|
+
left: 10px;
|
|
34
|
+
z-index: 2;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.overlay-element {
|
|
38
|
+
height: 34px;
|
|
39
|
+
line-height: 34px;
|
|
40
|
+
padding: 0 10px;
|
|
41
|
+
text-shadow: none;
|
|
42
|
+
background: rgba( 220, 220, 220, 0.8 );
|
|
43
|
+
color: #222;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.overlay-element.interactive:hover {
|
|
48
|
+
background: rgba( 220, 220, 220, 1 );
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#current-slide {
|
|
52
|
+
position: absolute;
|
|
53
|
+
width: 60%;
|
|
54
|
+
height: 100%;
|
|
55
|
+
top: 0;
|
|
56
|
+
left: 0;
|
|
57
|
+
padding-right: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#upcoming-slide {
|
|
61
|
+
position: absolute;
|
|
62
|
+
width: 40%;
|
|
63
|
+
height: 40%;
|
|
64
|
+
right: 0;
|
|
65
|
+
top: 0;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* Speaker controls */
|
|
69
|
+
#speaker-controls {
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 40%;
|
|
72
|
+
right: 0;
|
|
73
|
+
width: 40%;
|
|
74
|
+
height: 60%;
|
|
75
|
+
overflow: auto;
|
|
76
|
+
font-size: 18px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.speaker-controls-time.hidden,
|
|
80
|
+
.speaker-controls-notes.hidden {
|
|
81
|
+
display: none;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.speaker-controls-time .label,
|
|
85
|
+
.speaker-controls-notes .label {
|
|
86
|
+
text-transform: uppercase;
|
|
87
|
+
font-weight: normal;
|
|
88
|
+
font-size: 0.66em;
|
|
89
|
+
color: #666;
|
|
90
|
+
margin: 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.speaker-controls-time {
|
|
94
|
+
border-bottom: 1px solid rgba( 200, 200, 200, 0.5 );
|
|
95
|
+
margin-bottom: 10px;
|
|
96
|
+
padding: 10px 16px;
|
|
97
|
+
padding-bottom: 20px;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.speaker-controls-time .reset-button {
|
|
102
|
+
opacity: 0;
|
|
103
|
+
float: right;
|
|
104
|
+
color: #666;
|
|
105
|
+
text-decoration: none;
|
|
106
|
+
}
|
|
107
|
+
.speaker-controls-time:hover .reset-button {
|
|
108
|
+
opacity: 1;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.speaker-controls-time .timer,
|
|
112
|
+
.speaker-controls-time .clock {
|
|
113
|
+
width: 50%;
|
|
114
|
+
font-size: 1.9em;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.speaker-controls-time .timer {
|
|
118
|
+
float: left;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.speaker-controls-time .clock {
|
|
122
|
+
float: right;
|
|
123
|
+
text-align: right;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.speaker-controls-time span.mute {
|
|
127
|
+
color: #bbb;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.speaker-controls-notes {
|
|
131
|
+
padding: 10px 16px;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.speaker-controls-notes .value {
|
|
135
|
+
margin-top: 5px;
|
|
136
|
+
line-height: 1.4;
|
|
137
|
+
font-size: 1.2em;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* Layout selector */
|
|
141
|
+
#speaker-layout {
|
|
142
|
+
position: absolute;
|
|
143
|
+
top: 10px;
|
|
144
|
+
right: 10px;
|
|
145
|
+
color: #222;
|
|
146
|
+
z-index: 10;
|
|
147
|
+
}
|
|
148
|
+
#speaker-layout select {
|
|
149
|
+
position: absolute;
|
|
150
|
+
width: 100%;
|
|
151
|
+
height: 100%;
|
|
152
|
+
top: 0;
|
|
153
|
+
left: 0;
|
|
154
|
+
border: 0;
|
|
155
|
+
box-shadow: 0;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
opacity: 0;
|
|
158
|
+
|
|
159
|
+
font-size: 1em;
|
|
160
|
+
background-color: transparent;
|
|
161
|
+
|
|
162
|
+
-moz-appearance: none;
|
|
163
|
+
-webkit-appearance: none;
|
|
164
|
+
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
#speaker-layout select:focus {
|
|
168
|
+
outline: none;
|
|
169
|
+
box-shadow: none;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.clear {
|
|
173
|
+
clear: both;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* Speaker layout: Wide */
|
|
177
|
+
body[data-speaker-layout="wide"] #current-slide,
|
|
178
|
+
body[data-speaker-layout="wide"] #upcoming-slide {
|
|
179
|
+
width: 50%;
|
|
180
|
+
height: 45%;
|
|
181
|
+
padding: 6px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
body[data-speaker-layout="wide"] #current-slide {
|
|
185
|
+
top: 0;
|
|
186
|
+
left: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
body[data-speaker-layout="wide"] #upcoming-slide {
|
|
190
|
+
top: 0;
|
|
191
|
+
left: 50%;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
body[data-speaker-layout="wide"] #speaker-controls {
|
|
195
|
+
top: 45%;
|
|
196
|
+
left: 0;
|
|
197
|
+
width: 100%;
|
|
198
|
+
height: 50%;
|
|
199
|
+
font-size: 1.25em;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/* Speaker layout: Tall */
|
|
203
|
+
body[data-speaker-layout="tall"] #current-slide,
|
|
204
|
+
body[data-speaker-layout="tall"] #upcoming-slide {
|
|
205
|
+
width: 45%;
|
|
206
|
+
height: 50%;
|
|
207
|
+
padding: 6px;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
body[data-speaker-layout="tall"] #current-slide {
|
|
211
|
+
top: 0;
|
|
212
|
+
left: 0;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
body[data-speaker-layout="tall"] #upcoming-slide {
|
|
216
|
+
top: 50%;
|
|
217
|
+
left: 0;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
body[data-speaker-layout="tall"] #speaker-controls {
|
|
221
|
+
padding-top: 40px;
|
|
222
|
+
top: 0;
|
|
223
|
+
left: 45%;
|
|
224
|
+
width: 55%;
|
|
225
|
+
height: 100%;
|
|
226
|
+
font-size: 1.25em;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/* Speaker layout: Notes only */
|
|
230
|
+
body[data-speaker-layout="notes-only"] #current-slide,
|
|
231
|
+
body[data-speaker-layout="notes-only"] #upcoming-slide {
|
|
232
|
+
display: none;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
body[data-speaker-layout="notes-only"] #speaker-controls {
|
|
236
|
+
padding-top: 40px;
|
|
237
|
+
top: 0;
|
|
238
|
+
left: 0;
|
|
239
|
+
width: 100%;
|
|
240
|
+
height: 100%;
|
|
241
|
+
font-size: 1.25em;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
@media screen and (max-width: 1080px) {
|
|
245
|
+
body[data-speaker-layout="default"] #speaker-controls {
|
|
246
|
+
font-size: 16px;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
@media screen and (max-width: 900px) {
|
|
251
|
+
body[data-speaker-layout="default"] #speaker-controls {
|
|
252
|
+
font-size: 14px;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
@media screen and (max-width: 800px) {
|
|
257
|
+
body[data-speaker-layout="default"] #speaker-controls {
|
|
258
|
+
font-size: 12px;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
</style>
|
|
263
|
+
</head>
|
|
264
|
+
|
|
265
|
+
<body>
|
|
266
|
+
|
|
267
|
+
<div id="current-slide"></div>
|
|
268
|
+
<div id="upcoming-slide"><span class="overlay-element label">Upcoming</span></div>
|
|
269
|
+
<div id="speaker-controls">
|
|
270
|
+
<div class="speaker-controls-time">
|
|
271
|
+
<h4 class="label">Time <span class="reset-button">Click to Reset</span></h4>
|
|
272
|
+
<div class="clock">
|
|
273
|
+
<span class="clock-value">0:00 AM</span>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="timer">
|
|
276
|
+
<span class="hours-value">00</span><span class="minutes-value">:00</span><span class="seconds-value">:00</span>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="clear"></div>
|
|
279
|
+
</div>
|
|
280
|
+
|
|
281
|
+
<div class="speaker-controls-notes hidden">
|
|
282
|
+
<h4 class="label">Notes</h4>
|
|
283
|
+
<div class="value"></div>
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
286
|
+
<div id="speaker-layout" class="overlay-element interactive">
|
|
287
|
+
<span class="speaker-layout-label"></span>
|
|
288
|
+
<select class="speaker-layout-dropdown"></select>
|
|
289
|
+
</div>
|
|
290
|
+
|
|
291
|
+
<script src="../../plugin/markdown/marked.js"></script>
|
|
292
|
+
<script>
|
|
293
|
+
|
|
294
|
+
(function() {
|
|
295
|
+
|
|
296
|
+
var notes,
|
|
297
|
+
notesValue,
|
|
298
|
+
currentState,
|
|
299
|
+
currentSlide,
|
|
300
|
+
upcomingSlide,
|
|
301
|
+
layoutLabel,
|
|
302
|
+
layoutDropdown,
|
|
303
|
+
connected = false;
|
|
304
|
+
|
|
305
|
+
var SPEAKER_LAYOUTS = {
|
|
306
|
+
'default': 'Default',
|
|
307
|
+
'wide': 'Wide',
|
|
308
|
+
'tall': 'Tall',
|
|
309
|
+
'notes-only': 'Notes only'
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
setupLayout();
|
|
313
|
+
|
|
314
|
+
window.addEventListener( 'message', function( event ) {
|
|
315
|
+
|
|
316
|
+
var data = JSON.parse( event.data );
|
|
317
|
+
|
|
318
|
+
// The overview mode is only useful to the reveal.js instance
|
|
319
|
+
// where navigation occurs so we don't sync it
|
|
320
|
+
if( data.state ) delete data.state.overview;
|
|
321
|
+
|
|
322
|
+
// Messages sent by the notes plugin inside of the main window
|
|
323
|
+
if( data && data.namespace === 'reveal-notes' ) {
|
|
324
|
+
if( data.type === 'connect' ) {
|
|
325
|
+
handleConnectMessage( data );
|
|
326
|
+
}
|
|
327
|
+
else if( data.type === 'state' ) {
|
|
328
|
+
handleStateMessage( data );
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
// Messages sent by the reveal.js inside of the current slide preview
|
|
332
|
+
else if( data && data.namespace === 'reveal' ) {
|
|
333
|
+
if( /ready/.test( data.eventName ) ) {
|
|
334
|
+
// Send a message back to notify that the handshake is complete
|
|
335
|
+
window.opener.postMessage( JSON.stringify({ namespace: 'reveal-notes', type: 'connected'} ), '*' );
|
|
336
|
+
}
|
|
337
|
+
else if( /slidechanged|fragmentshown|fragmenthidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
|
|
338
|
+
|
|
339
|
+
window.opener.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ]} ), '*' );
|
|
340
|
+
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
} );
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Called when the main window is trying to establish a
|
|
348
|
+
* connection.
|
|
349
|
+
*/
|
|
350
|
+
function handleConnectMessage( data ) {
|
|
351
|
+
|
|
352
|
+
if( connected === false ) {
|
|
353
|
+
connected = true;
|
|
354
|
+
|
|
355
|
+
setupIframes( data );
|
|
356
|
+
setupKeyboard();
|
|
357
|
+
setupNotes();
|
|
358
|
+
setupTimer();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Called when the main window sends an updated state.
|
|
365
|
+
*/
|
|
366
|
+
function handleStateMessage( data ) {
|
|
367
|
+
|
|
368
|
+
// Store the most recently set state to avoid circular loops
|
|
369
|
+
// applying the same state
|
|
370
|
+
currentState = JSON.stringify( data.state );
|
|
371
|
+
|
|
372
|
+
// No need for updating the notes in case of fragment changes
|
|
373
|
+
if ( data.notes ) {
|
|
374
|
+
notes.classList.remove( 'hidden' );
|
|
375
|
+
notesValue.style.whiteSpace = data.whitespace;
|
|
376
|
+
if( data.markdown ) {
|
|
377
|
+
notesValue.innerHTML = marked( data.notes );
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
notesValue.innerHTML = data.notes;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
notes.classList.add( 'hidden' );
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// Update the note slides
|
|
388
|
+
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
|
|
389
|
+
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
|
|
390
|
+
upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'next' }), '*' );
|
|
391
|
+
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
// Limit to max one state update per X ms
|
|
395
|
+
handleStateMessage = debounce( handleStateMessage, 200 );
|
|
396
|
+
|
|
397
|
+
/**
|
|
398
|
+
* Forward keyboard events to the current slide window.
|
|
399
|
+
* This enables keyboard events to work even if focus
|
|
400
|
+
* isn't set on the current slide iframe.
|
|
401
|
+
*/
|
|
402
|
+
function setupKeyboard() {
|
|
403
|
+
|
|
404
|
+
document.addEventListener( 'keydown', function( event ) {
|
|
405
|
+
currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
|
|
406
|
+
} );
|
|
407
|
+
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Creates the preview iframes.
|
|
412
|
+
*/
|
|
413
|
+
function setupIframes( data ) {
|
|
414
|
+
|
|
415
|
+
var params = [
|
|
416
|
+
'receiver',
|
|
417
|
+
'progress=false',
|
|
418
|
+
'history=false',
|
|
419
|
+
'transition=none',
|
|
420
|
+
'autoSlide=0',
|
|
421
|
+
'backgroundTransition=none'
|
|
422
|
+
].join( '&' );
|
|
423
|
+
|
|
424
|
+
var urlSeparator = /\?/.test(data.url) ? '&' : '?';
|
|
425
|
+
var hash = '#/' + data.state.indexh + '/' + data.state.indexv;
|
|
426
|
+
var currentURL = data.url + urlSeparator + params + '&postMessageEvents=true' + hash;
|
|
427
|
+
var upcomingURL = data.url + urlSeparator + params + '&controls=false' + hash;
|
|
428
|
+
|
|
429
|
+
currentSlide = document.createElement( 'iframe' );
|
|
430
|
+
currentSlide.setAttribute( 'width', 1280 );
|
|
431
|
+
currentSlide.setAttribute( 'height', 1024 );
|
|
432
|
+
currentSlide.setAttribute( 'src', currentURL );
|
|
433
|
+
document.querySelector( '#current-slide' ).appendChild( currentSlide );
|
|
434
|
+
|
|
435
|
+
upcomingSlide = document.createElement( 'iframe' );
|
|
436
|
+
upcomingSlide.setAttribute( 'width', 640 );
|
|
437
|
+
upcomingSlide.setAttribute( 'height', 512 );
|
|
438
|
+
upcomingSlide.setAttribute( 'src', upcomingURL );
|
|
439
|
+
document.querySelector( '#upcoming-slide' ).appendChild( upcomingSlide );
|
|
440
|
+
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/**
|
|
444
|
+
* Setup the notes UI.
|
|
445
|
+
*/
|
|
446
|
+
function setupNotes() {
|
|
447
|
+
|
|
448
|
+
notes = document.querySelector( '.speaker-controls-notes' );
|
|
449
|
+
notesValue = document.querySelector( '.speaker-controls-notes .value' );
|
|
450
|
+
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* Create the timer and clock and start updating them
|
|
455
|
+
* at an interval.
|
|
456
|
+
*/
|
|
457
|
+
function setupTimer() {
|
|
458
|
+
|
|
459
|
+
var start = new Date(),
|
|
460
|
+
timeEl = document.querySelector( '.speaker-controls-time' ),
|
|
461
|
+
clockEl = timeEl.querySelector( '.clock-value' ),
|
|
462
|
+
hoursEl = timeEl.querySelector( '.hours-value' ),
|
|
463
|
+
minutesEl = timeEl.querySelector( '.minutes-value' ),
|
|
464
|
+
secondsEl = timeEl.querySelector( '.seconds-value' );
|
|
465
|
+
|
|
466
|
+
function _updateTimer() {
|
|
467
|
+
|
|
468
|
+
var diff, hours, minutes, seconds,
|
|
469
|
+
now = new Date();
|
|
470
|
+
|
|
471
|
+
diff = now.getTime() - start.getTime();
|
|
472
|
+
hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
|
|
473
|
+
minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
|
|
474
|
+
seconds = Math.floor( ( diff / 1000 ) % 60 );
|
|
475
|
+
|
|
476
|
+
clockEl.innerHTML = now.toLocaleTimeString( 'en-US', { hour12: true, hour: '2-digit', minute:'2-digit' } );
|
|
477
|
+
hoursEl.innerHTML = zeroPadInteger( hours );
|
|
478
|
+
hoursEl.className = hours > 0 ? '' : 'mute';
|
|
479
|
+
minutesEl.innerHTML = ':' + zeroPadInteger( minutes );
|
|
480
|
+
minutesEl.className = minutes > 0 ? '' : 'mute';
|
|
481
|
+
secondsEl.innerHTML = ':' + zeroPadInteger( seconds );
|
|
482
|
+
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
// Update once directly
|
|
486
|
+
_updateTimer();
|
|
487
|
+
|
|
488
|
+
// Then update every second
|
|
489
|
+
setInterval( _updateTimer, 1000 );
|
|
490
|
+
|
|
491
|
+
timeEl.addEventListener( 'click', function() {
|
|
492
|
+
start = new Date();
|
|
493
|
+
_updateTimer();
|
|
494
|
+
return false;
|
|
495
|
+
} );
|
|
496
|
+
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* Sets up the speaker view layout and layout selector.
|
|
501
|
+
*/
|
|
502
|
+
function setupLayout() {
|
|
503
|
+
|
|
504
|
+
layoutDropdown = document.querySelector( '.speaker-layout-dropdown' );
|
|
505
|
+
layoutLabel = document.querySelector( '.speaker-layout-label' );
|
|
506
|
+
|
|
507
|
+
// Render the list of available layouts
|
|
508
|
+
for( var id in SPEAKER_LAYOUTS ) {
|
|
509
|
+
var option = document.createElement( 'option' );
|
|
510
|
+
option.setAttribute( 'value', id );
|
|
511
|
+
option.textContent = SPEAKER_LAYOUTS[ id ];
|
|
512
|
+
layoutDropdown.appendChild( option );
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
// Monitor the dropdown for changes
|
|
516
|
+
layoutDropdown.addEventListener( 'change', function( event ) {
|
|
517
|
+
|
|
518
|
+
setLayout( layoutDropdown.value );
|
|
519
|
+
|
|
520
|
+
}, false );
|
|
521
|
+
|
|
522
|
+
// Restore any currently persisted layout
|
|
523
|
+
setLayout( getLayout() );
|
|
524
|
+
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Sets a new speaker view layout. The layout is persisted
|
|
529
|
+
* in local storage.
|
|
530
|
+
*/
|
|
531
|
+
function setLayout( value ) {
|
|
532
|
+
|
|
533
|
+
var title = SPEAKER_LAYOUTS[ value ];
|
|
534
|
+
|
|
535
|
+
layoutLabel.innerHTML = 'Layout' + ( title ? ( ': ' + title ) : '' );
|
|
536
|
+
layoutDropdown.value = value;
|
|
537
|
+
|
|
538
|
+
document.body.setAttribute( 'data-speaker-layout', value );
|
|
539
|
+
|
|
540
|
+
// Persist locally
|
|
541
|
+
if( window.localStorage ) {
|
|
542
|
+
window.localStorage.setItem( 'reveal-speaker-layout', value );
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Returns the ID of the most recently set speaker layout
|
|
549
|
+
* or our default layout if none has been set.
|
|
550
|
+
*/
|
|
551
|
+
function getLayout() {
|
|
552
|
+
|
|
553
|
+
if( window.localStorage ) {
|
|
554
|
+
var layout = window.localStorage.getItem( 'reveal-speaker-layout' );
|
|
555
|
+
if( layout ) {
|
|
556
|
+
return layout;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// Default to the first record in the layouts hash
|
|
561
|
+
for( var id in SPEAKER_LAYOUTS ) {
|
|
562
|
+
return id;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
function zeroPadInteger( num ) {
|
|
568
|
+
|
|
569
|
+
var str = '00' + parseInt( num );
|
|
570
|
+
return str.substring( str.length - 2 );
|
|
571
|
+
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Limits the frequency at which a function can be called.
|
|
576
|
+
*/
|
|
577
|
+
function debounce( fn, ms ) {
|
|
578
|
+
|
|
579
|
+
var lastTime = 0,
|
|
580
|
+
timeout;
|
|
581
|
+
|
|
582
|
+
return function() {
|
|
583
|
+
|
|
584
|
+
var args = arguments;
|
|
585
|
+
var context = this;
|
|
586
|
+
|
|
587
|
+
clearTimeout( timeout );
|
|
588
|
+
|
|
589
|
+
var timeSinceLastCall = Date.now() - lastTime;
|
|
590
|
+
if( timeSinceLastCall > ms ) {
|
|
591
|
+
fn.apply( context, args );
|
|
592
|
+
lastTime = Date.now();
|
|
593
|
+
}
|
|
594
|
+
else {
|
|
595
|
+
timeout = setTimeout( function() {
|
|
596
|
+
fn.apply( context, args );
|
|
597
|
+
lastTime = Date.now();
|
|
598
|
+
}, ms - timeSinceLastCall );
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
})();
|
|
606
|
+
|
|
607
|
+
</script>
|
|
608
|
+
</body>
|
|
609
|
+
</html>
|