Updated revealjs

This commit is contained in:
iko 2020-03-06 14:30:22 +03:00
parent b5e9fbfc4e
commit dd49a0e81e
28 changed files with 138 additions and 127 deletions

2
reveal.js/bower.json Normal file → Executable file
View File

@ -1,6 +1,6 @@
{
"name": "reveal.js",
"version": "3.8.0",
"version": "3.9.2",
"main": [
"js/reveal.js",
"css/reveal.css"

2
reveal.js/gruntfile.js Normal file → Executable file
View File

@ -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' +
' */'
},

192
reveal.js/js/reveal.js Normal file → Executable file
View File

@ -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 ) {
@ -26,14 +26,18 @@
var Reveal;
// The reveal.js version
var VERSION = '3.8.0';
var VERSION = '3.9.2';
var SLIDES_SELECTOR = '.slides section',
HORIZONTAL_SLIDES_SELECTOR = '.slides>section',
VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section',
HOME_SLIDE_SELECTOR = '.slides>section:first-of-type',
UA = navigator.userAgent,
// Methods that may not be invoked via the postMessage API
POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/,
// Configuration defaults, can be overridden at initialization time
config = {
@ -77,9 +81,9 @@
// - "c/t": Flattened slide number / total slides
//
// Alternatively, you can provide a function that returns the slide
// number for the current slide. The function needs to return an array
// with one string [slideNumber] or three strings [n1,delimiter,n2].
// See #formatSlideNumber().
// number for the current slide. The function should take in a slide
// object and return an array with one string [slideNumber] or
// three strings [n1,delimiter,n2]. See #formatSlideNumber().
slideNumber: false,
// Can be used to limit the contexts in which the slide number appears
@ -855,17 +859,10 @@
// Make sure stretch elements fit on slide
layoutSlideContents( slideWidth, slideHeight );
// Add each slide's index as attributes on itself, we need these
// indices to generate slide numbers below
toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) ).forEach( function( hslide, h ) {
hslide.setAttribute( 'data-index-h', h );
if( hslide.classList.contains( 'stack' ) ) {
toArray( hslide.querySelectorAll( 'section' ) ).forEach( function( vslide, v ) {
vslide.setAttribute( 'data-index-h', h );
vslide.setAttribute( 'data-index-v', v );
} );
}
// Compute slide numbers now, before we start duplicating slides
var doingSlideNumbers = config.slideNumber && /all|print/i.test( config.showSlideNumber );
toArray( dom.wrapper.querySelectorAll( SLIDES_SELECTOR ) ).forEach( function( slide ) {
slide.setAttribute( 'data-slide-number', getSlideNumber( slide ) );
} );
// Slide and slide background layout
@ -936,14 +933,11 @@
}
// Inject slide numbers if `slideNumbers` are enabled
if( config.slideNumber && /all|print/i.test( config.showSlideNumber ) ) {
var slideNumberH = parseInt( slide.getAttribute( 'data-index-h' ), 10 ) + 1,
slideNumberV = parseInt( slide.getAttribute( 'data-index-v' ), 10 ) + 1;
if( doingSlideNumbers ) {
var numberElement = document.createElement( 'div' );
numberElement.classList.add( 'slide-number' );
numberElement.classList.add( 'slide-number-pdf' );
numberElement.innerHTML = formatSlideNumber( slideNumberH, '.', slideNumberV );
numberElement.innerHTML = slide.getAttribute( 'data-slide-number' );
page.appendChild( numberElement );
}
@ -1284,11 +1278,20 @@
// Check if the requested method can be found
if( data.method && typeof Reveal[data.method] === 'function' ) {
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 } );
if( POST_MESSAGE_METHOD_BLACKLIST.test( data.method ) === false ) {
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 } );
}
else {
console.warn( 'reveal.js: "'+ data.method +'" is is blacklisted from the postMessage API' );
}
}
}
}, false );
@ -2657,34 +2660,37 @@
}
/**
* Return a hash URL that will resolve to the current slide location.
* Return a hash URL that will resolve to the given slide location.
*
* @param {HTMLElement} [slide=currentSlide] The slide to link to
*/
function locationHash() {
function locationHash( slide ) {
var url = '/';
// Attempt to create a named link based on the slide's ID
var id = currentSlide ? currentSlide.getAttribute( 'id' ) : null;
var s = slide || currentSlide;
var id = s ? s.getAttribute( 'id' ) : null;
if( id ) {
id = encodeURIComponent( id );
}
var indexf;
if( config.fragmentInURL ) {
indexf = getIndices().f;
var index = getIndices( slide );
if( !config.fragmentInURL ) {
index.f = undefined;
}
// If the current slide has an ID, use that as a named link,
// but we don't support named links with a fragment index
if( typeof id === 'string' && id.length && indexf === undefined ) {
if( typeof id === 'string' && id.length && index.f === undefined ) {
url = '/' + id;
}
// Otherwise use the /h/v index
else {
var hashIndexBase = config.hashOneBasedIndex ? 1 : 0;
if( indexh > 0 || indexv > 0 || indexf !== undefined ) url += indexh + hashIndexBase;
if( indexv > 0 || indexf !== undefined ) url += '/' + (indexv + hashIndexBase );
if( indexf !== undefined ) url += '/' + indexf;
if( index.h > 0 || index.v > 0 || index.f !== undefined ) url += index.h + hashIndexBase;
if( index.v > 0 || index.f !== undefined ) url += '/' + (index.v + hashIndexBase );
if( index.f !== undefined ) url += '/' + index.f;
}
return url;
@ -3428,48 +3434,58 @@
// Update slide number if enabled
if( config.slideNumber && dom.slideNumber ) {
var value;
var format = 'h.v';
if( typeof config.slideNumber === 'function' ) {
value = config.slideNumber();
}
else {
// Check if a custom number format is available
if( typeof config.slideNumber === 'string' ) {
format = config.slideNumber;
}
// If there are ONLY vertical slides in this deck, always use
// a flattened slide number
if( !/c/.test( format ) && dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length === 1 ) {
format = 'c';
}
value = [];
switch( format ) {
case 'c':
value.push( getSlidePastCount() + 1 );
break;
case 'c/t':
value.push( getSlidePastCount() + 1, '/', getTotalSlides() );
break;
case 'h/v':
value.push( indexh + 1 );
if( isVerticalSlide() ) value.push( '/', indexv + 1 );
break;
default:
value.push( indexh + 1 );
if( isVerticalSlide() ) value.push( '.', indexv + 1 );
}
}
dom.slideNumber.innerHTML = formatSlideNumber( value[0], value[1], value[2] );
dom.slideNumber.innerHTML = getSlideNumber();
}
}
/**
* Returns the HTML string corresponding to the current slide number,
* including formatting.
*/
function getSlideNumber( slide ) {
var value;
var format = 'h.v';
if( slide === undefined ) {
slide = currentSlide;
}
if ( typeof config.slideNumber === 'function' ) {
value = config.slideNumber( slide );
} else {
// Check if a custom number format is available
if( typeof config.slideNumber === 'string' ) {
format = config.slideNumber;
}
// If there are ONLY vertical slides in this deck, always use
// a flattened slide number
if( !/c/.test( format ) && dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length === 1 ) {
format = 'c';
}
value = [];
switch( format ) {
case 'c':
value.push( getSlidePastCount( slide ) + 1 );
break;
case 'c/t':
value.push( getSlidePastCount( slide ) + 1, '/', getTotalSlides() );
break;
default:
var indices = getIndices( slide );
value.push( indices.h + 1 );
var sep = format === 'h/v' ? '/' : '.';
if( isVerticalSlide( slide ) ) value.push( sep, indices.v + 1 );
}
}
var url = '#' + locationHash( slide );
return formatSlideNumber( value[0], value[1], value[2], url );
}
/**
* Applies HTML formatting to a slide number before it's
* written to the DOM.
@ -3477,11 +3493,14 @@
* @param {number} a Current slide
* @param {string} delimiter Character to separate slide numbers
* @param {(number|*)} b Total slides
* @param {HTMLElement} [url='#'+locationHash()] The url to link to
* @return {string} HTML string fragment
*/
function formatSlideNumber( a, delimiter, b ) {
function formatSlideNumber( a, delimiter, b, url ) {
var url = '#' + locationHash();
if( url === undefined ) {
url = '#' + locationHash();
}
if( typeof b === 'number' && !isNaN( b ) ) {
return '<a href="' + url + '">' +
'<span class="slide-number-a">'+ a +'</span>' +
@ -4232,9 +4251,15 @@
* Returns the number of past slides. This can be used as a global
* flattened index for slides.
*
* @param {HTMLElement} [slide=currentSlide] The slide we're counting before
*
* @return {number} Past slide count
*/
function getSlidePastCount() {
function getSlidePastCount( slide ) {
if( slide === undefined ) {
slide = currentSlide;
}
var horizontalSlides = toArray( dom.wrapper.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
@ -4250,7 +4275,7 @@
for( var j = 0; j < verticalSlides.length; j++ ) {
// Stop as soon as we arrive at the present
if( verticalSlides[j].classList.contains( 'present' ) ) {
if( verticalSlides[j] === slide ) {
break mainLoop;
}
@ -4259,7 +4284,7 @@
}
// Stop as soon as we arrive at the present
if( horizontalSlide.classList.contains( 'present' ) ) {
if( horizontalSlide === slide ) {
break;
}
@ -4751,6 +4776,8 @@
if( fragments.length ) {
var maxIndex = 0;
if( typeof index !== 'number' ) {
var currentFragment = sortFragments( currentSlide.querySelectorAll( '.fragment.visible' ) ).pop();
if( currentFragment ) {
@ -4764,6 +4791,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 );
@ -4787,6 +4816,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 );
}
}

File diff suppressed because one or more lines are too long

0
reveal.js/lib/css/monokai.css Normal file → Executable file
View File

0
reveal.js/lib/css/zenburn.css Normal file → Executable file
View File

0
reveal.js/lib/font/league-gothic/LICENSE Normal file → Executable file
View File

0
reveal.js/lib/font/league-gothic/league-gothic.css Normal file → Executable file
View File

0
reveal.js/lib/js/html5shiv.js vendored Normal file → Executable file
View File

0
reveal.js/lib/js/promise.js Normal file → Executable file
View File

50
reveal.js/package-lock.json generated Normal file → Executable file
View File

@ -1,6 +1,6 @@
{
"name": "reveal.js",
"version": "3.8.0",
"version": "3.9.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -53,12 +53,12 @@
}
},
"ajv": {
"version": "6.10.2",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.2.tgz",
"integrity": "sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.11.0.tgz",
"integrity": "sha512-nCprB/0syFYy9fVYU1ox1l2KN8S9I+tziH8D4zdZuLT3N6RMlGSGt5FSTpAiHB/Whv8Qs1cWHma1aMKZyaHRKA==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-deep-equal": "^3.1.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.2"
@ -275,9 +275,9 @@
"dev": true
},
"aws4": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.0.tgz",
"integrity": "sha512-Uvq6hVe90D0B2WEnUqtdgY1bATGz3mw33nH9Y+dmA+w5DHvUmBgkr5rM/KCHpCsiFNRUfokW/szpPPgMK2hm4A==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz",
"integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==",
"dev": true
},
"backo2": {
@ -1775,9 +1775,9 @@
"dev": true
},
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz",
"integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==",
"dev": true
},
"fast-json-stable-stringify": {
@ -3616,9 +3616,9 @@
}
},
"node-sass": {
"version": "4.13.0",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz",
"integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==",
"version": "4.13.1",
"resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz",
"integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==",
"dev": true,
"requires": {
"async-foreach": "^0.1.3",
@ -3638,14 +3638,6 @@
"sass-graph": "^2.2.4",
"stdout-stream": "^1.4.0",
"true-case-path": "^1.0.2"
},
"dependencies": {
"lodash": {
"version": "4.17.15",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz",
"integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==",
"dev": true
}
}
},
"nopt": {
@ -4328,14 +4320,6 @@
"tough-cookie": "~2.4.3",
"tunnel-agent": "^0.6.0",
"uuid": "^3.3.2"
},
"dependencies": {
"extend": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
"integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
"dev": true
}
}
},
"require-directory": {
@ -5477,9 +5461,9 @@
"dev": true
},
"uuid": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz",
"integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==",
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
"dev": true
},
"v8flags": {

6
reveal.js/package.json Normal file → Executable file
View File

@ -1,6 +1,6 @@
{
"name": "reveal.js",
"version": "3.8.0",
"version": "3.9.2",
"description": "The HTML Presentation Framework",
"homepage": "http://revealjs.com",
"subdomain": "revealjs",
@ -25,8 +25,8 @@
"devDependencies": {
"express": "^4.16.2",
"grunt": "^1.0.4",
"grunt-cli": "^1.3.2",
"grunt-autoprefixer": "^3.0.4",
"grunt-cli": "^1.3.2",
"grunt-contrib-connect": "^2.0.0",
"grunt-contrib-cssmin": "^3.0.0",
"grunt-contrib-jshint": "^2.0.0",
@ -36,8 +36,8 @@
"grunt-sass": "^3.0.2",
"grunt-zip": "~0.17.1",
"load-grunt-tasks": "^4.0.0",
"node-sass": "^4.13.0",
"mustache": "^2.3.0",
"node-sass": "^4.13.1",
"socket.io": "^2.2.0"
},
"license": "MIT"

4
reveal.js/plugin/highlight/highlight.js Normal file → Executable file

File diff suppressed because one or more lines are too long

0
reveal.js/plugin/markdown/example.html Normal file → Executable file
View File

0
reveal.js/plugin/markdown/example.md Normal file → Executable file
View File

0
reveal.js/plugin/markdown/marked.js Normal file → Executable file
View File

0
reveal.js/plugin/multiplex/client.js Normal file → Executable file
View File

0
reveal.js/plugin/multiplex/index.js Normal file → Executable file
View File

0
reveal.js/plugin/multiplex/master.js Normal file → Executable file
View File

0
reveal.js/plugin/multiplex/package.json Normal file → Executable file
View File

0
reveal.js/plugin/notes-server/client.js Normal file → Executable file
View File

0
reveal.js/plugin/notes-server/index.js Normal file → Executable file
View File

0
reveal.js/plugin/notes-server/notes.html Normal file → Executable file
View File

0
reveal.js/plugin/notes/notes.html Normal file → Executable file
View File

0
reveal.js/plugin/notes/notes.js Normal file → Executable file
View File

0
reveal.js/plugin/print-pdf/print-pdf.js Normal file → Executable file
View File

0
reveal.js/plugin/search/search.js Normal file → Executable file
View File

0
reveal.js/plugin/zoom-js/zoom.js Normal file → Executable file
View File