reveal-ck 3.9.2 → 4.0.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 (82) hide show
  1. checksums.yaml +5 -5
  2. data/features/step_definitions/serve_steps.rb +1 -1
  3. data/files/reveal-ck/templates/index.html/body.html.erb +0 -2
  4. data/files/reveal-ck/templates/index.html/head.html.erb +6 -6
  5. data/files/reveal-ck/templates/index.html/index.html.erb +2 -2
  6. data/files/reveal-ck/templates/index.html/script.js.erb +4 -6
  7. data/files/reveal.js/LICENSE +1 -1
  8. data/files/reveal.js/README.md +268 -82
  9. data/files/reveal.js/bower.json +1 -4
  10. data/files/reveal.js/css/reset.css +30 -0
  11. data/files/reveal.js/css/reveal.css +114 -99
  12. data/files/reveal.js/css/reveal.scss +108 -95
  13. data/files/reveal.js/css/theme/README.md +1 -1
  14. data/files/reveal.js/css/theme/beige.css +1 -1
  15. data/files/reveal.js/css/theme/black.css +4 -4
  16. data/files/reveal.js/css/theme/blood.css +1 -1
  17. data/files/reveal.js/css/theme/league.css +1 -1
  18. data/files/reveal.js/css/theme/moon.css +1 -1
  19. data/files/reveal.js/css/theme/night.css +1 -1
  20. data/files/reveal.js/css/theme/serif.css +1 -1
  21. data/files/reveal.js/css/theme/simple.css +1 -1
  22. data/files/reveal.js/css/theme/sky.css +1 -1
  23. data/files/reveal.js/css/theme/solarized.css +1 -1
  24. data/files/reveal.js/css/theme/source/black.scss +1 -1
  25. data/files/reveal.js/css/theme/template/settings.scss +3 -1
  26. data/files/reveal.js/css/theme/template/theme.scss +3 -3
  27. data/files/reveal.js/css/theme/white.css +1 -1
  28. data/files/reveal.js/demo.html +35 -26
  29. data/files/reveal.js/{Gruntfile.js → gruntfile.js} +21 -25
  30. data/files/reveal.js/index.html +5 -4
  31. data/files/reveal.js/js/reveal.js +961 -347
  32. data/files/reveal.js/lib/css/monokai.css +71 -0
  33. data/files/reveal.js/lib/js/promise.js +2 -0
  34. data/files/reveal.js/package-lock.json +5703 -0
  35. data/files/reveal.js/package.json +13 -12
  36. data/files/reveal.js/plugin/highlight/highlight.js +247 -21
  37. data/files/reveal.js/plugin/markdown/example.html +1 -3
  38. data/files/reveal.js/plugin/markdown/markdown.js +107 -73
  39. data/files/reveal.js/plugin/markdown/marked.js +3 -3
  40. data/files/reveal.js/plugin/math/math.js +51 -26
  41. data/files/reveal.js/plugin/notes/notes.html +138 -76
  42. data/files/reveal.js/plugin/notes/notes.js +46 -15
  43. data/files/reveal.js/plugin/search/search.js +1 -1
  44. data/files/reveal.js/plugin/zoom-js/zoom.js +22 -17
  45. data/files/reveal.js/test/assets/external-script-a.js +1 -0
  46. data/files/reveal.js/test/assets/external-script-b.js +1 -0
  47. data/files/reveal.js/test/assets/external-script-c.js +1 -0
  48. data/files/reveal.js/test/assets/external-script-d.js +1 -0
  49. data/files/reveal.js/test/examples/assets/beeping.txt +2 -0
  50. data/files/reveal.js/test/examples/assets/beeping.wav +0 -0
  51. data/files/reveal.js/test/examples/embedded-media.html +5 -1
  52. data/files/reveal.js/test/examples/math.html +23 -3
  53. data/files/reveal.js/test/examples/slide-backgrounds.html +0 -1
  54. data/files/reveal.js/test/examples/slide-transitions.html +0 -1
  55. data/files/reveal.js/test/test-dependencies-async.html +78 -0
  56. data/files/reveal.js/test/test-dependencies.html +54 -0
  57. data/files/reveal.js/test/test-grid-navigation.html +74 -0
  58. data/files/reveal.js/test/test-iframe-backgrounds.html +104 -0
  59. data/files/reveal.js/test/test-iframes.html +108 -0
  60. data/files/reveal.js/test/test-markdown-element-attributes.html +1 -3
  61. data/files/reveal.js/test/test-markdown-external.html +5 -4
  62. data/files/reveal.js/test/test-markdown-options.html +0 -1
  63. data/files/reveal.js/test/test-markdown-slide-attributes.html +0 -1
  64. data/files/reveal.js/test/test-markdown.html +0 -1
  65. data/files/reveal.js/test/test-pdf.html +1 -2
  66. data/files/reveal.js/test/test-plugins.html +105 -0
  67. data/files/reveal.js/test/test-state.html +139 -0
  68. data/files/reveal.js/test/test.html +3 -4
  69. data/files/reveal.js/test/test.js +21 -0
  70. data/lib/reveal-ck/builders/create_index_html.rb +0 -1
  71. data/lib/reveal-ck/builders/index_html.rb +2 -4
  72. data/lib/reveal-ck/commands/listen_to_reload_browser.rb +4 -1
  73. data/lib/reveal-ck/commands/serve.rb +2 -2
  74. data/lib/reveal-ck/commands/start_web_server.rb +1 -1
  75. data/lib/reveal-ck/commands/thread_waker.rb +1 -1
  76. data/lib/reveal-ck/config.rb +1 -1
  77. data/lib/reveal-ck/version.rb +1 -1
  78. data/spec/lib/reveal-ck/builders/index_html_spec.rb +1 -11
  79. data/spec/lib/reveal-ck/commands/thread_waker_spec.rb +2 -0
  80. metadata +94 -80
  81. data/files/reveal.js/lib/js/classList.js +0 -2
  82. data/files/reveal.js/lib/js/head.min.js +0 -6
@@ -200,7 +200,7 @@ function Hilitor(id, tag)
200
200
  toggleSearch();
201
201
  }
202
202
  }, false );
203
- if( window.Reveal ) Reveal.registerKeyboardShortcut( 'Ctrl-Shift-F', 'Search' );
203
+ if( window.Reveal ) Reveal.registerKeyboardShortcut( 'CTRL + Shift + F', 'Search' );
204
204
  closeSearch();
205
205
  return { open: openSearch };
206
206
  })();
@@ -1,29 +1,34 @@
1
1
  // Custom reveal.js integration
2
- (function(){
3
- var revealElement = document.querySelector( '.reveal' );
4
- if( revealElement ) {
2
+ var RevealZoom = (function(){
5
3
 
6
- revealElement.addEventListener( 'mousedown', function( event ) {
7
- var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
4
+ return {
5
+ init: function() {
8
6
 
9
- var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : defaultModifier ) + 'Key';
10
- var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 );
7
+ Reveal.getRevealElement().addEventListener( 'mousedown', function( event ) {
8
+ var defaultModifier = /Linux/.test( window.navigator.platform ) ? 'ctrl' : 'alt';
11
9
 
12
- if( event[ modifier ] && !Reveal.isOverview() ) {
13
- event.preventDefault();
10
+ var modifier = ( Reveal.getConfig().zoomKey ? Reveal.getConfig().zoomKey : defaultModifier ) + 'Key';
11
+ var zoomLevel = ( Reveal.getConfig().zoomLevel ? Reveal.getConfig().zoomLevel : 2 );
14
12
 
15
- zoom.to({
16
- x: event.clientX,
17
- y: event.clientY,
18
- scale: zoomLevel,
19
- pan: false
20
- });
21
- }
22
- } );
13
+ if( event[ modifier ] && !Reveal.isOverview() ) {
14
+ event.preventDefault();
15
+
16
+ zoom.to({
17
+ x: event.clientX,
18
+ y: event.clientY,
19
+ scale: zoomLevel,
20
+ pan: false
21
+ });
22
+ }
23
+ } );
23
24
 
25
+ }
24
26
  }
27
+
25
28
  })();
26
29
 
30
+ Reveal.registerPlugin( 'zoom', RevealZoom );
31
+
27
32
  /*!
28
33
  * zoom.js 0.3 (modified for use with reveal.js)
29
34
  * http://lab.hakim.se/zoom-js
@@ -0,0 +1 @@
1
+ window.externalScriptSequence += 'A';
@@ -0,0 +1 @@
1
+ window.externalScriptSequence += 'B';
@@ -0,0 +1 @@
1
+ window.externalScriptSequence += 'C';
@@ -0,0 +1 @@
1
+ window.externalScriptSequence += 'D';
@@ -0,0 +1,2 @@
1
+ Source: https://freesound.org/people/fennelliott/sounds/379419/
2
+ License: CC0 (public domain)
@@ -30,11 +30,15 @@
30
30
  <h2>Empty Slide</h2>
31
31
  </section>
32
32
 
33
+ <section>
34
+ <h2>Auto-playing audio</h2>
35
+ <audio src="assets/beeping.wav" data-autoplay></audio>
36
+ </section>
37
+
33
38
  </div>
34
39
 
35
40
  </div>
36
41
 
37
- <script src="../../lib/js/head.min.js"></script>
38
42
  <script src="../../js/reveal.js"></script>
39
43
 
40
44
  <script>
@@ -82,6 +82,14 @@
82
82
  \]
83
83
  </section>
84
84
 
85
+ <section>
86
+ <h3>TeX Macros</h3>
87
+
88
+ Here is a common vector space:
89
+ \[L^2(\R) = \set{u : \R \to \R}{\int_\R |u|^2 &lt; +\infty}\]
90
+ used in functional analysis.
91
+ </section>
92
+
85
93
  <section>
86
94
  <section>
87
95
  <h3>The Lorenz Equations</h3>
@@ -153,13 +161,20 @@
153
161
  \]
154
162
  </div>
155
163
  </section>
164
+
165
+ <section>
166
+ <h3>TeX Macros</h3>
167
+
168
+ Here is a common vector space:
169
+ \[L^2(\R) = \set{u : \R \to \R}{\int_\R |u|^2 &lt; +\infty}\]
170
+ used in functional analysis.
171
+ </section>
156
172
  </section>
157
173
 
158
174
  </div>
159
175
 
160
176
  </div>
161
177
 
162
- <script src="../../lib/js/head.min.js"></script>
163
178
  <script src="../../js/reveal.js"></script>
164
179
 
165
180
  <script>
@@ -170,11 +185,16 @@
170
185
 
171
186
  math: {
172
187
  // mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js',
173
- config: 'TeX-AMS_HTML-full'
188
+ config: 'TeX-AMS_HTML-full',
189
+ TeX: {
190
+ Macros: {
191
+ R: '\\mathbb{R}',
192
+ set: [ '\\left\\{#1 \\; ; \\; #2\\right\\}', 2 ]
193
+ }
194
+ }
174
195
  },
175
196
 
176
197
  dependencies: [
177
- { src: '../../lib/js/classList.js' },
178
198
  { src: '../../plugin/math/math.js', async: true }
179
199
  ]
180
200
  });
@@ -122,7 +122,6 @@
122
122
 
123
123
  </div>
124
124
 
125
- <script src="../../lib/js/head.min.js"></script>
126
125
  <script src="../../js/reveal.js"></script>
127
126
 
128
127
  <script>
@@ -81,7 +81,6 @@
81
81
 
82
82
  </div>
83
83
 
84
- <script src="../../lib/js/head.min.js"></script>
85
84
  <script src="../../js/reveal.js"></script>
86
85
 
87
86
  <script>
@@ -0,0 +1,78 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test Async Dependencies</title>
8
+
9
+ <link rel="stylesheet" href="../css/reveal.css">
10
+ <link rel="stylesheet" href="qunit-2.5.0.css">
11
+ </head>
12
+
13
+ <body style="overflow: auto;">
14
+
15
+ <div id="qunit"></div>
16
+ <div id="qunit-fixture"></div>
17
+
18
+ <div class="reveal" style="display: none;">
19
+
20
+ <div class="slides">
21
+
22
+ <section>Slide content</section>
23
+
24
+ </div>
25
+
26
+ </div>
27
+
28
+ <script src="../js/reveal.js"></script>
29
+ <script src="qunit-2.5.0.js"></script>
30
+
31
+ <script>
32
+ var externalScriptSequence = '';
33
+ var scriptCount = 0;
34
+
35
+ QUnit.config.autostart = false;
36
+ QUnit.module( 'Async Dependencies' );
37
+
38
+ QUnit.test( 'Async scripts are loaded', function( assert ) {
39
+ assert.expect( 5 );
40
+ var done = assert.async( 5 );
41
+
42
+ function callback( event ) {
43
+ if( externalScriptSequence.length === 1 ) {
44
+ assert.ok( externalScriptSequence === 'A', 'first callback was sync script' );
45
+ done();
46
+ }
47
+ else {
48
+ assert.ok( true, 'async script loaded' );
49
+ done();
50
+ }
51
+
52
+ if( externalScriptSequence.length === 4 ) {
53
+ assert.ok( externalScriptSequence.indexOf( 'A' ) !== -1 &&
54
+ externalScriptSequence.indexOf( 'B' ) !== -1 &&
55
+ externalScriptSequence.indexOf( 'C' ) !== -1 &&
56
+ externalScriptSequence.indexOf( 'D' ) !== -1, 'four unique scripts were loaded' );
57
+ done();
58
+ }
59
+
60
+ scriptCount ++;
61
+ }
62
+
63
+ Reveal.initialize({
64
+ dependencies: [
65
+ { src: 'assets/external-script-a.js', async: false, callback: callback },
66
+ { src: 'assets/external-script-b.js', async: true, callback: callback },
67
+ { src: 'assets/external-script-c.js', async: true, callback: callback },
68
+ { src: 'assets/external-script-d.js', async: true, callback: callback }
69
+ ]
70
+ });
71
+ });
72
+
73
+ QUnit.start();
74
+
75
+ </script>
76
+
77
+ </body>
78
+ </html>
@@ -0,0 +1,54 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test Dependencies</title>
8
+
9
+ <link rel="stylesheet" href="../css/reveal.css">
10
+ <link rel="stylesheet" href="qunit-2.5.0.css">
11
+ </head>
12
+
13
+ <body style="overflow: auto;">
14
+
15
+ <div id="qunit"></div>
16
+ <div id="qunit-fixture"></div>
17
+
18
+ <div class="reveal" style="display: none;">
19
+
20
+ <div class="slides">
21
+
22
+ <section>Slide content</section>
23
+
24
+ </div>
25
+
26
+ </div>
27
+
28
+ <script src="../js/reveal.js"></script>
29
+ <script src="qunit-2.5.0.js"></script>
30
+
31
+ <script>
32
+ window.externalScriptSequence = '';
33
+
34
+ Reveal.addEventListener( 'ready', function() {
35
+
36
+ QUnit.module( 'Dependencies' );
37
+
38
+ QUnit.test( 'Load synchronous scripts', function( assert ) {
39
+ assert.strictEqual( window.externalScriptSequence, 'ABC', 'Loaded and executed in order' );
40
+ });
41
+
42
+ } );
43
+
44
+ Reveal.initialize({
45
+ dependencies: [
46
+ { src: 'assets/external-script-a.js' },
47
+ { src: 'assets/external-script-b.js' },
48
+ { src: 'assets/external-script-c.js' }
49
+ ]
50
+ });
51
+ </script>
52
+
53
+ </body>
54
+ </html>
@@ -0,0 +1,74 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test Grid</title>
8
+
9
+ <link rel="stylesheet" href="../css/reveal.css">
10
+ <link rel="stylesheet" href="qunit-2.5.0.css">
11
+ </head>
12
+
13
+ <body style="overflow: auto;">
14
+
15
+ <div id="qunit"></div>
16
+ <div id="qunit-fixture"></div>
17
+
18
+ <div class="reveal" style="display: none;">
19
+
20
+ <div class="slides">
21
+
22
+ <section>0</section>
23
+ <section>
24
+ <section>1.1</section>
25
+ <section>1.2</section>
26
+ <section>1.3</section>
27
+ <section>1.4</section>
28
+ </section>
29
+ <section>
30
+ <section>2.1</section>
31
+ <section>2.2</section>
32
+ <section>2.3</section>
33
+ <section>2.4</section>
34
+ </section>
35
+
36
+ </div>
37
+
38
+ </div>
39
+
40
+ <script src="../js/reveal.js"></script>
41
+ <script src="qunit-2.5.0.js"></script>
42
+
43
+ <script>
44
+ Reveal.addEventListener( 'ready', function() {
45
+
46
+ QUnit.module( 'Grid Navigation' );
47
+
48
+ QUnit.test( 'Disabled', function( assert ) {
49
+ Reveal.right();
50
+ Reveal.down();
51
+ Reveal.down();
52
+ assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' );
53
+ Reveal.right();
54
+ assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: undefined }, 'Moves to top when going to adjacent stack' );
55
+ });
56
+
57
+ QUnit.test( 'Enabled', function( assert ) {
58
+ Reveal.configure({ navigationMode: 'grid' });
59
+ Reveal.slide( 0, 0 );
60
+ Reveal.right();
61
+ Reveal.down();
62
+ Reveal.down();
63
+ assert.deepEqual( Reveal.getIndices(), { h: 1, v: 2, f: undefined }, 'Correct starting point' );
64
+ Reveal.right();
65
+ assert.deepEqual( Reveal.getIndices(), { h: 2, v: 2, f: undefined }, 'Remains at same vertical index when going to adjacent stack' );
66
+ });
67
+
68
+ } );
69
+
70
+ Reveal.initialize();
71
+ </script>
72
+
73
+ </body>
74
+ </html>
@@ -0,0 +1,104 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test Iframe Backgrounds</title>
8
+
9
+ <link rel="stylesheet" href="../css/reveal.css">
10
+ <link rel="stylesheet" href="qunit-2.5.0.css">
11
+ </head>
12
+
13
+ <body style="overflow: auto;">
14
+
15
+ <div id="qunit"></div>
16
+ <div id="qunit-fixture"></div>
17
+
18
+ <div class="reveal" style="display: none;">
19
+
20
+ <div class="slides">
21
+
22
+ <section data-background-iframe="#1">1</section>
23
+ <section data-background-iframe="#2">2</section>
24
+ <section data-background-iframe="#3" data-preload>3</section>
25
+ <section data-background-iframe="#4">4</section>
26
+ <section data-background-iframe="#5">5</section>
27
+ <section data-background-iframe="#6">6</section>
28
+
29
+ </div>
30
+
31
+ </div>
32
+
33
+ <script src="../js/reveal.js"></script>
34
+ <script src="qunit-2.5.0.js"></script>
35
+
36
+ <script>
37
+
38
+
39
+ Reveal.addEventListener( 'ready', function() {
40
+
41
+ function getIframe( index ) {
42
+ return document.querySelectorAll( '.slide-background' )[index].querySelector( 'iframe' );
43
+ }
44
+
45
+ QUnit.module( 'Iframe' );
46
+
47
+ QUnit.test( 'Using default settings', function( assert ) {
48
+
49
+ Reveal.slide(0);
50
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), false, 'not preloaded when within viewDistance' );
51
+
52
+ Reveal.slide(1);
53
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
54
+
55
+ Reveal.slide(0);
56
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), false, 'unloaded when slide becomes invisible' );
57
+
58
+ });
59
+
60
+ QUnit.test( 'Using data-preload', function( assert ) {
61
+
62
+ Reveal.slide(1);
63
+ assert.strictEqual( getIframe(2).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
64
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
65
+
66
+ Reveal.slide(0);
67
+ assert.strictEqual( getIframe(3).hasAttribute( 'src' ), false, 'unloads outside of viewDistance' );
68
+
69
+ });
70
+
71
+ QUnit.test( 'Using preloadIframes: true', function( assert ) {
72
+
73
+ Reveal.configure({ preloadIframes: true });
74
+
75
+ Reveal.slide(1);
76
+ assert.strictEqual( getIframe(0).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
77
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
78
+ assert.strictEqual( getIframe(2).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
79
+
80
+ });
81
+
82
+ QUnit.test( 'Using preloadIframes: false', function( assert ) {
83
+
84
+ Reveal.configure({ preloadIframes: false });
85
+
86
+ Reveal.slide(0);
87
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), false, 'not preloaded within viewDistance' );
88
+ assert.strictEqual( getIframe(2).hasAttribute( 'src' ), false, 'not preloaded within viewDistance' );
89
+
90
+ Reveal.slide(1);
91
+ assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
92
+
93
+
94
+ });
95
+
96
+ } );
97
+
98
+ Reveal.initialize({
99
+ viewDistance: 3
100
+ });
101
+ </script>
102
+
103
+ </body>
104
+ </html>