slippery 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -0
  3. data/assets/deck.js/core/deck.core.css +60 -0
  4. data/assets/deck.js/core/deck.core.js +728 -0
  5. data/assets/deck.js/core/deck.core.scss +65 -0
  6. data/assets/deck.js/core/print.css +25 -0
  7. data/assets/deck.js/core/print.scss +14 -0
  8. data/assets/deck.js/css/common.css +216 -0
  9. data/assets/deck.js/css/common.scss +233 -0
  10. data/assets/deck.js/css/home.css +790 -0
  11. data/assets/deck.js/css/home.scss +892 -0
  12. data/assets/deck.js/extensions/goto/deck.goto.css +36 -0
  13. data/assets/deck.js/extensions/goto/deck.goto.html +7 -0
  14. data/assets/deck.js/extensions/goto/deck.goto.js +190 -0
  15. data/assets/deck.js/extensions/goto/deck.goto.scss +39 -0
  16. data/assets/deck.js/extensions/hash/deck.hash.css +13 -0
  17. data/assets/deck.js/extensions/hash/deck.hash.html +2 -0
  18. data/assets/deck.js/extensions/hash/deck.hash.js +145 -0
  19. data/assets/deck.js/extensions/hash/deck.hash.scss +13 -0
  20. data/assets/deck.js/extensions/menu/deck.menu.css +45 -0
  21. data/assets/deck.js/extensions/menu/deck.menu.js +225 -0
  22. data/assets/deck.js/extensions/menu/deck.menu.scss +55 -0
  23. data/assets/deck.js/extensions/navigation/deck.navigation.css +42 -0
  24. data/assets/deck.js/extensions/navigation/deck.navigation.html +5 -0
  25. data/assets/deck.js/extensions/navigation/deck.navigation.js +94 -0
  26. data/assets/deck.js/extensions/navigation/deck.navigation.scss +44 -0
  27. data/assets/deck.js/extensions/scale/deck.scale.css +20 -0
  28. data/assets/deck.js/extensions/scale/deck.scale.js +190 -0
  29. data/assets/deck.js/extensions/scale/deck.scale.scss +22 -0
  30. data/assets/deck.js/extensions/status/deck.status.css +18 -0
  31. data/assets/deck.js/extensions/status/deck.status.html +6 -0
  32. data/assets/deck.js/extensions/status/deck.status.js +108 -0
  33. data/assets/deck.js/extensions/status/deck.status.scss +18 -0
  34. data/assets/deck.js/modernizr.custom.js +4 -0
  35. data/assets/deck.js/themes/style/_reset.scss +300 -0
  36. data/assets/deck.js/themes/style/neon.css +421 -0
  37. data/assets/deck.js/themes/style/neon.scss +148 -0
  38. data/assets/deck.js/themes/style/swiss.css +389 -0
  39. data/assets/deck.js/themes/style/swiss.scss +109 -0
  40. data/assets/deck.js/themes/style/web-2.0.css +500 -0
  41. data/assets/deck.js/themes/style/web-2.0.scss +228 -0
  42. data/assets/deck.js/themes/transition/fade.css +35 -0
  43. data/assets/deck.js/themes/transition/fade.scss +59 -0
  44. data/assets/deck.js/themes/transition/horizontal-slide.css +53 -0
  45. data/assets/deck.js/themes/transition/horizontal-slide.scss +72 -0
  46. data/assets/deck.js/themes/transition/vertical-slide.css +67 -0
  47. data/assets/deck.js/themes/transition/vertical-slide.scss +92 -0
  48. data/assets/highlight.js/CHANGES.md +953 -0
  49. data/assets/highlight.js/LICENSE +24 -0
  50. data/assets/highlight.js/README.md +101 -0
  51. data/assets/highlight.js/README.ru.md +101 -0
  52. data/assets/highlight.js/highlight-0.8.default.min.css +1 -0
  53. data/assets/highlight.js/highlight-0.8.min.js +1 -0
  54. data/assets/highlight.js/highlight.pack.js +1 -0
  55. data/assets/highlight.js/styles/arta.css +141 -0
  56. data/assets/highlight.js/styles/ascetic.css +53 -0
  57. data/assets/highlight.js/styles/atelier-dune.dark.css +95 -0
  58. data/assets/highlight.js/styles/atelier-dune.light.css +95 -0
  59. data/assets/highlight.js/styles/atelier-forest.dark.css +95 -0
  60. data/assets/highlight.js/styles/atelier-forest.light.css +95 -0
  61. data/assets/highlight.js/styles/atelier-heath.dark.css +95 -0
  62. data/assets/highlight.js/styles/atelier-heath.light.css +95 -0
  63. data/assets/highlight.js/styles/atelier-lakeside.dark.css +95 -0
  64. data/assets/highlight.js/styles/atelier-lakeside.light.css +95 -0
  65. data/assets/highlight.js/styles/atelier-seaside.dark.css +95 -0
  66. data/assets/highlight.js/styles/atelier-seaside.light.css +95 -0
  67. data/assets/highlight.js/styles/brown_paper.css +105 -0
  68. data/assets/highlight.js/styles/brown_papersq.png +0 -0
  69. data/assets/highlight.js/styles/codepen-embed.css +108 -0
  70. data/assets/highlight.js/styles/color-brewer.css +169 -0
  71. data/assets/highlight.js/styles/dark.css +105 -0
  72. data/assets/highlight.js/styles/default.css +153 -0
  73. data/assets/highlight.js/styles/docco.css +136 -0
  74. data/assets/highlight.js/styles/far.css +112 -0
  75. data/assets/highlight.js/styles/foundation.css +136 -0
  76. data/assets/highlight.js/styles/github.css +127 -0
  77. data/assets/highlight.js/styles/googlecode.css +148 -0
  78. data/assets/highlight.js/styles/hybrid.css +171 -0
  79. data/assets/highlight.js/styles/idea.css +126 -0
  80. data/assets/highlight.js/styles/ir_black.css +110 -0
  81. data/assets/highlight.js/styles/kimbie.dark.css +96 -0
  82. data/assets/highlight.js/styles/kimbie.light.css +96 -0
  83. data/assets/highlight.js/styles/magula.css +122 -0
  84. data/assets/highlight.js/styles/mono-blue.css +70 -0
  85. data/assets/highlight.js/styles/monokai.css +127 -0
  86. data/assets/highlight.js/styles/monokai_sublime.css +148 -0
  87. data/assets/highlight.js/styles/obsidian.css +154 -0
  88. data/assets/highlight.js/styles/paraiso.dark.css +95 -0
  89. data/assets/highlight.js/styles/paraiso.light.css +95 -0
  90. data/assets/highlight.js/styles/pojoaque.css +108 -0
  91. data/assets/highlight.js/styles/pojoaque.jpg +0 -0
  92. data/assets/highlight.js/styles/railscasts.css +185 -0
  93. data/assets/highlight.js/styles/rainbow.css +109 -0
  94. data/assets/highlight.js/styles/school_book.css +113 -0
  95. data/assets/highlight.js/styles/school_book.png +0 -0
  96. data/assets/highlight.js/styles/solarized_dark.css +109 -0
  97. data/assets/highlight.js/styles/solarized_light.css +109 -0
  98. data/assets/highlight.js/styles/sunburst.css +165 -0
  99. data/assets/highlight.js/styles/tomorrow-night-blue.css +95 -0
  100. data/assets/highlight.js/styles/tomorrow-night-bright.css +94 -0
  101. data/assets/highlight.js/styles/tomorrow-night-eighties.css +94 -0
  102. data/assets/highlight.js/styles/tomorrow-night.css +95 -0
  103. data/assets/highlight.js/styles/tomorrow.css +92 -0
  104. data/assets/highlight.js/styles/vs.css +94 -0
  105. data/assets/highlight.js/styles/xcode.css +159 -0
  106. data/assets/highlight.js/styles/zenburn.css +119 -0
  107. data/assets/jquery/jquery-2.1.0.min.js +4 -0
  108. data/assets/reveal.js/css/print/paper.css +1 -1
  109. data/assets/reveal.js/css/print/pdf.css +2 -2
  110. data/assets/reveal.js/css/reveal.css +372 -108
  111. data/assets/reveal.js/css/reveal.min.css +2 -2
  112. data/assets/reveal.js/css/theme/README.md +3 -1
  113. data/assets/reveal.js/css/theme/beige.css +7 -1
  114. data/assets/reveal.js/css/theme/blood.css +175 -0
  115. data/assets/reveal.js/css/theme/default.css +7 -1
  116. data/assets/reveal.js/css/theme/moon.css +7 -1
  117. data/assets/reveal.js/css/theme/night.css +7 -1
  118. data/assets/reveal.js/css/theme/serif.css +7 -1
  119. data/assets/reveal.js/css/theme/simple.css +7 -1
  120. data/assets/reveal.js/css/theme/sky.css +7 -1
  121. data/assets/reveal.js/css/theme/solarized.css +7 -1
  122. data/assets/reveal.js/css/theme/source/blood.scss +91 -0
  123. data/assets/reveal.js/css/theme/template/settings.scss +1 -0
  124. data/assets/reveal.js/css/theme/template/theme.scss +9 -2
  125. data/assets/reveal.js/js/reveal.js +1238 -433
  126. data/assets/reveal.js/js/reveal.min.js +4 -3
  127. data/assets/reveal.js/lib/css/zenburn.css +16 -17
  128. data/assets/reveal.js/plugin/highlight/highlight.js +3 -2
  129. data/assets/reveal.js/plugin/leap/leap.js +3 -0
  130. data/assets/reveal.js/plugin/markdown/example.html +37 -5
  131. data/assets/reveal.js/plugin/markdown/example.md +2 -0
  132. data/assets/reveal.js/plugin/markdown/markdown.js +373 -171
  133. data/assets/reveal.js/plugin/math/math.js +64 -0
  134. data/assets/reveal.js/plugin/multiplex/master.js +2 -1
  135. data/assets/reveal.js/plugin/notes/notes.html +33 -19
  136. data/assets/reveal.js/plugin/notes/notes.js +25 -47
  137. data/assets/reveal.js/plugin/remotes/remotes.js +4 -4
  138. data/assets/reveal.js/plugin/zoom-js/zoom.js +3 -1
  139. data/assets/reveal.old/css/print/paper.css +176 -0
  140. data/assets/reveal.old/css/print/pdf.css +190 -0
  141. data/assets/reveal.old/css/reveal.css +1616 -0
  142. data/assets/reveal.old/css/reveal.min.css +7 -0
  143. data/assets/reveal.old/css/theme/README.md +23 -0
  144. data/assets/reveal.old/css/theme/beige.css +142 -0
  145. data/assets/reveal.old/css/theme/default.css +142 -0
  146. data/assets/reveal.old/css/theme/moon.css +142 -0
  147. data/assets/reveal.old/css/theme/night.css +130 -0
  148. data/assets/reveal.old/css/theme/serif.css +132 -0
  149. data/assets/reveal.old/css/theme/simple.css +132 -0
  150. data/assets/reveal.old/css/theme/sky.css +139 -0
  151. data/assets/reveal.old/css/theme/solarized.css +142 -0
  152. data/assets/reveal.old/css/theme/source/beige.scss +50 -0
  153. data/assets/reveal.old/css/theme/source/default.scss +42 -0
  154. data/assets/reveal.old/css/theme/source/moon.scss +68 -0
  155. data/assets/reveal.old/css/theme/source/night.scss +35 -0
  156. data/assets/reveal.old/css/theme/source/serif.scss +35 -0
  157. data/assets/reveal.old/css/theme/source/simple.scss +38 -0
  158. data/assets/reveal.old/css/theme/source/sky.scss +46 -0
  159. data/assets/reveal.old/css/theme/source/solarized.scss +74 -0
  160. data/assets/reveal.old/css/theme/template/mixins.scss +29 -0
  161. data/assets/reveal.old/css/theme/template/settings.scss +33 -0
  162. data/assets/reveal.old/css/theme/template/theme.scss +163 -0
  163. data/assets/{reveal.js → reveal.old}/js/head.min.js +0 -0
  164. data/assets/reveal.old/js/reveal.js +2577 -0
  165. data/assets/reveal.old/js/reveal.min.js +8 -0
  166. data/assets/reveal.old/lib/css/zenburn.css +115 -0
  167. data/assets/reveal.old/lib/font/league_gothic-webfont.eot +0 -0
  168. data/assets/reveal.old/lib/font/league_gothic-webfont.svg +230 -0
  169. data/assets/reveal.old/lib/font/league_gothic-webfont.ttf +0 -0
  170. data/assets/reveal.old/lib/font/league_gothic-webfont.woff +0 -0
  171. data/assets/reveal.old/lib/font/league_gothic_license +2 -0
  172. data/assets/reveal.old/lib/js/classList.js +2 -0
  173. data/assets/reveal.old/lib/js/head.min.js +8 -0
  174. data/assets/reveal.old/lib/js/html5shiv.js +7 -0
  175. data/assets/reveal.old/plugin/highlight/highlight.js +31 -0
  176. data/assets/reveal.old/plugin/leap/leap.js +154 -0
  177. data/assets/reveal.old/plugin/markdown/example.html +97 -0
  178. data/assets/reveal.old/plugin/markdown/example.md +29 -0
  179. data/assets/reveal.old/plugin/markdown/markdown.js +190 -0
  180. data/assets/reveal.old/plugin/markdown/marked.js +37 -0
  181. data/assets/reveal.old/plugin/multiplex/client.js +13 -0
  182. data/assets/reveal.old/plugin/multiplex/index.js +56 -0
  183. data/assets/reveal.old/plugin/multiplex/master.js +50 -0
  184. data/assets/reveal.old/plugin/notes-server/client.js +57 -0
  185. data/assets/reveal.old/plugin/notes-server/index.js +59 -0
  186. data/assets/reveal.old/plugin/notes-server/notes.html +142 -0
  187. data/assets/reveal.old/plugin/notes/notes.html +253 -0
  188. data/assets/reveal.old/plugin/notes/notes.js +100 -0
  189. data/assets/reveal.old/plugin/postmessage/example.html +39 -0
  190. data/assets/reveal.old/plugin/postmessage/postmessage.js +42 -0
  191. data/assets/reveal.old/plugin/print-pdf/print-pdf.js +44 -0
  192. data/assets/reveal.old/plugin/remotes/remotes.js +39 -0
  193. data/assets/reveal.old/plugin/search/search.js +196 -0
  194. data/assets/reveal.old/plugin/zoom-js/zoom.js +256 -0
  195. data/bin/slippery +1 -0
  196. data/code_of_conduct.md +32 -0
  197. data/lib/slippery.rb +5 -3
  198. data/lib/slippery/document.rb +2 -2
  199. data/lib/slippery/presentation.rb +10 -1
  200. data/lib/slippery/processor.rb +18 -0
  201. data/lib/slippery/processor_helpers.rb +16 -2
  202. data/lib/slippery/processors/add_highlight.rb +9 -2
  203. data/lib/slippery/processors/deck_js.rb +81 -0
  204. data/lib/slippery/processors/fathom_js.rb +31 -0
  205. data/lib/slippery/processors/impress_js/add_impress_js.rb +2 -2
  206. data/lib/slippery/processors/jquery.rb +12 -0
  207. data/lib/slippery/processors/reveal_js/add_reveal_js.rb +12 -9
  208. data/lib/slippery/rake_tasks.rb +59 -31
  209. data/lib/slippery/version.rb +1 -1
  210. data/slippery.gemspec +5 -4
  211. metadata +215 -33
  212. data/lib/slippery/converter.rb +0 -132
@@ -0,0 +1,57 @@
1
+ (function() {
2
+ // don't emit events from inside the previews themselves
3
+ if ( window.location.search.match( /receiver/gi ) ) { return; }
4
+
5
+ var socket = io.connect(window.location.origin);
6
+ var socketId = Math.random().toString().slice(2);
7
+
8
+ console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId);
9
+ window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId);
10
+
11
+ // Fires when a fragment is shown
12
+ Reveal.addEventListener( 'fragmentshown', function( event ) {
13
+ var fragmentData = {
14
+ fragment : 'next',
15
+ socketId : socketId
16
+ };
17
+ socket.emit('fragmentchanged', fragmentData);
18
+ } );
19
+
20
+ // Fires when a fragment is hidden
21
+ Reveal.addEventListener( 'fragmenthidden', function( event ) {
22
+ var fragmentData = {
23
+ fragment : 'previous',
24
+ socketId : socketId
25
+ };
26
+ socket.emit('fragmentchanged', fragmentData);
27
+ } );
28
+
29
+ // Fires when slide is changed
30
+ Reveal.addEventListener( 'slidechanged', function( event ) {
31
+ var nextindexh;
32
+ var nextindexv;
33
+ var slideElement = event.currentSlide;
34
+
35
+ if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') {
36
+ nextindexh = event.indexh;
37
+ nextindexv = event.indexv + 1;
38
+ } else {
39
+ nextindexh = event.indexh + 1;
40
+ nextindexv = 0;
41
+ }
42
+
43
+ var notes = slideElement.querySelector('aside.notes');
44
+ var slideData = {
45
+ notes : notes ? notes.innerHTML : '',
46
+ indexh : event.indexh,
47
+ indexv : event.indexv,
48
+ nextindexh : nextindexh,
49
+ nextindexv : nextindexv,
50
+ socketId : socketId,
51
+ markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false
52
+
53
+ };
54
+
55
+ socket.emit('slidechanged', slideData);
56
+ } );
57
+ }());
@@ -0,0 +1,59 @@
1
+ var express = require('express');
2
+ var fs = require('fs');
3
+ var io = require('socket.io');
4
+ var _ = require('underscore');
5
+ var Mustache = require('mustache');
6
+
7
+ var app = express.createServer();
8
+ var staticDir = express.static;
9
+
10
+ io = io.listen(app);
11
+
12
+ var opts = {
13
+ port : 1947,
14
+ baseDir : __dirname + '/../../'
15
+ };
16
+
17
+ io.sockets.on('connection', function(socket) {
18
+ socket.on('slidechanged', function(slideData) {
19
+ socket.broadcast.emit('slidedata', slideData);
20
+ });
21
+ socket.on('fragmentchanged', function(fragmentData) {
22
+ socket.broadcast.emit('fragmentdata', fragmentData);
23
+ });
24
+ });
25
+
26
+ app.configure(function() {
27
+ [ 'css', 'js', 'images', 'plugin', 'lib' ].forEach(function(dir) {
28
+ app.use('/' + dir, staticDir(opts.baseDir + dir));
29
+ });
30
+ });
31
+
32
+ app.get("/", function(req, res) {
33
+ res.writeHead(200, {'Content-Type': 'text/html'});
34
+ fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
35
+ });
36
+
37
+ app.get("/notes/:socketId", function(req, res) {
38
+
39
+ fs.readFile(opts.baseDir + 'plugin/notes-server/notes.html', function(err, data) {
40
+ res.send(Mustache.to_html(data.toString(), {
41
+ socketId : req.params.socketId
42
+ }));
43
+ });
44
+ // fs.createReadStream(opts.baseDir + 'notes-server/notes.html').pipe(res);
45
+ });
46
+
47
+ // Actually listen
48
+ app.listen(opts.port || null);
49
+
50
+ var brown = '\033[33m',
51
+ green = '\033[32m',
52
+ reset = '\033[0m';
53
+
54
+ var slidesLocation = "http://localhost" + ( opts.port ? ( ':' + opts.port ) : '' );
55
+
56
+ console.log( brown + "reveal.js - Speaker Notes" + reset );
57
+ console.log( "1. Open the slides at " + green + slidesLocation + reset );
58
+ console.log( "2. Click on the link your JS console to go to the notes page" );
59
+ console.log( "3. Advance through your slides and your notes will advance automatically" );
@@ -0,0 +1,142 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+
6
+ <meta name="viewport" content="width=1150">
7
+
8
+ <title>reveal.js - Slide Notes</title>
9
+
10
+ <style>
11
+ body {
12
+ font-family: Helvetica;
13
+ }
14
+
15
+ #notes {
16
+ font-size: 24px;
17
+ width: 640px;
18
+ margin-top: 5px;
19
+ clear: left;
20
+ }
21
+
22
+ #wrap-current-slide {
23
+ width: 640px;
24
+ height: 512px;
25
+ float: left;
26
+ overflow: hidden;
27
+ }
28
+
29
+ #current-slide {
30
+ width: 1280px;
31
+ height: 1024px;
32
+ border: none;
33
+
34
+ -webkit-transform-origin: 0 0;
35
+ -moz-transform-origin: 0 0;
36
+ -ms-transform-origin: 0 0;
37
+ -o-transform-origin: 0 0;
38
+ transform-origin: 0 0;
39
+
40
+ -webkit-transform: scale(0.5);
41
+ -moz-transform: scale(0.5);
42
+ -ms-transform: scale(0.5);
43
+ -o-transform: scale(0.5);
44
+ transform: scale(0.5);
45
+ }
46
+
47
+ #wrap-next-slide {
48
+ width: 448px;
49
+ height: 358px;
50
+ float: left;
51
+ margin: 0 0 0 10px;
52
+ overflow: hidden;
53
+ }
54
+
55
+ #next-slide {
56
+ width: 1280px;
57
+ height: 1024px;
58
+ border: none;
59
+
60
+ -webkit-transform-origin: 0 0;
61
+ -moz-transform-origin: 0 0;
62
+ -ms-transform-origin: 0 0;
63
+ -o-transform-origin: 0 0;
64
+ transform-origin: 0 0;
65
+
66
+ -webkit-transform: scale(0.35);
67
+ -moz-transform: scale(0.35);
68
+ -ms-transform: scale(0.35);
69
+ -o-transform: scale(0.35);
70
+ transform: scale(0.35);
71
+ }
72
+
73
+ .slides {
74
+ position: relative;
75
+ margin-bottom: 10px;
76
+ border: 1px solid black;
77
+ border-radius: 2px;
78
+ background: rgb(28, 30, 32);
79
+ }
80
+
81
+ .slides span {
82
+ position: absolute;
83
+ top: 3px;
84
+ left: 3px;
85
+ font-weight: bold;
86
+ font-size: 14px;
87
+ color: rgba( 255, 255, 255, 0.9 );
88
+ }
89
+ </style>
90
+ </head>
91
+
92
+ <body>
93
+
94
+ <div id="wrap-current-slide" class="slides">
95
+ <iframe src="/?receiver" width="1280" height="1024" id="current-slide"></iframe>
96
+ </div>
97
+
98
+ <div id="wrap-next-slide" class="slides">
99
+ <iframe src="/?receiver" width="640" height="512" id="next-slide"></iframe>
100
+ <span>UPCOMING:</span>
101
+ </div>
102
+ <div id="notes"></div>
103
+
104
+ <script src="/socket.io/socket.io.js"></script>
105
+ <script src="/plugin/markdown/marked.js"></script>
106
+
107
+ <script>
108
+ var socketId = '{{socketId}}';
109
+ var socket = io.connect(window.location.origin);
110
+ var notes = document.getElementById('notes');
111
+ var currentSlide = document.getElementById('current-slide');
112
+ var nextSlide = document.getElementById('next-slide');
113
+
114
+ socket.on('slidedata', function(data) {
115
+ // ignore data from sockets that aren't ours
116
+ if (data.socketId !== socketId) { return; }
117
+
118
+ if (data.markdown) {
119
+ notes.innerHTML = marked(data.notes);
120
+ }
121
+ else {
122
+ notes.innerHTML = data.notes;
123
+ }
124
+
125
+ currentSlide.contentWindow.Reveal.slide(data.indexh, data.indexv);
126
+ nextSlide.contentWindow.Reveal.slide(data.nextindexh, data.nextindexv);
127
+ });
128
+ socket.on('fragmentdata', function(data) {
129
+ // ignore data from sockets that aren't ours
130
+ if (data.socketId !== socketId) { return; }
131
+
132
+ if (data.fragment === 'next') {
133
+ currentSlide.contentWindow.Reveal.nextFragment();
134
+ }
135
+ else if (data.fragment === 'previous') {
136
+ currentSlide.contentWindow.Reveal.prevFragment();
137
+ }
138
+ });
139
+ </script>
140
+
141
+ </body>
142
+ </html>
@@ -0,0 +1,253 @@
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
+ }
12
+
13
+ #notes {
14
+ font-size: 24px;
15
+ width: 640px;
16
+ margin-top: 5px;
17
+ clear: left;
18
+ }
19
+
20
+ #wrap-current-slide {
21
+ width: 640px;
22
+ height: 512px;
23
+ float: left;
24
+ overflow: hidden;
25
+ }
26
+
27
+ #current-slide {
28
+ width: 1280px;
29
+ height: 1024px;
30
+ border: none;
31
+
32
+ -webkit-transform-origin: 0 0;
33
+ -moz-transform-origin: 0 0;
34
+ -ms-transform-origin: 0 0;
35
+ -o-transform-origin: 0 0;
36
+ transform-origin: 0 0;
37
+
38
+ -webkit-transform: scale(0.5);
39
+ -moz-transform: scale(0.5);
40
+ -ms-transform: scale(0.5);
41
+ -o-transform: scale(0.5);
42
+ transform: scale(0.5);
43
+ }
44
+
45
+ #wrap-next-slide {
46
+ width: 448px;
47
+ height: 358px;
48
+ float: left;
49
+ margin: 0 0 0 10px;
50
+ overflow: hidden;
51
+ }
52
+
53
+ #next-slide {
54
+ width: 1280px;
55
+ height: 1024px;
56
+ border: none;
57
+
58
+ -webkit-transform-origin: 0 0;
59
+ -moz-transform-origin: 0 0;
60
+ -ms-transform-origin: 0 0;
61
+ -o-transform-origin: 0 0;
62
+ transform-origin: 0 0;
63
+
64
+ -webkit-transform: scale(0.35);
65
+ -moz-transform: scale(0.35);
66
+ -ms-transform: scale(0.35);
67
+ -o-transform: scale(0.35);
68
+ transform: scale(0.35);
69
+ }
70
+
71
+ .slides {
72
+ position: relative;
73
+ margin-bottom: 10px;
74
+ border: 1px solid black;
75
+ border-radius: 2px;
76
+ background: rgb(28, 30, 32);
77
+ }
78
+
79
+ .slides span {
80
+ position: absolute;
81
+ top: 3px;
82
+ left: 3px;
83
+ font-weight: bold;
84
+ font-size: 14px;
85
+ color: rgba( 255, 255, 255, 0.9 );
86
+ }
87
+
88
+ .error {
89
+ font-weight: bold;
90
+ color: red;
91
+ font-size: 1.5em;
92
+ text-align: center;
93
+ margin-top: 10%;
94
+ }
95
+
96
+ .error code {
97
+ font-family: monospace;
98
+ }
99
+
100
+ .time {
101
+ width: 448px;
102
+ margin: 30px 0 0 10px;
103
+ float: left;
104
+ text-align: center;
105
+ opacity: 0;
106
+
107
+ -webkit-transition: opacity 0.4s;
108
+ -moz-transition: opacity 0.4s;
109
+ -o-transition: opacity 0.4s;
110
+ transition: opacity 0.4s;
111
+ }
112
+
113
+ .elapsed,
114
+ .clock {
115
+ color: #333;
116
+ font-size: 2em;
117
+ text-align: center;
118
+ display: inline-block;
119
+ padding: 0.5em;
120
+ background-color: #eee;
121
+ border-radius: 10px;
122
+ }
123
+
124
+ .elapsed h2,
125
+ .clock h2 {
126
+ font-size: 0.8em;
127
+ line-height: 100%;
128
+ margin: 0;
129
+ color: #aaa;
130
+ }
131
+
132
+ .elapsed .mute {
133
+ color: #ddd;
134
+ }
135
+
136
+ </style>
137
+ </head>
138
+
139
+ <body>
140
+
141
+ <div id="wrap-current-slide" class="slides">
142
+ <script>document.write( '<iframe width="1280" height="1024" id="current-slide" src="'+ window.opener.location.href +'"></iframe>' );</script>
143
+ </div>
144
+
145
+ <div id="wrap-next-slide" class="slides">
146
+ <script>document.write( '<iframe width="640" height="512" id="next-slide" src="'+ window.opener.location.href +'"></iframe>' );</script>
147
+ <span>UPCOMING:</span>
148
+ </div>
149
+
150
+ <div class="time">
151
+ <div class="clock">
152
+ <h2>Time</h2>
153
+ <span id="clock">0:00:00 AM</span>
154
+ </div>
155
+ <div class="elapsed">
156
+ <h2>Elapsed</h2>
157
+ <span id="hours">00</span><span id="minutes">:00</span><span id="seconds">:00</span>
158
+ </div>
159
+ </div>
160
+
161
+ <div id="notes"></div>
162
+
163
+ <script src="../../plugin/markdown/marked.js"></script>
164
+ <script>
165
+
166
+ window.addEventListener( 'load', function() {
167
+
168
+ if( window.opener && window.opener.location && window.opener.location.href ) {
169
+
170
+ var notes = document.getElementById( 'notes' ),
171
+ currentSlide = document.getElementById( 'current-slide' ),
172
+ nextSlide = document.getElementById( 'next-slide' );
173
+
174
+ window.addEventListener( 'message', function( event ) {
175
+ var data = JSON.parse( event.data );
176
+ // No need for updating the notes in case of fragment changes
177
+ if ( data.notes !== undefined) {
178
+ if( data.markdown ) {
179
+ notes.innerHTML = marked( data.notes );
180
+ }
181
+ else {
182
+ notes.innerHTML = data.notes;
183
+ }
184
+ }
185
+
186
+ // Showing and hiding fragments
187
+ if( data.fragment === 'next' ) {
188
+ currentSlide.contentWindow.Reveal.nextFragment();
189
+ }
190
+ else if( data.fragment === 'prev' ) {
191
+ currentSlide.contentWindow.Reveal.prevFragment();
192
+ }
193
+ else {
194
+ // Update the note slides
195
+ currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv );
196
+ nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv );
197
+ }
198
+
199
+ }, false );
200
+
201
+ var start = new Date(),
202
+ timeEl = document.querySelector( '.time' ),
203
+ clockEl = document.getElementById( 'clock' ),
204
+ hoursEl = document.getElementById( 'hours' ),
205
+ minutesEl = document.getElementById( 'minutes' ),
206
+ secondsEl = document.getElementById( 'seconds' );
207
+
208
+ setInterval( function() {
209
+
210
+ timeEl.style.opacity = 1;
211
+
212
+ var diff, hours, minutes, seconds,
213
+ now = new Date();
214
+
215
+ diff = now.getTime() - start.getTime();
216
+ hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
217
+ minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
218
+ seconds = Math.floor( ( diff / 1000 ) % 60 );
219
+
220
+ clockEl.innerHTML = now.toLocaleTimeString();
221
+ hoursEl.innerHTML = zeroPadInteger( hours );
222
+ hoursEl.className = hours > 0 ? "" : "mute";
223
+ minutesEl.innerHTML = ":" + zeroPadInteger( minutes );
224
+ minutesEl.className = minutes > 0 ? "" : "mute";
225
+ secondsEl.innerHTML = ":" + zeroPadInteger( seconds );
226
+
227
+ }, 1000 );
228
+
229
+ // Navigate the main window when the notes slide changes
230
+ currentSlide.contentWindow.Reveal.addEventListener( 'slidechanged', function( event ) {
231
+
232
+ window.opener.Reveal.slide( event.indexh, event.indexv );
233
+
234
+ } );
235
+
236
+ }
237
+ else {
238
+
239
+ document.body.innerHTML = '<p class="error">Unable to access <code>window.opener.location</code>.<br>Make sure the presentation is running on a web server.</p>';
240
+
241
+ }
242
+
243
+
244
+ }, false );
245
+
246
+ function zeroPadInteger( num ) {
247
+ var str = "00" + parseInt( num );
248
+ return str.substring( str.length - 2 );
249
+ }
250
+
251
+ </script>
252
+ </body>
253
+ </html>