slide_hero 0.0.2

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 (111) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/.travis.yml +3 -0
  4. data/Gemfile +4 -0
  5. data/Guardfile +28 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +161 -0
  8. data/Rakefile +9 -0
  9. data/bin/slidehero +37 -0
  10. data/config.ru +14 -0
  11. data/lib/slide_hero/code.rb +16 -0
  12. data/lib/slide_hero/dsl.rb +10 -0
  13. data/lib/slide_hero/grouped_slides.rb +21 -0
  14. data/lib/slide_hero/list.rb +29 -0
  15. data/lib/slide_hero/list_point.rb +26 -0
  16. data/lib/slide_hero/point.rb +27 -0
  17. data/lib/slide_hero/presentation.rb +36 -0
  18. data/lib/slide_hero/slide.rb +47 -0
  19. data/lib/slide_hero/version.rb +3 -0
  20. data/lib/slide_hero/views/_footer.html.erb +0 -0
  21. data/lib/slide_hero/views/_header.html.erb +0 -0
  22. data/lib/slide_hero/views/code.html.erb +3 -0
  23. data/lib/slide_hero/views/empty.html +12 -0
  24. data/lib/slide_hero/views/grouped_slides.html.erb +5 -0
  25. data/lib/slide_hero/views/layout.html.erb +54 -0
  26. data/lib/slide_hero/views/ordered_list.html.erb +5 -0
  27. data/lib/slide_hero/views/slide.html.erb +6 -0
  28. data/lib/slide_hero/views/unordered_list.html.erb +5 -0
  29. data/lib/slide_hero.rb +15 -0
  30. data/slide_hero.gemspec +29 -0
  31. data/templates/new_presentation.tt +11 -0
  32. data/test/fixtures/testclass.rb +5 -0
  33. data/test/minitest_helper.rb +18 -0
  34. data/test/slide_hero/code_spec.rb +29 -0
  35. data/test/slide_hero/dsl_spec.rb +27 -0
  36. data/test/slide_hero/grouped_slides_spec.rb +29 -0
  37. data/test/slide_hero/list_point_spec.rb +34 -0
  38. data/test/slide_hero/list_spec.rb +49 -0
  39. data/test/slide_hero/point_spec.rb +25 -0
  40. data/test/slide_hero/presentation_spec.rb +56 -0
  41. data/test/slide_hero/slide_spec.rb +147 -0
  42. data/test/slide_hero_spec.rb +15 -0
  43. data/vendor/reveal.js/.gitignore +6 -0
  44. data/vendor/reveal.js/.travis.yml +5 -0
  45. data/vendor/reveal.js/Gruntfile.js +132 -0
  46. data/vendor/reveal.js/LICENSE +19 -0
  47. data/vendor/reveal.js/README.md +798 -0
  48. data/vendor/reveal.js/css/print/paper.css +176 -0
  49. data/vendor/reveal.js/css/print/pdf.css +190 -0
  50. data/vendor/reveal.js/css/reveal.css +1649 -0
  51. data/vendor/reveal.js/css/reveal.min.css +7 -0
  52. data/vendor/reveal.js/css/theme/README.md +23 -0
  53. data/vendor/reveal.js/css/theme/beige.css +142 -0
  54. data/vendor/reveal.js/css/theme/default.css +142 -0
  55. data/vendor/reveal.js/css/theme/moon.css +142 -0
  56. data/vendor/reveal.js/css/theme/night.css +130 -0
  57. data/vendor/reveal.js/css/theme/serif.css +132 -0
  58. data/vendor/reveal.js/css/theme/simple.css +132 -0
  59. data/vendor/reveal.js/css/theme/sky.css +139 -0
  60. data/vendor/reveal.js/css/theme/solarized.css +142 -0
  61. data/vendor/reveal.js/css/theme/source/beige.scss +50 -0
  62. data/vendor/reveal.js/css/theme/source/default.scss +42 -0
  63. data/vendor/reveal.js/css/theme/source/moon.scss +68 -0
  64. data/vendor/reveal.js/css/theme/source/night.scss +35 -0
  65. data/vendor/reveal.js/css/theme/source/serif.scss +35 -0
  66. data/vendor/reveal.js/css/theme/source/simple.scss +38 -0
  67. data/vendor/reveal.js/css/theme/source/sky.scss +46 -0
  68. data/vendor/reveal.js/css/theme/source/solarized.scss +74 -0
  69. data/vendor/reveal.js/css/theme/template/mixins.scss +29 -0
  70. data/vendor/reveal.js/css/theme/template/settings.scss +34 -0
  71. data/vendor/reveal.js/css/theme/template/theme.scss +163 -0
  72. data/vendor/reveal.js/examples/assets/image1.png +0 -0
  73. data/vendor/reveal.js/examples/assets/image2.png +0 -0
  74. data/vendor/reveal.js/examples/barebones.html +42 -0
  75. data/vendor/reveal.js/examples/embedded-media.html +49 -0
  76. data/vendor/reveal.js/examples/math.html +185 -0
  77. data/vendor/reveal.js/examples/slide-backgrounds.html +101 -0
  78. data/vendor/reveal.js/js/reveal.js +2788 -0
  79. data/vendor/reveal.js/js/reveal.min.js +8 -0
  80. data/vendor/reveal.js/lib/css/zenburn.css +115 -0
  81. data/vendor/reveal.js/lib/font/league_gothic-webfont.eot +0 -0
  82. data/vendor/reveal.js/lib/font/league_gothic-webfont.svg +230 -0
  83. data/vendor/reveal.js/lib/font/league_gothic-webfont.ttf +0 -0
  84. data/vendor/reveal.js/lib/font/league_gothic-webfont.woff +0 -0
  85. data/vendor/reveal.js/lib/font/league_gothic_license +2 -0
  86. data/vendor/reveal.js/lib/js/classList.js +2 -0
  87. data/vendor/reveal.js/lib/js/head.min.js +8 -0
  88. data/vendor/reveal.js/lib/js/html5shiv.js +7 -0
  89. data/vendor/reveal.js/package.json +45 -0
  90. data/vendor/reveal.js/plugin/highlight/highlight.js +31 -0
  91. data/vendor/reveal.js/plugin/leap/leap.js +157 -0
  92. data/vendor/reveal.js/plugin/markdown/example.html +98 -0
  93. data/vendor/reveal.js/plugin/markdown/example.md +31 -0
  94. data/vendor/reveal.js/plugin/markdown/markdown.js +220 -0
  95. data/vendor/reveal.js/plugin/markdown/marked.js +37 -0
  96. data/vendor/reveal.js/plugin/math/math.js +64 -0
  97. data/vendor/reveal.js/plugin/multiplex/client.js +13 -0
  98. data/vendor/reveal.js/plugin/multiplex/index.js +56 -0
  99. data/vendor/reveal.js/plugin/multiplex/master.js +50 -0
  100. data/vendor/reveal.js/plugin/notes/notes.html +259 -0
  101. data/vendor/reveal.js/plugin/notes/notes.js +78 -0
  102. data/vendor/reveal.js/plugin/notes-server/client.js +57 -0
  103. data/vendor/reveal.js/plugin/notes-server/index.js +59 -0
  104. data/vendor/reveal.js/plugin/notes-server/notes.html +142 -0
  105. data/vendor/reveal.js/plugin/postmessage/example.html +39 -0
  106. data/vendor/reveal.js/plugin/postmessage/postmessage.js +42 -0
  107. data/vendor/reveal.js/plugin/print-pdf/print-pdf.js +44 -0
  108. data/vendor/reveal.js/plugin/remotes/remotes.js +39 -0
  109. data/vendor/reveal.js/plugin/search/search.js +196 -0
  110. data/vendor/reveal.js/plugin/zoom-js/zoom.js +256 -0
  111. metadata +277 -0
@@ -0,0 +1,259 @@
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
+ silenced = false;
174
+
175
+ window.addEventListener( 'message', function( event ) {
176
+ var data = JSON.parse( event.data );
177
+
178
+ // No need for updating the notes in case of fragment changes
179
+ if ( data.notes !== undefined) {
180
+ if( data.markdown ) {
181
+ notes.innerHTML = marked( data.notes );
182
+ }
183
+ else {
184
+ notes.innerHTML = data.notes;
185
+ }
186
+ }
187
+
188
+ silenced = true;
189
+
190
+ // Update the note slides
191
+ currentSlide.contentWindow.Reveal.slide( data.indexh, data.indexv, data.indexf );
192
+ nextSlide.contentWindow.Reveal.slide( data.nextindexh, data.nextindexv );
193
+
194
+ silenced = false;
195
+
196
+ }, false );
197
+
198
+ var start = new Date(),
199
+ timeEl = document.querySelector( '.time' ),
200
+ clockEl = document.getElementById( 'clock' ),
201
+ hoursEl = document.getElementById( 'hours' ),
202
+ minutesEl = document.getElementById( 'minutes' ),
203
+ secondsEl = document.getElementById( 'seconds' );
204
+
205
+ setInterval( function() {
206
+
207
+ timeEl.style.opacity = 1;
208
+
209
+ var diff, hours, minutes, seconds,
210
+ now = new Date();
211
+
212
+ diff = now.getTime() - start.getTime();
213
+ hours = Math.floor( diff / ( 1000 * 60 * 60 ) );
214
+ minutes = Math.floor( ( diff / ( 1000 * 60 ) ) % 60 );
215
+ seconds = Math.floor( ( diff / 1000 ) % 60 );
216
+
217
+ clockEl.innerHTML = now.toLocaleTimeString();
218
+ hoursEl.innerHTML = zeroPadInteger( hours );
219
+ hoursEl.className = hours > 0 ? "" : "mute";
220
+ minutesEl.innerHTML = ":" + zeroPadInteger( minutes );
221
+ minutesEl.className = minutes > 0 ? "" : "mute";
222
+ secondsEl.innerHTML = ":" + zeroPadInteger( seconds );
223
+
224
+ }, 1000 );
225
+
226
+ // Broadcasts the state of the notes window to synchronize
227
+ // the main window
228
+ function synchronizeMainWindow() {
229
+
230
+ if( !silenced ) {
231
+ var indices = currentSlide.contentWindow.Reveal.getIndices();
232
+ window.opener.Reveal.slide( indices.h, indices.v, indices.f );
233
+ }
234
+
235
+ }
236
+
237
+ // Navigate the main window when the notes slide changes
238
+ currentSlide.contentWindow.Reveal.addEventListener( 'slidechanged', synchronizeMainWindow );
239
+ currentSlide.contentWindow.Reveal.addEventListener( 'fragmentshown', synchronizeMainWindow );
240
+ currentSlide.contentWindow.Reveal.addEventListener( 'fragmenthidden', synchronizeMainWindow );
241
+
242
+ }
243
+ else {
244
+
245
+ 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>';
246
+
247
+ }
248
+
249
+
250
+ }, false );
251
+
252
+ function zeroPadInteger( num ) {
253
+ var str = "00" + parseInt( num );
254
+ return str.substring( str.length - 2 );
255
+ }
256
+
257
+ </script>
258
+ </body>
259
+ </html>
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Handles opening of and synchronization with the reveal.js
3
+ * notes window.
4
+ */
5
+ var RevealNotes = (function() {
6
+
7
+ function openNotes() {
8
+ var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
9
+ jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
10
+ var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' );
11
+
12
+ // Fires when slide is changed
13
+ Reveal.addEventListener( 'slidechanged', post );
14
+
15
+ // Fires when a fragment is shown
16
+ Reveal.addEventListener( 'fragmentshown', post );
17
+
18
+ // Fires when a fragment is hidden
19
+ Reveal.addEventListener( 'fragmenthidden', post );
20
+
21
+ /**
22
+ * Posts the current slide data to the notes window
23
+ */
24
+ function post() {
25
+ var slideElement = Reveal.getCurrentSlide(),
26
+ slideIndices = Reveal.getIndices(),
27
+ messageData;
28
+
29
+ var notes = slideElement.querySelector( 'aside.notes' ),
30
+ nextindexh,
31
+ nextindexv;
32
+
33
+ if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) {
34
+ nextindexh = slideIndices.h;
35
+ nextindexv = slideIndices.v + 1;
36
+ } else {
37
+ nextindexh = slideIndices.h + 1;
38
+ nextindexv = 0;
39
+ }
40
+
41
+ messageData = {
42
+ notes : notes ? notes.innerHTML : '',
43
+ indexh : slideIndices.h,
44
+ indexv : slideIndices.v,
45
+ indexf : slideIndices.f,
46
+ nextindexh : nextindexh,
47
+ nextindexv : nextindexv,
48
+ markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false
49
+ };
50
+
51
+ notesPopup.postMessage( JSON.stringify( messageData ), '*' );
52
+ }
53
+
54
+ // Navigate to the current slide when the notes are loaded
55
+ notesPopup.addEventListener( 'load', function( event ) {
56
+ post();
57
+ }, false );
58
+ }
59
+
60
+ // If the there's a 'notes' query set, open directly
61
+ if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) {
62
+ openNotes();
63
+ }
64
+
65
+ // Open the notes when the 's' key is hit
66
+ document.addEventListener( 'keydown', function( event ) {
67
+ // Disregard the event if the target is editable or a
68
+ // modifier is present
69
+ if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
70
+
71
+ if( event.keyCode === 83 ) {
72
+ event.preventDefault();
73
+ openNotes();
74
+ }
75
+ }, false );
76
+
77
+ return { open: openNotes };
78
+ })();
@@ -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,39 @@
1
+ <html>
2
+ <body>
3
+
4
+ <iframe id="reveal" src="../../index.html" style="border: 0;" width="500" height="500"></iframe>
5
+
6
+ <div>
7
+ <input id="back" type="button" value="go back"/>
8
+ <input id="ahead" type="button" value="go ahead"/>
9
+ <input id="slideto" type="button" value="slideto 2-2"/>
10
+ </div>
11
+
12
+ <script>
13
+
14
+ (function (){
15
+
16
+ var back = document.getElementById( 'back' ),
17
+ ahead = document.getElementById( 'ahead' ),
18
+ slideto = document.getElementById( 'slideto' ),
19
+ reveal = window.frames[0];
20
+
21
+ back.addEventListener( 'click', function () {
22
+
23
+ reveal.postMessage( JSON.stringify({method: 'prev', args: []}), '*' );
24
+ }, false );
25
+
26
+ ahead.addEventListener( 'click', function (){
27
+ reveal.postMessage( JSON.stringify({method: 'next', args: []}), '*' );
28
+ }, false );
29
+
30
+ slideto.addEventListener( 'click', function (){
31
+ reveal.postMessage( JSON.stringify({method: 'slide', args: [2,2]}), '*' );
32
+ }, false );
33
+
34
+ }());
35
+
36
+ </script>
37
+
38
+ </body>
39
+ </html>
@@ -0,0 +1,42 @@
1
+ /*
2
+
3
+ simple postmessage plugin
4
+
5
+ Useful when a reveal slideshow is inside an iframe.
6
+ It allows to call reveal methods from outside.
7
+
8
+ Example:
9
+ var reveal = window.frames[0];
10
+
11
+ // Reveal.prev();
12
+ reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*');
13
+ // Reveal.next();
14
+ reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*');
15
+ // Reveal.slide(2, 2);
16
+ reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*');
17
+
18
+ Add to the slideshow:
19
+
20
+ dependencies: [
21
+ ...
22
+ { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } }
23
+ ]
24
+
25
+ */
26
+
27
+ (function (){
28
+
29
+ window.addEventListener( "message", function ( event ) {
30
+ var data = JSON.parse( event.data ),
31
+ method = data.method,
32
+ args = data.args;
33
+
34
+ if( typeof Reveal[method] === 'function' ) {
35
+ Reveal[method].apply( Reveal, data.args );
36
+ }
37
+ }, false);
38
+
39
+ }());
40
+
41
+
42
+