1
0
mirror of https://github.com/hakimel/reveal.js.git synced 2025-08-08 23:57:13 +02:00

update reveal.js version

This commit is contained in:
Hakim El Hattab
2019-05-28 12:21:40 +02:00
parent 8f32e236f9
commit 72949a2d28
11 changed files with 433 additions and 106 deletions

View File

@@ -18,7 +18,7 @@
<link rel="stylesheet" href="css/theme/black.css" id="theme"> <link rel="stylesheet" href="css/theme/black.css" id="theme">
<!-- Theme used for syntax highlighting of code --> <!-- Theme used for syntax highlighting of code -->
<link rel="stylesheet" href="lib/css/zenburn.css"> <link rel="stylesheet" href="lib/css/monokai.css">
<!-- Printing and PDF exports --> <!-- Printing and PDF exports -->
<script> <script>

View File

@@ -227,7 +227,7 @@ body {
bottom: 12px; bottom: 12px;
right: 12px; right: 12px;
left: auto; left: auto;
z-index: 1; z-index: 11;
color: #000; color: #000;
pointer-events: none; pointer-events: none;
font-size: 10px; } font-size: 10px; }
@@ -312,7 +312,8 @@ body {
transform: rotate(90deg); } transform: rotate(90deg); }
.reveal .controls .navigate-down { .reveal .controls .navigate-down {
right: 3.2em; right: 3.2em;
bottom: 0; bottom: -1.4em;
padding-bottom: 1.4em;
-webkit-transform: translateY(10px); -webkit-transform: translateY(10px);
transform: translateY(10px); } transform: translateY(10px); }
.reveal .controls .navigate-down .controls-arrow { .reveal .controls .navigate-down .controls-arrow {
@@ -395,18 +396,18 @@ body {
right: auto; } right: auto; }
.reveal .controls[data-controls-layout="edges"] .navigate-left { .reveal .controls[data-controls-layout="edges"] .navigate-left {
top: 50%; top: 50%;
left: 8px; left: 0.8em;
margin-top: -1.8em; } margin-top: -1.8em; }
.reveal .controls[data-controls-layout="edges"] .navigate-right { .reveal .controls[data-controls-layout="edges"] .navigate-right {
top: 50%; top: 50%;
right: 8px; right: 0.8em;
margin-top: -1.8em; } margin-top: -1.8em; }
.reveal .controls[data-controls-layout="edges"] .navigate-up { .reveal .controls[data-controls-layout="edges"] .navigate-up {
top: 8px; top: 0.8em;
left: 50%; left: 50%;
margin-left: -1.8em; } margin-left: -1.8em; }
.reveal .controls[data-controls-layout="edges"] .navigate-down { .reveal .controls[data-controls-layout="edges"] .navigate-down {
bottom: 8px; bottom: -0.3em;
left: 50%; left: 50%;
margin-left: -1.8em; } } margin-left: -1.8em; } }
@@ -1453,8 +1454,15 @@ body {
text-align: right; text-align: right;
vertical-align: top; } 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.25; } opacity: 0.4; }
.reveal .hljs:not(:first-child).fragment {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box; }
/********************************************* /*********************************************
* ROLLING LINKS * ROLLING LINKS

2
css/reveal.min.css vendored

File diff suppressed because one or more lines are too long

View File

@@ -263,7 +263,7 @@ $controlsArrowAngleActive: 36deg;
bottom: $spacing; bottom: $spacing;
right: $spacing; right: $spacing;
left: auto; left: auto;
z-index: 1; z-index: 11;
color: #000; color: #000;
pointer-events: none; pointer-events: none;
font-size: 10px; font-size: 10px;
@@ -355,7 +355,8 @@ $controlsArrowAngleActive: 36deg;
.navigate-down { .navigate-down {
right: $controlArrowSpacing + $controlArrowSize/2; right: $controlArrowSpacing + $controlArrowSize/2;
bottom: 0; bottom: -$controlArrowSpacing;
padding-bottom: $controlArrowSpacing;
transform: translateY( 10px ); transform: translateY( 10px );
.controls-arrow { .controls-arrow {
@@ -452,7 +453,7 @@ $controlsArrowAngleActive: 36deg;
// Edge aligned controls layout // Edge aligned controls layout
@media screen and (min-width: 500px) { @media screen and (min-width: 500px) {
$spacing: 8px; $spacing: 0.8em;
.reveal .controls[data-controls-layout="edges"] { .reveal .controls[data-controls-layout="edges"] {
& { & {
@@ -489,7 +490,7 @@ $controlsArrowAngleActive: 36deg;
} }
.navigate-down { .navigate-down {
bottom: $spacing; bottom: $spacing - $controlArrowSpacing + 0.3em;
left: 50%; left: 50%;
margin-left: -$controlArrowSize/2; margin-left: -$controlArrowSize/2;
} }
@@ -1590,10 +1591,18 @@ $controlsArrowAngleActive: 36deg;
vertical-align: top; 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; opacity: 0.4;
} }
.reveal .hljs:not(:first-child).fragment {
position: absolute;
top: 0;
left: 0;
width: 100%;
box-sizing: border-box;
}
/********************************************* /*********************************************
* ROLLING LINKS * ROLLING LINKS

View File

@@ -26,7 +26,7 @@
var Reveal; var Reveal;
// The reveal.js version // The reveal.js version
var VERSION = '3.7.0'; var VERSION = '3.8.0';
var SLIDES_SELECTOR = '.slides section', var SLIDES_SELECTOR = '.slides section',
HORIZONTAL_SLIDES_SELECTOR = '.slides>section', HORIZONTAL_SLIDES_SELECTOR = '.slides>section',
@@ -146,8 +146,8 @@
// 1.3 2.3 // 1.3 2.3
// //
// If you're on slide 1.3 and navigate right, you will normally move // If you're on slide 1.3 and navigate right, you will normally move
// from 1.3 -> 2.1. With "gridNavigation" enabled the same navigation // from 1.3 -> 2.1. If "grid" is used, the same navigation takes you
// takes you from 1.3 -> 2.3. // from 1.3 -> 2.3.
navigationMode: 'default', navigationMode: 'default',
// Randomizes the order of slides each time the presentation loads // Randomizes the order of slides each time the presentation loads
@@ -180,6 +180,13 @@
// - false: No media will autoplay, regardless of individual setting // - false: No media will autoplay, regardless of individual setting
autoPlayMedia: null, autoPlayMedia: null,
// Global override for preloading lazy-loaded iframes
// - null: Iframes with data-src AND data-preload will be loaded when within
// the viewDistance, iframes with only data-src will be loaded when visible
// - true: All iframes with data-src will be loaded when within the viewDistance
// - false: All iframes with data-src will be loaded only when visible
preloadIframes: null,
// Controls automatic progression to the next slide // Controls automatic progression to the next slide
// - 0: Auto-sliding only happens if the data-autoslide HTML attribute // - 0: Auto-sliding only happens if the data-autoslide HTML attribute
// is present on the current slide or fragment // is present on the current slide or fragment
@@ -367,20 +374,9 @@
threshold: 40 threshold: 40
}, },
// Holds information about the keyboard shortcuts // A key:value map of shortcut keyboard keys and descriptions of
keyboardShortcuts = { // the actions they trigger, generated in #configure()
'N , SPACE': 'Next slide', keyboardShortcuts = {},
'P': 'Previous slide',
'&#8592; , H': 'Navigate left',
'&#8594; , L': 'Navigate right',
'&#8593; , K': 'Navigate up',
'&#8595; , J': 'Navigate down',
'Home , &#8984;/CTRL &#8592;': 'First slide',
'End , &#8984;/CTRL &#8594;': 'Last slide',
'B , .': 'Pause',
'F': 'Fullscreen',
'ESC, O': 'Slide overview'
},
// Holds custom key code mappings // Holds custom key code mappings
registeredKeyBindings = {}; registeredKeyBindings = {};
@@ -1221,6 +1217,8 @@
if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor; if( data.backgroundColor ) element.style.backgroundColor = data.backgroundColor;
if( data.backgroundTransition ) element.setAttribute( 'data-background-transition', data.backgroundTransition ); 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 // Background image options are set on the content wrapper
if( data.backgroundSize ) contentElement.style.backgroundSize = data.backgroundSize; if( data.backgroundSize ) contentElement.style.backgroundSize = data.backgroundSize;
if( data.backgroundRepeat ) contentElement.style.backgroundRepeat = data.backgroundRepeat; if( data.backgroundRepeat ) contentElement.style.backgroundRepeat = data.backgroundRepeat;
@@ -1280,7 +1278,11 @@
// Check if the requested method can be found // Check if the requested method can be found
if( data.method && typeof Reveal[data.method] === 'function' ) { 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 ); }, false );
@@ -1437,6 +1439,26 @@
dom.wrapper.removeAttribute( 'data-navigation-mode' ); dom.wrapper.removeAttribute( 'data-navigation-mode' );
} }
// Define our contextual list of keyboard shortcuts
if( config.navigationMode === 'linear' ) {
keyboardShortcuts['&#8594; , &#8595; , SPACE , N , L , J'] = 'Next slide';
keyboardShortcuts['&#8592; , &#8593; , P , H , K'] = 'Previous slide';
}
else {
keyboardShortcuts['N , SPACE'] = 'Next slide';
keyboardShortcuts['P'] = 'Previous slide';
keyboardShortcuts['&#8592; , H'] = 'Navigate left';
keyboardShortcuts['&#8594; , L'] = 'Navigate right';
keyboardShortcuts['&#8593; , K'] = 'Navigate up';
keyboardShortcuts['&#8595; , J'] = 'Navigate down';
}
keyboardShortcuts['Home , Shift &#8592;'] = 'First slide';
keyboardShortcuts['End , Shift &#8594;'] = 'Last slide';
keyboardShortcuts['B , .'] = 'Pause';
keyboardShortcuts['F'] = 'Fullscreen';
keyboardShortcuts['ESC, O'] = 'Slide overview';
sync(); sync();
} }
@@ -1587,6 +1609,29 @@
} }
/**
* Checks if a specific plugin has been registered.
*
* @param {String} id Unique plugin identifier
*/
function hasPlugin( id ) {
return !!plugins[id];
}
/**
* Returns the specific plugin instance, if a plugin
* with the given ID has been registered.
*
* @param {String} id Unique plugin identifier
*/
function getPlugin( id ) {
return plugins[id];
}
/** /**
* Add a custom key binding with optional description to * Add a custom key binding with optional description to
* be added to the help screen. * be added to the help screen.
@@ -1942,8 +1987,25 @@
// If we're in an iframe, post each reveal.js event to the // If we're in an iframe, post each reveal.js event to the
// parent window. Used by the notes plugin // 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 ) { 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 ), '*' );
} }
} }
@@ -2204,10 +2266,12 @@
transformSlides( { layout: '' } ); transformSlides( { layout: '' } );
} }
else { else {
// Prefer zoom for scaling up so that content remains crisp. // Zoom Scaling
// Don't use zoom to scale down since that can lead to shifts // Content remains crisp no matter how much we scale. Side
// in text layout/line breaks. // effects are minor differences in text layout and iframe
if( scale > 1 && features.zoom ) { // 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.zoom = scale;
dom.slides.style.left = ''; dom.slides.style.left = '';
dom.slides.style.top = ''; dom.slides.style.top = '';
@@ -2215,7 +2279,10 @@
dom.slides.style.right = ''; dom.slides.style.right = '';
transformSlides( { layout: '' } ); 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 { else {
dom.slides.style.zoom = ''; dom.slides.style.zoom = '';
dom.slides.style.left = '50%'; dom.slides.style.left = '50%';
@@ -3000,11 +3067,11 @@
syncBackground( slide ); syncBackground( slide );
syncFragments( slide ); syncFragments( slide );
loadSlide( slide );
updateBackground(); updateBackground();
updateNotes(); updateNotes();
loadSlide( slide );
} }
/** /**
@@ -3270,7 +3337,7 @@
} }
// Flag if there are ANY vertical slides, anywhere in the deck // 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' ); dom.wrapper.classList.add( 'has-vertical-slides' );
} }
else { else {
@@ -3278,7 +3345,7 @@
} }
// Flag if there are ANY horizontal slides, anywhere in the deck // 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' ); dom.wrapper.classList.add( 'has-horizontal-slides' );
} }
else { else {
@@ -3560,7 +3627,7 @@
// Stop content inside of previous backgrounds // Stop content inside of previous backgrounds
if( previousBackground ) { if( previousBackground ) {
stopEmbeddedContent( previousBackground ); stopEmbeddedContent( previousBackground, { unloadIframes: !shouldPreload( previousBackground ) } );
} }
@@ -3671,6 +3738,26 @@
} }
/**
* Should the given element be preloaded?
* Decides based on local element attributes and global config.
*
* @param {HTMLElement} element
*/
function shouldPreload( element ) {
// Prefer an explicit global preload setting
var preload = config.preloadIframes;
// If no global setting is available, fall back on the element's
// own preload setting
if( typeof preload !== 'boolean' ) {
preload = element.hasAttribute( 'data-preload' );
}
return preload;
}
/** /**
* Called when the given slide is within the configured view * Called when the given slide is within the configured view
* distance. Shows the slide element and loads any content * distance. Shows the slide element and loads any content
@@ -3686,10 +3773,12 @@
slide.style.display = config.display; slide.style.display = config.display;
// Media elements with data-src attributes // Media elements with data-src attributes
toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src]' ) ).forEach( function( element ) { toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src], iframe[data-src]' ) ).forEach( function( element ) {
element.setAttribute( 'src', element.getAttribute( 'data-src' ) ); if( element.tagName !== 'IFRAME' || shouldPreload( element ) ) {
element.setAttribute( 'data-lazy-loaded', '' ); element.setAttribute( 'src', element.getAttribute( 'data-src' ) );
element.removeAttribute( 'data-src' ); element.setAttribute( 'data-lazy-loaded', '' );
element.removeAttribute( 'data-src' );
}
} ); } );
// Media elements with <source> children // Media elements with <source> children
@@ -3717,6 +3806,7 @@
background.style.display = 'block'; background.style.display = 'block';
var backgroundContent = slide.slideBackgroundContentElement; var backgroundContent = slide.slideBackgroundContentElement;
var backgroundIframe = slide.getAttribute( 'data-background-iframe' );
// If the background contains media, load it // If the background contains media, load it
if( background.hasAttribute( 'data-loaded' ) === false ) { if( background.hasAttribute( 'data-loaded' ) === false ) {
@@ -3725,8 +3815,7 @@
var backgroundImage = slide.getAttribute( 'data-background-image' ), var backgroundImage = slide.getAttribute( 'data-background-image' ),
backgroundVideo = slide.getAttribute( 'data-background-video' ), backgroundVideo = slide.getAttribute( 'data-background-video' ),
backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ), backgroundVideoLoop = slide.hasAttribute( 'data-background-video-loop' ),
backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' ), backgroundVideoMuted = slide.hasAttribute( 'data-background-video-muted' );
backgroundIframe = slide.getAttribute( 'data-background-iframe' );
// Images // Images
if( backgroundImage ) { if( backgroundImage ) {
@@ -3767,14 +3856,7 @@
iframe.setAttribute( 'mozallowfullscreen', '' ); iframe.setAttribute( 'mozallowfullscreen', '' );
iframe.setAttribute( 'webkitallowfullscreen', '' ); iframe.setAttribute( 'webkitallowfullscreen', '' );
// Only load autoplaying content when the slide is shown to iframe.setAttribute( 'data-src', backgroundIframe );
// 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.width = '100%';
iframe.style.height = '100%'; iframe.style.height = '100%';
@@ -3785,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 );
}
}
}
} }
} }
@@ -3804,10 +3899,15 @@
var background = getSlideBackground( slide ); var background = getSlideBackground( slide );
if( background ) { if( background ) {
background.style.display = 'none'; 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 // Reset lazy-loaded media elements with src attributes
toArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src]' ) ).forEach( function( element ) { toArray( slide.querySelectorAll( 'video[data-lazy-loaded][src], audio[data-lazy-loaded][src], iframe[data-lazy-loaded][src]' ) ).forEach( function( element ) {
element.setAttribute( 'data-src', element.getAttribute( 'src' ) ); element.setAttribute( 'data-src', element.getAttribute( 'src' ) );
element.removeAttribute( 'src' ); element.removeAttribute( 'src' );
} ); } );
@@ -4197,7 +4297,7 @@
} }
return pastCount / ( totalCount - 1 ); return Math.min( pastCount / ( totalCount - 1 ), 1 );
} }
@@ -4290,11 +4390,21 @@
writeURLTimeout = setTimeout( writeURL, delay ); writeURLTimeout = setTimeout( writeURL, delay );
} }
else if( currentSlide ) { else if( currentSlide ) {
// If we're configured to push to history OR the history
// API is not avaialble.
if( config.history || !window.history ) { if( config.history || !window.history ) {
window.location.hash = locationHash(); window.location.hash = locationHash();
} }
// If we're configured to reflect the current slide in the
// URL without pushing to history.
else if( config.hash ) { else if( config.hash ) {
window.history.replaceState(null, null, '#' + locationHash()); window.history.replaceState( null, null, '#' + locationHash() );
}
// If history and hash are both disabled, a hash may still
// be added to the URL by clicking on a href with a hash
// target. Counter this by always removing the hash.
else {
window.history.replaceState( null, null, window.location.pathname + window.location.search );
} }
} }
@@ -4358,7 +4468,44 @@
*/ */
function getSlides() { 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;
} }
@@ -5045,8 +5192,8 @@
// Whitelist specific modified + keycode combinations // Whitelist specific modified + keycode combinations
var prevSlideShortcut = event.shiftKey && event.keyCode === 32; var prevSlideShortcut = event.shiftKey && event.keyCode === 32;
var firstSlideShortcut = ( event.metaKey || event.ctrlKey ) && keyCode === 37; var firstSlideShortcut = event.shiftKey && keyCode === 37;
var lastSlideShortcut = ( event.metaKey || event.ctrlKey ) && keyCode === 39; var lastSlideShortcut = event.shiftKey && keyCode === 39;
// Prevent all other events when a modifier is pressed // Prevent all other events when a modifier is pressed
var unusedModifier = !prevSlideShortcut && !firstSlideShortcut && !lastSlideShortcut && var unusedModifier = !prevSlideShortcut && !firstSlideShortcut && !lastSlideShortcut &&
@@ -5073,6 +5220,10 @@
return false; 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; var triggered = false;
// 1. User defined key bindings // 1. User defined key bindings
@@ -5145,7 +5296,7 @@
if( firstSlideShortcut ) { if( firstSlideShortcut ) {
slide( 0 ); slide( 0 );
} }
else if( !isOverview() && config.navigationMode === 'linear' ) { else if( !isOverview() && useLinearMode ) {
navigatePrev(); navigatePrev();
} }
else { else {
@@ -5157,7 +5308,7 @@
if( lastSlideShortcut ) { if( lastSlideShortcut ) {
slide( Number.MAX_VALUE ); slide( Number.MAX_VALUE );
} }
else if( !isOverview() && config.navigationMode === 'linear' ) { else if( !isOverview() && useLinearMode ) {
navigateNext(); navigateNext();
} }
else { else {
@@ -5166,7 +5317,7 @@
} }
// K, UP // K, UP
else if( keyCode === 75 || keyCode === 38 ) { else if( keyCode === 75 || keyCode === 38 ) {
if( !isOverview() && config.navigationMode === 'linear' ) { if( !isOverview() && useLinearMode ) {
navigatePrev(); navigatePrev();
} }
else { else {
@@ -5175,7 +5326,7 @@
} }
// J, DOWN // J, DOWN
else if( keyCode === 74 || keyCode === 40 ) { else if( keyCode === 74 || keyCode === 40 ) {
if( !isOverview() && config.navigationMode === 'linear' ) { if( !isOverview() && useLinearMode ) {
navigateNext(); navigateNext();
} }
else { else {
@@ -5834,6 +5985,15 @@
// Returns the speaker notes string for a slide, or null // Returns the speaker notes string for a slide, or null
getSlideNotes: getSlideNotes, 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 // Returns the previous slide element, may be null
getPreviousSlide: function() { getPreviousSlide: function() {
return previousSlide; return previousSlide;
@@ -5932,14 +6092,16 @@
} }
}, },
// Adds/remvoes a custom key binding // Adds/removes a custom key binding
addKeyBinding: addKeyBinding, addKeyBinding: addKeyBinding,
removeKeyBinding: removeKeyBinding, removeKeyBinding: removeKeyBinding,
// Called by plugins to register themselves // API for registering and retrieving plugins
registerPlugin: registerPlugin, registerPlugin: registerPlugin,
hasPlugin: hasPlugin,
getPlugin: getPlugin,
// Programatically triggers a keyboard event // Programmatically triggers a keyboard event
triggerKey: function( keyCode ) { triggerKey: function( keyCode ) {
onDocumentKeyDown( { keyCode: keyCode } ); onDocumentKeyDown( { keyCode: keyCode } );
}, },

4
js/reveal.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,2 +0,0 @@
/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p<o;p++){if(p in this&&this[p]===q){return p}}return -1},n=function(o,p){this.name=o;this.code=DOMException[o];this.message=p},g=function(p,o){if(o===""){throw new n("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(o)){throw new n("INVALID_CHARACTER_ERR","String contains an invalid character")}return c.call(p,o)},d=function(s){var r=k.call(s.className),q=r?r.split(/\s+/):[],p=0,o=q.length;for(;p<o;p++){this.push(q[p])}this._updateClassName=function(){s.className=this.toString()}},e=d[f]=[],i=function(){return new d(this)};n[f]=Error[f];e.item=function(o){return this[o]||null};e.contains=function(o){o+="";return g(this,o)!==-1};e.add=function(o){o+="";if(g(this,o)===-1){this.push(o);this._updateClassName()}};e.remove=function(p){p+="";var o=g(this,p);if(o!==-1){this.splice(o,1);this._updateClassName()}};e.toggle=function(o){o+="";if(g(this,o)===-1){this.add(o)}else{this.remove(o)}};e.toString=function(){return this.join(" ")};if(b.defineProperty){var l={get:i,enumerable:true,configurable:true};try{b.defineProperty(m,a,l)}catch(h){if(h.number===-2146823252){l.enumerable=false;b.defineProperty(m,a,l)}}}else{if(b[f].__defineGetter__){m.__defineGetter__(a,i)}}}(self))};

9
lib/js/head.min.js vendored
View File

@@ -1,9 +0,0 @@
/*! head.core - v1.0.2 */
(function(n,t){"use strict";function r(n){a[a.length]=n}function k(n){var t=new RegExp(" ?\\b"+n+"\\b");c.className=c.className.replace(t,"")}function p(n,t){for(var i=0,r=n.length;i<r;i++)t.call(n,n[i],i)}function tt(){var t,e,f,o;c.className=c.className.replace(/ (w-|eq-|gt-|gte-|lt-|lte-|portrait|no-portrait|landscape|no-landscape)\d+/g,"");t=n.innerWidth||c.clientWidth;e=n.outerWidth||n.screen.width;u.screen.innerWidth=t;u.screen.outerWidth=e;r("w-"+t);p(i.screens,function(n){t>n?(i.screensCss.gt&&r("gt-"+n),i.screensCss.gte&&r("gte-"+n)):t<n?(i.screensCss.lt&&r("lt-"+n),i.screensCss.lte&&r("lte-"+n)):t===n&&(i.screensCss.lte&&r("lte-"+n),i.screensCss.eq&&r("e-q"+n),i.screensCss.gte&&r("gte-"+n))});f=n.innerHeight||c.clientHeight;o=n.outerHeight||n.screen.height;u.screen.innerHeight=f;u.screen.outerHeight=o;u.feature("portrait",f>t);u.feature("landscape",f<t)}function it(){n.clearTimeout(b);b=n.setTimeout(tt,50)}var y=n.document,rt=n.navigator,ut=n.location,c=y.documentElement,a=[],i={screens:[240,320,480,640,768,800,1024,1280,1440,1680,1920],screensCss:{gt:!0,gte:!1,lt:!0,lte:!1,eq:!1},browsers:[{ie:{min:6,max:11}}],browserCss:{gt:!0,gte:!1,lt:!0,lte:!1,eq:!0},html5:!0,page:"-page",section:"-section",head:"head"},v,u,s,w,o,h,l,d,f,g,nt,e,b;if(n.head_conf)for(v in n.head_conf)n.head_conf[v]!==t&&(i[v]=n.head_conf[v]);u=n[i.head]=function(){u.ready.apply(null,arguments)};u.feature=function(n,t,i){return n?(Object.prototype.toString.call(t)==="[object Function]"&&(t=t.call()),r((t?"":"no-")+n),u[n]=!!t,i||(k("no-"+n),k(n),u.feature()),u):(c.className+=" "+a.join(" "),a=[],u)};u.feature("js",!0);s=rt.userAgent.toLowerCase();w=/mobile|android|kindle|silk|midp|phone|(windows .+arm|touch)/.test(s);u.feature("mobile",w,!0);u.feature("desktop",!w,!0);s=/(chrome|firefox)[ \/]([\w.]+)/.exec(s)||/(iphone|ipad|ipod)(?:.*version)?[ \/]([\w.]+)/.exec(s)||/(android)(?:.*version)?[ \/]([\w.]+)/.exec(s)||/(webkit|opera)(?:.*version)?[ \/]([\w.]+)/.exec(s)||/(msie) ([\w.]+)/.exec(s)||/(trident).+rv:(\w.)+/.exec(s)||[];o=s[1];h=parseFloat(s[2]);switch(o){case"msie":case"trident":o="ie";h=y.documentMode||h;break;case"firefox":o="ff";break;case"ipod":case"ipad":case"iphone":o="ios";break;case"webkit":o="safari"}for(u.browser={name:o,version:h},u.browser[o]=!0,l=0,d=i.browsers.length;l<d;l++)for(f in i.browsers[l])if(o===f)for(r(f),g=i.browsers[l][f].min,nt=i.browsers[l][f].max,e=g;e<=nt;e++)h>e?(i.browserCss.gt&&r("gt-"+f+e),i.browserCss.gte&&r("gte-"+f+e)):h<e?(i.browserCss.lt&&r("lt-"+f+e),i.browserCss.lte&&r("lte-"+f+e)):h===e&&(i.browserCss.lte&&r("lte-"+f+e),i.browserCss.eq&&r("eq-"+f+e),i.browserCss.gte&&r("gte-"+f+e));else r("no-"+f);r(o);r(o+parseInt(h,10));i.html5&&o==="ie"&&h<9&&p("abbr|article|aside|audio|canvas|details|figcaption|figure|footer|header|hgroup|main|mark|meter|nav|output|progress|section|summary|time|video".split("|"),function(n){y.createElement(n)});p(ut.pathname.split("/"),function(n,u){if(this.length>2&&this[u+1]!==t)u&&r(this.slice(u,u+1).join("-").toLowerCase()+i.section);else{var f=n||"index",e=f.indexOf(".");e>0&&(f=f.substring(0,e));c.id=f.toLowerCase()+i.page;u||r("root"+i.section)}});u.screen={height:n.screen.height,width:n.screen.width};tt();b=0;n.addEventListener?n.addEventListener("resize",it,!1):n.attachEvent("onresize",it)})(window);
/*! head.css3 - v1.0.0 */
(function(n,t){"use strict";function a(n){for(var r in n)if(i[n[r]]!==t)return!0;return!1}function r(n){var t=n.charAt(0).toUpperCase()+n.substr(1),i=(n+" "+c.join(t+" ")+t).split(" ");return!!a(i)}var h=n.document,o=h.createElement("i"),i=o.style,s=" -o- -moz- -ms- -webkit- -khtml- ".split(" "),c="Webkit Moz O ms Khtml".split(" "),l=n.head_conf&&n.head_conf.head||"head",u=n[l],f={gradient:function(){var n="background-image:";return i.cssText=(n+s.join("gradient(linear,left top,right bottom,from(#9f9),to(#fff));"+n)+s.join("linear-gradient(left top,#eee,#fff);"+n)).slice(0,-n.length),!!i.backgroundImage},rgba:function(){return i.cssText="background-color:rgba(0,0,0,0.5)",!!i.backgroundColor},opacity:function(){return o.style.opacity===""},textshadow:function(){return i.textShadow===""},multiplebgs:function(){i.cssText="background:url(https://),url(https://),red url(https://)";var n=(i.background||"").match(/url/g);return Object.prototype.toString.call(n)==="[object Array]"&&n.length===3},boxshadow:function(){return r("boxShadow")},borderimage:function(){return r("borderImage")},borderradius:function(){return r("borderRadius")},cssreflections:function(){return r("boxReflect")},csstransforms:function(){return r("transform")},csstransitions:function(){return r("transition")},touch:function(){return"ontouchstart"in n},retina:function(){return n.devicePixelRatio>1},fontface:function(){var t=u.browser.name,n=u.browser.version;switch(t){case"ie":return n>=9;case"chrome":return n>=13;case"ff":return n>=6;case"ios":return n>=5;case"android":return!1;case"webkit":return n>=5.1;case"opera":return n>=10;default:return!1}}};for(var e in f)f[e]&&u.feature(e,f[e].call(),!0);u.feature()})(window);
/*! head.load - v1.0.3 */
(function(n,t){"use strict";function w(){}function u(n,t){if(n){typeof n=="object"&&(n=[].slice.call(n));for(var i=0,r=n.length;i<r;i++)t.call(n,n[i],i)}}function it(n,i){var r=Object.prototype.toString.call(i).slice(8,-1);return i!==t&&i!==null&&r===n}function s(n){return it("Function",n)}function a(n){return it("Array",n)}function et(n){var i=n.split("/"),t=i[i.length-1],r=t.indexOf("?");return r!==-1?t.substring(0,r):t}function f(n){(n=n||w,n._done)||(n(),n._done=1)}function ot(n,t,r,u){var f=typeof n=="object"?n:{test:n,success:!t?!1:a(t)?t:[t],failure:!r?!1:a(r)?r:[r],callback:u||w},e=!!f.test;return e&&!!f.success?(f.success.push(f.callback),i.load.apply(null,f.success)):e||!f.failure?u():(f.failure.push(f.callback),i.load.apply(null,f.failure)),i}function v(n){var t={},i,r;if(typeof n=="object")for(i in n)!n[i]||(t={name:i,url:n[i]});else t={name:et(n),url:n};return(r=c[t.name],r&&r.url===t.url)?r:(c[t.name]=t,t)}function y(n){n=n||c;for(var t in n)if(n.hasOwnProperty(t)&&n[t].state!==l)return!1;return!0}function st(n){n.state=ft;u(n.onpreload,function(n){n.call()})}function ht(n){n.state===t&&(n.state=nt,n.onpreload=[],rt({url:n.url,type:"cache"},function(){st(n)}))}function ct(){var n=arguments,t=n[n.length-1],r=[].slice.call(n,1),f=r[0];return(s(t)||(t=null),a(n[0]))?(n[0].push(t),i.load.apply(null,n[0]),i):(f?(u(r,function(n){s(n)||!n||ht(v(n))}),b(v(n[0]),s(f)?f:function(){i.load.apply(null,r)})):b(v(n[0])),i)}function lt(){var n=arguments,t=n[n.length-1],r={};return(s(t)||(t=null),a(n[0]))?(n[0].push(t),i.load.apply(null,n[0]),i):(u(n,function(n){n!==t&&(n=v(n),r[n.name]=n)}),u(n,function(n){n!==t&&(n=v(n),b(n,function(){y(r)&&f(t)}))}),i)}function b(n,t){if(t=t||w,n.state===l){t();return}if(n.state===tt){i.ready(n.name,t);return}if(n.state===nt){n.onpreload.push(function(){b(n,t)});return}n.state=tt;rt(n,function(){n.state=l;t();u(h[n.name],function(n){f(n)});o&&y()&&u(h.ALL,function(n){f(n)})})}function at(n){n=n||"";var t=n.split("?")[0].split(".");return t[t.length-1].toLowerCase()}function rt(t,i){function e(t){t=t||n.event;u.onload=u.onreadystatechange=u.onerror=null;i()}function o(f){f=f||n.event;(f.type==="load"||/loaded|complete/.test(u.readyState)&&(!r.documentMode||r.documentMode<9))&&(n.clearTimeout(t.errorTimeout),n.clearTimeout(t.cssTimeout),u.onload=u.onreadystatechange=u.onerror=null,i())}function s(){if(t.state!==l&&t.cssRetries<=20){for(var i=0,f=r.styleSheets.length;i<f;i++)if(r.styleSheets[i].href===u.href){o({type:"load"});return}t.cssRetries++;t.cssTimeout=n.setTimeout(s,250)}}var u,h,f;i=i||w;h=at(t.url);h==="css"?(u=r.createElement("link"),u.type="text/"+(t.type||"css"),u.rel="stylesheet",u.href=t.url,t.cssRetries=0,t.cssTimeout=n.setTimeout(s,500)):(u=r.createElement("script"),u.type="text/"+(t.type||"javascript"),u.src=t.url);u.onload=u.onreadystatechange=o;u.onerror=e;u.async=!1;u.defer=!1;t.errorTimeout=n.setTimeout(function(){e({type:"timeout"})},7e3);f=r.head||r.getElementsByTagName("head")[0];f.insertBefore(u,f.lastChild)}function vt(){for(var t,u=r.getElementsByTagName("script"),n=0,f=u.length;n<f;n++)if(t=u[n].getAttribute("data-headjs-load"),!!t){i.load(t);return}}function yt(n,t){var v,p,e;return n===r?(o?f(t):d.push(t),i):(s(n)&&(t=n,n="ALL"),a(n))?(v={},u(n,function(n){v[n]=c[n];i.ready(n,function(){y(v)&&f(t)})}),i):typeof n!="string"||!s(t)?i:(p=c[n],p&&p.state===l||n==="ALL"&&y()&&o)?(f(t),i):(e=h[n],e?e.push(t):e=h[n]=[t],i)}function e(){if(!r.body){n.clearTimeout(i.readyTimeout);i.readyTimeout=n.setTimeout(e,50);return}o||(o=!0,vt(),u(d,function(n){f(n)}))}function k(){r.addEventListener?(r.removeEventListener("DOMContentLoaded",k,!1),e()):r.readyState==="complete"&&(r.detachEvent("onreadystatechange",k),e())}var r=n.document,d=[],h={},c={},ut="async"in r.createElement("script")||"MozAppearance"in r.documentElement.style||n.opera,o,g=n.head_conf&&n.head_conf.head||"head",i=n[g]=n[g]||function(){i.ready.apply(null,arguments)},nt=1,ft=2,tt=3,l=4,p;if(r.readyState==="complete")e();else if(r.addEventListener)r.addEventListener("DOMContentLoaded",k,!1),n.addEventListener("load",e,!1);else{r.attachEvent("onreadystatechange",k);n.attachEvent("onload",e);p=!1;try{p=!n.frameElement&&r.documentElement}catch(wt){}p&&p.doScroll&&function pt(){if(!o){try{p.doScroll("left")}catch(t){n.clearTimeout(i.readyTimeout);i.readyTimeout=n.setTimeout(pt,50);return}e()}}()}i.load=i.js=ut?lt:ct;i.test=ot;i.ready=yt;i.ready(r,function(){y()&&u(h.ALL,function(n){f(n)});i.feature&&i.feature("domloaded",!0)})})(window);
/*
//# sourceMappingURL=head.min.js.map
*/

2
lib/js/promise.js Normal file
View File

@@ -0,0 +1,2 @@
/* MIT | https://github.com/taylorhakes/promise-polyfill */
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n():"function"==typeof define&&define.amd?define(n):n()}(0,function(){"use strict";function e(e){var n=this.constructor;return this.then(function(t){return n.resolve(e()).then(function(){return t})},function(t){return n.resolve(e()).then(function(){return n.reject(t)})})}function n(){}function t(e){if(!(this instanceof t))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=undefined,this._deferreds=[],u(e,this)}function o(e,n){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,t._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null!==t){var o;try{o=t(e._value)}catch(f){return void i(n.promise,f)}r(n.promise,o)}else(1===e._state?r:i)(n.promise,e._value)})):e._deferreds.push(n)}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var o=n.then;if(n instanceof t)return e._state=3,e._value=n,void f(e);if("function"==typeof o)return void u(function(e,n){return function(){e.apply(n,arguments)}}(o,n),e)}e._state=1,e._value=n,f(e)}catch(r){i(e,r)}}function i(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&t._immediateFn(function(){e._handled||t._unhandledRejectionFn(e._value)});for(var n=0,r=e._deferreds.length;r>n;n++)o(e,e._deferreds[n]);e._deferreds=null}function u(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,i(n,e))})}catch(o){if(t)return;t=!0,i(n,o)}}var c=setTimeout;t.prototype["catch"]=function(e){return this.then(null,e)},t.prototype.then=function(e,t){var r=new this.constructor(n);return o(this,new function(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}(e,t,r)),r},t.prototype["finally"]=e,t.all=function(e){return new t(function(n,t){function o(e,f){try{if(f&&("object"==typeof f||"function"==typeof f)){var u=f.then;if("function"==typeof u)return void u.call(f,function(n){o(e,n)},t)}r[e]=f,0==--i&&n(r)}catch(c){t(c)}}if(!e||"undefined"==typeof e.length)throw new TypeError("Promise.all accepts an array");var r=Array.prototype.slice.call(e);if(0===r.length)return n([]);for(var i=r.length,f=0;r.length>f;f++)o(f,r[f])})},t.resolve=function(e){return e&&"object"==typeof e&&e.constructor===t?e:new t(function(n){n(e)})},t.reject=function(e){return new t(function(n,t){t(e)})},t.race=function(e){return new t(function(n,t){for(var o=0,r=e.length;r>o;o++)e[o].then(n,t)})},t._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){c(e,0)},t._unhandledRejectionFn=function(e){void 0!==console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)};var l=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}();"Promise"in l?l.Promise.prototype["finally"]||(l.Promise.prototype["finally"]=e):l.Promise=t});

File diff suppressed because one or more lines are too long

View File

@@ -539,12 +539,17 @@
callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) { callRevealApi( 'getSlidesAttributes', [], function ( slideAttributes ) {
callRevealApi( 'getConfig', [], function ( config ) { callRevealApi( 'getConfig', [], function ( config ) {
var totalTime = config.totalTime;
var minTimePerSlide = config.minimumTimePerSlide || 0;
var defaultTiming = config.defaultTiming; var defaultTiming = config.defaultTiming;
if (defaultTiming == null) { if ((defaultTiming == null) && (totalTime == null)) {
callback(null); callback(null);
return; return;
} }
// Setting totalTime overrides defaultTiming
if (totalTime) {
defaultTiming = 0;
}
var timings = []; var timings = [];
for ( var i in slideAttributes ) { for ( var i in slideAttributes ) {
var slide = slideAttributes[ i ]; var slide = slideAttributes[ i ];
@@ -559,7 +564,22 @@
} }
timings.push(timing); 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 ); callback( timings );
} ); } );
} ); } );