Bladeren bron

Merge branch 'dev' into jh/print-optimize

Jeroen Hermans 4 jaren geleden
bovenliggende
commit
acafabf023

+ 11 - 11
demo.html

@@ -249,17 +249,17 @@
 					<p>
 						reveal.js comes with a few themes built in: <br>
 						<!-- Hacks to swap themes after the page has loaded. Not flexible and only intended for the reveal.js demo deck. -->
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/black.css'); return false;">Black (default)</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/white.css'); return false;">White</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/league.css'); return false;">League</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/sky.css'); return false;">Sky</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/beige.css'); return false;">Beige</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/simple.css'); return false;">Simple</a> <br>
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/serif.css'); return false;">Serif</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/blood.css'); return false;">Blood</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/night.css'); return false;">Night</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/moon.css'); return false;">Moon</a> -
-						<a href="#" onclick="document.getElementById('theme').setAttribute('href','css/theme/solarized.css'); return false;">Solarized</a>
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/black.css'); return false;">Black (default)</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/white.css'); return false;">White</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/league.css'); return false;">League</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/sky.css'); return false;">Sky</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/beige.css'); return false;">Beige</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/simple.css'); return false;">Simple</a> <br>
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/serif.css'); return false;">Serif</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/blood.css'); return false;">Blood</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/night.css'); return false;">Night</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/moon.css'); return false;">Moon</a> -
+						<a href="#" onclick="document.getElementById('theme').setAttribute('href','dist/theme/solarized.css'); return false;">Solarized</a>
 					</p>
 				</section>
 

+ 1 - 1
dist/reveal.css

@@ -1,5 +1,5 @@
 /*!
-* reveal.js 4.0.2
+* reveal.js 4.1.0
 * https://revealjs.com
 * MIT licensed
 *

File diff suppressed because it is too large
+ 1 - 1
dist/reveal.esm.js


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


+ 2 - 0
gulpfile.js

@@ -32,6 +32,8 @@ const banner = `/*!
 * Copyright (C) 2020 Hakim El Hattab, https://hakim.se
 */\n`
 
+sass.compiler = require('node-sass');
+
 // Prevents warnings from opening too many test pages
 process.setMaxListeners(20);
 

+ 6 - 0
js/controllers/print.js

@@ -50,6 +50,12 @@ export default class Print {
 		await new Promise(requestAnimationFrame);
 		this.Reveal.layoutSlideContents( slideWidth, slideHeight );
 
+		slides.forEach( function( slide ) {
+			// Re-run the slide layout so that r-fit-text is applied based on
+			// the printed slide size
+			this.Reveal.slideContent.layout( slide );
+		});
+
 		// Batch scrollHeight access to prevent layout thrashing
 		await new Promise(requestAnimationFrame);
 		const slideScrollHeights = []

+ 4 - 2
js/controllers/progress.js

@@ -88,14 +88,16 @@ export default class Progress {
 
 		event.preventDefault();
 
-		let slidesTotal = this.Reveal.getHorizontalSlides().length;
+		let slides = this.Reveal.getSlides();
+		let slidesTotal = slides.length;
 		let slideIndex = Math.floor( ( event.clientX / this.getMaxWidth() ) * slidesTotal );
 
 		if( this.Reveal.getConfig().rtl ) {
 			slideIndex = slidesTotal - slideIndex;
 		}
 
-		this.Reveal.slide( slideIndex );
+		let targetIndices = this.Reveal.getIndices(slides[slideIndex]);
+		this.Reveal.slide( targetIndices.h, targetIndices.v );
 
 	}
 

+ 11 - 2
js/controllers/slidecontent.js

@@ -167,11 +167,20 @@ export default class SlideContent {
 
 		}
 
+		this.layout( slide );
+
+	}
+
+	/**
+	 * Applies JS-dependent layout helpers for the given slide,
+	 * if there are any.
+	 */
+	layout( slide ) {
+
 		// Autosize text with the r-fit-text class based on the
 		// size of its container. This needs to happen after the
 		// slide is visible in order to measure the text.
-		Array.from( slide.querySelectorAll( '.r-fit-text:not([data-fitted])' ) ).forEach( element => {
-			element.dataset.fitted = '';
+		Array.from( slide.querySelectorAll( '.r-fit-text' ) ).forEach( element => {
 			fitty( element, {
 				minSize: 24,
 				maxSize: this.Reveal.getConfig().height * 0.8,

File diff suppressed because it is too large
+ 996 - 818
package-lock.json


+ 2 - 1
package.json

@@ -47,12 +47,13 @@
     "gulp-connect": "^5.7.0",
     "gulp-eslint": "^6.0.0",
     "gulp-header": "^2.0.9",
-    "gulp-sass": "^4.0.2",
+    "gulp-sass": "^4.1.0",
     "gulp-tap": "^2.0.0",
     "gulp-zip": "^5.0.1",
     "highlight.js": "^10.0.3",
     "marked": "^1.1.0",
     "node-qunit-puppeteer": "^2.0.1",
+    "node-sass": "^5.0.0",
     "qunit": "^2.10.0",
     "rollup": "^2.26.4",
     "rollup-plugin-terser": "^7.0.0",

File diff suppressed because it is too large
+ 0 - 0
plugin/highlight/highlight.esm.js


File diff suppressed because it is too large
+ 0 - 0
plugin/highlight/highlight.js


File diff suppressed because it is too large
+ 0 - 0
plugin/markdown/markdown.esm.js


File diff suppressed because it is too large
+ 0 - 0
plugin/markdown/markdown.js


File diff suppressed because it is too large
+ 0 - 0
plugin/notes/notes.esm.js


File diff suppressed because it is too large
+ 0 - 0
plugin/notes/notes.js


File diff suppressed because it is too large
+ 0 - 0
plugin/search/search.esm.js


File diff suppressed because it is too large
+ 0 - 0
plugin/search/search.js


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