reveal-ck 3.9.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,108 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test Iframes</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>1</section>
23
+ <section>2</section>
24
+ <section>
25
+ <iframe class="default-iframe" data-src="#"></iframe>
26
+ <iframe class="preload-iframe" data-src="#" data-preload></iframe>
27
+ </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
+ var defaultIframe = document.querySelector( '.default-iframe' ),
42
+ preloadIframe = document.querySelector( '.preload-iframe' );
43
+
44
+ QUnit.module( 'Iframe' );
45
+
46
+ QUnit.test( 'Using default settings', function( assert ) {
47
+
48
+ Reveal.slide(1);
49
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), false, 'not preloaded when within viewDistance' );
50
+
51
+ Reveal.slide(2);
52
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
53
+
54
+ Reveal.slide(1);
55
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), false, 'unloaded when slide becomes invisible' );
56
+
57
+ });
58
+
59
+ QUnit.test( 'Using data-preload', function( assert ) {
60
+
61
+ Reveal.slide(1);
62
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
63
+
64
+ Reveal.slide(2);
65
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), true, 'loaded when slide becoems visible' );
66
+
67
+ Reveal.slide(0);
68
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), false, 'unloads outside of viewDistance' );
69
+
70
+ });
71
+
72
+ QUnit.test( 'Using preloadIframes: true', function( assert ) {
73
+
74
+ Reveal.configure({ preloadIframes: true });
75
+
76
+ Reveal.slide(1);
77
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
78
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
79
+
80
+ Reveal.slide(2);
81
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
82
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
83
+
84
+ });
85
+
86
+ QUnit.test( 'Using preloadIframes: false', function( assert ) {
87
+
88
+ Reveal.configure({ preloadIframes: false });
89
+
90
+ Reveal.slide(0);
91
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), false, 'not preloaded within viewDistance' );
92
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), false, 'not preloaded within viewDistance' );
93
+
94
+ Reveal.slide(2);
95
+ assert.strictEqual( defaultIframe.hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
96
+ assert.strictEqual( preloadIframe.hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
97
+
98
+ });
99
+
100
+ } );
101
+
102
+ Reveal.initialize({
103
+ viewDistance: 2
104
+ });
105
+ </script>
106
+
107
+ </body>
108
+ </html>
@@ -66,8 +66,7 @@
66
66
 
67
67
  Test
68
68
 
69
- ![Example Picture](examples/assets/image2.png)
70
- <!-- {_class="reveal stretch"} -->
69
+ ![Example Picture](examples/assets/image2.png) <!-- {_class="reveal stretch"} -->
71
70
 
72
71
  </script>
73
72
  </section>
@@ -122,7 +121,6 @@
122
121
 
123
122
  </div>
124
123
 
125
- <script src="../lib/js/head.min.js"></script>
126
124
  <script src="../js/reveal.js"></script>
127
125
  <script src="../plugin/markdown/marked.js"></script>
128
126
  <script src="../plugin/markdown/markdown.js"></script>
@@ -13,24 +13,25 @@
13
13
  <body style="overflow: auto;">
14
14
 
15
15
  <div id="qunit"></div>
16
- <div id="qunit-fixture"></div>
16
+ <div id="qunit-fixture"></div>
17
17
 
18
18
  <div class="reveal" style="display: none;">
19
19
 
20
20
  <div class="slides">
21
- <section data-markdown="simple.md" data-separator="^\r?\n\r?\n\r?\n" data-separator-vertical="^\r?\n\r?\n"></section>
21
+ <!-- <section data-markdown="simple.md" data-separator="^\r?\n\r?\n\r?\n" data-separator-vertical="^\r?\n\r?\n"></section> -->
22
22
  </div>
23
23
 
24
24
  </div>
25
25
 
26
- <script src="../lib/js/head.min.js"></script>
27
26
  <script src="../js/reveal.js"></script>
28
27
  <script src="../plugin/highlight/highlight.js"></script>
29
28
  <script src="../plugin/markdown/marked.js"></script>
30
29
  <script src="../plugin/markdown/markdown.js"></script>
31
30
  <script src="qunit-2.5.0.js"></script>
32
31
 
33
- <script src="test-markdown-external.js"></script>
32
+ <!-- <script src="test-markdown-external.js"></script> -->
33
+
34
+ <!-- Test disabled 28/2/2019 by Hakim – Markdown plugin needs to be updated to load extenal files asycnhronously -->
34
35
 
35
36
  </body>
36
37
  </html>
@@ -31,7 +31,6 @@
31
31
 
32
32
  </div>
33
33
 
34
- <script src="../lib/js/head.min.js"></script>
35
34
  <script src="../js/reveal.js"></script>
36
35
  <script src="qunit-2.5.0.js"></script>
37
36
 
@@ -116,7 +116,6 @@
116
116
 
117
117
  </div>
118
118
 
119
- <script src="../lib/js/head.min.js"></script>
120
119
  <script src="../js/reveal.js"></script>
121
120
  <script src="../plugin/markdown/marked.js"></script>
122
121
  <script src="../plugin/markdown/markdown.js"></script>
@@ -40,7 +40,6 @@
40
40
 
41
41
  </div>
42
42
 
43
- <script src="../lib/js/head.min.js"></script>
44
43
  <script src="../js/reveal.js"></script>
45
44
  <script src="../plugin/markdown/marked.js"></script>
46
45
  <script src="../plugin/markdown/markdown.js"></script>
@@ -22,7 +22,7 @@
22
22
 
23
23
  <section>
24
24
  <h1>1</h1>
25
- <img data-src="fake-url.png">
25
+ <img data-src="">
26
26
  </section>
27
27
 
28
28
  <section>
@@ -73,7 +73,6 @@
73
73
 
74
74
  </div>
75
75
 
76
- <script src="../lib/js/head.min.js"></script>
77
76
  <script src="../js/reveal.js"></script>
78
77
  <script src="qunit-2.5.0.js"></script>
79
78
 
@@ -0,0 +1,105 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test Plugins</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
+
33
+ QUnit.module( 'Plugins' );
34
+
35
+ var initCounter = { PluginB: 0, PluginC: 0, PluginD: 0 };
36
+
37
+ // Plugin with no init method
38
+ var PluginA = {};
39
+
40
+ // Plugin with init method
41
+ var PluginB = { init: function() {
42
+ initCounter['PluginB'] += 1;
43
+ } };
44
+
45
+ // Async plugin with init method
46
+ var PluginC = { init: function() {
47
+ return new Promise(function( resolve ) {
48
+ setTimeout( () => {
49
+ initCounter['PluginC'] += 1;
50
+ resolve();
51
+ }, 1000 );
52
+ });
53
+ } };
54
+
55
+ // Plugin initialized after reveal.js is ready
56
+ var PluginD = { init: function() {
57
+ initCounter['PluginD'] += 1;
58
+ } };
59
+
60
+ var PluginE = {};
61
+
62
+ Reveal.registerPlugin( 'PluginA', PluginA );
63
+ Reveal.registerPlugin( 'PluginB', PluginB );
64
+ Reveal.registerPlugin( 'PluginC', PluginC );
65
+
66
+ Reveal.initialize();
67
+
68
+ QUnit.test( 'Can initialize synchronously', function( assert ) {
69
+ assert.strictEqual( initCounter['PluginB'], 1 );
70
+
71
+ Reveal.registerPlugin( 'PluginB', PluginB );
72
+
73
+ assert.strictEqual( initCounter['PluginB'], 1, 'prevents duplicate registration' );
74
+ });
75
+
76
+ QUnit.test( 'Can initialize asynchronously', function( assert ) {
77
+ assert.expect( 3 );
78
+ var done = assert.async( 2 );
79
+
80
+ assert.strictEqual( initCounter['PluginC'], 0, 'async plugin not immediately initialized' );
81
+
82
+ Reveal.addEventListener( 'ready', function() {
83
+ assert.strictEqual( initCounter['PluginC'], 1, 'finsihed initializing when reveal.js dispatches "ready"' );
84
+ done();
85
+
86
+ Reveal.registerPlugin( 'PluginD', PluginD );
87
+ assert.strictEqual( initCounter['PluginD'], 1, 'plugin registered after reveal.js is ready still initiailizes' );
88
+ done();
89
+ });
90
+ } );
91
+
92
+ QUnit.test( 'Can check if plugin is registered', function( assert ) {
93
+ assert.strictEqual( Reveal.hasPlugin( 'PluginA' ), true );
94
+ assert.strictEqual( Reveal.hasPlugin( 'PluginE' ), false );
95
+ Reveal.registerPlugin( 'PluginE', PluginE );
96
+ assert.strictEqual( Reveal.hasPlugin( 'PluginE' ), true );
97
+ } );
98
+
99
+ QUnit.test( 'Can retrieve plugin instance', function( assert ) {
100
+ assert.strictEqual( Reveal.getPlugin( 'PluginB' ), PluginB );
101
+ } );
102
+ </script>
103
+
104
+ </body>
105
+ </html>
@@ -0,0 +1,139 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8">
6
+
7
+ <title>reveal.js - Test State</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>No state</section>
23
+ <section id="slide2" data-state="state1">State 1</section>
24
+ <section data-state="state1">State 1</section>
25
+ <section data-state="state2">State 2</section>
26
+ <section>
27
+ <section>No state</section>
28
+ <section data-state="state1">State 1</section>
29
+ <section data-state="state3">State 3</section>
30
+ <section>No state</section>
31
+ </section>
32
+ <section>No state</section>
33
+
34
+ </div>
35
+
36
+ </div>
37
+
38
+ <script src="../js/reveal.js"></script>
39
+ <script src="qunit-2.5.0.js"></script>
40
+
41
+ <script>
42
+
43
+
44
+ Reveal.addEventListener( 'ready', function() {
45
+
46
+ QUnit.module( 'State' );
47
+
48
+ QUnit.test( 'Fire events when changing slide', function( assert ) {
49
+ assert.expect( 2 );
50
+ var state1 = assert.async();
51
+ var state2 = assert.async();
52
+
53
+ var _onState1 = function( event ) {
54
+ assert.ok( true, 'state1 fired' );
55
+ state1();
56
+ }
57
+
58
+ var _onState2 = function( event ) {
59
+ assert.ok( true, 'state2 fired' );
60
+ state2();
61
+ }
62
+
63
+ Reveal.addEventListener( 'state1', _onState1 );
64
+ Reveal.addEventListener( 'state2', _onState2 );
65
+
66
+ Reveal.slide( 1 );
67
+ Reveal.slide( 3 );
68
+
69
+ Reveal.removeEventListener( 'state1', _onState1 );
70
+ Reveal.removeEventListener( 'state2', _onState2 );
71
+ });
72
+
73
+ QUnit.test( 'Fire state events for vertical slides', function( assert ) {
74
+ assert.expect( 2 );
75
+ var done = assert.async( 2 );
76
+
77
+ var _onState1 = function( event ) {
78
+ assert.ok( true, 'state1 fired' );
79
+ done();
80
+ }
81
+
82
+ var _onState3 = function( event ) {
83
+ assert.ok( true, 'state3 fired' );
84
+ done();
85
+ }
86
+
87
+ Reveal.addEventListener( 'state1', _onState1 );
88
+ Reveal.addEventListener( 'state3', _onState3 );
89
+
90
+ Reveal.slide( 0 );
91
+ Reveal.slide( 4, 1 );
92
+ Reveal.slide( 4, 2 );
93
+
94
+ Reveal.removeEventListener( 'state1', _onState1 );
95
+ Reveal.removeEventListener( 'state3', _onState3 );
96
+ });
97
+
98
+ QUnit.test( 'No events if state remains unchanged', function( assert ) {
99
+ var stateChanges = 0;
100
+
101
+ var _onEvent = function( event ) {
102
+ stateChanges += 1;
103
+ }
104
+
105
+ Reveal.addEventListener( 'state1', _onEvent );
106
+
107
+ Reveal.slide( 0 ); // no state
108
+ Reveal.slide( 1 ); // state1
109
+ Reveal.slide( 2 ); // state1
110
+ Reveal.prev(); // state1
111
+ Reveal.next(); // state1
112
+ Reveal.slide( 4, 1 ); // state1
113
+ Reveal.slide( 0 ); // no state
114
+
115
+ Reveal.removeEventListener( 'state1', _onEvent );
116
+
117
+ assert.strictEqual( stateChanges, 1, 'no event was fired when going to slide with same state' );
118
+ });
119
+
120
+ QUnit.test( 'Event order', function( assert ) {
121
+ var _onEvent = function( event ) {
122
+ assert.ok( Reveal.getCurrentSlide() == document.querySelector( '#slide2' ), 'correct current slide immediately after state event' );
123
+ }
124
+
125
+ Reveal.addEventListener( 'state1', _onEvent );
126
+
127
+ Reveal.slide( 0 );
128
+ Reveal.slide( 1 );
129
+
130
+ Reveal.removeEventListener( 'state1', _onEvent );
131
+ });
132
+
133
+ } );
134
+
135
+ Reveal.initialize();
136
+ </script>
137
+
138
+ </body>
139
+ </html>
@@ -21,9 +21,9 @@
21
21
 
22
22
  <section data-background-image="examples/assets/image1.png">
23
23
  <h1>1</h1>
24
- <img data-src="fake-url.png">
25
- <video data-src="fake-url.mp4"></video>
26
- <audio data-src="fake-url.mp3"></audio>
24
+ <img data-src="">
25
+ <video data-src=""></video>
26
+ <audio data-src=""></audio>
27
27
  <aside class="notes">speaker notes 1</aside>
28
28
  </section>
29
29
 
@@ -76,7 +76,6 @@
76
76
 
77
77
  </div>
78
78
 
79
- <script src="../lib/js/head.min.js"></script>
80
79
  <script src="../js/reveal.js"></script>
81
80
  <script src="qunit-2.5.0.js"></script>
82
81