From ccbc7ed6bcd9a2fe9a8d6c651fdc8644ecc08ee6 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Fri, 7 Aug 2015 22:55:37 -0600 Subject: [PATCH 01/67] resolves #1324 allow display property to be configured - allow display property apply to current slide to be configured --- js/reveal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index ff5ea5336c..499d0068ae 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -45,6 +45,9 @@ minScale: 0.2, maxScale: 1.5, + // Value of the display CSS property applied to current slide to make it visible + display: 'block', + // Display controls in the bottom right corner controls: true, @@ -2721,7 +2724,7 @@ function showSlide( slide ) { // Show the slide element - slide.style.display = 'block'; + slide.style.display = config.display; // Media elements with data-src attributes toArray( slide.querySelectorAll( 'img[data-src], video[data-src], audio[data-src]' ) ).forEach( function( element ) { From 338a7b0ff9be7e26aa07252160fcf2135f125291 Mon Sep 17 00:00:00 2001 From: Quentin Bramas Date: Tue, 28 Jun 2016 14:31:37 +0200 Subject: [PATCH 02/67] add 'npm build' script that launch grunt --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3135f3531a..2e3f4a0773 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "main": "js/reveal.js", "scripts": { "test": "grunt test", - "start": "grunt serve" + "start": "grunt serve", + "build": "grunt" }, "author": { "name": "Hakim El Hattab", From a652e0a8ea3ecb904a9be77a266a5e84b8a9ab3a Mon Sep 17 00:00:00 2001 From: Asvin Goel Date: Thu, 21 Jul 2016 12:15:07 +0200 Subject: [PATCH 03/67] Allow switching off preview links The data-preview-link=false tag can be used to switch off preview links --- js/reveal.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index b975ff438e..b8b64cf292 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -983,10 +983,11 @@ // Iframe link previews if( config.previewLinks ) { enablePreviewLinks(); + disablePreviewLinks( '[data-preview-link=false]' ); } else { disablePreviewLinks(); - enablePreviewLinks( '[data-preview-link]' ); + enablePreviewLinks( '[data-preview-link]:not([data-preview-link=false])' ); } // Remove existing auto-slide controls @@ -1456,9 +1457,9 @@ /** * Unbind preview frame links. */ - function disablePreviewLinks() { + function disablePreviewLinks( selector ) { - var anchors = toArray( document.querySelectorAll( 'a' ) ); + var anchors = toArray( document.querySelectorAll( selector ? selector : 'a' ) ); anchors.forEach( function( element ) { if( /^(http|www)/gi.test( element.getAttribute( 'href' ) ) ) { From b78cca5831e71e1165d70243e805af19e0d4df60 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Sun, 16 Oct 2016 09:53:19 +0100 Subject: [PATCH 04/67] Support sass extension for custom themes --- Gruntfile.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 87630d5012..3bcefce427 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -42,7 +42,7 @@ module.exports = function(grunt) { { expand: true, cwd: 'css/theme/source', - src: ['*.scss'], + src: ['*.sass', '*.scss'], dest: 'css/theme', ext: '.css' } @@ -118,7 +118,12 @@ module.exports = function(grunt) { tasks: 'js' }, theme: { - files: [ 'css/theme/source/*.scss', 'css/theme/template/*.scss' ], + files: [ + 'css/theme/source/*.sass', + 'css/theme/source/*.scss', + 'css/theme/template/*.sass', + 'css/theme/template/*.scss' + ], tasks: 'css-themes' }, css: { From 22de402888cf29321e4e6ff30aad5565c958d1d0 Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Thu, 8 Dec 2016 15:26:16 +0800 Subject: [PATCH 05/67] Shift `dependencies` to `devDependencies`. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `reveal.js` npm module is typically installed to access the CSS/JS assets for Reveal.js. For those that want to run the plugins, they would clone the whole repository. Hence, it doesn’t make sense to include those as `dependencies`, which will increase download times. Closes #1734. --- package.json | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 7a9f18564c..0aebeceba7 100644 --- a/package.json +++ b/package.json @@ -21,15 +21,11 @@ "engines": { "node": ">=4.0.0" }, - "dependencies": { - "express": "~4.14.0", - "grunt-cli": "~1.2.0", - "mustache": "~2.2.1", - "socket.io": "^1.4.8" - }, "devDependencies": { + "express": "~4.14.0", "grunt": "~1.0.1", "grunt-autoprefixer": "~3.0.3", + "grunt-cli": "~1.2.0", "grunt-contrib-connect": "~0.11.2", "grunt-contrib-cssmin": "~0.14.0", "grunt-contrib-jshint": "~0.11.3", @@ -39,7 +35,9 @@ "grunt-sass": "~1.2.0", "grunt-retire": "~0.3.10", "grunt-zip": "~0.17.1", - "node-sass": "~3.13.0" + "mustache": "~2.2.1", + "node-sass": "~3.13.0", + "socket.io": "^1.4.8" }, "license": "MIT" } From 441a26cf9060b934a26c362ecbb0f6e3fa6701ea Mon Sep 17 00:00:00 2001 From: Benjamin Tan Date: Sun, 11 Dec 2016 18:14:02 +0800 Subject: [PATCH 06/67] Allow background images without protocols to have query hashes/parameters. Closes #1603. --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 28aa400056..695b26b578 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -859,7 +859,7 @@ if( data.background ) { // Auto-wrap image urls in url(...) - if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)$/gi.test( data.background ) ) { + if( /^(http|file|\/\/)/gi.test( data.background ) || /\.(svg|png|jpg|jpeg|gif|bmp)([?#]|$)/gi.test( data.background ) ) { slide.setAttribute( 'data-background-image', data.background ); } else { From 6831f6c17415c6c20269f3d61e673482442319b6 Mon Sep 17 00:00:00 2001 From: Markku Roponen Date: Mon, 12 Dec 2016 16:30:07 +0200 Subject: [PATCH 07/67] #1770, resume playback for paused media. --- js/reveal.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 2c929545b7..9594255fd7 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3016,7 +3016,8 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( el.hasAttribute( 'data-autoplay' ) && typeof el.play === 'function' ) { + if( ( el.hasAttribute( 'data-autoplay' ) || el.hasAttribute( 'data-paused-by-reveal' ) ) && typeof el.play === 'function' ) { + el.removeAttribute('data-paused-by-reveal'); el.play(); } } ); @@ -3071,6 +3072,7 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { + el.addAttribute('data-paused-by-reveal'); el.pause(); } } ); From 54bfad62d7292c0a7e2e7d74b11493c0a37636c9 Mon Sep 17 00:00:00 2001 From: Markku Roponen Date: Mon, 12 Dec 2016 16:41:52 +0200 Subject: [PATCH 08/67] #1770, fixed function name. --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 9594255fd7..fd0e324ead 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3072,7 +3072,7 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { - el.addAttribute('data-paused-by-reveal'); + el.setAttribute('data-paused-by-reveal'); el.pause(); } } ); From da40eafccd1e62f5754069edc2ddc4706055b2ff Mon Sep 17 00:00:00 2001 From: Markku Roponen Date: Mon, 12 Dec 2016 16:44:24 +0200 Subject: [PATCH 09/67] #1770, added second argument for setAttribute --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index fd0e324ead..c8ce5a2e43 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3072,7 +3072,7 @@ // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { - el.setAttribute('data-paused-by-reveal'); + el.setAttribute('data-paused-by-reveal', ''); el.pause(); } } ); From 962c6c133b0860b5ad4d99d9fb36eca625de5b7a Mon Sep 17 00:00:00 2001 From: Markku Roponen Date: Tue, 13 Dec 2016 16:02:26 +0200 Subject: [PATCH 10/67] #1770, set 'data-paused-by-reveal' attribute only for the media elements, which are not already in paused state. --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index c8ce5a2e43..6781639c97 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3071,7 +3071,7 @@ if( slide && slide.parentNode ) { // HTML5 media elements toArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' ) { + if( !el.hasAttribute( 'data-ignore' ) && typeof el.pause === 'function' && el.paused === false ) { el.setAttribute('data-paused-by-reveal', ''); el.pause(); } From 5f762345664551bc99cb12e0fe5e0c6c38b70b6e Mon Sep 17 00:00:00 2001 From: Season Chen Date: Fri, 23 Dec 2016 13:08:23 +0800 Subject: [PATCH 11/67] support complex markdown support --- plugin/markdown/markdown.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/markdown/markdown.js b/plugin/markdown/markdown.js index ad596bfd74..bc2198aa73 100755 --- a/plugin/markdown/markdown.js +++ b/plugin/markdown/markdown.js @@ -42,8 +42,8 @@ * element. Normalizes leading tabs/whitespace. */ function getMarkdownFromSlide( section ) { - - var template = section.querySelector( 'script' ); + // support + var template = section.querySelector( '[data-tempate]' ) || section.querySelector( 'script' ); // strip leading whitespace so it isn't evaluated as code var text = ( template || section ).textContent; From 4afd854037d72b7528ee8844970c2c644b880ba0 Mon Sep 17 00:00:00 2001 From: Piotr Kubowicz Date: Sun, 15 Jan 2017 16:35:31 +0100 Subject: [PATCH 12/67] Remove 'history: true' from index.html Readme says the default is 'history: false', so it may be surprising for users - it's easy to miss the contradicting setting in index.html --- index.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/index.html b/index.html index 0c7a67279b..039b1c309b 100644 --- a/index.html +++ b/index.html @@ -35,8 +35,6 @@ + ``` From 7daa0e04de7d0ab2bae3159faae0b18d4eb3c8d3 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 31 Jan 2017 16:24:06 +0100 Subject: [PATCH 28/67] make background videos work on ipad #1778 --- js/reveal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/reveal.js b/js/reveal.js index 9b0768ab17..c2888e81c9 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3212,6 +3212,9 @@ else { el.removeEventListener( 'loadeddata', startEmbeddedMedia ); // remove first to avoid dupes el.addEventListener( 'loadeddata', startEmbeddedMedia ); + + // `loadeddata` never fires unless we start playing on iPad + if( /ipad/gi.test( UA ) ) el.play(); } } From f496613dd3309a3066642adf1261e9da0578cdda Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 31 Jan 2017 17:08:08 +0100 Subject: [PATCH 29/67] improved fragment notes support #1636 --- plugin/notes/notes.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/plugin/notes/notes.js b/plugin/notes/notes.js index 46bf5dea1a..44efe15d51 100644 --- a/plugin/notes/notes.js +++ b/plugin/notes/notes.js @@ -50,10 +50,11 @@ var RevealNotes = (function() { /** * Posts the current slide data to the notes window */ - function post(event) { + function post( event ) { var slideElement = Reveal.getCurrentSlide(), - notesElement = slideElement.querySelector( 'aside.notes' ); + notesElement = slideElement.querySelector( 'aside.notes' ), + fragmentElement = slideElement.querySelector( '.current-fragment' ); var messageData = { namespace: 'reveal-notes', @@ -64,21 +65,27 @@ var RevealNotes = (function() { state: Reveal.getState() }; - // Look for notes defined in a fragment, if it is a fragmentshown event - if (event && event.hasOwnProperty('fragment')) { - var innerNotes = event.fragment.querySelector( 'aside.notes' ); - - if ( innerNotes) { - notesElement = innerNotes; - } - } - // Look for notes defined in a slide attribute if( slideElement.hasAttribute( 'data-notes' ) ) { messageData.notes = slideElement.getAttribute( 'data-notes' ); messageData.whitespace = 'pre-wrap'; } + // Look for notes defined in a fragment + if( fragmentElement ) { + var fragmentNotes = fragmentElement.querySelector( 'aside.notes' ); + if( fragmentNotes ) { + notesElement = fragmentNotes; + } + else if( fragmentElement.hasAttribute( 'data-notes' ) ) { + messageData.notes = fragmentElement.getAttribute( 'data-notes' ); + messageData.whitespace = 'pre-wrap'; + + // In case there are slide notes + notesElement = null; + } + } + // Look for notes defined in an aside element if( notesElement ) { messageData.notes = notesElement.innerHTML; From 2c9e226fab51763d830754d72e1a92cc839ceacc Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 1 Feb 2017 10:33:43 +0100 Subject: [PATCH 30/67] warning about cube/page being deprecated #1774 --- css/reveal.css | 8 ++++++++ css/reveal.scss | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/css/reveal.css b/css/reveal.css index 296c8e9466..cde184afcf 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -595,6 +595,10 @@ body { /********************************************* * CUBE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. *********************************************/ .reveal.cube .slides { -webkit-perspective: 1300px; @@ -670,6 +674,10 @@ body { /********************************************* * PAGE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. *********************************************/ .reveal.page .slides { -webkit-perspective-origin: 0% 50%; diff --git a/css/reveal.scss b/css/reveal.scss index ee3c440b37..1972183e81 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -617,6 +617,10 @@ body { /********************************************* * CUBE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. *********************************************/ .reveal.cube .slides { @@ -689,6 +693,10 @@ body { /********************************************* * PAGE TRANSITION + * + * WARNING: + * this is deprecated and will be removed in a + * future version. *********************************************/ .reveal.page .slides { From 9f99ac8b849aa26df98232bfa04db50eb2baa5ee Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 2 Feb 2017 10:46:44 +0100 Subject: [PATCH 31/67] adjust comment for display config value #1325 --- README.md | 5 ++++- js/reveal.js | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0aa0f295bc..bfd5c9fdc1 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,10 @@ Reveal.initialize({ // - Calculated automatically unless specified // - Set to 0 to disable movement along an axis parallaxBackgroundHorizontal: null, - parallaxBackgroundVertical: null + parallaxBackgroundVertical: null, + + // The display mode that will be used to show slides + display: 'block' }); ``` diff --git a/js/reveal.js b/js/reveal.js index 6c349e73b2..125a7b6af2 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -49,9 +49,6 @@ minScale: 0.2, maxScale: 2.0, - // Value of the display CSS property applied to current slide to make it visible - display: 'block', - // Display controls in the bottom right corner controls: true, @@ -163,6 +160,9 @@ // Number of slides away from the current that are visible viewDistance: 3, + // The display mode that will be used to show slides + display: 'block', + // Script dependencies to load dependencies: [] From bede9a22e86bb1c8debb945ccdfb22265393297d Mon Sep 17 00:00:00 2001 From: Frazer Kirkman Date: Sun, 5 Feb 2017 18:42:59 +0100 Subject: [PATCH 32/67] added toggleHelp function this way a key can be given ability to toggleHelp on and off. Previously Reveal.showHelp could open the help screen, but no way to close it. --- js/reveal.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 9251dc0e25..290097fd1e 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1628,6 +1628,18 @@ } + /** + * Open or close help overlay window. + */ + function toggleHelp(){ + if( dom.overlay ) { + closeOverlay(); + } + else { + showHelp( true ); + } + } + /** * Opens an overlay window with help material. */ @@ -4113,12 +4125,7 @@ // Check if the pressed key is question mark if( event.shiftKey && event.charCode === 63 ) { - if( dom.overlay ) { - closeOverlay(); - } - else { - showHelp( true ); - } + toggleHelp(); } } @@ -4818,6 +4825,7 @@ // Shows a help overlay with keyboard shortcuts showHelp: showHelp, + toggleHelp: toggleHelp, // Forces an update in slide layout layout: layout, From 2a1303f3c1861d12ff27f401c0f5d421f7c5133b Mon Sep 17 00:00:00 2001 From: Frazer Kirkman Date: Tue, 7 Feb 2017 19:53:58 +0100 Subject: [PATCH 33/67] added override parameter to toggleHelp function --- js/reveal.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 290097fd1e..2e4e9783f4 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1630,15 +1630,26 @@ /** * Open or close help overlay window. + * + * @param {Boolean} [override] Flag which overrides the + * toggle logic and forcibly sets the desired state. True means + * help is open, false means it's closed. */ - function toggleHelp(){ - if( dom.overlay ) { - closeOverlay(); + function toggleHelp( override ){ + + if( typeof override === 'boolean' ) { + override ? showHelp( true ) : closeOverlay(); } - else { - showHelp( true ); + else { + if( dom.overlay ) { + closeOverlay(); + } + else { + showHelp( true ); + } } } + /** * Opens an overlay window with help material. From adc326139a51079c2b8908a13f5d6a474ca4ee9f Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 8 Feb 2017 12:56:51 +0100 Subject: [PATCH 34/67] update deserialize regex to work with decimals --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 125a7b6af2..4502919421 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1230,7 +1230,7 @@ if( value === 'null' ) return null; else if( value === 'true' ) return true; else if( value === 'false' ) return false; - else if( value.match( /^\d+$/ ) ) return parseFloat( value ); + else if( value.match( /^[\d\.]+$/ ) ) return parseFloat( value ); } return value; From 5ad66f3779a7b26e43f899753a26ef5e3fe9667f Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 9 Feb 2017 11:37:47 +0100 Subject: [PATCH 35/67] docs for #1816 and remove showHelp --- README.md | 7 ++++--- js/reveal.js | 16 +++++++--------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index bfd5c9fdc1..288de99edc 100644 --- a/README.md +++ b/README.md @@ -466,14 +466,15 @@ Reveal.nextFragment(); // Randomize the order of slides Reveal.shuffle(); -// Shows a help overlay with keyboard shortcuts -Reveal.showHelp(); - // Toggle presentation states, optionally pass true/false to force on/off Reveal.toggleOverview(); Reveal.togglePause(); Reveal.toggleAutoSlide(); +// Shows a help overlay with keyboard shortcuts, optionally pass true/false +// to force on/off +Reveal.toggleHelp(); + // Change a config value at runtime Reveal.configure({ controls: true }); diff --git a/js/reveal.js b/js/reveal.js index a5783e07e1..882149ed8b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1641,21 +1641,20 @@ * help is open, false means it's closed. */ function toggleHelp( override ){ - + if( typeof override === 'boolean' ) { - override ? showHelp( true ) : closeOverlay(); + override ? showHelp() : closeOverlay(); } - else { + else { if( dom.overlay ) { closeOverlay(); } else { - showHelp( true ); + showHelp(); } } } - /** * Opens an overlay window with help material. */ @@ -4878,10 +4877,6 @@ navigatePrev: navigatePrev, navigateNext: navigateNext, - // Shows a help overlay with keyboard shortcuts - showHelp: showHelp, - toggleHelp: toggleHelp, - // Forces an update in slide layout layout: layout, @@ -4894,6 +4889,9 @@ // Returns an object with the available fragments as booleans (prev/next) availableFragments: availableFragments, + // Toggles a help overlay with keyboard shortcuts + toggleHelp: toggleHelp, + // Toggles the overview mode on/off toggleOverview: toggleOverview, From fa70a7a5174b16b1b4e9ccaf3f36cbb082cc8051 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 15 Feb 2017 11:43:57 +0100 Subject: [PATCH 36/67] phantom export throws error if reveal.js isn't present --- plugin/print-pdf/print-pdf.js | 38 ++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/plugin/print-pdf/print-pdf.js b/plugin/print-pdf/print-pdf.js index c3c5d9418f..d1c3251b2d 100644 --- a/plugin/print-pdf/print-pdf.js +++ b/plugin/print-pdf/print-pdf.js @@ -31,20 +31,30 @@ probePage.open( inputFile, function( status ) { return Reveal.getConfig(); } ); - printPage.paperSize = { - width: config.width * ( 1 + config.margin ), - height: config.height * ( 1 + config.margin ), - border: 0 - }; - - printPage.open( inputFile, function( status ) { - window.setTimeout( function() { - console.log( 'Export PDF: Writing file [3/3]' ); - printPage.render( outputFile ); - console.log( 'Export PDF: Finished successfully!' ); - phantom.exit(); - }, 1000 ); - } ); + if( config ) { + + printPage.paperSize = { + width: Math.floor( config.width * ( 1 + config.margin ) ), + height: Math.floor( config.height * ( 1 + config.margin ) ), + border: 0 + }; + + printPage.open( inputFile, function( status ) { + window.setTimeout( function() { + console.log( 'Export PDF: Writing file [3/3]' ); + printPage.render( outputFile ); + console.log( 'Export PDF: Finished successfully!' ); + phantom.exit(); + }, 1000 ); + } ); + + } + else { + + console.log( 'Export PDF: Unable to read reveal.js config. Make sure the input address points to a reveal.js page.' ); + phantom.exit(1); + + } } ); From 1cee8998a0e423265d7e99feb6a74d627fc306ca Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Fri, 17 Feb 2017 10:50:52 +0100 Subject: [PATCH 37/67] fix overview rendering issues in latest chrome #1649 --- css/reveal.css | 6 ++---- css/reveal.scss | 8 ++++---- js/reveal.js | 11 +++++++++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/css/reveal.css b/css/reveal.css index cde184afcf..f6759777ce 100644 --- a/css/reveal.css +++ b/css/reveal.css @@ -1059,6 +1059,8 @@ body { visibility: visible; outline: 10px solid rgba(150, 150, 150, 0.1); outline-offset: 10px; } + .reveal.overview .backgrounds .slide-background.stack { + overflow: visible; } .reveal.overview .slides section, .reveal.overview-deactivating .slides section { @@ -1070,10 +1072,6 @@ body { -webkit-transition: none; transition: none; } -.reveal.overview-animated .slides { - -webkit-transition: -webkit-transform 0.4s ease; - transition: transform 0.4s ease; } - /********************************************* * RTL SUPPORT *********************************************/ diff --git a/css/reveal.scss b/css/reveal.scss index 1972183e81..fba248e75f 100644 --- a/css/reveal.scss +++ b/css/reveal.scss @@ -1101,6 +1101,10 @@ body { outline: 10px solid rgba(150,150,150,0.1); outline-offset: 10px; } + + .backgrounds .slide-background.stack { + overflow: visible; + } } // Disable transitions transitions while we're activating @@ -1115,10 +1119,6 @@ body { transition: none; } -.reveal.overview-animated .slides { - transition: transform 0.4s ease; -} - /********************************************* * RTL SUPPORT diff --git a/js/reveal.js b/js/reveal.js index d31d591e04..5325beb964 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1797,6 +1797,10 @@ updateProgress(); updateParallax(); + if( isOverview() ) { + updateOverview(); + } + } } @@ -2012,11 +2016,14 @@ */ function updateOverview() { + var vmin = Math.min( window.innerWidth, window.innerHeight ); + var scale = Math.max( vmin / 5, 150 ) / vmin; + transformSlides( { overview: [ + 'scale('+ scale +')', 'translateX('+ ( -indexh * overviewSlideWidth ) +'px)', - 'translateY('+ ( -indexv * overviewSlideHeight ) +'px)', - 'translateZ('+ ( window.innerWidth < 400 ? -1000 : -2500 ) +'px)' + 'translateY('+ ( -indexv * overviewSlideHeight ) +'px)' ].join( ' ' ) } ); From da23d682c63a4f3ee04a42ae70222950b2888daa Mon Sep 17 00:00:00 2001 From: Malcolm Young Date: Fri, 17 Feb 2017 15:08:57 +0000 Subject: [PATCH 38/67] allow configuration of which view slide number appears on - fixes #1791 --- README.md | 7 ++++++- js/reveal.js | 16 +++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76ca321932..3d52092912 100644 --- a/README.md +++ b/README.md @@ -749,7 +749,7 @@ By default, Reveal is configured with [highlight.js](https://highlightjs.org/) f ``` ### Slide number -If you would like to display the page number of the current slide you can do so using the ```slideNumber``` configuration value. +If you would like to display the page number of the current slide you can do so using the ```slideNumber``` and ```showSlideNumber``` configuration values. ```javascript // Shows the slide number using default formatting @@ -762,6 +762,11 @@ Reveal.configure({ slideNumber: true }); // "c/t": flattened slide number / total slides Reveal.configure({ slideNumber: 'c/t' }); +// Control which views the slide number displays on using the "showSlideNumber" value. +// "all": show on all views (default) +// "notes": only show slide numbers on speaker notes view +Reveal.configure({ slideNumberFormat: 'notes' }); + ``` diff --git a/js/reveal.js b/js/reveal.js index 9251dc0e25..574c943c1f 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -57,6 +57,9 @@ // Display the page number of the current slide slideNumber: false, + + // Determine which displays to show the slide number on + showSlideNumber: 'all', // Push each slide change to the browser history history: false, @@ -977,7 +980,18 @@ dom.controls.style.display = config.controls ? 'block' : 'none'; dom.progress.style.display = config.progress ? 'block' : 'none'; - dom.slideNumber.style.display = config.slideNumber && !isPrintingPDF() ? 'block' : 'none'; + + var slideNumberDisplay = 'none'; + if (config.slideNumber && !isPrintingPDF()) { + if (config.showSlideNumber === 'all') { + slideNumberDisplay = 'block'; + } + else if (config.showSlideNumber === 'notes' && isSpeakerNotes()) { + slideNumberDisplay = 'block'; + } + } + + dom.slideNumber.style.display = slideNumberDisplay; if( config.shuffle ) { shuffle(); From 95bca847d6d000fc745660852c70ae5d3c63e9d0 Mon Sep 17 00:00:00 2001 From: Malcolm Young Date: Fri, 17 Feb 2017 15:19:15 +0000 Subject: [PATCH 39/67] correct config name in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3d52092912..9a76b937f9 100644 --- a/README.md +++ b/README.md @@ -765,7 +765,7 @@ Reveal.configure({ slideNumber: 'c/t' }); // Control which views the slide number displays on using the "showSlideNumber" value. // "all": show on all views (default) // "notes": only show slide numbers on speaker notes view -Reveal.configure({ slideNumberFormat: 'notes' }); +Reveal.configure({ showSlideNumber: 'notes' }); ``` From 5565d0861260c62f20f9ad5211aea697b4e8a0cc Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 20 Feb 2017 11:37:18 +0100 Subject: [PATCH 40/67] note about deploying multiplex server with now #1830 --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b52390936..97ca0c226d 100644 --- a/README.md +++ b/README.md @@ -1047,11 +1047,13 @@ Server that receives the slideChanged events from the master presentation and br 1. ```npm install``` 2. ```node plugin/multiplex``` -Or you use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/). +Or you can use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/). You'll need to generate a unique secret and token pair for your master and client presentations. To do so, visit ```http://example.com/token```, where ```http://example.com``` is the location of your socket.io server. Or if you're going to use the socket.io server at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), visit [https://reveal-js-multiplex-ccjbegmaii.now.sh/token](https://reveal-js-multiplex-ccjbegmaii.now.sh/token). -You are very welcome to point your presentations at the Socket.io server running at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), but availability and stability are not guaranteed. For anything mission critical I recommend you run your own server. It is simple to deploy to nodejitsu, heroku, your own environment, etc. +You are very welcome to point your presentations at the Socket.io server running at [https://reveal-js-multiplex-ccjbegmaii.now.sh/](https://reveal-js-multiplex-ccjbegmaii.now.sh/), but availability and stability are not guaranteed. + +For anything mission critical I recommend you run your own server. The easiest way to do this is by installing [now](https://zeit.co/now). With that installed, deploying your own Multiplex server is as easy running the following command from the reveal.js folder: `now plugin/multiplex`. ##### socket.io server as file static server From b143e5976bd3dbc5445a27052a93ab6f060b361b Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Mon, 20 Feb 2017 11:49:19 +0100 Subject: [PATCH 41/67] tweaks to showSlideNumber config #1833 --- README.md | 9 +++++---- js/reveal.js | 29 +++++++++++++++-------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index e711dd031a..789a8fae25 100644 --- a/README.md +++ b/README.md @@ -767,10 +767,11 @@ Reveal.configure({ slideNumber: true }); // "c/t": flattened slide number / total slides Reveal.configure({ slideNumber: 'c/t' }); -// Control which views the slide number displays on using the "showSlideNumber" value. -// "all": show on all views (default) -// "notes": only show slide numbers on speaker notes view -Reveal.configure({ showSlideNumber: 'notes' }); +// Control which views the slide number displays on using the "showSlideNumber" value: +// "all": show on all views (default) +// "speaker": only show slide numbers on speaker notes view +// "print": only show slide numbers when printing to PDF +Reveal.configure({ showSlideNumber: 'speaker' }); ``` diff --git a/js/reveal.js b/js/reveal.js index b48620b294..65560a6a9d 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -57,7 +57,7 @@ // Display the page number of the current slide slideNumber: false, - + // Determine which displays to show the slide number on showSlideNumber: 'all', @@ -701,7 +701,7 @@ } // Inject slide numbers if `slideNumbers` are enabled - if( config.slideNumber ) { + 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; @@ -984,18 +984,6 @@ dom.controls.style.display = config.controls ? 'block' : 'none'; dom.progress.style.display = config.progress ? 'block' : 'none'; - - var slideNumberDisplay = 'none'; - if (config.slideNumber && !isPrintingPDF()) { - if (config.showSlideNumber === 'all') { - slideNumberDisplay = 'block'; - } - else if (config.showSlideNumber === 'notes' && isSpeakerNotes()) { - slideNumberDisplay = 'block'; - } - } - - dom.slideNumber.style.display = slideNumberDisplay; if( config.shuffle ) { shuffle(); @@ -1079,6 +1067,19 @@ } ); } + // Slide numbers + var slideNumberDisplay = 'none'; + if( config.slideNumber && !isPrintingPDF() ) { + if( config.showSlideNumber === 'all' ) { + slideNumberDisplay = 'block'; + } + else if( config.showSlideNumber === 'speaker' && isSpeakerNotes() ) { + slideNumberDisplay = 'block'; + } + } + + dom.slideNumber.style.display = slideNumberDisplay; + sync(); } From 7e6fb9ec87f10f4cc379240fc5824925ebf2bff3 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 14 Mar 2017 09:06:39 +0100 Subject: [PATCH 42/67] avoid npe on iframe postMessage --- js/reveal.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 65560a6a9d..3267465960 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3377,20 +3377,20 @@ // Generic postMessage API for non-lazy loaded iframes toArray( element.querySelectorAll( 'iframe' ) ).forEach( function( el ) { - el.contentWindow.postMessage( 'slide:stop', '*' ); + if( el.contentWindow ) el.contentWindow.postMessage( 'slide:stop', '*' ); el.removeEventListener( 'load', startEmbeddedIframe ); }); // YouTube postMessage API toArray( element.querySelectorAll( 'iframe[src*="youtube.com/embed/"]' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && typeof el.contentWindow.postMessage === 'function' ) { + if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) { el.contentWindow.postMessage( '{"event":"command","func":"pauseVideo","args":""}', '*' ); } }); // Vimeo postMessage API toArray( element.querySelectorAll( 'iframe[src*="player.vimeo.com/"]' ) ).forEach( function( el ) { - if( !el.hasAttribute( 'data-ignore' ) && typeof el.contentWindow.postMessage === 'function' ) { + if( !el.hasAttribute( 'data-ignore' ) && el.contentWindow && typeof el.contentWindow.postMessage === 'function' ) { el.contentWindow.postMessage( '{"method":"pause"}', '*' ); } }); From 9a7c7ce93a530cfb8bb85e0670b1ffd171ccbba4 Mon Sep 17 00:00:00 2001 From: Manuel Riezebosch Date: Tue, 14 Mar 2017 14:13:24 +0100 Subject: [PATCH 43/67] print-pdf using callback iso timer Use window.callPhantom icw page. onCallback to wait for pdf-ready event. From: http://stackoverflow.com/a/28925479/129269 --- plugin/print-pdf/print-pdf.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/plugin/print-pdf/print-pdf.js b/plugin/print-pdf/print-pdf.js index d1c3251b2d..9ffc261d38 100644 --- a/plugin/print-pdf/print-pdf.js +++ b/plugin/print-pdf/print-pdf.js @@ -6,6 +6,7 @@ * * @author Manuel Bieh (https://github.com/manuelbieh) * @author Hakim El Hattab (https://github.com/hakimel) + * @author Manuel Riezebosch (https://github.com/riezebosch) */ // html2pdf.js @@ -21,11 +22,11 @@ if( outputFile.match( /\.pdf$/gi ) === null ) { outputFile += '.pdf'; } -console.log( 'Export PDF: Reading reveal.js config [1/3]' ); +console.log( 'Export PDF: Reading reveal.js config [1/4]' ); probePage.open( inputFile, function( status ) { - console.log( 'Export PDF: Preparing print layout [2/3]' ); + console.log( 'Export PDF: Preparing print layout [2/4]' ); var config = probePage.evaluate( function() { return Reveal.getConfig(); @@ -40,14 +41,22 @@ probePage.open( inputFile, function( status ) { }; printPage.open( inputFile, function( status ) { - window.setTimeout( function() { - console.log( 'Export PDF: Writing file [3/3]' ); + console.log( 'Export PDF: Preparing pdf [3/4]') + printPage.evaluate(function() { + Reveal.isReady() ? window.callPhantom() : Reveal.addEventListener( 'pdf-ready', window.callPhantom ); + }); + } ); + + printPage.onCallback = function(data) { + // For some reason we need to "jump the queue" for syntax highlighting to work. + // See: http://stackoverflow.com/a/3580132/129269 + setTimeout(function() { + console.log( 'Export PDF: Writing file [4/4]' ); printPage.render( outputFile ); console.log( 'Export PDF: Finished successfully!' ); phantom.exit(); - }, 1000 ); - } ); - + }, 0); + }; } else { @@ -55,7 +64,6 @@ probePage.open( inputFile, function( status ) { phantom.exit(1); } - } ); From 34f3773bf0e09e0300a5fcdf6926b3d4699aa71f Mon Sep 17 00:00:00 2001 From: Manuel Riezebosch Date: Tue, 14 Mar 2017 14:39:31 +0100 Subject: [PATCH 44/67] print-pdf layout slide contents to fit stretch elements layout() and thereby layoutSlideContents() is never invoked when isPrintingPdf() is true so stretch elements are not sized correctly. This is ensured now by invoking the layoutSlideContents from SetupPDF(). There seems no need to scale down like in other PR's is suggested. --- js/reveal.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/js/reveal.js b/js/reveal.js index 3267465960..452c6bff1a 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -620,6 +620,9 @@ document.body.style.width = pageWidth + 'px'; document.body.style.height = pageHeight + 'px'; + // 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 ) { From d9dd9a92fb5fde644847eb839a3c37ff1860da07 Mon Sep 17 00:00:00 2001 From: ADAM STONE Date: Fri, 17 Mar 2017 22:47:25 -0400 Subject: [PATCH 45/67] Fix video background autoplay on iOS --- js/reveal.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/reveal.js b/js/reveal.js index 9251dc0e25..43c599c3bc 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1426,7 +1426,7 @@ * target element. * * remaining height = [ configured parent height ] - [ current parent height ] - * + * * @param {HTMLElement} element * @param {number} [height] */ @@ -3058,6 +3058,8 @@ // Videos else if ( backgroundVideo && !isSpeakerNotes() ) { var video = document.createElement( 'video' ); + video.setAttribute( 'autoplay', '' ); + video.setAttribute( 'playsinline', '' ); if( backgroundVideoLoop ) { video.setAttribute( 'loop', '' ); @@ -3900,7 +3902,7 @@ // If there are media elements with data-autoplay, // automatically set the autoSlide duration to the // length of that media. Not applicable if the slide - // is divided up into fragments. + // is divided up into fragments. // playbackRate is accounted for in the duration. if( currentSlide.querySelectorAll( '.fragment' ).length === 0 ) { toArray( currentSlide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) { From a0a3b4f80da716f041ba6ba071ca0c2900404f52 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Thu, 23 Mar 2017 11:44:02 +0100 Subject: [PATCH 46/67] add autoPlayMedia config option, overrides individual autoplay settings --- README.md | 18 +++++++++++++++--- js/reveal.js | 41 ++++++++++++++++++++++++++++++----------- 2 files changed, 45 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 789a8fae25..8e319351b7 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,12 @@ Reveal.initialize({ // Flags if speaker notes should be visible to all viewers showNotes: false, + // Global override for autolaying embedded media (video/audio/iframe) + // - null: Media will only autoplay if data-autoplay is present + // - true: All media will autoplay, regardless of individual setting + // - false: No media will autoplay, regardless of individual setting + autoPlayMedia: null, + // Number of milliseconds between automatically proceeding to the // next slide, disabled when set to 0, this value can be overwritten // by using a data-autoslide attribute on your slides @@ -789,20 +795,26 @@ Reveal.addEventListener( 'overviewhidden', function( event ) { /* ... */ } ); Reveal.toggleOverview(); ``` + ### Fullscreen mode Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode. ### Embedded media -Embedded HTML5 `