Merge branch 'dev' into patch-1
This commit is contained in:
commit
9693816480
2
LICENSE
2
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
|
||||
|
|
|
@ -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); }
|
||||
|
@ -227,7 +227,7 @@ body {
|
|||
bottom: 12px;
|
||||
right: 12px;
|
||||
left: auto;
|
||||
z-index: 1;
|
||||
z-index: 11;
|
||||
color: #000;
|
||||
pointer-events: none;
|
||||
font-size: 10px; }
|
||||
|
@ -312,7 +312,8 @@ body {
|
|||
transform: rotate(90deg); }
|
||||
.reveal .controls .navigate-down {
|
||||
right: 3.2em;
|
||||
bottom: 0;
|
||||
bottom: -1.4em;
|
||||
padding-bottom: 1.4em;
|
||||
-webkit-transform: translateY(10px);
|
||||
transform: translateY(10px); }
|
||||
.reveal .controls .navigate-down .controls-arrow {
|
||||
|
@ -395,18 +396,18 @@ body {
|
|||
right: auto; }
|
||||
.reveal .controls[data-controls-layout="edges"] .navigate-left {
|
||||
top: 50%;
|
||||
left: 8px;
|
||||
left: 0.8em;
|
||||
margin-top: -1.8em; }
|
||||
.reveal .controls[data-controls-layout="edges"] .navigate-right {
|
||||
top: 50%;
|
||||
right: 8px;
|
||||
right: 0.8em;
|
||||
margin-top: -1.8em; }
|
||||
.reveal .controls[data-controls-layout="edges"] .navigate-up {
|
||||
top: 8px;
|
||||
top: 0.8em;
|
||||
left: 50%;
|
||||
margin-left: -1.8em; }
|
||||
.reveal .controls[data-controls-layout="edges"] .navigate-down {
|
||||
bottom: 8px;
|
||||
bottom: -0.3em;
|
||||
left: 50%;
|
||||
margin-left: -1.8em; } }
|
||||
|
||||
|
@ -1453,9 +1454,16 @@ body {
|
|||
text-align: right;
|
||||
vertical-align: top; }
|
||||
|
||||
.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) {
|
||||
.reveal .hljs.has-highlights tr:not(.highlight-line) {
|
||||
opacity: 0.4; }
|
||||
|
||||
.reveal .hljs:not(:first-child).fragment {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box; }
|
||||
|
||||
/*********************************************
|
||||
* ROLLING LINKS
|
||||
*********************************************/
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
||||
|
||||
|
@ -102,7 +102,7 @@ body {
|
|||
}
|
||||
|
||||
.reveal .slides section .fragment.fade-up {
|
||||
transform: translate(0, 20%);
|
||||
transform: translate(0, 40px);
|
||||
|
||||
&.visible {
|
||||
transform: translate(0, 0);
|
||||
|
@ -110,7 +110,7 @@ body {
|
|||
}
|
||||
|
||||
.reveal .slides section .fragment.fade-down {
|
||||
transform: translate(0, -20%);
|
||||
transform: translate(0, -40px);
|
||||
|
||||
&.visible {
|
||||
transform: translate(0, 0);
|
||||
|
@ -118,7 +118,7 @@ body {
|
|||
}
|
||||
|
||||
.reveal .slides section .fragment.fade-right {
|
||||
transform: translate(-20%, 0);
|
||||
transform: translate(-40px, 0);
|
||||
|
||||
&.visible {
|
||||
transform: translate(0, 0);
|
||||
|
@ -126,7 +126,7 @@ body {
|
|||
}
|
||||
|
||||
.reveal .slides section .fragment.fade-left {
|
||||
transform: translate(20%, 0);
|
||||
transform: translate(40px, 0);
|
||||
|
||||
&.visible {
|
||||
transform: translate(0, 0);
|
||||
|
@ -263,7 +263,7 @@ $controlsArrowAngleActive: 36deg;
|
|||
bottom: $spacing;
|
||||
right: $spacing;
|
||||
left: auto;
|
||||
z-index: 1;
|
||||
z-index: 11;
|
||||
color: #000;
|
||||
pointer-events: none;
|
||||
font-size: 10px;
|
||||
|
@ -355,7 +355,8 @@ $controlsArrowAngleActive: 36deg;
|
|||
|
||||
.navigate-down {
|
||||
right: $controlArrowSpacing + $controlArrowSize/2;
|
||||
bottom: 0;
|
||||
bottom: -$controlArrowSpacing;
|
||||
padding-bottom: $controlArrowSpacing;
|
||||
transform: translateY( 10px );
|
||||
|
||||
.controls-arrow {
|
||||
|
@ -452,7 +453,7 @@ $controlsArrowAngleActive: 36deg;
|
|||
// Edge aligned controls layout
|
||||
@media screen and (min-width: 500px) {
|
||||
|
||||
$spacing: 8px;
|
||||
$spacing: 0.8em;
|
||||
|
||||
.reveal .controls[data-controls-layout="edges"] {
|
||||
& {
|
||||
|
@ -489,7 +490,7 @@ $controlsArrowAngleActive: 36deg;
|
|||
}
|
||||
|
||||
.navigate-down {
|
||||
bottom: $spacing;
|
||||
bottom: $spacing - $controlArrowSpacing + 0.3em;
|
||||
left: 50%;
|
||||
margin-left: -$controlArrowSize/2;
|
||||
}
|
||||
|
@ -1590,10 +1591,18 @@ $controlsArrowAngleActive: 36deg;
|
|||
vertical-align: top;
|
||||
}
|
||||
|
||||
.reveal .hljs[data-line-numbers]:not([data-line-numbers=""]) tr:not(.highlight-line) {
|
||||
.reveal .hljs.has-highlights tr:not(.highlight-line) {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
.reveal .hljs:not(:first-child).fragment {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
/*********************************************
|
||||
* ROLLING LINKS
|
||||
|
|
|
@ -4,7 +4,7 @@ Themes are written using Sass to keep things modular and reduce the need for rep
|
|||
|
||||
## Creating a Theme
|
||||
|
||||
To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/Gruntfile.js)) when you run `npm run build -- css-themes`.
|
||||
To create your own theme, start by duplicating a ```.scss``` file in [/css/theme/source](https://github.com/hakimel/reveal.js/blob/master/css/theme/source). It will be automatically compiled by Grunt from Sass to CSS (see the [Gruntfile](https://github.com/hakimel/reveal.js/blob/master/gruntfile.js)) when you run `npm run build -- css-themes`.
|
||||
|
||||
Each theme file does four things in the following order:
|
||||
|
||||
|
|
|
@ -241,7 +241,7 @@
|
|||
|
||||
<section>
|
||||
<h2>Pretty Code</h2>
|
||||
<pre><code class="hljs" data-trim data-line-numbers="4,8-11">
|
||||
<pre><code class="hljs" data-trim data-line-numbers="4|9|4,8-11">
|
||||
import React, { useState } from 'react';
|
||||
|
||||
function Example() {
|
||||
|
@ -412,7 +412,7 @@ Reveal.addEventListener( 'customevent', function() {
|
|||
dependencies: [
|
||||
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||||
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
||||
{ src: 'plugin/highlight/highlight.js', async: true },
|
||||
{ src: 'plugin/highlight/highlight.js' },
|
||||
{ src: 'plugin/search/search.js', async: true },
|
||||
{ src: 'plugin/zoom-js/zoom.js', async: true },
|
||||
{ src: 'plugin/notes/notes.js', async: true }
|
||||
|
|
|
@ -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' +
|
||||
' */'
|
||||
},
|
||||
|
||||
|
|
|
@ -37,11 +37,12 @@
|
|||
// - https://github.com/hakimel/reveal.js#configuration
|
||||
// - https://github.com/hakimel/reveal.js#dependencies
|
||||
Reveal.initialize({
|
||||
hash: true,
|
||||
dependencies: [
|
||||
{ src: 'plugin/markdown/marked.js' },
|
||||
{ src: 'plugin/markdown/markdown.js' },
|
||||
{ src: 'plugin/notes/notes.js', async: true },
|
||||
{ src: 'plugin/highlight/highlight.js', async: true }
|
||||
{ src: 'plugin/highlight/highlight.js' },
|
||||
{ src: 'plugin/notes/notes.js', async: true }
|
||||
]
|
||||
});
|
||||
</script>
|
||||
|
|
204
js/reveal.js
204
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 ) {
|
||||
|
@ -270,6 +270,11 @@
|
|||
// 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,
|
||||
|
||||
// The display mode that will be used to show slides
|
||||
display: 'block',
|
||||
|
||||
|
@ -447,7 +452,8 @@
|
|||
*/
|
||||
function checkCapabilities() {
|
||||
|
||||
isMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA );
|
||||
isMobileDevice = /(iphone|ipod|ipad|android)/gi.test( UA ) ||
|
||||
( navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1 ); // iPadOS
|
||||
isChrome = /chrome/i.test( UA ) && !/edge/i.test( UA );
|
||||
|
||||
var testElement = document.createElement( 'div' );
|
||||
|
@ -1217,6 +1223,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;
|
||||
|
@ -1276,7 +1284,11 @@
|
|||
|
||||
// Check if the requested method can be found
|
||||
if( data.method && typeof Reveal[data.method] === 'function' ) {
|
||||
Reveal[data.method].apply( Reveal, data.args );
|
||||
var result = Reveal[data.method].apply( Reveal, data.args );
|
||||
|
||||
// Dispatch a postMessage event with the returned value from
|
||||
// our method invocation for getter functions
|
||||
dispatchPostMessage( 'callback', { method: data.method, result: result } );
|
||||
}
|
||||
}
|
||||
}, false );
|
||||
|
@ -1447,8 +1459,8 @@
|
|||
keyboardShortcuts['↓ , J'] = 'Navigate down';
|
||||
}
|
||||
|
||||
keyboardShortcuts['Home , ⌘/CTRL ←'] = 'First slide';
|
||||
keyboardShortcuts['End , ⌘/CTRL →'] = 'Last slide';
|
||||
keyboardShortcuts['Home , Shift ←'] = 'First slide';
|
||||
keyboardShortcuts['End , Shift →'] = 'Last slide';
|
||||
keyboardShortcuts['B , .'] = 'Pause';
|
||||
keyboardShortcuts['F'] = 'Fullscreen';
|
||||
keyboardShortcuts['ESC, O'] = 'Slide overview';
|
||||
|
@ -1981,8 +1993,25 @@
|
|||
|
||||
// If we're in an iframe, post each reveal.js event to the
|
||||
// parent window. Used by the notes plugin
|
||||
dispatchPostMessage( type );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatched a postMessage of the given type from our window.
|
||||
*/
|
||||
function dispatchPostMessage( type, data ) {
|
||||
|
||||
if( config.postMessageEvents && window.parent !== window.self ) {
|
||||
window.parent.postMessage( JSON.stringify({ namespace: 'reveal', eventName: type, state: getState() }), '*' );
|
||||
var message = {
|
||||
namespace: 'reveal',
|
||||
eventName: type,
|
||||
state: getState()
|
||||
};
|
||||
|
||||
extend( message, data );
|
||||
|
||||
window.parent.postMessage( JSON.stringify( message ), '*' );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2243,10 +2272,12 @@
|
|||
transformSlides( { layout: '' } );
|
||||
}
|
||||
else {
|
||||
// Prefer zoom for scaling up so that content remains crisp.
|
||||
// Don't use zoom to scale down since that can lead to shifts
|
||||
// in text layout/line breaks.
|
||||
if( scale > 1 && features.zoom ) {
|
||||
// Zoom Scaling
|
||||
// Content remains crisp no matter how much we scale. Side
|
||||
// effects are minor differences in text layout and iframe
|
||||
// viewports changing size. A 200x200 iframe viewport in a
|
||||
// 2x zoomed presentation ends up having a 400x400 viewport.
|
||||
if( scale > 1 && features.zoom && window.devicePixelRatio < 2 ) {
|
||||
dom.slides.style.zoom = scale;
|
||||
dom.slides.style.left = '';
|
||||
dom.slides.style.top = '';
|
||||
|
@ -2254,7 +2285,10 @@
|
|||
dom.slides.style.right = '';
|
||||
transformSlides( { layout: '' } );
|
||||
}
|
||||
// Apply scale transform as a fallback
|
||||
// Transform Scaling
|
||||
// Content layout remains the exact same when scaled up.
|
||||
// Side effect is content becoming blurred, especially with
|
||||
// high scale values on ldpi screens.
|
||||
else {
|
||||
dom.slides.style.zoom = '';
|
||||
dom.slides.style.left = '50%';
|
||||
|
@ -3039,11 +3073,11 @@
|
|||
syncBackground( slide );
|
||||
syncFragments( slide );
|
||||
|
||||
loadSlide( slide );
|
||||
|
||||
updateBackground();
|
||||
updateNotes();
|
||||
|
||||
loadSlide( slide );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3255,9 +3289,10 @@
|
|||
// 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 : 2;
|
||||
viewDistance = isOverview() ? 6 : config.mobileViewDistance;
|
||||
}
|
||||
|
||||
// All slides need to be visible when exporting to PDF
|
||||
|
@ -3309,7 +3344,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 {
|
||||
|
@ -3317,7 +3352,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 {
|
||||
|
@ -3599,7 +3634,7 @@
|
|||
// Stop content inside of previous backgrounds
|
||||
if( previousBackground ) {
|
||||
|
||||
stopEmbeddedContent( previousBackground );
|
||||
stopEmbeddedContent( previousBackground, { unloadIframes: !shouldPreload( previousBackground ) } );
|
||||
|
||||
}
|
||||
|
||||
|
@ -3778,6 +3813,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 ) {
|
||||
|
@ -3786,8 +3822,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 ) {
|
||||
|
@ -3827,15 +3862,9 @@
|
|||
iframe.setAttribute( 'allowfullscreen', '' );
|
||||
iframe.setAttribute( 'mozallowfullscreen', '' );
|
||||
iframe.setAttribute( 'webkitallowfullscreen', '' );
|
||||
iframe.setAttribute( 'allow', 'autoplay' );
|
||||
|
||||
// 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.style.width = '100%';
|
||||
iframe.style.height = '100%';
|
||||
|
@ -3846,6 +3875,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 );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3865,6 +3907,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
|
||||
|
@ -4433,6 +4480,43 @@
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array of objects where each object represents the
|
||||
* attributes on its respective slide.
|
||||
|
@ -4667,6 +4751,8 @@
|
|||
|
||||
if( fragments.length ) {
|
||||
|
||||
var maxIndex = 0;
|
||||
|
||||
if( typeof index !== 'number' ) {
|
||||
var currentFragment = sortFragments( currentSlide.querySelectorAll( '.fragment.visible' ) ).pop();
|
||||
if( currentFragment ) {
|
||||
|
@ -4680,6 +4766,8 @@
|
|||
i = parseInt( el.getAttribute( 'data-fragment-index' ), 10 );
|
||||
}
|
||||
|
||||
maxIndex = Math.max( maxIndex, i );
|
||||
|
||||
// Visible fragments
|
||||
if( i <= index ) {
|
||||
if( !el.classList.contains( 'visible' ) ) changedFragments.shown.push( el );
|
||||
|
@ -4703,6 +4791,13 @@
|
|||
|
||||
} );
|
||||
|
||||
// Write the current fragment index to the slide <section>.
|
||||
// This can be used by end users to apply styles based on
|
||||
// the current fragment index.
|
||||
index = typeof index === 'number' ? index : -1;
|
||||
index = Math.max( Math.min( index, maxIndex ), -1 );
|
||||
currentSlide.setAttribute( 'data-fragment', index );
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5116,8 +5211,8 @@
|
|||
|
||||
// Whitelist specific modified + keycode combinations
|
||||
var prevSlideShortcut = event.shiftKey && event.keyCode === 32;
|
||||
var firstSlideShortcut = ( event.metaKey || event.ctrlKey ) && keyCode === 37;
|
||||
var lastSlideShortcut = ( event.metaKey || event.ctrlKey ) && keyCode === 39;
|
||||
var firstSlideShortcut = event.shiftKey && keyCode === 37;
|
||||
var lastSlideShortcut = event.shiftKey && keyCode === 39;
|
||||
|
||||
// Prevent all other events when a modifier is pressed
|
||||
var unusedModifier = !prevSlideShortcut && !firstSlideShortcut && !lastSlideShortcut &&
|
||||
|
@ -5144,6 +5239,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
|
||||
|
@ -5216,7 +5315,7 @@
|
|||
if( firstSlideShortcut ) {
|
||||
slide( 0 );
|
||||
}
|
||||
else if( !isOverview() && config.navigationMode === 'linear' ) {
|
||||
else if( !isOverview() && useLinearMode ) {
|
||||
navigatePrev();
|
||||
}
|
||||
else {
|
||||
|
@ -5228,7 +5327,7 @@
|
|||
if( lastSlideShortcut ) {
|
||||
slide( Number.MAX_VALUE );
|
||||
}
|
||||
else if( !isOverview() && config.navigationMode === 'linear' ) {
|
||||
else if( !isOverview() && useLinearMode ) {
|
||||
navigateNext();
|
||||
}
|
||||
else {
|
||||
|
@ -5237,7 +5336,7 @@
|
|||
}
|
||||
// K, UP
|
||||
else if( keyCode === 75 || keyCode === 38 ) {
|
||||
if( !isOverview() && config.navigationMode === 'linear' ) {
|
||||
if( !isOverview() && useLinearMode ) {
|
||||
navigatePrev();
|
||||
}
|
||||
else {
|
||||
|
@ -5246,7 +5345,7 @@
|
|||
}
|
||||
// J, DOWN
|
||||
else if( keyCode === 74 || keyCode === 40 ) {
|
||||
if( !isOverview() && config.navigationMode === 'linear' ) {
|
||||
if( !isOverview() && useLinearMode ) {
|
||||
navigateNext();
|
||||
}
|
||||
else {
|
||||
|
@ -5356,20 +5455,50 @@
|
|||
|
||||
if( deltaX > touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) {
|
||||
touch.captured = true;
|
||||
if( config.navigationMode === 'linear' ) {
|
||||
if( config.rtl ) {
|
||||
navigateNext();
|
||||
}
|
||||
else {
|
||||
navigatePrev();
|
||||
}
|
||||
}
|
||||
else {
|
||||
navigateLeft();
|
||||
}
|
||||
}
|
||||
else if( deltaX < -touch.threshold && Math.abs( deltaX ) > Math.abs( deltaY ) ) {
|
||||
touch.captured = true;
|
||||
if( config.navigationMode === 'linear' ) {
|
||||
if( config.rtl ) {
|
||||
navigatePrev();
|
||||
}
|
||||
else {
|
||||
navigateNext();
|
||||
}
|
||||
}
|
||||
else {
|
||||
navigateRight();
|
||||
}
|
||||
}
|
||||
else if( deltaY > touch.threshold ) {
|
||||
touch.captured = true;
|
||||
if( config.navigationMode === 'linear' ) {
|
||||
navigatePrev();
|
||||
}
|
||||
else {
|
||||
navigateUp();
|
||||
}
|
||||
}
|
||||
else if( deltaY < -touch.threshold ) {
|
||||
touch.captured = true;
|
||||
if( config.navigationMode === 'linear' ) {
|
||||
navigateNext();
|
||||
}
|
||||
else {
|
||||
navigateDown();
|
||||
}
|
||||
}
|
||||
|
||||
// If we're embedded, only block touch events if they have
|
||||
// triggered an action
|
||||
|
@ -5905,6 +6034,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;
|
||||
|
|
360
package-lock.json
generated
360
package-lock.json
generated
|
@ -44,18 +44,18 @@
|
|||
"dev": true
|
||||
},
|
||||
"agent-base": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz",
|
||||
"integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
|
||||
"integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"es6-promisify": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"ajv": {
|
||||
"version": "6.9.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.9.2.tgz",
|
||||
"integrity": "sha512-4UFy0/LgDo7Oa/+wOAlj44tp9K78u38E5/359eSrqEp1Z5PdVfimCcs7SluXMP755RUQu6d2b4AvF0R1C9RZjg==",
|
||||
"version": "6.10.2",
|
||||
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
|
||||
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fast-deep-equal": "^2.0.1",
|
||||
|
@ -275,9 +275,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"aws4": {
|
||||
"version": "1.8.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
|
||||
"integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==",
|
||||
"version": "1.9.0",
|
||||
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz",
|
||||
"integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==",
|
||||
"dev": true
|
||||
},
|
||||
"backo2": {
|
||||
|
@ -712,9 +712,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz",
|
||||
"integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==",
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
|
@ -1263,9 +1263,9 @@
|
|||
}
|
||||
},
|
||||
"es6-promise": {
|
||||
"version": "4.2.6",
|
||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
|
||||
"integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==",
|
||||
"version": "4.2.8",
|
||||
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
|
||||
"integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
|
||||
"dev": true
|
||||
},
|
||||
"es6-promisify": {
|
||||
|
@ -1615,9 +1615,9 @@
|
|||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz",
|
||||
"integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=",
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
|
||||
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
|
||||
"dev": true
|
||||
},
|
||||
"extend-shallow": {
|
||||
|
@ -1737,15 +1737,15 @@
|
|||
"dev": true
|
||||
},
|
||||
"process-nextick-args": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz",
|
||||
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
|
||||
"integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
|
||||
"dev": true
|
||||
},
|
||||
"readable-stream": {
|
||||
"version": "2.3.6",
|
||||
"resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
|
||||
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
|
||||
"version": "2.3.7",
|
||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
|
||||
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"core-util-is": "~1.0.0",
|
||||
|
@ -1781,9 +1781,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"fast-json-stable-stringify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
|
||||
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=",
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
|
||||
"integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
|
||||
"dev": true
|
||||
},
|
||||
"faye-websocket": {
|
||||
|
@ -1988,9 +1988,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"fstream": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz",
|
||||
"integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=",
|
||||
"version": "1.0.12",
|
||||
"resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
|
||||
"integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
|
@ -2305,9 +2305,9 @@
|
|||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -2790,12 +2790,12 @@
|
|||
"dev": true
|
||||
},
|
||||
"https-proxy-agent": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
|
||||
"integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
|
||||
"version": "2.2.4",
|
||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
|
||||
"integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"agent-base": "^4.1.0",
|
||||
"agent-base": "^4.3.0",
|
||||
"debug": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -3120,9 +3120,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "3.13.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.0.tgz",
|
||||
"integrity": "sha512-pZZoSxcCYco+DIKBTimr67J6Hy+EYGZDY/HCWC+iAEA9h1ByhMXAIVUXMcMFpOCxQ/xjXmPI2MkDL5HRm5eFrQ==",
|
||||
"version": "3.13.1",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
|
||||
"integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
|
@ -3276,21 +3276,9 @@
|
|||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.assign": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
|
||||
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.clonedeep": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz",
|
||||
"integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=",
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.isfinite": {
|
||||
|
@ -3299,12 +3287,6 @@
|
|||
"integrity": "sha1-+4m2WpqAKBgz8LdHizpRBPiY67M=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.mergewith": {
|
||||
"version": "4.6.1",
|
||||
"resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz",
|
||||
"integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==",
|
||||
"dev": true
|
||||
},
|
||||
"loud-rejection": {
|
||||
"version": "1.6.0",
|
||||
"resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz",
|
||||
|
@ -3431,18 +3413,18 @@
|
|||
"dev": true
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.38.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz",
|
||||
"integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==",
|
||||
"version": "1.43.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
|
||||
"integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==",
|
||||
"dev": true
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.22",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz",
|
||||
"integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==",
|
||||
"version": "2.1.26",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
|
||||
"integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"mime-db": "~1.38.0"
|
||||
"mime-db": "1.43.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
|
@ -3461,9 +3443,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"mixin-deep": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz",
|
||||
"integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==",
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
|
||||
"integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"for-in": "^1.0.2",
|
||||
|
@ -3559,9 +3541,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz",
|
||||
"integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==",
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"dev": true
|
||||
},
|
||||
"nanomatch": {
|
||||
|
@ -3609,45 +3591,6 @@
|
|||
"which": "1"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.3.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz",
|
||||
|
@ -3673,9 +3616,9 @@
|
|||
}
|
||||
},
|
||||
"node-sass": {
|
||||
"version": "4.11.0",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.11.0.tgz",
|
||||
"integrity": "sha512-bHUdHTphgQJZaF1LASx0kAviPH7sGlcyNhWade4eVIpFp6tsn7SV8xNMTbsQFpEV9VXpnwTTnNYlfsZXgGgmkA==",
|
||||
"version": "4.13.0",
|
||||
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz",
|
||||
"integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"async-foreach": "^0.1.3",
|
||||
|
@ -3685,12 +3628,10 @@
|
|||
"get-stdin": "^4.0.1",
|
||||
"glob": "^7.0.3",
|
||||
"in-publish": "^2.0.0",
|
||||
"lodash.assign": "^4.2.0",
|
||||
"lodash.clonedeep": "^4.3.2",
|
||||
"lodash.mergewith": "^4.6.0",
|
||||
"lodash": "^4.17.15",
|
||||
"meow": "^3.7.0",
|
||||
"mkdirp": "^0.5.1",
|
||||
"nan": "^2.10.0",
|
||||
"nan": "^2.13.2",
|
||||
"node-gyp": "^3.8.0",
|
||||
"npmlog": "^4.0.0",
|
||||
"request": "^2.88.0",
|
||||
|
@ -3699,44 +3640,11 @@
|
|||
"true-case-path": "^1.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"lodash": {
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -4153,9 +4061,9 @@
|
|||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.11",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz",
|
||||
"integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==",
|
||||
"version": "4.17.15",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
|
||||
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -4229,9 +4137,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"psl": {
|
||||
"version": "1.1.31",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz",
|
||||
"integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==",
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.7.0.tgz",
|
||||
"integrity": "sha512-5NsSEDv8zY70ScRnOTn7bK7eanl2MvFrOrS/R6x+dBt5g1ghnj9Zv90kO8GwT8gxcu2ANyFprnFYB85IogIJOQ==",
|
||||
"dev": true
|
||||
},
|
||||
"punycode": {
|
||||
|
@ -4241,9 +4149,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"puppeteer": {
|
||||
"version": "1.12.2",
|
||||
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.12.2.tgz",
|
||||
"integrity": "sha512-xWSyCeD6EazGlfnQweMpM+Hs6X6PhUYhNTHKFj/axNZDq4OmrVERf70isBf7HsnFgB3zOC1+23/8+wCAZYg+Pg==",
|
||||
"version": "1.20.0",
|
||||
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.20.0.tgz",
|
||||
"integrity": "sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"debug": "^4.1.0",
|
||||
|
@ -4266,9 +4174,9 @@
|
|||
}
|
||||
},
|
||||
"mime": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.0.tgz",
|
||||
"integrity": "sha512-ikBcWwyqXQSHKtciCcctu9YfPbFYZ4+gbHEmE0Q8jzcTYQg5dHCr3g2wwAZjPoJfQVXZq6KXAjpXOTf5/cjT7w==",
|
||||
"version": "2.4.4",
|
||||
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz",
|
||||
"integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
@ -4572,47 +4480,6 @@
|
|||
"lodash": "^4.0.0",
|
||||
"scss-tokenizer": "^0.2.3",
|
||||
"yargs": "^7.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.0.4",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"minimatch": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"brace-expansion": "^1.1.7"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"scss-tokenizer": {
|
||||
|
@ -4773,9 +4640,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"set-value": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz",
|
||||
"integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
|
||||
"integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"extend-shallow": "^2.0.1",
|
||||
|
@ -5248,13 +5115,13 @@
|
|||
"dev": true
|
||||
},
|
||||
"tar": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz",
|
||||
"integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=",
|
||||
"version": "2.2.2",
|
||||
"resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz",
|
||||
"integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"block-stream": "*",
|
||||
"fstream": "^1.0.2",
|
||||
"fstream": "^1.0.12",
|
||||
"inherits": "2"
|
||||
}
|
||||
},
|
||||
|
@ -5379,26 +5246,10 @@
|
|||
"glob": "^7.1.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"balanced-match": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
||||
"dev": true
|
||||
},
|
||||
"brace-expansion": {
|
||||
"version": "1.1.11",
|
||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"balanced-match": "^1.0.0",
|
||||
"concat-map": "0.0.1"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz",
|
||||
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
|
||||
"version": "7.1.6",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
|
||||
"integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
|
@ -5488,38 +5339,15 @@
|
|||
}
|
||||
},
|
||||
"union-value": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz",
|
||||
"integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=",
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
|
||||
"integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"arr-union": "^3.1.0",
|
||||
"get-value": "^2.0.6",
|
||||
"is-extendable": "^0.1.1",
|
||||
"set-value": "^0.4.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"extend-shallow": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
|
||||
"integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"is-extendable": "^0.1.0"
|
||||
}
|
||||
},
|
||||
"set-value": {
|
||||
"version": "0.4.3",
|
||||
"resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz",
|
||||
"integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"extend-shallow": "^2.0.1",
|
||||
"is-extendable": "^0.1.1",
|
||||
"is-plain-object": "^2.0.1",
|
||||
"to-object-path": "^0.3.0"
|
||||
}
|
||||
}
|
||||
"set-value": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"unpipe": {
|
||||
|
@ -5649,9 +5477,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"uuid": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
|
||||
"integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==",
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
|
||||
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
|
||||
"dev": true
|
||||
},
|
||||
"v8flags": {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"grunt-sass": "^3.0.2",
|
||||
"grunt-zip": "~0.17.1",
|
||||
"load-grunt-tasks": "^4.0.0",
|
||||
"node-sass": "^4.11.0",
|
||||
"node-sass": "^4.13.0",
|
||||
"mustache": "^2.3.0",
|
||||
"socket.io": "^2.2.0"
|
||||
},
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -539,12 +539,17 @@
|
|||
|
||||
callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) {
|
||||
callRevealApi( 'getConfig', [], function ( config ) {
|
||||
var totalTime = config.totalTime;
|
||||
var minTimePerSlide = config.minimumTimePerSlide || 0;
|
||||
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 +564,22 @@
|
|||
}
|
||||
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) } );
|
||||
}
|
||||
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 );
|
||||
} );
|
||||
} );
|
||||
|
|
104
test/test-iframe-backgrounds.html
Normal file
104
test/test-iframe-backgrounds.html
Normal file
|
@ -0,0 +1,104 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
|
||||
<title>reveal.js - Test Iframe Backgrounds</title>
|
||||
|
||||
<link rel="stylesheet" href="../css/reveal.css">
|
||||
<link rel="stylesheet" href="qunit-2.5.0.css">
|
||||
</head>
|
||||
|
||||
<body style="overflow: auto;">
|
||||
|
||||
<div id="qunit"></div>
|
||||
<div id="qunit-fixture"></div>
|
||||
|
||||
<div class="reveal" style="display: none;">
|
||||
|
||||
<div class="slides">
|
||||
|
||||
<section data-background-iframe="#1">1</section>
|
||||
<section data-background-iframe="#2">2</section>
|
||||
<section data-background-iframe="#3" data-preload>3</section>
|
||||
<section data-background-iframe="#4">4</section>
|
||||
<section data-background-iframe="#5">5</section>
|
||||
<section data-background-iframe="#6">6</section>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="../js/reveal.js"></script>
|
||||
<script src="qunit-2.5.0.js"></script>
|
||||
|
||||
<script>
|
||||
|
||||
|
||||
Reveal.addEventListener( 'ready', function() {
|
||||
|
||||
function getIframe( index ) {
|
||||
return document.querySelectorAll( '.slide-background' )[index].querySelector( 'iframe' );
|
||||
}
|
||||
|
||||
QUnit.module( 'Iframe' );
|
||||
|
||||
QUnit.test( 'Using default settings', function( assert ) {
|
||||
|
||||
Reveal.slide(0);
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), false, 'not preloaded when within viewDistance' );
|
||||
|
||||
Reveal.slide(1);
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
|
||||
|
||||
Reveal.slide(0);
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), false, 'unloaded when slide becomes invisible' );
|
||||
|
||||
});
|
||||
|
||||
QUnit.test( 'Using data-preload', function( assert ) {
|
||||
|
||||
Reveal.slide(1);
|
||||
assert.strictEqual( getIframe(2).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
|
||||
|
||||
Reveal.slide(0);
|
||||
assert.strictEqual( getIframe(3).hasAttribute( 'src' ), false, 'unloads outside of viewDistance' );
|
||||
|
||||
});
|
||||
|
||||
QUnit.test( 'Using preloadIframes: true', function( assert ) {
|
||||
|
||||
Reveal.configure({ preloadIframes: true });
|
||||
|
||||
Reveal.slide(1);
|
||||
assert.strictEqual( getIframe(0).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
|
||||
assert.strictEqual( getIframe(2).hasAttribute( 'src' ), true, 'preloaded within viewDistance' );
|
||||
|
||||
});
|
||||
|
||||
QUnit.test( 'Using preloadIframes: false', function( assert ) {
|
||||
|
||||
Reveal.configure({ preloadIframes: false });
|
||||
|
||||
Reveal.slide(0);
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), false, 'not preloaded within viewDistance' );
|
||||
assert.strictEqual( getIframe(2).hasAttribute( 'src' ), false, 'not preloaded within viewDistance' );
|
||||
|
||||
Reveal.slide(1);
|
||||
assert.strictEqual( getIframe(1).hasAttribute( 'src' ), true, 'loaded when slide becomes visible' );
|
||||
|
||||
|
||||
});
|
||||
|
||||
} );
|
||||
|
||||
Reveal.initialize({
|
||||
viewDistance: 3
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
16
test/test.js
16
test/test.js
|
@ -250,6 +250,22 @@ Reveal.addEventListener( 'ready', function() {
|
|||
assert.deepEqual( Reveal.getIndices(), { h: 2, v: 0, f: 1 }, 'Reveal.slide( 2, 0, 1 )' );
|
||||
});
|
||||
|
||||
QUnit.test( 'data-fragment is set on slide <section>', function( assert ) {
|
||||
Reveal.slide( 2, 0, -1 );
|
||||
assert.deepEqual( Reveal.getCurrentSlide().getAttribute( 'data-fragment' ), '-1' );
|
||||
|
||||
Reveal.slide( 2, 0, 2 );
|
||||
assert.deepEqual( Reveal.getCurrentSlide().getAttribute( 'data-fragment' ), '2' );
|
||||
|
||||
Reveal.slide( 2, 0, 0 );
|
||||
assert.deepEqual( Reveal.getCurrentSlide().getAttribute( 'data-fragment' ), '0' );
|
||||
|
||||
var fragmentSlide = Reveal.getCurrentSlide();
|
||||
|
||||
Reveal.slide( 3, 0 );
|
||||
assert.deepEqual( fragmentSlide.getAttribute( 'data-fragment' ), '0', 'data-fragment persists when jumping to another slide' );
|
||||
});
|
||||
|
||||
QUnit.test( 'Hiding all fragments', function( assert ) {
|
||||
var fragmentSlide = document.querySelector( '#fragment-slides>section:nth-child(1)' );
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user