From a16b71a981e9385627959273bb4e910e1d502c92 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 23 Apr 2019 10:52:45 +0200 Subject: the postMessage API now works for getter methods --- README.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 33956e9..65f9332 100644 --- a/README.md +++ b/README.md @@ -1065,18 +1065,38 @@ The framework has a built-in postMessage API that can be used when communicating .postMessage( JSON.stringify({ method: 'slide', args: [ 2 ] }), '*' ); ``` +#### postMessage Events + When reveal.js runs inside of an iframe it can optionally bubble all of its events to the parent. Bubbled events are stringified JSON with three fields: namespace, eventName and state. Here's how you subscribe to them from the parent window: ```javascript window.addEventListener( 'message', function( event ) { var data = JSON.parse( event.data ); - if( data.namespace === 'reveal' && data.eventName ==='slidechanged' ) { + if( data.namespace === 'reveal' && data.eventName === 'slidechanged' ) { // Slide changed, see data.state for slide number } } ); ``` -This cross-window messaging can be toggled on or off using configuration flags. +#### postMessage Callbacks + +When you call any method via the postMessage API, reveal.js will dispatch a message with the return value. This is done so that you can call a getter method and see what the result is. Check out this example: + +```javascript +.postMessage( JSON.stringify({ method: 'getTotalSlides' }), '*' ); + +window.addEventListener( 'message', function( event ) { + var data = JSON.parse( event.data ); + // `data.method`` is the method that we invoked + if( data.namespace === 'reveal' && data.eventName === 'callback' && data.method === 'getTotalSlides' ) { + data.result // = the total number of slides + } +} ); +``` + +#### Turning postMessage on/off + +This cross-window messaging can be toggled on or off using configuration flags. These are the default values. ```javascript Reveal.initialize({ -- cgit v1.2.3 From 1f5fb971d4a6cf6ab153a2484a440f80e24a1400 Mon Sep 17 00:00:00 2001 From: Mario Botsch Date: Tue, 23 Apr 2019 23:28:05 +0200 Subject: Fix plugin documentation Mention that reveal.js will wait for the Promise of a plugin's init() function only when the plugin is loaded non-async. The init functions of plugins that are loaded as async dependencies are called after reveal.js has dispatched the 'ready' event. --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index 65f9332..2e0f48f 100644 --- a/README.md +++ b/README.md @@ -1268,6 +1268,7 @@ Reveal.addEventListener( 'ready', () => console.log( 'Three seconds later...' ) Reveal.initialize(); ``` +For plugins that are loaded as [dependencies](#dependencies), reveal.js will wait for the fullfillment of their init Promise only for the *non-async* plugins. If the init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. ### Retrieving Plugins -- cgit v1.2.3 From 39ed39f3e24def3312713633a0b4274fdd29fb46 Mon Sep 17 00:00:00 2001 From: Daniel Noga Date: Sun, 5 May 2019 13:34:43 +0200 Subject: update minimal nodejs version in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 33956e9..4f7b6a6 100644 --- a/README.md +++ b/README.md @@ -1228,7 +1228,7 @@ Reveal.initialize({ Then: -1. Install [Node.js](http://nodejs.org/) (4.0.0 or later) +1. Install [Node.js](http://nodejs.org/) (9.0.0 or later) 2. Run `npm install` 3. Run `node plugin/notes-server` -- cgit v1.2.3 From 078ba6205066fcedeec59dbb6dd16d039558adb4 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Fri, 10 May 2019 00:03:30 +0200 Subject: Notes: Introduce alternate pacing timer, based on total presentation time The current pacing timer operates on the assumption that there is a default amount of time to be allocated to each slide, and that individual slides can deviate from that default by specifying their own data-timing attribute. This patch introduces an alternate pacing method: by specifying the totalTime configuration option, the presenter can set the total time available to present. The pacing timer will then continue to allocate the exact pacing time for slides that do have data-timing set, as before. However, rather than applying the defaultTiming constant to all others, it will - Add up the time already allocated to slides via data-timing; - subtract that from totalTime; - divide the difference by the number of slides without data-timing set; - apply the thus-calculated average to those slides. totalTime has no default, and if both defaultTiming and totalTime are set, totalTime wins. This preserves backward compatibility: if a presenter has set defaultTiming and updates reveal.js, totalTime will be null and defaultTiming is still applied to all slides without a data-timing attribute. The presenter can then switch to the automatic calculation, if desired, by setting a value for totalTime. --- README.md | 8 +++++++- plugin/notes/notes.html | 20 +++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 65f9332..557ca4b 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,12 @@ Reveal.initialize({ // speaker view defaultTiming: 120, + // Specify the total time in seconds that is available to + // present. If this is set to a nonzero value, the pacing + // timer will work out the time available for each slide, + // instead of using the defaultTiming value + totalTime: 0, + // Enable slide navigation via mouse wheel mouseWheel: false, @@ -1228,7 +1234,7 @@ The speaker notes window will also show: - Current wall-clock time - (Optionally) a pacing timer which indicates whether the current pace of the presentation is on track for the right timing (shown in green), and if not, whether the presenter should speed up (shown in red) or has the luxury of slowing down (blue). -The pacing timer can be enabled by configuring by the `defaultTiming` parameter in the `Reveal` configuration block, which specifies the number of seconds per slide. 120 can be a reasonable rule of thumb. Timings can also be given per slide `
` by setting the `data-timing` attribute. Both values are in numbers of seconds. +The pacing timer can be enabled by configuring the `defaultTiming` parameter in the `Reveal` configuration block, which specifies the number of seconds per slide. 120 can be a reasonable rule of thumb. Alternatively, you can enable the timer by setting `totalTime`, which sets the total length of your presentation (also in seconds). If both values are specified, `totalTime` wins and `defaultTiming` is ignored. Regardless of the baseline timing method, timings can also be given per slide `
` by setting the `data-timing` attribute (again, in seconds). ## Server Side Speaker Notes diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index 9e0b230..b5635bc 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -539,12 +539,16 @@ callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) { callRevealApi( 'getConfig', [], function ( config ) { + var totalTime = config.totalTime; var defaultTiming = config.defaultTiming; - if (defaultTiming == null) { + if ((defaultTiming == null) && (totalTime == null)) { callback(null); return; } - + // Setting totalTime overrides defaultTiming + if (totalTime) { + defaultTiming = 0; + } var timings = []; for ( var i in slideAttributes ) { var slide = slideAttributes[ i ]; @@ -559,7 +563,17 @@ } timings.push(timing); } - + if ( totalTime ) { + // After we've allocated time to individual slides, we summarize it and + // subtract it from the total time + var remainingTime = totalTime - timings.reduce( function(a, b) { return a + b; }, 0 ); + // The remaining time is divided by the number of slides that have 0 seconds + // allocated at the moment, giving the average time-per-slide on the remaining slides + var remainingSlides = (timings.filter( function(x) { return x == 0 }) ).length + var timePerSlide = Math.round( remainingTime / remainingSlides, 0 ) + // And now we replace every zero-value timing with that average + timings = timings.map( function(x) { return (x==0 ? timePerSlide : x) } ); + } callback( timings ); } ); } ); -- cgit v1.2.3 From 1766e37a6358d2abe03ec5695279f1b6c860e522 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 13 May 2019 10:55:29 +0200 Subject: iframe background preload behavior now matches inline iframes + adheres to the new 'preloadIframes' config option --- README.md | 2 + js/reveal.js | 35 +++++++++---- test/test-iframe-backgrounds.html | 104 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 130 insertions(+), 11 deletions(-) create mode 100644 test/test-iframe-backgrounds.html (limited to 'README.md') diff --git a/README.md b/README.md index 65f9332..7bd33c6 100644 --- a/README.md +++ b/README.md @@ -778,6 +778,8 @@ Embeds a web page as a slide background that covers 100% of the reveal.js width
``` +Iframes are lazy-loaded when they become visible. If you'd like to preload iframes aehad of time, you can append a `data-preload` attribute to the slide `
`. You can also enable preloading globally for all iframes using the `preloadIframes` configuration option. + #### Background Transitions Backgrounds transition using a fade animation by default. This can be changed to a linear sliding transition by passing `backgroundTransition: 'slide'` to the `Reveal.initialize()` call. Alternatively you can set `data-background-transition` on any section with a background to override that specific transition. diff --git a/js/reveal.js b/js/reveal.js index 91e7396..cd51cca 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1217,6 +1217,8 @@ if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor; if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition ); + if( slide.hasAttribute( 'data-preload' ) ) element.setAttribute( 'data-preload', '' ); + // Background image options are set on the content wrapper if( data.backgroundSize ) contentElement.style.backgroundSize = data.backgroundSize; if( data.backgroundRepeat ) contentElement.style.backgroundRepeat = data.backgroundRepeat; @@ -3625,7 +3627,7 @@ // Stop content inside of previous backgrounds if( previousBackground ) { - stopEmbeddedContent( previousBackground ); + stopEmbeddedContent( previousBackground, { unloadIframes: !shouldPreload( previousBackground ) } ); } @@ -3804,6 +3806,7 @@ background.style.display = 'block'; var backgroundContent = slide.slideBackgroundContentElement; + var backgroundIframe = slide.getAttribute( 'data-background-iframe' ); // If the background contains media, load it if( background.hasAttribute( 'data-loaded' ) === false ) { @@ -3812,8 +3815,7 @@ var backgroundImage = slide.getAttribute( 'data-background-image' ), backgroundVideo = slide.getAttribute( 'data-background-video' ), backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ), - backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ), - backgroundIframe = slide.getAttribute( 'data-background-iframe' ); + backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ); // Images if( backgroundImage ) { @@ -3854,14 +3856,7 @@ iframe.setAttribute( 'mozallowfullscreen', '' ); iframe.setAttribute( 'webkitallowfullscreen', '' ); - // Only load autoplaying content when the slide is shown to - // avoid having it play in the background - if( /autoplay=(1|true|yes)/gi.test( backgroundIframe ) ) { - iframe.setAttribute( 'data-src', backgroundIframe ); - } - else { - iframe.setAttribute( 'src', backgroundIframe ); - } + iframe.setAttribute( 'data-src', backgroundIframe ); iframe.style.width = '100%'; iframe.style.height = '100%'; @@ -3872,6 +3867,19 @@ } } + // Start loading preloadable iframes + var backgroundIframeElement = backgroundContent.querySelector( 'iframe[data-src]' ); + if( backgroundIframeElement ) { + + // Check if this iframe is eligible to be preloaded + if( shouldPreload( background ) && !/autoplay=(1|true|yes)/gi.test( backgroundIframe ) ) { + if( backgroundIframeElement.getAttribute( 'src' ) !== backgroundIframe ) { + backgroundIframeElement.setAttribute( 'src', backgroundIframe ); + } + } + + } + } } @@ -3891,6 +3899,11 @@ var background = getSlideBackground( slide ); if( background ) { background.style.display = 'none'; + + // Unload any background iframes + toArray( background.querySelectorAll( 'iframe[src]' ) ).forEach( function( element ) { + element.removeAttribute( 'src' ); + } ); } // Reset lazy-loaded media elements with src attributes diff --git a/test/test-iframe-backgrounds.html b/test/test-iframe-backgrounds.html new file mode 100644 index 0000000..15888bc --- /dev/null +++ b/test/test-iframe-backgrounds.html @@ -0,0 +1,104 @@ + + + + + + + reveal.js - Test Iframe Backgrounds + + + + + + + +
+
+ + + + + + + + + + -- cgit v1.2.3 From bd1e82d19af43294df240f33a738e8d1bc293444 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 20 May 2019 11:24:05 +0200 Subject: new API methods for getting horizontal/vertical slides, force linear navigation for one-dimensional decks --- README.md | 11 ++++++++++- js/reveal.js | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 67 insertions(+), 8 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7bd33c6..283801f 100644 --- a/README.md +++ b/README.md @@ -629,6 +629,15 @@ Reveal.getProgress(); // (0 == first slide, 1 == last slide) Reveal.getSlides(); // Array of all slides Reveal.getTotalSlides(); // Total number of slides +// Returns an array with all horizontal/vertical slides in the deck +Reveal.getHorizontalSlides(); +Reveal.getVerticalSlides(); + +// Checks if the presentation contains two or more +// horizontal/vertical slides +Reveal.hasHorizontalSlides(); +Reveal.hasVerticalSlides(); + // Returns the speaker notes for the current slide Reveal.getSlideNotes(); @@ -640,7 +649,7 @@ Reveal.isPaused(); Reveal.isAutoSliding(); // Returns the top-level DOM element -getRevealElement(); //
...
+Reveal.getRevealElement(); //
...
``` ### Custom Key Bindings diff --git a/js/reveal.js b/js/reveal.js index cd51cca..08412bc 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3337,7 +3337,7 @@ } // Flag if there are ANY vertical slides, anywhere in the deck - if( dom.wrapper.querySelectorAll( '.slides>section>section' ).length ) { + if( hasVerticalSlides() ) { dom.wrapper.classList.add( 'has-vertical-slides' ); } else { @@ -3345,7 +3345,7 @@ } // Flag if there are ANY horizontal slides, anywhere in the deck - if( dom.wrapper.querySelectorAll( '.slides>section' ).length > 1 ) { + if( hasHorizontalSlides() ) { dom.wrapper.classList.add( 'has-horizontal-slides' ); } else { @@ -4468,7 +4468,44 @@ */ function getSlides() { - return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' )); + return toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR + ':not(.stack)' ) ); + + } + + /** + * Returns a list of all horizontal slides in the deck. Each + * vertical stack is included as one horizontal slide in the + * resulting array. + */ + function getHorizontalSlides() { + + return toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ); + + } + + /** + * Returns all vertical slides that exist within this deck. + */ + function getVerticalSlides() { + + return toArray( dom.wrapper.querySelectorAll( '.slides>section>section' ) ); + + } + + /** + * Returns true if there are at least two horizontal slides. + */ + function hasHorizontalSlides() { + + return getHorizontalSlides().length > 1; + } + + /** + * Returns true if there are at least two vertical slides. + */ + function hasVerticalSlides() { + + return getVerticalSlides().length > 1; } @@ -5183,6 +5220,10 @@ return false; } + // Use linear navigation if we're configured to OR if + // the presentation is one-dimensional + var useLinearMode = config.navigationMode === 'linear' || !hasHorizontalSlides() || !hasVerticalSlides(); + var triggered = false; // 1. User defined key bindings @@ -5255,7 +5296,7 @@ if( firstSlideShortcut ) { slide( 0 ); } - else if( !isOverview() && config.navigationMode === 'linear' ) { + else if( !isOverview() && useLinearMode ) { navigatePrev(); } else { @@ -5267,7 +5308,7 @@ if( lastSlideShortcut ) { slide( Number.MAX_VALUE ); } - else if( !isOverview() && config.navigationMode === 'linear' ) { + else if( !isOverview() && useLinearMode ) { navigateNext(); } else { @@ -5276,7 +5317,7 @@ } // K, UP else if( keyCode === 75 || keyCode === 38 ) { - if( !isOverview() && config.navigationMode === 'linear' ) { + if( !isOverview() && useLinearMode ) { navigatePrev(); } else { @@ -5285,7 +5326,7 @@ } // J, DOWN else if( keyCode === 74 || keyCode === 40 ) { - if( !isOverview() && config.navigationMode === 'linear' ) { + if( !isOverview() && useLinearMode ) { navigateNext(); } else { @@ -5944,6 +5985,15 @@ // Returns the speaker notes string for a slide, or null getSlideNotes: getSlideNotes, + // Returns an array with all horizontal/vertical slides in the deck + getHorizontalSlides: getHorizontalSlides, + getVerticalSlides: getVerticalSlides, + + // Checks if the presentation contains two or more + // horizontal/vertical slides + hasHorizontalSlides: hasHorizontalSlides, + hasVerticalSlides: hasVerticalSlides, + // Returns the previous slide element, may be null getPreviousSlide: function() { return previousSlide; -- cgit v1.2.3 From 23c12d73321469743424264d9625eab72d8eb179 Mon Sep 17 00:00:00 2001 From: Florian Haas Date: Sat, 11 May 2019 22:23:28 +0200 Subject: Notes: Weakly enforce a minimum allocated pacing time per slide When using the totalTime-based pacing calculation, a presenter may inadvertently set totalTime and per-slide data-timing attributes in such a way that the pacing time for some slides is impossibly low or even negative. Add a check to ensure that the pacing on a slide never falls below a configurable minimum, defaulting to 0. Display an alert if the pacing for any slide(s) falls below the threshold. --- README.md | 7 +++++++ plugin/notes/notes.html | 6 ++++++ 2 files changed, 13 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 557ca4b..9220b2b 100644 --- a/README.md +++ b/README.md @@ -346,6 +346,13 @@ Reveal.initialize({ // instead of using the defaultTiming value totalTime: 0, + // Specify the minimum amount of time you want to allot to + // each slide, if using the totalTime calculation method. If + // the automated time allocation causes slide pacing to fall + // below this threshold, then you will see an alert in the + // speaker notes window + minimumTimePerSlide: 0; + // Enable slide navigation via mouse wheel mouseWheel: false, diff --git a/plugin/notes/notes.html b/plugin/notes/notes.html index b5635bc..fdb81ad 100644 --- a/plugin/notes/notes.html +++ b/plugin/notes/notes.html @@ -540,6 +540,7 @@ callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) { callRevealApi( 'getConfig', [], function ( config ) { var totalTime = config.totalTime; + var minTimePerSlide = config.minimumTimePerSlide || 0; var defaultTiming = config.defaultTiming; if ((defaultTiming == null) && (totalTime == null)) { callback(null); @@ -574,6 +575,11 @@ // And now we replace every zero-value timing with that average timings = timings.map( function(x) { return (x==0 ? timePerSlide : x) } ); } + var slidesUnderMinimum = timings.filter( function(x) { return (x < minTimePerSlide) } ).length + if ( slidesUnderMinimum ) { + message = "The pacing time for " + slidesUnderMinimum + " slide(s) is under the configured minimum of " + minTimePerSlide + " seconds. Check the data-timing attribute on individual slides, or consider increasing the totalTime or minimumTimePerSlide configuration options (or removing some slides)."; + alert(message); + } callback( timings ); } ); } ); -- cgit v1.2.3 From f5759c3d522d30c3047b233f113145f33ff7a7f3 Mon Sep 17 00:00:00 2001 From: autopp Date: Fri, 7 Jun 2019 09:45:20 +0900 Subject: add missing comma to MathJax example in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 05aec24..034ba7c 100644 --- a/README.md +++ b/README.md @@ -1455,7 +1455,7 @@ Reveal.initialize({ math: { mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js', - config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html + config: 'TeX-AMS_HTML-full', // See http://docs.mathjax.org/en/latest/config-files.html // pass other options into `MathJax.Hub.Config()` TeX: { Macros: macros } }, -- cgit v1.2.3 From 5fb743e65e1da9cfc30b169d026e870878840124 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 10 Jun 2019 07:38:57 +0200 Subject: rephrased #2378 --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index d0d33ca..f0a1220 100644 --- a/README.md +++ b/README.md @@ -1292,8 +1292,7 @@ Reveal.addEventListener( 'ready', () => console.log( 'Three seconds later...' ) Reveal.initialize(); ``` -For plugins that are loaded as [dependencies](#dependencies), reveal.js will wait for the fullfillment of their init Promise only for the *non-async* plugins. -If the init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. +Note that reveal.js will *not* wait for the fullfillment of init promises if your plugin is loaded as an [async dependency](#dependencies). If the plugin's init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. ### Retrieving Plugins -- cgit v1.2.3 From bd3758a4df0cef60c984551ad413df7a90862b2b Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 10 Jun 2019 07:41:07 +0200 Subject: readme tweak --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index f0a1220..8db5508 100644 --- a/README.md +++ b/README.md @@ -1292,7 +1292,7 @@ Reveal.addEventListener( 'ready', () => console.log( 'Three seconds later...' ) Reveal.initialize(); ``` -Note that reveal.js will *not* wait for the fullfillment of init promises if your plugin is loaded as an [async dependency](#dependencies). If the plugin's init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. +Note that reveal.js will *not* wait for init Promise fullfillment if the plugin is loaded as an [async dependency](#dependencies). If the plugin's init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. ### Retrieving Plugins -- cgit v1.2.3 From abac58cfc5324e310ea573780944e32f9dd487e8 Mon Sep 17 00:00:00 2001 From: Pius Uzamere Date: Sat, 22 Jun 2019 15:17:01 -0400 Subject: Tweak to MathJax example Added a missing comma and used an actual macro so that the MathJax example runs right out of the box upon a copy/paste.--- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 33956e9..534861e 100644 --- a/README.md +++ b/README.md @@ -1411,9 +1411,9 @@ Reveal.initialize({ math: { mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js', - config: 'TeX-AMS_HTML-full' // See http://docs.mathjax.org/en/latest/config-files.html + config: 'TeX-AMS_HTML-full', // See http://docs.mathjax.org/en/latest/config-files.html // pass other options into `MathJax.Hub.Config()` - TeX: { Macros: macros } + TeX: { Macros: { RR: "{\\bf R}" } } }, dependencies: [ -- cgit v1.2.3 From 1bacb27072ecd5b057ee68f29df6cad3ee5f76ce Mon Sep 17 00:00:00 2001 From: Jason Cooke Date: Fri, 5 Jul 2019 22:00:10 +1200 Subject: docs: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 33956e9..e0e14f1 100644 --- a/README.md +++ b/README.md @@ -1237,7 +1237,7 @@ Then: Plugins should register themselves with reveal.js by calling `Reveal.registerPlugin( 'myPluginID', MyPlugin )`. Registered plugin instances can optionally expose an "init" function that reveal.js will call to initialize them. -When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fullfilled before finshing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that does some asynchronous work before reveal.js can proceed: +When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fulfilled before finshing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that does some asynchronous work before reveal.js can proceed: ```javascript let MyPlugin = { -- cgit v1.2.3 From 52e57d3677fdc8b365e2697a79fb6a309d805e4c Mon Sep 17 00:00:00 2001 From: İsmail Arılık Date: Fri, 12 Jul 2019 14:38:53 +0300 Subject: Add forgotten element to Table of Contents --- README.md | 1 + 1 file changed, 1 insertion(+) (limited to 'README.md') diff --git a/README.md b/README.md index 33956e9..fb13381 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ reveal.js comes with a broad range of features including [nested slides](https:/ - [Touch Navigation](#touch-navigation) - [Lazy Loading](#lazy-loading) - [API](#api) + - [Custom Key Bindings](#custom-key-bindings) - [Slide Changed Event](#slide-changed-event) - [Presentation State](#presentation-state) - [Slide States](#slide-states) -- cgit v1.2.3 From a4586766147df4460888040f2c2519e136e64a25 Mon Sep 17 00:00:00 2001 From: Christian Oliff Date: Tue, 3 Sep 2019 10:59:33 +0900 Subject: HTTPS relevant links on README --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 33956e9..b18762e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # reveal.js [![Build Status](https://travis-ci.org/hakimel/reveal.js.svg?branch=master)](https://travis-ci.org/hakimel/reveal.js) Slides -A framework for easily creating beautiful presentations using HTML. [Check out the live demo](http://revealjs.com/). +A framework for easily creating beautiful presentations using HTML. [Check out the live demo](https://revealjs.com/). reveal.js comes with a broad range of features including [nested slides](https://github.com/hakimel/reveal.js#markup), [Markdown contents](https://github.com/hakimel/reveal.js#markdown), [PDF export](https://github.com/hakimel/reveal.js#pdf-export), [speaker notes](https://github.com/hakimel/reveal.js#speaker-notes) and a [JavaScript API](https://github.com/hakimel/reveal.js#api). There's also a fully featured visual editor and platform for sharing reveal.js presentations at [slides.com](https://slides.com?ref=github). @@ -86,7 +86,7 @@ The core of reveal.js is very easy to install. You'll simply need to download a Some reveal.js features, like external Markdown and speaker notes, require that presentations run from a local web server. The following instructions will set up such a server as well as all of the development tasks needed to make edits to the reveal.js source code. -1. Install [Node.js](http://nodejs.org/) (4.0.0 or later) +1. Install [Node.js](https://nodejs.org/) (4.0.0 or later) 1. Clone the reveal.js repository ```sh @@ -1304,7 +1304,7 @@ Reveal.initialize({ #### Client presentation -Served from a publicly accessible static file server. Examples include: GitHub Pages, Amazon S3, Dreamhost, Akamai, etc. The more reliable, the better. Your audience can then access the client presentation via `http://example.com/path/to/presentation/client/index.html`, with the configuration below causing them to connect to the socket.io server as clients. +Served from a publicly accessible static file server. Examples include: GitHub Pages, Amazon S3, Dreamhost, Akamai, etc. The more reliable, the better. Your audience can then access the client presentation via `https://example.com/path/to/presentation/client/index.html`, with the configuration below causing them to connect to the socket.io server as clients. Example configuration: @@ -1338,7 +1338,7 @@ Server that receives the `slideChanged` events from the master presentation and Or you can use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/). -You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit `http://example.com/token`, where `http://example.com` is the location of your socket.io server. Or if you're going to use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token). +You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit `https://example.com/token`, where `https://example.com` is the location of your socket.io server. Or if you're going to use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token). You are very welcome to point your presentations at the Socket.io server running at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), but availability and stability are not guaranteed. @@ -1401,7 +1401,7 @@ Reveal.initialize({ If you want to display math equations in your presentation you can easily do so by including this plugin. The plugin is a very thin wrapper around the [MathJax](http://www.mathjax.org/) library. To use it you'll need to include it as a reveal.js dependency, [find our more about dependencies here](#dependencies). -The plugin defaults to using [LaTeX](http://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the `math` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the `mathjax` configuration value. +The plugin defaults to using [LaTeX](https://en.wikipedia.org/wiki/LaTeX) but that can be adjusted through the `math` configuration object. Note that MathJax is loaded from a remote server. If you want to use it offline you'll need to download a copy of the library and adjust the `mathjax` configuration value. Below is an example of how the plugin can be configured. If you don't intend to change these values you do not need to include the `math` config object at all. -- cgit v1.2.3 From 02a42d1c9e7cea692d0f80e343820c94f162a9bd Mon Sep 17 00:00:00 2001 From: Adri-May Date: Wed, 18 Sep 2019 21:57:24 -0400 Subject: Bug fix: spelling errors --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3be68fb..3cb542d 100644 --- a/README.md +++ b/README.md @@ -544,7 +544,7 @@ Slides can be nested within other slides to create vertical stacks (see [Markup] #### Navigation Mode -You can finetune the reveal.js navigation behavior by using the `navigationMode` config option. Note that these options are only useful for presnetations that use a mix of horizontal and vertical slides. The following navigation modes are available: +You can fine tune the reveal.js navigation behavior by using the `navigationMode` config option. Note that these options are only useful for presentations that use a mix of horizontal and vertical slides. The following navigation modes are available: | Value | Description | | :--------------------------- | :---------- | @@ -800,7 +800,7 @@ Embeds a web page as a slide background that covers 100% of the reveal.js width
``` -Iframes are lazy-loaded when they become visible. If you'd like to preload iframes aehad of time, you can append a `data-preload` attribute to the slide `
`. You can also enable preloading globally for all iframes using the `preloadIframes` configuration option. +Iframes are lazy-loaded when they become visible. If you'd like to preload iframes ahead of time, you can append a `data-preload` attribute to the slide `
`. You can also enable preloading globally for all iframes using the `preloadIframes` configuration option. #### Background Transitions @@ -1281,7 +1281,7 @@ Then: Plugins should register themselves with reveal.js by calling `Reveal.registerPlugin( 'myPluginID', MyPlugin )`. Registered plugin instances can optionally expose an "init" function that reveal.js will call to initialize them. -When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fulfilled before finshing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that does some asynchronous work before reveal.js can proceed: +When reveal.js is booted up via `Reveal.initialize()`, it will go through all registered plugins and invoke their "init" methods. If the "init" method returns a Promise, reveal.js will wait for that promise to be fulfilled before finishing the startup sequence and firing the [ready](#ready-event) event. Here's an example of a plugin that does some asynchronous work before reveal.js can proceed: ```javascript let MyPlugin = { @@ -1292,7 +1292,7 @@ Reveal.addEventListener( 'ready', () => console.log( 'Three seconds later...' ) Reveal.initialize(); ``` -Note that reveal.js will *not* wait for init Promise fullfillment if the plugin is loaded as an [async dependency](#dependencies). If the plugin's init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. +Note that reveal.js will *not* wait for init Promise fulfillment if the plugin is loaded as an [async dependency](#dependencies). If the plugin's init method does _not_ return a Promise, the plugin is considered ready right away and will not hold up the reveal.js startup sequence. ### Retrieving Plugins -- cgit v1.2.3 From 94de806f06a3f8e349b77c865fcaf674f8aab06b Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 9 Dec 2019 21:05:41 +0100 Subject: add mobileViewDistance to readme #2513 --- README.md | 5 +++++ js/reveal.js | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 3be68fb..55dbf8a 100644 --- a/README.md +++ b/README.md @@ -382,6 +382,11 @@ Reveal.initialize({ // Number of slides away from the current that are visible viewDistance: 3, + // Number of slides away from the current that are visible on mobile + // devices. It is advisable to set this to a lower number than + // viewDistance in order to save resources. + mobileViewDistance: 2, + // Parallax background image parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'" diff --git a/js/reveal.js b/js/reveal.js index 75e3c68..57fe29d 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -270,8 +270,9 @@ // Number of slides away from the current that are visible viewDistance: 3, - // Number of slides away from the current that are visible on mobile devices - // It is advisable to set this to a lower number than viewDistance in order to save resources + // Number of slides away from the current that are visible on mobile + // devices. It is advisable to set this to a lower number than + // viewDistance in order to save resources. mobileViewDistance: 2, // The display mode that will be used to show slides @@ -3288,7 +3289,8 @@ // be visible var viewDistance = isOverview() ? 10 : config.viewDistance; - // Limit view distance on weaker devices + // Shorten the view distance on devices that typically have + // less resources if( isMobileDevice ) { viewDistance = isOverview() ? 6 : config.mobileViewDistance; } -- cgit v1.2.3 From d969ec5f259a08e53911370a4db90ded828a324a Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 15 Jan 2020 11:39:19 +0100 Subject: 2020 --- LICENSE | 2 +- README.md | 2 +- css/reveal.css | 18 +++++++++--------- css/reveal.scss | 2 +- gruntfile.js | 2 +- js/reveal.js | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'README.md') diff --git a/LICENSE b/LICENSE index 697d156..d15cf3b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2019 Hakim El Hattab, http://hakim.se, and reveal.js contributors +Copyright (C) 2020 Hakim El Hattab, http://hakim.se, and reveal.js contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 42dba52..abdfc2c 100644 --- a/README.md +++ b/README.md @@ -1485,4 +1485,4 @@ If you want to include math inside of a presentation written in Markdown you nee MIT licensed -Copyright (C) 2019 Hakim El Hattab, http://hakim.se +Copyright (C) 2020 Hakim El Hattab, http://hakim.se diff --git a/css/reveal.css b/css/reveal.css index fb47296..0ca77e7 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -3,7 +3,7 @@ * http://revealjs.com * MIT licensed * - * Copyright (C) 2019 Hakim El Hattab, http://hakim.se + * Copyright (C) 2020 Hakim El Hattab, http://hakim.se */ /********************************************* * GLOBAL STYLES @@ -77,29 +77,29 @@ body { text-decoration: line-through; } .reveal .slides section .fragment.fade-up { - -webkit-transform: translate(0, 20%); - transform: translate(0, 20%); } + -webkit-transform: translate(0, 40px); + transform: translate(0, 40px); } .reveal .slides section .fragment.fade-up.visible { -webkit-transform: translate(0, 0); transform: translate(0, 0); } .reveal .slides section .fragment.fade-down { - -webkit-transform: translate(0, -20%); - transform: translate(0, -20%); } + -webkit-transform: translate(0, -40px); + transform: translate(0, -40px); } .reveal .slides section .fragment.fade-down.visible { -webkit-transform: translate(0, 0); transform: translate(0, 0); } .reveal .slides section .fragment.fade-right { - -webkit-transform: translate(-20%, 0); - transform: translate(-20%, 0); } + -webkit-transform: translate(-40px, 0); + transform: translate(-40px, 0); } .reveal .slides section .fragment.fade-right.visible { -webkit-transform: translate(0, 0); transform: translate(0, 0); } .reveal .slides section .fragment.fade-left { - -webkit-transform: translate(20%, 0); - transform: translate(20%, 0); } + -webkit-transform: translate(40px, 0); + transform: translate(40px, 0); } .reveal .slides section .fragment.fade-left.visible { -webkit-transform: translate(0, 0); transform: translate(0, 0); } diff --git a/css/reveal.scss b/css/reveal.scss index 176c736..ab11f32 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -3,7 +3,7 @@ * http://revealjs.com * MIT licensed * - * Copyright (C) 2019 Hakim El Hattab, http://hakim.se + * Copyright (C) 2020 Hakim El Hattab, http://hakim.se */ diff --git a/gruntfile.js b/gruntfile.js index 7e35753..acf34b6 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -19,7 +19,7 @@ module.exports = grunt => { ' * http://revealjs.com\n' + ' * MIT licensed\n' + ' *\n' + - ' * Copyright (C) 2019 Hakim El Hattab, http://hakim.se\n' + + ' * Copyright (C) 2020 Hakim El Hattab, http://hakim.se\n' + ' */' }, diff --git a/js/reveal.js b/js/reveal.js index da806fc..56719cc 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3,7 +3,7 @@ * http://revealjs.com * MIT licensed * - * Copyright (C) 2019 Hakim El Hattab, http://hakim.se + * Copyright (C) 2020 Hakim El Hattab, http://hakim.se */ (function( root, factory ) { if( typeof define === 'function' && define.amd ) { -- cgit v1.2.3