two js bundles; reveal.js (es6) and reveal.es5.js, add source maps

This commit is contained in:
Hakim El Hattab committed 2020-04-17 10:59:55 +02:00
1 parent d9690462e0
commit 4f6bdf1420
31 files changed
+154 -51

No files matched your search

+2 -2
View File
@@ -128,7 +128,7 @@ Here's a barebones example of a fully working reveal.js presentation:
<section>Slide 2</section> <section>Slide 2</section>
</div> </div>
</div> </div>
<script src="dist/reveal.min.js"></script> <script src="dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize(); Reveal.initialize();
</script> </script>
@@ -156,7 +156,7 @@ It's also possible to write presentations using [Markdown](#markdown).
If you only have a single presentation on the page we recommend initializing reveal.js using the singleton API. If you only have a single presentation on the page we recommend initializing reveal.js using the singleton API.
```html ```html
<script src="dist/reveal.min.js"></script> <script src="dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ keyboard: true }); Reveal.initialize({ keyboard: true });
</script> </script>
+2 -4
View File
@@ -412,7 +412,7 @@ Reveal.on( 'customevent', function() {
<script type="module"> <script type="module">
import Reveal from '/js/reveal.js'; import Reveal from '/dist/reveal.js';
import Zoom from '/plugin/zoom/zoom.js'; import Zoom from '/plugin/zoom/zoom.js';
import Notes from '/plugin/notes/notes.js'; import Notes from '/plugin/notes/notes.js';
import Search from '/plugin/search/search.js'; import Search from '/plugin/search/search.js';
@@ -420,7 +420,7 @@ Reveal.on( 'customevent', function() {
import Highlight from '/plugin/highlight/highlight.js'; import Highlight from '/plugin/highlight/highlight.js';
// More info https://github.com/hakimel/reveal.js#configuration // More info https://github.com/hakimel/reveal.js#configuration
let deck = new Reveal({ Reveal.initialize({
controls: true, controls: true,
progress: true, progress: true,
center: true, center: true,
@@ -432,8 +432,6 @@ Reveal.on( 'customevent', function() {
plugins: [ Zoom, Notes, Search, Markdown, Highlight ] plugins: [ Zoom, Notes, Search, Markdown, Highlight ]
}); });
deck.initialize();
</script> </script>
</body> </body>
+1 -1
View File
@@ -1,5 +1,5 @@
/*! /*!
* reveal.js 4.0.0-dev (Thu Apr 16 2020) * reveal.js 4.0.0-dev (Fri Apr 17 2020)
* https://revealjs.com * https://revealjs.com
* MIT licensed * MIT licensed
* *
+9
View File
@@ -0,0 +1,9 @@
/*!
* reveal.js 4.0.0-dev (Fri Apr 17 2020)
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Reveal=t()}(this,(function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){a(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var d=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/,c=/fade-(down|up|right|left|out|in-then-out|in-then-semi-out)|semi-fade-out|current-visible|shrink|grow/,u=function(e,t){for(var i in t)e[i]=t[i];return e},h=function(e,t){return Array.from(e.querySelectorAll(t))},v=function(e){if("string"==typeof e){if("null"===e)return null;if("true"===e)return!0;if("false"===e)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},g=function(e,t){e.style.transform=t},f=function(e,t){for(var i=e.parentNode;i;){var n=i.matches||i.matchesSelector||i.msMatchesSelector;if(n&&n.call(i,t))return i;i=i.parentNode}return null},p=function(e,t,i){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=e.querySelectorAll("."+i),r=0;r<a.length;r++){var s=a[r];if(s.parentNode===e)return s}var o=document.createElement(t);return o.className=i,o.innerHTML=n,e.appendChild(o),o},m=function(e){var t=document.createElement("style");return t.type="text/css",e&&e.length>0&&(t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))),document.head.appendChild(t),t},y=function(){var e={};for(var t in location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,(function(t){e[t.split("=").shift()]=t.split("=").pop()})),e){var i=e[t];e[t]=v(unescape(i))}return void 0!==e.dependencies&&delete e.dependencies,e},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e){var i,n=e.style.height;return e.style.height="0px",e.parentNode.style.height="auto",i=t-e.parentNode.offsetHeight,e.style.height=n+"px",e.parentNode.style.removeProperty("height"),i}return t},k=navigator.userAgent,w=document.createElement("div"),A=/(iphone|ipod|ipad|android)/gi.test(k)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,R=/chrome/i.test(k)&&!/edge/i.test(k),E=/android/gi.test(k),S="zoom"in w.style&&!A&&(R||/Version\/[\d\.]+.*Safari/.test(k)),L="function"==typeof window.history.replaceState&&!/PhantomJS/.test(k),x=function(){function e(i){t(this,e),this.Reveal=i,this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this)}return n(e,[{key:"shouldPreload",value:function(e){var t=this.Reveal.getConfig().preloadIframes;return"boolean"!=typeof t&&(t=e.hasAttribute("data-preload")),t}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.style.display=this.Reveal.getConfig().display,h(e,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach((function(e){("IFRAME"!==e.tagName||t.shouldPreload(e))&&(e.setAttribute("src",e.getAttribute("data-src")),e.setAttribute("data-lazy-loaded",""),e.removeAttribute("data-src"))})),h(e,"video, audio").forEach((function(e){var t=0;h(e,"source[data-src]").forEach((function(e){e.setAttribute("src",e.getAttribute("data-src")),e.removeAttribute("Line truncated
//# sourceMappingURL=reveal.es5.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"reveal.es5.js","sources":["../js/utils/constants.js","../js/utils/util.js","../js/utils/device.js","../js/controllers/slidecontent.js","../js/controllers/slidenumber.js","../js/utils/color.js","../js/controllers/backgrounds.js","../js/controllers/autoanimate.js","../js/controllers/fragments.js","../js/controllers/overview.js","../js/controllers/keyboard.js","../js/controllers/location.js","../js/controllers/controls.js","../js/controllers/progress.js","../js/controllers/pointer.js","../js/utils/loader.js","../js/controllers/plugins.js","../js/controllers/print.js","../js/controllers/touch.js","../js/controllers/notes.js","../js/components/playback.js","../js/config.js","../js/reveal.js","../js/index.js"],"sourcesContent":["\nexport const SLIDES_SELECTOR = '.slides section';\nexport const HORIZONTAL_SLIDES_SELECTOR = '.slides>section';\nexport const VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section';\n\n// Methods that may not be invoked via the postMessage API\nexport const POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/;\n\n// Regex for retrieving the fragment style from a class attribute\nexport const FRAGMENT_STYLE_REGEX = /fade-(down|up|right|left|out|in-then-out|in-then-semi-out)|semi-fade-out|current-visible|shrink|grow/;","/**\n * Extend object a with the properties of object b.\n * If there's a conflict, object b takes precedence.\n *\n * @param {object} a\n * @param {object} b\n */\nexport const extend = ( a, b ) => {\n\n\tfor( let i in b ) {\n\t\ta[ i ] = b[ i ];\n\t}\n\n\treturn a;\n\n}\n\n/**\n * querySelectorAll but returns an Array.\n */\nexport const queryAll = ( el, selector ) => {\n\n\treturn Array.from( el.querySelectorAll( selector ) );\n\n}\n\n/**\n * Utility for deserializing a value.\n *\n * @param {*} value\n * @return {*}\n */\nexport const deserialize = ( value ) => {\n\n\tif( typeof value === 'string' ) {\n\t\tif( value === 'null' ) return null;\n\t\telse if( value === 'true' ) return true;\n\t\telse if( value === 'false' ) return false;\n\t\telse if( value.match( /^-?[\\d\\.]+$/ ) ) return parseFloat( value );\n\t}\n\n\treturn value;\n\n}\n\n/**\n * Measures the distance in pixels between point a\n * and point b.\n *\n * @param {object} a point with x/y properties\n * @param {object} b point with x/y properties\n *\n * @return {number}\n */\nexport const distanceBetween = ( a, b ) => {\n\n\tlet dx = a.x - b.x,\n\t\tdy = a.y - b.y;\n\n\treturn Math.sqrt( dx*dx + dy*dy );\n\n}\n\n/**\n * Applies a CSS transform to the target element.\n *\n * @param {HTMLElement} element\n * @param {string} transform\n */\nexport const transformElement = ( element, transform ) => {\n\n\telement.style.transform = transform;\n\n}\n\n/**\n * Find the closest parent that matches the given\n * selector.\n *\n * @param {HTMLElement} target The child element\n * @param {String} selector The CSS selector to match\n * the parents against\n *\n * @return {HTMLElement} The matched parent or null\n * if no matching parent was found\n */\nexport const closestParent = ( target, selector ) => {\n\n\tlet parent = target.parentNode;\n\n\twhile( parent ) {\n\n\t\t// There's some overhead doing this each time, we don't\n\t\t// want to rewrite the element prototype but should still\n\t\t// be enough to feature detect once at startup...\n\t\tlet matchesMethod = parent.matches || parent.matchesSelector || parent.msMatchesSelector;\n\n\t\t// If we find a match, we're all set\n\t\tif( matchesMethod && matchesMethod.call( parent, selector ) ) {\n\t\t\treturn parent;\n\t\t}\n\n\t\t// Keep searching\n\t\tparent = parent.parentNode;\n\n\t}\n\n\treturn null;\n\n}\n\n/**\n * Handling the fullscreen functionality via the fullscreen API\n *\n * @see http://fullscreen.spec.whatwg.org/\n * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode\n */\nexport const enterFullscreen = () => {\n\n\tlet element = document.documentElement;\n\n\t// Check which implementation is available\n\tlet requestMethod = element.requestFullscreen ||\n\t\t\t\t\t\telement.webkitRequestFullscreen ||\n\t\t\t\t\t\telement.webkitRequestFullScreen ||\n\t\t\t\t\t\telement.mozRequestFullScreen ||\n\t\t\t\t\t\telement.msRequestFullscreen;\n\n\tif( requestMethod ) {\n\t\trequestMethod.apply( element );\n\t}\n\n}\n\n/**\n * Creates an HTML element and returns a reference to it.\n * If the element already exists the existing instance will\n * be returned.\n *\n * @param {HTMLElement} container\n * @param {string} tagname\n * @param {string} classname\n * @param {string} innerHTML\n *\n * @return {HTMLElement}\n */\nexport const createSingletonNode = ( container, tagname, classname, innerHTML='' ) => {\n\n\t// Find all nodes matching the description\n\tlet nodes = container.querySelectorAll( '.' + classname );\n\n\t// Check all matches to find one which is a direct child of\n\t// the specified container\n\tfor( let i = 0; i < nodes.length; i++ ) {\n\t\tlet testNoLine truncated
+9
View File
@@ -0,0 +1,9 @@
/*!
* reveal.js 4.0.0-dev (Fri Apr 17 2020)
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/
function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){a(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var d=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/,c=/fade-(down|up|right|left|out|in-then-out|in-then-semi-out)|semi-fade-out|current-visible|shrink|grow/,u=function(e,t){for(var i in t)e[i]=t[i];return e},h=function(e,t){return Array.from(e.querySelectorAll(t))},v=function(e){if("string"==typeof e){if("null"===e)return null;if("true"===e)return!0;if("false"===e)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},g=function(e,t){e.style.transform=t},f=function(e,t){for(var i=e.parentNode;i;){var n=i.matches||i.matchesSelector||i.msMatchesSelector;if(n&&n.call(i,t))return i;i=i.parentNode}return null},p=function(e,t,i){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=e.querySelectorAll("."+i),r=0;r<a.length;r++){var s=a[r];if(s.parentNode===e)return s}var o=document.createElement(t);return o.className=i,o.innerHTML=n,e.appendChild(o),o},m=function(e){var t=document.createElement("style");return t.type="text/css",e&&e.length>0&&(t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))),document.head.appendChild(t),t},y=function(){var e={};for(var t in location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,(function(t){e[t.split("=").shift()]=t.split("=").pop()})),e){var i=e[t];e[t]=v(unescape(i))}return void 0!==e.dependencies&&delete e.dependencies,e},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e){var i,n=e.style.height;return e.style.height="0px",e.parentNode.style.height="auto",i=t-e.parentNode.offsetHeight,e.style.height=n+"px",e.parentNode.style.removeProperty("height"),i}return t},k=navigator.userAgent,w=document.createElement("div"),A=/(iphone|ipod|ipad|android)/gi.test(k)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,R=/chrome/i.test(k)&&!/edge/i.test(k),E=/android/gi.test(k),S="zoom"in w.style&&!A&&(R||/Version\/[\d\.]+.*Safari/.test(k)),L="function"==typeof window.history.replaceState&&!/PhantomJS/.test(k),x=function(){function e(i){t(this,e),this.Reveal=i,this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this)}return n(e,[{key:"shouldPreload",value:function(e){var t=this.Reveal.getConfig().preloadIframes;return"boolean"!=typeof t&&(t=e.hasAttribute("data-preload")),t}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.style.display=this.Reveal.getConfig().display,h(e,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach((function(e){("IFRAME"!==e.tagName||t.shouldPreload(e))&&(e.setAttribute("src",e.getAttribute("data-src")),e.setAttribute("data-lazy-loaded",""),e.removeAttribute("data-src"))})),h(e,"video, audio").forEach((function(e){var t=0;h(e,"source[data-src]").forEach((function(e){e.setAttribute("src",e.getAttribute("data-src")),e.removeAttribute("data-src"),e.setAttribute("data-lazy-loaded",""),t+=1})),t>0&&e.load()}));var n=e.slideBackgroundElement;if(n){n.style.display="block";var a=e.slideBackgroundContentElement,r=e.getAttributeLine truncated
//# sourceMappingURL=reveal.js.map
+1
View File
@@ -0,0 +1 @@
{"version":3,"file":"reveal.js","sources":["../js/utils/constants.js","../js/utils/util.js","../js/utils/device.js","../js/controllers/slidecontent.js","../js/controllers/slidenumber.js","../js/utils/color.js","../js/controllers/backgrounds.js","../js/controllers/autoanimate.js","../js/controllers/fragments.js","../js/controllers/overview.js","../js/controllers/keyboard.js","../js/controllers/location.js","../js/controllers/controls.js","../js/controllers/progress.js","../js/controllers/pointer.js","../js/utils/loader.js","../js/controllers/plugins.js","../js/controllers/print.js","../js/controllers/touch.js","../js/controllers/notes.js","../js/components/playback.js","../js/config.js","../js/reveal.js","../js/index.js"],"sourcesContent":["\nexport const SLIDES_SELECTOR = '.slides section';\nexport const HORIZONTAL_SLIDES_SELECTOR = '.slides>section';\nexport const VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section';\n\n// Methods that may not be invoked via the postMessage API\nexport const POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/;\n\n// Regex for retrieving the fragment style from a class attribute\nexport const FRAGMENT_STYLE_REGEX = /fade-(down|up|right|left|out|in-then-out|in-then-semi-out)|semi-fade-out|current-visible|shrink|grow/;","/**\n * Extend object a with the properties of object b.\n * If there's a conflict, object b takes precedence.\n *\n * @param {object} a\n * @param {object} b\n */\nexport const extend = ( a, b ) => {\n\n\tfor( let i in b ) {\n\t\ta[ i ] = b[ i ];\n\t}\n\n\treturn a;\n\n}\n\n/**\n * querySelectorAll but returns an Array.\n */\nexport const queryAll = ( el, selector ) => {\n\n\treturn Array.from( el.querySelectorAll( selector ) );\n\n}\n\n/**\n * Utility for deserializing a value.\n *\n * @param {*} value\n * @return {*}\n */\nexport const deserialize = ( value ) => {\n\n\tif( typeof value === 'string' ) {\n\t\tif( value === 'null' ) return null;\n\t\telse if( value === 'true' ) return true;\n\t\telse if( value === 'false' ) return false;\n\t\telse if( value.match( /^-?[\\d\\.]+$/ ) ) return parseFloat( value );\n\t}\n\n\treturn value;\n\n}\n\n/**\n * Measures the distance in pixels between point a\n * and point b.\n *\n * @param {object} a point with x/y properties\n * @param {object} b point with x/y properties\n *\n * @return {number}\n */\nexport const distanceBetween = ( a, b ) => {\n\n\tlet dx = a.x - b.x,\n\t\tdy = a.y - b.y;\n\n\treturn Math.sqrt( dx*dx + dy*dy );\n\n}\n\n/**\n * Applies a CSS transform to the target element.\n *\n * @param {HTMLElement} element\n * @param {string} transform\n */\nexport const transformElement = ( element, transform ) => {\n\n\telement.style.transform = transform;\n\n}\n\n/**\n * Find the closest parent that matches the given\n * selector.\n *\n * @param {HTMLElement} target The child element\n * @param {String} selector The CSS selector to match\n * the parents against\n *\n * @return {HTMLElement} The matched parent or null\n * if no matching parent was found\n */\nexport const closestParent = ( target, selector ) => {\n\n\tlet parent = target.parentNode;\n\n\twhile( parent ) {\n\n\t\t// There's some overhead doing this each time, we don't\n\t\t// want to rewrite the element prototype but should still\n\t\t// be enough to feature detect once at startup...\n\t\tlet matchesMethod = parent.matches || parent.matchesSelector || parent.msMatchesSelector;\n\n\t\t// If we find a match, we're all set\n\t\tif( matchesMethod && matchesMethod.call( parent, selector ) ) {\n\t\t\treturn parent;\n\t\t}\n\n\t\t// Keep searching\n\t\tparent = parent.parentNode;\n\n\t}\n\n\treturn null;\n\n}\n\n/**\n * Handling the fullscreen functionality via the fullscreen API\n *\n * @see http://fullscreen.spec.whatwg.org/\n * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode\n */\nexport const enterFullscreen = () => {\n\n\tlet element = document.documentElement;\n\n\t// Check which implementation is available\n\tlet requestMethod = element.requestFullscreen ||\n\t\t\t\t\t\telement.webkitRequestFullscreen ||\n\t\t\t\t\t\telement.webkitRequestFullScreen ||\n\t\t\t\t\t\telement.mozRequestFullScreen ||\n\t\t\t\t\t\telement.msRequestFullscreen;\n\n\tif( requestMethod ) {\n\t\trequestMethod.apply( element );\n\t}\n\n}\n\n/**\n * Creates an HTML element and returns a reference to it.\n * If the element already exists the existing instance will\n * be returned.\n *\n * @param {HTMLElement} container\n * @param {string} tagname\n * @param {string} classname\n * @param {string} innerHTML\n *\n * @return {HTMLElement}\n */\nexport const createSingletonNode = ( container, tagname, classname, innerHTML='' ) => {\n\n\t// Find all nodes matching the description\n\tlet nodes = container.querySelectorAll( '.' + classname );\n\n\t// Check all matches to find one which is a direct child of\n\t// the specified container\n\tfor( let i = 0; i < nodes.length; i++ ) {\n\t\tlet testNode =Line truncated
-8
View File
@@ -1,8 +0,0 @@
/*!
* reveal.js 4.0.0-dev (Fri Apr 17 2020)
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2020 Hakim El Hattab, https://hakim.se
*/
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function r(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function s(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?r(Object(i),!0).forEach((function(t){a(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):r(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var d=/registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/,c=/fade-(down|up|right|left|out|in-then-out|in-then-semi-out)|semi-fade-out|current-visible|shrink|grow/,u=function(e,t){for(var i in t)e[i]=t[i];return e},h=function(e,t){return Array.from(e.querySelectorAll(t))},v=function(e){if("string"==typeof e){if("null"===e)return null;if("true"===e)return!0;if("false"===e)return!1;if(e.match(/^-?[\d\.]+$/))return parseFloat(e)}return e},g=function(e,t){e.style.transform=t},f=function(e,t){for(var i=e.parentNode;i;){var n=i.matches||i.matchesSelector||i.msMatchesSelector;if(n&&n.call(i,t))return i;i=i.parentNode}return null},p=function(e,t,i){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=e.querySelectorAll("."+i),r=0;r<a.length;r++){var s=a[r];if(s.parentNode===e)return s}var o=document.createElement(t);return o.className=i,o.innerHTML=n,e.appendChild(o),o},m=function(e){var t=document.createElement("style");return t.type="text/css",e&&e.length>0&&(t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))),document.head.appendChild(t),t},y=function(){var e={};for(var t in location.search.replace(/[A-Z0-9]+?=([\w\.%-]*)/gi,(function(t){e[t.split("=").shift()]=t.split("=").pop()})),e){var i=e[t];e[t]=v(unescape(i))}return void 0!==e.dependencies&&delete e.dependencies,e},b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e){var i,n=e.style.height;return e.style.height="0px",e.parentNode.style.height="auto",i=t-e.parentNode.offsetHeight,e.style.height=n+"px",e.parentNode.style.removeProperty("height"),i}return t},k=navigator.userAgent,w=document.createElement("div"),A=/(iphone|ipod|ipad|android)/gi.test(k)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,R=/chrome/i.test(k)&&!/edge/i.test(k),E=/android/gi.test(k),S="zoom"in w.style&&!A&&(R||/Version\/[\d\.]+.*Safari/.test(k)),L="function"==typeof window.history.replaceState&&!/PhantomJS/.test(k),x=function(){function e(i){t(this,e),this.Reveal=i,this.startEmbeddedIframe=this.startEmbeddedIframe.bind(this)}return n(e,[{key:"shouldPreload",value:function(e){var t=this.Reveal.getConfig().preloadIframes;return"boolean"!=typeof t&&(t=e.hasAttribute("data-preload")),t}},{key:"load",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.style.display=this.Reveal.getConfig().display,h(e,"img[data-src], video[data-src], audio[data-src], iframe[data-src]").forEach((function(e){("IFRAME"!==e.tagName||t.shouldPreload(e))&&(e.setAttribute("src",e.getAttribute("data-src")),e.setAttribute("data-lazy-loaded",""),e.removeAttribute("data-src"))})),h(e,"video, audio").forEach((function(e){var t=0;h(e,"source[data-src]").forEach((function(e){e.setAttribute("src",e.getAttribute("data-src")),e.removeAttribute("data-src"),e.setAttribute("data-lazy-loaded",""),t+=1})),t>0&&e.load()}));var n=e.slideBackgroundELine truncated
+1 -1
View File
@@ -162,7 +162,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script src="../dist/plugin/highlight.js"></script> <script src="../dist/plugin/highlight.js"></script>
<script> <script>
Reveal.initialize({ Reveal.initialize({
+1 -1
View File
@@ -29,7 +29,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize(); Reveal.initialize();
</script> </script>
+1 -1
View File
@@ -175,7 +175,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ Reveal.initialize({
history: true, history: true,
+1 -1
View File
@@ -45,7 +45,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ Reveal.initialize({
transition: 'linear' transition: 'linear'
+1 -1
View File
@@ -30,7 +30,7 @@
</div> </div>
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
let r1 = new Reveal( document.querySelector( '.deck1' ), { let r1 = new Reveal( document.querySelector( '.deck1' ), {
+1 -1
View File
@@ -122,7 +122,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
// Full list of configuration options available here: // Full list of configuration options available here:
+1 -1
View File
@@ -81,7 +81,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ Reveal.initialize({
center: true, center: true,
+16 -7
View File
@@ -5,10 +5,10 @@ const yargs = require('yargs')
const colors = require('colors') const colors = require('colors')
const qunit = require('node-qunit-puppeteer') const qunit = require('node-qunit-puppeteer')
const {rollup} = require('rollup'); const {rollup} = require('rollup')
const {terser} = require('rollup-plugin-terser'); const {terser} = require('rollup-plugin-terser')
const babel = require('rollup-plugin-babel'); const babel = require('rollup-plugin-babel')
const resolve = require('@rollup/plugin-node-resolve'); const resolve = require('@rollup/plugin-node-resolve')
const gulp = require('gulp') const gulp = require('gulp')
const tap = require('gulp-tap') const tap = require('gulp-tap')
@@ -58,9 +58,18 @@ gulp.task('js', () => {
...rollupConfig ...rollupConfig
}).then( bundle => { }).then( bundle => {
bundle.write({ bundle.write({
file: './dist/reveal.min.js', file: './dist/reveal.js',
format: 'es',
banner: banner,
sourcemap: true
});
bundle.write({
name: 'Reveal',
file: './dist/reveal.es5.js',
format: 'umd', format: 'umd',
banner: banner banner: banner,
sourcemap: true
}); });
}); });
}) })
@@ -175,7 +184,7 @@ gulp.task('test', gulp.series( 'eslint', 'qunit' ))
gulp.task('default', gulp.series(gulp.parallel('js', 'css', 'plugins'), 'test')) gulp.task('default', gulp.series(gulp.parallel('js', 'css', 'plugins'), 'test'))
gulp.task('build', gulp.parallel('js', 'css')) gulp.task('build', gulp.parallel('js', 'css', 'plugins'))
gulp.task('package', gulp.series('default', () => gulp.task('package', gulp.series('default', () =>
+1 -1
View File
@@ -21,7 +21,7 @@
</div> </div>
</div> </div>
<script src="dist/reveal.min.js"></script> <script src="dist/reveal.es5.js"></script>
<script src="dist/plugin/markdown.js"></script> <script src="dist/plugin/markdown.js"></script>
<script src="dist/plugin/highlight.js"></script> <script src="dist/plugin/highlight.js"></script>
<script src="dist/plugin/notes.js"></script> <script src="dist/plugin/notes.js"></script>
+9 -7
View File
@@ -1,4 +1,4 @@
import Presentation from './reveal.js' import Deck from './reveal.js'
/** /**
* Expose the Reveal class to the window. To create a * Expose the Reveal class to the window. To create a
@@ -10,7 +10,7 @@ import Presentation from './reveal.js'
* // reveal.js is ready * // reveal.js is ready
* }); * });
*/ */
window.Reveal = Presentation; var Reveal = Deck;
/** /**
@@ -27,15 +27,15 @@ window.Reveal = Presentation;
let enqueuedAPICalls = []; let enqueuedAPICalls = [];
window.Reveal.initialize = options => { Reveal.initialize = options => {
// Create our singleton reveal.js instance // Create our singleton reveal.js instance
window.Reveal = new Presentation( document.querySelector( '.reveal' ), options ); Object.assign( Reveal, new Deck( document.querySelector( '.reveal' ), options ) );
// Invoke any enqueued API calls // Invoke any enqueued API calls
enqueuedAPICalls.map( method => method( window.Reveal ) ); enqueuedAPICalls.map( method => method( Reveal ) );
return window.Reveal.initialize(); return Reveal.initialize();
} }
@@ -46,7 +46,9 @@ window.Reveal.initialize = options => {
* when Reveal.initialize is called. * when Reveal.initialize is called.
*/ */
[ 'on', 'off', 'addEventListener', 'removeEventListener', 'registerPlugin' ].forEach( method => { [ 'on', 'off', 'addEventListener', 'removeEventListener', 'registerPlugin' ].forEach( method => {
window.Reveal[method] = ( ...args ) => { Reveal[method] = ( ...args ) => {
enqueuedAPICalls.push( deck => deck[method].call( null, ...args ) ); enqueuedAPICalls.push( deck => deck[method].call( null, ...args ) );
} }
} ); } );
export default Reveal;
+1 -1
View File
@@ -109,7 +109,7 @@
</div> </div>
</div> </div>
<script src="../../dist/reveal.min.js"></script> <script src="../../dist/reveal.es5.js"></script>
<script> <script>
+1 -1
View File
@@ -62,7 +62,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
const slides = Array.prototype.map.call( document.querySelectorAll( '.slides section' ), slide => { const slides = Array.prototype.map.call( document.querySelectorAll( '.slides section' ), slide => {
+1 -1
View File
@@ -26,7 +26,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
var externalScriptSequence = ''; var externalScriptSequence = '';
var scriptCount = 0; var scriptCount = 0;
+1 -1
View File
@@ -26,7 +26,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
window.externalScriptSequence = ''; window.externalScriptSequence = '';
+1 -1
View File
@@ -38,7 +38,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize().then( () => { Reveal.initialize().then( () => {
+1 -1
View File
@@ -31,7 +31,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ viewDistance: 3 }).then( () => { Reveal.initialize({ viewDistance: 3 }).then( () => {
+1 -1
View File
@@ -31,7 +31,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ viewDistance: 2 }).then( () => { Reveal.initialize({ viewDistance: 2 }).then( () => {
+76
View File
@@ -0,0 +1,76 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>reveal.js - Test Iframes</title>
<link rel="stylesheet" href="../dist/reveal.css">
<link rel="stylesheet" href="qunit-2.5.0.css">
<script src="qunit-2.5.0.js"></script>
</head>
<body style="overflow: auto;">
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<div class="deck1">
<div class="reveal" style="display: none;">
<div class="slides">
<section>1.1</section>
<section>1.2</section>
<section>1.3</section>
</div>
</div>
</div>
<div class="deck2">
<div class="reveal" style="display: none;">
<div class="slides">
<section>2.1</section>
<section>2.2</section>
<section>2.3</section>
</div>
</div>
</div>
<script src="../dist/reveal.es5.js"></script>
<script>
QUnit.module( 'Multiple reveal.js instances' );
let r1 = new Reveal( document.querySelector( '.deck1 .reveal' ), {
embedded: true,
keyboard: true
} );
r1.initialize();
let r2 = new Reveal( document.querySelector( '.deck2 .reveal' ), {
embedded: true,
keyboard: false
} );
r2.initialize();
QUnit.test( 'Can make independent changes', function( assert ) {
r1.slide(1);
r2.slide(2);
assert.strictEqual( r1.getCurrentSlide().textContent, '1.2' );
assert.strictEqual( r2.getCurrentSlide().textContent, '2.3' );
r2.toggleOverview( true );
assert.strictEqual( r1.isOverview(), false );
assert.strictEqual( r2.isOverview(), true );
r2.toggleOverview( false );
assert.strictEqual( r1.getConfig().keyboard, true );
assert.strictEqual( r2.getConfig().keyboard, false );
});
</script>
</body>
</html>
+8 -2
View File
@@ -36,8 +36,9 @@
</div> </div>
</div> </div>
<script src="../dist/reveal.min.js"></script> <script type="module">
<script>
import Reveal from '../dist/reveal.js';
QUnit.module( 'Multiple reveal.js instances' ); QUnit.module( 'Multiple reveal.js instances' );
@@ -71,6 +72,11 @@
}); });
</script> </script>
<script>
QUnit.test( 'Reveal does not leak to window', function( assert ) {
assert.strictEqual( window.Reveal, undefined );
});
</script>
</body> </body>
</html> </html>
+1 -1
View File
@@ -73,7 +73,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize({ pdf: true }).then( function() { Reveal.initialize({ pdf: true }).then( function() {
+1 -1
View File
@@ -26,7 +26,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
QUnit.module( 'Plugins' ); QUnit.module( 'Plugins' );
+2 -2
View File
@@ -36,11 +36,11 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
Reveal.initialize().then( function() { Reveal.initialize().then( function() {
console.log(Reveal);
QUnit.module( 'State' ); QUnit.module( 'State' );
+1 -1
View File
@@ -77,7 +77,7 @@
</div> </div>
<script src="../dist/reveal.min.js"></script> <script src="../dist/reveal.es5.js"></script>
<script> <script>
// These tests expect the DOM to contain a presentation // These tests expect the DOM to contain a presentation
// with the following slide structure: // with the following slide structure: