Sfoglia il codice sorgente

support including plugins via <script> instead of dependencies

Hakim El Hattab 5 anni fa
parent
commit
7b151c2320

File diff suppressed because it is too large
+ 0 - 0
dist/reveal.min.js


+ 1 - 1
js/index.js

@@ -45,7 +45,7 @@ window.Reveal.initialize = options => {
  * queuing up early API calls and invoking all of them
  * when Reveal.initialize is called.
  */
-[ 'on', 'off', 'addEventListener', 'removeEventListener' ].forEach( method => {
+[ 'on', 'off', 'addEventListener', 'removeEventListener', 'registerPlugin' ].forEach( method => {
 	window.Reveal[method] = ( ...args ) => {
 		enqueuedAPICalls.push( deck => deck[method].call( null, ...args ) );
 	}

+ 1 - 1
js/reveal.js

@@ -34,7 +34,7 @@ import {
 
 /**
  * reveal.js
- * http://revealjs.com
+ * https://revealjs.com
  * MIT licensed
  *
  * Copyright (C) 2020 Hakim El Hattab, https://hakim.se

+ 1 - 6
test/examples/auto-animate.html

@@ -163,20 +163,15 @@
 		</div>
 
 		<script src="../../dist/reveal.min.js"></script>
-
 		<script>
-
-			// Full list of configuration options available here:
-			// https://github.com/hakimel/reveal.js#configuration
 			Reveal.initialize({
 				center: true,
 				hash: true,
 
 				dependencies: [
-					{ src: '../../plugin/highlight/highlight.js', async: true }
+					{ src: '../../dist/plugin/highlight.js', async: true }
 				]
 			});
-
 		</script>
 
 	</body>

+ 0 - 3
test/examples/barebones.html

@@ -30,11 +30,8 @@
 		</div>
 
 		<script src="../../dist/reveal.min.js"></script>
-
 		<script>
-
 			Reveal.initialize();
-
 		</script>
 
 	</body>

+ 0 - 3
test/examples/embedded-media.html

@@ -40,13 +40,10 @@
 		</div>
 
 		<script src="../../dist/reveal.min.js"></script>
-
 		<script>
-
 			Reveal.initialize({
 				transition: 'linear'
 			});
-
 		</script>
 
 	</body>

+ 0 - 3
test/examples/math.html

@@ -176,9 +176,7 @@
 		</div>
 
 		<script src="../../dist/reveal.min.js"></script>
-
 		<script>
-
 			Reveal.initialize({
 				history: true,
 				transition: 'linear',
@@ -198,7 +196,6 @@
 					{ src: '../../dist/plugin/math.js', async: true }
 				]
 			});
-
 		</script>
 
 	</body>

+ 2 - 3
test/examples/multiple-instances.html

@@ -40,10 +40,9 @@
 			</div>
 		</div>
 
-		<script src="../../dist/reveal.min.js"></script>
-
 		<script type="module">
 
+			import Reveal from '../../js/reveal.js';
 			import Markdown from '../../plugin/markdown/markdown.js';
 
 			let r1 = new Reveal( document.querySelector( '.deck1' ), {
@@ -55,7 +54,7 @@
 				let r2 = new Reveal( document.querySelector( '.deck2' ), {
 					embedded: true,
 					keyboard: false,
-					dependencies: [{plugin: Markdown}]
+					dependencies: [ Markdown ]
 				} );
 				r2.initialize();
 

+ 0 - 2
test/examples/slide-backgrounds.html

@@ -123,14 +123,12 @@
 		</div>
 
 		<script src="../../dist/reveal.min.js"></script>
-
 		<script>
 
 			// Full list of configuration options available here:
 			// https://github.com/hakimel/reveal.js#configuration
 			Reveal.initialize({
 				center: true,
-				// rtl: true,
 
 				transition: 'linear',
 				// transitionSpeed: 'slow',

+ 0 - 3
test/examples/slide-transitions.html

@@ -82,9 +82,7 @@
 		</div>
 
 		<script src="../../dist/reveal.min.js"></script>
-
 		<script>
-
 			Reveal.initialize({
 				center: true,
 				history: true,
@@ -93,7 +91,6 @@
 				// transitionSpeed: 'slow',
 				// backgroundTransition: 'slide'
 			});
-
 		</script>
 
 	</body>

Some files were not shown because too many files changed in this diff