jekyll-theme-newtype 0.1.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.
Files changed (142) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +66 -0
  4. data/_includes/footer.html +4 -0
  5. data/_includes/head.html +22 -0
  6. data/_includes/header.html +31 -0
  7. data/_includes/navbar.html +9 -0
  8. data/_includes/post_preview.html +10 -0
  9. data/_includes/sidebar.html +1 -0
  10. data/_layouts/category_index.html +11 -0
  11. data/_layouts/default.html +29 -0
  12. data/_layouts/home.html +7 -0
  13. data/_layouts/page.html +5 -0
  14. data/_layouts/post.html +5 -0
  15. data/_layouts/slides.html +50 -0
  16. data/_sass/newtype.scss +32 -0
  17. data/_sass/skeleton/base/_base-styles.scss +37 -0
  18. data/_sass/skeleton/base/_functions.scss +17 -0
  19. data/_sass/skeleton/base/_normalize.scss +428 -0
  20. data/_sass/skeleton/base/_typography.scss +29 -0
  21. data/_sass/skeleton/base/_utils.scss +20 -0
  22. data/_sass/skeleton/base/_variables.scss +32 -0
  23. data/_sass/skeleton/modules/_buttons.scss +147 -0
  24. data/_sass/skeleton/modules/_code.scss +18 -0
  25. data/_sass/skeleton/modules/_forms.scss +88 -0
  26. data/_sass/skeleton/modules/_grid.scss +116 -0
  27. data/_sass/skeleton/modules/_lists.scss +32 -0
  28. data/_sass/skeleton/modules/_media-queries.scss +22 -0
  29. data/_sass/skeleton/modules/_spacing.scss +26 -0
  30. data/_sass/skeleton/modules/_tables.scss +19 -0
  31. data/_sass/skeleton/normalize.scss +427 -0
  32. data/_sass/skeleton/skeleton.scss +418 -0
  33. data/_sass/syntax.scss +60 -0
  34. data/assets/bullet.svg +13 -0
  35. data/assets/revealjs/.gitignore +13 -0
  36. data/assets/revealjs/.travis.yml +7 -0
  37. data/assets/revealjs/CONTRIBUTING.md +23 -0
  38. data/assets/revealjs/Gruntfile.js +192 -0
  39. data/assets/revealjs/LICENSE +19 -0
  40. data/assets/revealjs/README.md +1238 -0
  41. data/assets/revealjs/bower.json +27 -0
  42. data/assets/revealjs/css/print/paper.css +203 -0
  43. data/assets/revealjs/css/print/pdf.css +178 -0
  44. data/assets/revealjs/css/reveal.css +1555 -0
  45. data/assets/revealjs/css/reveal.scss +1717 -0
  46. data/assets/revealjs/css/theme/README.md +21 -0
  47. data/assets/revealjs/css/theme/beige.css +268 -0
  48. data/assets/revealjs/css/theme/black.css +264 -0
  49. data/assets/revealjs/css/theme/blood.css +287 -0
  50. data/assets/revealjs/css/theme/league.css +270 -0
  51. data/assets/revealjs/css/theme/moon.css +268 -0
  52. data/assets/revealjs/css/theme/night.css +262 -0
  53. data/assets/revealjs/css/theme/serif.css +264 -0
  54. data/assets/revealjs/css/theme/simple.css +267 -0
  55. data/assets/revealjs/css/theme/sky.css +271 -0
  56. data/assets/revealjs/css/theme/solarized.css +268 -0
  57. data/assets/revealjs/css/theme/source/beige.scss +39 -0
  58. data/assets/revealjs/css/theme/source/black.scss +49 -0
  59. data/assets/revealjs/css/theme/source/blood.scss +78 -0
  60. data/assets/revealjs/css/theme/source/league.scss +34 -0
  61. data/assets/revealjs/css/theme/source/moon.scss +57 -0
  62. data/assets/revealjs/css/theme/source/night.scss +34 -0
  63. data/assets/revealjs/css/theme/source/serif.scss +35 -0
  64. data/assets/revealjs/css/theme/source/simple.scss +43 -0
  65. data/assets/revealjs/css/theme/source/sky.scss +46 -0
  66. data/assets/revealjs/css/theme/source/solarized.scss +63 -0
  67. data/assets/revealjs/css/theme/source/white.scss +49 -0
  68. data/assets/revealjs/css/theme/template/mixins.scss +29 -0
  69. data/assets/revealjs/css/theme/template/settings.scss +43 -0
  70. data/assets/revealjs/css/theme/template/theme.scss +316 -0
  71. data/assets/revealjs/css/theme/white.css +264 -0
  72. data/assets/revealjs/demo.html +410 -0
  73. data/assets/revealjs/index.html +49 -0
  74. data/assets/revealjs/js/reveal.js +5239 -0
  75. data/assets/revealjs/lib/css/zenburn.css +80 -0
  76. data/assets/revealjs/lib/font/league-gothic/LICENSE +2 -0
  77. data/assets/revealjs/lib/font/league-gothic/league-gothic.css +10 -0
  78. data/assets/revealjs/lib/font/league-gothic/league-gothic.eot +0 -0
  79. data/assets/revealjs/lib/font/league-gothic/league-gothic.ttf +0 -0
  80. data/assets/revealjs/lib/font/league-gothic/league-gothic.woff +0 -0
  81. data/assets/revealjs/lib/font/source-sans-pro/LICENSE +45 -0
  82. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.eot +0 -0
  83. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.ttf +0 -0
  84. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-italic.woff +0 -0
  85. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-regular.eot +0 -0
  86. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-regular.ttf +0 -0
  87. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-regular.woff +0 -0
  88. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-semibold.eot +0 -0
  89. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-semibold.ttf +0 -0
  90. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-semibold.woff +0 -0
  91. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-semibolditalic.eot +0 -0
  92. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-semibolditalic.ttf +0 -0
  93. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro-semibolditalic.woff +0 -0
  94. data/assets/revealjs/lib/font/source-sans-pro/source-sans-pro.css +39 -0
  95. data/assets/revealjs/lib/js/classList.js +2 -0
  96. data/assets/revealjs/lib/js/head.min.js +9 -0
  97. data/assets/revealjs/lib/js/html5shiv.js +7 -0
  98. data/assets/revealjs/package.json +43 -0
  99. data/assets/revealjs/plugin/highlight/highlight.js +77 -0
  100. data/assets/revealjs/plugin/markdown/markdown.js +412 -0
  101. data/assets/revealjs/plugin/markdown/marked.js +6 -0
  102. data/assets/revealjs/plugin/math/math.js +67 -0
  103. data/assets/revealjs/plugin/multiplex/client.js +13 -0
  104. data/assets/revealjs/plugin/multiplex/index.js +64 -0
  105. data/assets/revealjs/plugin/multiplex/master.js +34 -0
  106. data/assets/revealjs/plugin/multiplex/package.json +19 -0
  107. data/assets/revealjs/plugin/notes/notes.html +759 -0
  108. data/assets/revealjs/plugin/notes/notes.js +155 -0
  109. data/assets/revealjs/plugin/notes-server/client.js +65 -0
  110. data/assets/revealjs/plugin/notes-server/index.js +69 -0
  111. data/assets/revealjs/plugin/notes-server/notes.html +585 -0
  112. data/assets/revealjs/plugin/print-pdf/print-pdf.js +69 -0
  113. data/assets/revealjs/plugin/search/search.js +206 -0
  114. data/assets/revealjs/plugin/zoom-js/zoom.js +272 -0
  115. data/assets/revealjs/test/examples/assets/image1.png +0 -0
  116. data/assets/revealjs/test/examples/assets/image2.png +0 -0
  117. data/assets/revealjs/test/examples/barebones.html +41 -0
  118. data/assets/revealjs/test/examples/embedded-media.html +49 -0
  119. data/assets/revealjs/test/examples/math.html +185 -0
  120. data/assets/revealjs/test/examples/slide-backgrounds.html +144 -0
  121. data/assets/revealjs/test/examples/slide-transitions.html +101 -0
  122. data/assets/revealjs/test/qunit-1.12.0.css +244 -0
  123. data/assets/revealjs/test/qunit-1.12.0.js +2212 -0
  124. data/assets/revealjs/test/test-markdown-element-attributes.html +134 -0
  125. data/assets/revealjs/test/test-markdown-element-attributes.js +46 -0
  126. data/assets/revealjs/test/test-markdown-external.html +36 -0
  127. data/assets/revealjs/test/test-markdown-external.js +24 -0
  128. data/assets/revealjs/test/test-markdown-options.html +41 -0
  129. data/assets/revealjs/test/test-markdown-options.js +26 -0
  130. data/assets/revealjs/test/test-markdown-slide-attributes.html +128 -0
  131. data/assets/revealjs/test/test-markdown-slide-attributes.js +47 -0
  132. data/assets/revealjs/test/test-markdown.html +52 -0
  133. data/assets/revealjs/test/test-markdown.js +15 -0
  134. data/assets/revealjs/test/test-pdf.html +83 -0
  135. data/assets/revealjs/test/test-pdf.js +15 -0
  136. data/assets/revealjs/test/test.html +86 -0
  137. data/assets/revealjs/test/test.js +597 -0
  138. data/assets/social-github.svg +14 -0
  139. data/assets/social-twitter.png +0 -0
  140. data/assets/social-twitter.svg +12 -0
  141. data/assets/style.scss +4 -0
  142. metadata +226 -0
@@ -0,0 +1,585 @@
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
+ </style>
245
+ </head>
246
+
247
+ <body>
248
+
249
+ <div id="current-slide"></div>
250
+ <div id="upcoming-slide"><span class="overlay-element label">Upcoming</span></div>
251
+ <div id="speaker-controls">
252
+ <div class="speaker-controls-time">
253
+ <h4 class="label">Time <span class="reset-button">Click to Reset</span></h4>
254
+ <div class="clock">
255
+ <span class="clock-value">0:00 AM</span>
256
+ </div>
257
+ <div class="timer">
258
+ <span class="hours-value">00</span><span class="minutes-value">:00</span><span class="seconds-value">:00</span>
259
+ </div>
260
+ <div class="clear"></div>
261
+ </div>
262
+
263
+ <div class="speaker-controls-notes hidden">
264
+ <h4 class="label">Notes</h4>
265
+ <div class="value"></div>
266
+ </div>
267
+ </div>
268
+ <div id="speaker-layout" class="overlay-element interactive">
269
+ <span class="speaker-layout-label"></span>
270
+ <select class="speaker-layout-dropdown"></select>
271
+ </div>
272
+
273
+ <script src="/socket.io/socket.io.js"></script>
274
+ <script src="/plugin/markdown/marked.js"></script>
275
+
276
+ <script>
277
+ (function() {
278
+
279
+ var notes,
280
+ notesValue,
281
+ currentState,
282
+ currentSlide,
283
+ upcomingSlide,
284
+ layoutLabel,
285
+ layoutDropdown,
286
+ connected = false;
287
+
288
+ var socket = io.connect( window.location.origin ),
289
+ socketId = '{{socketId}}';
290
+
291
+ var SPEAKER_LAYOUTS = {
292
+ 'default': 'Default',
293
+ 'wide': 'Wide',
294
+ 'tall': 'Tall',
295
+ 'notes-only': 'Notes only'
296
+ };
297
+
298
+ socket.on( 'statechanged', function( data ) {
299
+
300
+ // ignore data from sockets that aren't ours
301
+ if( data.socketId !== socketId ) { return; }
302
+
303
+ if( connected === false ) {
304
+ connected = true;
305
+
306
+ setupKeyboard();
307
+ setupNotes();
308
+ setupTimer();
309
+
310
+ }
311
+
312
+ handleStateMessage( data );
313
+
314
+ } );
315
+
316
+ setupLayout();
317
+
318
+ // Load our presentation iframes
319
+ setupIframes();
320
+
321
+ // Once the iframes have loaded, emit a signal saying there's
322
+ // a new subscriber which will trigger a 'statechanged'
323
+ // message to be sent back
324
+ window.addEventListener( 'message', function( event ) {
325
+
326
+ var data = JSON.parse( event.data );
327
+
328
+ if( data && data.namespace === 'reveal' ) {
329
+ if( /ready/.test( data.eventName ) ) {
330
+ socket.emit( 'new-subscriber', { socketId: socketId } );
331
+ }
332
+ }
333
+
334
+ // Messages sent by reveal.js inside of the current slide preview
335
+ if( data && data.namespace === 'reveal' ) {
336
+ if( /slidechanged|fragmentshown|fragmenthidden|overviewshown|overviewhidden|paused|resumed/.test( data.eventName ) && currentState !== JSON.stringify( data.state ) ) {
337
+ socket.emit( 'statechanged-speaker', { state: data.state } );
338
+ }
339
+ }
340
+
341
+ } );
342
+
343
+ /**
344
+ * Called when the main window sends an updated state.
345
+ */
346
+ function handleStateMessage( data ) {
347
+
348
+ // Store the most recently set state to avoid circular loops
349
+ // applying the same state
350
+ currentState = JSON.stringify( data.state );
351
+
352
+ // No need for updating the notes in case of fragment changes
353
+ if ( data.notes ) {
354
+ notes.classList.remove( 'hidden' );
355
+ if( data.markdown ) {
356
+ notesValue.innerHTML = marked( data.notes );
357
+ }
358
+ else {
359
+ notesValue.innerHTML = data.notes;
360
+ }
361
+ }
362
+ else {
363
+ notes.classList.add( 'hidden' );
364
+ }
365
+
366
+ // Update the note slides
367
+ currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
368
+ upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'setState', args: [ data.state ] }), '*' );
369
+ upcomingSlide.contentWindow.postMessage( JSON.stringify({ method: 'next' }), '*' );
370
+
371
+ }
372
+
373
+ // Limit to max one state update per X ms
374
+ handleStateMessage = debounce( handleStateMessage, 200 );
375
+
376
+ /**
377
+ * Forward keyboard events to the current slide window.
378
+ * This enables keyboard events to work even if focus
379
+ * isn't set on the current slide iframe.
380
+ */
381
+ function setupKeyboard() {
382
+
383
+ document.addEventListener( 'keydown', function( event ) {
384
+ currentSlide.contentWindow.postMessage( JSON.stringify({ method: 'triggerKey', args: [ event.keyCode ] }), '*' );
385
+ } );
386
+
387
+ }
388
+
389
+ /**
390
+ * Creates the preview iframes.
391
+ */
392
+ function setupIframes() {
393
+
394
+ var params = [
395
+ 'receiver',
396
+ 'progress=false',
397
+ 'history=false',
398
+ 'transition=none',
399
+ 'backgroundTransition=none'
400
+ ].join( '&' );
401
+
402
+ var currentURL = '/?' + params + '&postMessageEvents=true';
403
+ var upcomingURL = '/?' + params + '&controls=false';
404
+
405
+ currentSlide = document.createElement( 'iframe' );
406
+ currentSlide.setAttribute( 'width', 1280 );
407
+ currentSlide.setAttribute( 'height', 1024 );
408
+ currentSlide.setAttribute( 'src', currentURL );
409
+ document.querySelector( '#current-slide' ).appendChild( currentSlide );
410
+
411
+ upcomingSlide = document.createElement( 'iframe' );
412
+ upcomingSlide.setAttribute( 'width', 640 );
413
+ upcomingSlide.setAttribute( 'height', 512 );
414
+ upcomingSlide.setAttribute( 'src', upcomingURL );
415
+ document.querySelector( '#upcoming-slide' ).appendChild( upcomingSlide );
416
+
417
+ }
418
+
419
+ /**
420
+ * Setup the notes UI.
421
+ */
422
+ function setupNotes() {
423
+
424
+ notes = document.querySelector( '.speaker-controls-notes' );
425
+ notesValue = document.querySelector( '.speaker-controls-notes .value' );
426
+
427
+ }
428
+
429
+ /**
430
+ * Create the timer and clock and start updating them
431
+ * at an interval.
432
+ */
433
+ function setupTimer() {
434
+
435
+ var start = new Date(),
436
+ timeEl = document.querySelector( '.speaker-controls-time' ),
437
+ clockEl = timeEl.querySelector( '.clock-value' ),
438
+ hoursEl = timeEl.querySelector( '.hours-value' ),
439
+ minutesEl = timeEl.querySelector( '.minutes-value' ),
440
+ secondsEl = timeEl.querySelector( '.seconds-value' );
441
+
442
+ function _updateTimer() {
443
+
444
+ var diff, hours, minutes, seconds,
445
+ now = new Date();
446
+
447
+ diff = now.getTime() - start.getTime();
448
+ hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
449
+ minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
450
+ seconds = Math.floor( ( diff / 1000 ) % 60 );
451
+
452
+ clockEl.innerHTML = now.toLocaleTimeString( 'en-US', { hour12: true, hour: '2-digit', minute:'2-digit' } );
453
+ hoursEl.innerHTML = zeroPadInteger( hours );
454
+ hoursEl.className = hours > 0 ? '' : 'mute';
455
+ minutesEl.innerHTML = ':' + zeroPadInteger( minutes );
456
+ minutesEl.className = minutes > 0 ? '' : 'mute';
457
+ secondsEl.innerHTML = ':' + zeroPadInteger( seconds );
458
+
459
+ }
460
+
461
+ // Update once directly
462
+ _updateTimer();
463
+
464
+ // Then update every second
465
+ setInterval( _updateTimer, 1000 );
466
+
467
+ timeEl.addEventListener( 'click', function() {
468
+ start = new Date();
469
+ _updateTimer();
470
+ return false;
471
+ } );
472
+
473
+ }
474
+
475
+ /**
476
+ * Sets up the speaker view layout and layout selector.
477
+ */
478
+ function setupLayout() {
479
+
480
+ layoutDropdown = document.querySelector( '.speaker-layout-dropdown' );
481
+ layoutLabel = document.querySelector( '.speaker-layout-label' );
482
+
483
+ // Render the list of available layouts
484
+ for( var id in SPEAKER_LAYOUTS ) {
485
+ var option = document.createElement( 'option' );
486
+ option.setAttribute( 'value', id );
487
+ option.textContent = SPEAKER_LAYOUTS[ id ];
488
+ layoutDropdown.appendChild( option );
489
+ }
490
+
491
+ // Monitor the dropdown for changes
492
+ layoutDropdown.addEventListener( 'change', function( event ) {
493
+
494
+ setLayout( layoutDropdown.value );
495
+
496
+ }, false );
497
+
498
+ // Restore any currently persisted layout
499
+ setLayout( getLayout() );
500
+
501
+ }
502
+
503
+ /**
504
+ * Sets a new speaker view layout. The layout is persisted
505
+ * in local storage.
506
+ */
507
+ function setLayout( value ) {
508
+
509
+ var title = SPEAKER_LAYOUTS[ value ];
510
+
511
+ layoutLabel.innerHTML = 'Layout' + ( title ? ( ': ' + title ) : '' );
512
+ layoutDropdown.value = value;
513
+
514
+ document.body.setAttribute( 'data-speaker-layout', value );
515
+
516
+ // Persist locally
517
+ if( window.localStorage ) {
518
+ window.localStorage.setItem( 'reveal-speaker-layout', value );
519
+ }
520
+
521
+ }
522
+
523
+ /**
524
+ * Returns the ID of the most recently set speaker layout
525
+ * or our default layout if none has been set.
526
+ */
527
+ function getLayout() {
528
+
529
+ if( window.localStorage ) {
530
+ var layout = window.localStorage.getItem( 'reveal-speaker-layout' );
531
+ if( layout ) {
532
+ return layout;
533
+ }
534
+ }
535
+
536
+ // Default to the first record in the layouts hash
537
+ for( var id in SPEAKER_LAYOUTS ) {
538
+ return id;
539
+ }
540
+
541
+ }
542
+
543
+ function zeroPadInteger( num ) {
544
+
545
+ var str = '00' + parseInt( num );
546
+ return str.substring( str.length - 2 );
547
+
548
+ }
549
+
550
+ /**
551
+ * Limits the frequency at which a function can be called.
552
+ */
553
+ function debounce( fn, ms ) {
554
+
555
+ var lastTime = 0,
556
+ timeout;
557
+
558
+ return function() {
559
+
560
+ var args = arguments;
561
+ var context = this;
562
+
563
+ clearTimeout( timeout );
564
+
565
+ var timeSinceLastCall = Date.now() - lastTime;
566
+ if( timeSinceLastCall > ms ) {
567
+ fn.apply( context, args );
568
+ lastTime = Date.now();
569
+ }
570
+ else {
571
+ timeout = setTimeout( function() {
572
+ fn.apply( context, args );
573
+ lastTime = Date.now();
574
+ }, ms - timeSinceLastCall );
575
+ }
576
+
577
+ }
578
+
579
+ }
580
+
581
+ })();
582
+ </script>
583
+
584
+ </body>
585
+ </html>
@@ -0,0 +1,69 @@
1
+ /**
2
+ * phantomjs script for printing presentations to PDF.
3
+ *
4
+ * Example:
5
+ * phantomjs print-pdf.js "http://revealjs.com?print-pdf" reveal-demo.pdf
6
+ *
7
+ * @author Manuel Bieh (https://github.com/manuelbieh)
8
+ * @author Hakim El Hattab (https://github.com/hakimel)
9
+ * @author Manuel Riezebosch (https://github.com/riezebosch)
10
+ */
11
+
12
+ // html2pdf.js
13
+ var system = require( 'system' );
14
+
15
+ var probePage = new WebPage();
16
+ var printPage = new WebPage();
17
+
18
+ var inputFile = system.args[1] || 'index.html?print-pdf';
19
+ var outputFile = system.args[2] || 'slides.pdf';
20
+
21
+ if( outputFile.match( /\.pdf$/gi ) === null ) {
22
+ outputFile += '.pdf';
23
+ }
24
+
25
+ console.log( 'Export PDF: Reading reveal.js config [1/4]' );
26
+
27
+ probePage.open( inputFile, function( status ) {
28
+
29
+ console.log( 'Export PDF: Preparing print layout [2/4]' );
30
+
31
+ var config = probePage.evaluate( function() {
32
+ return Reveal.getConfig();
33
+ } );
34
+
35
+ if( config ) {
36
+
37
+ printPage.paperSize = {
38
+ width: Math.floor( config.width * ( 1 + config.margin ) ),
39
+ height: Math.floor( config.height * ( 1 + config.margin ) ),
40
+ border: 0
41
+ };
42
+
43
+ printPage.open( inputFile, function( status ) {
44
+ console.log( 'Export PDF: Preparing pdf [3/4]')
45
+ printPage.evaluate(function() {
46
+ Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom );
47
+ });
48
+ } );
49
+
50
+ printPage.onCallback = function(data) {
51
+ // For some reason we need to "jump the queue" for syntax highlighting to work.
52
+ // See: http://stackoverflow.com/a/3580132/129269
53
+ setTimeout(function() {
54
+ console.log( 'Export PDF: Writing file [4/4]' );
55
+ printPage.render( outputFile );
56
+ console.log( 'Export PDF: Finished successfully!' );
57
+ phantom.exit();
58
+ }, 0);
59
+ };
60
+ }
61
+ else {
62
+
63
+ console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' );
64
+ phantom.exit(1);
65
+
66
+ }
67
+ } );
68
+
69
+