auto-slide playback updates, fix tap action, hide during overview
This commit is contained in:
1 parent
abf33e55b0
commit
6aaf88aae7
4 files changed
+59
-48
No files matched your search
+46
-45
@@ -69,7 +69,7 @@ var Reveal = (function(){
|
||||
autoSlide: 0,
|
||||
|
||||
// Stop auto-sliding after user input
|
||||
autoSlideStoppable: false,
|
||||
autoSlideStoppable: true,
|
||||
|
||||
// Enable slide navigation via mouse wheel
|
||||
mouseWheel: false,
|
||||
@@ -1610,16 +1610,6 @@ var Reveal = (function(){
|
||||
// Update the URL hash
|
||||
writeURL();
|
||||
|
||||
// If the current slide has a data-autoslide use that,
|
||||
// otherwise use the config.autoSlide value
|
||||
var slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' );
|
||||
if( slideAutoSlide ) {
|
||||
autoSlide = parseInt( slideAutoSlide, 10 );
|
||||
}
|
||||
else {
|
||||
autoSlide = config.autoSlide;
|
||||
}
|
||||
|
||||
cueAutoSlide();
|
||||
|
||||
}
|
||||
@@ -2258,23 +2248,35 @@ var Reveal = (function(){
|
||||
*/
|
||||
function cueAutoSlide() {
|
||||
|
||||
clearTimeout( autoSlideTimeout );
|
||||
autoSlideTimeout = -1;
|
||||
cancelAutoSlide();
|
||||
|
||||
autoSlideStartTime = Date.now();
|
||||
if( currentSlide ) {
|
||||
|
||||
// Cue the next auto-slide if:
|
||||
// - There is an autoSlide value
|
||||
// - Auto-sliding isn't paused by the user
|
||||
// - The presentation isn't paused
|
||||
// - The overview isn't active
|
||||
// - The presentation isn't over
|
||||
if( autoSlide && !autoSlidePaused && !isPaused() && !isOverview() && ( !Reveal.isLastSlide() || config.loop === true ) ) {
|
||||
autoSlideTimeout = setTimeout( navigateNext, autoSlide );
|
||||
}
|
||||
// If the current slide has a data-autoslide use that,
|
||||
// otherwise use the config.autoSlide value
|
||||
var slideAutoSlide = currentSlide.getAttribute( 'data-autoslide' );
|
||||
if( slideAutoSlide ) {
|
||||
autoSlide = parseInt( slideAutoSlide, 10 );
|
||||
}
|
||||
else {
|
||||
autoSlide = config.autoSlide;
|
||||
}
|
||||
|
||||
// Cue the next auto-slide if:
|
||||
// - There is an autoSlide value
|
||||
// - Auto-sliding isn't paused by the user
|
||||
// - The presentation isn't paused
|
||||
// - The overview isn't active
|
||||
// - The presentation isn't over
|
||||
if( autoSlide && !autoSlidePaused && !isPaused() && !isOverview() && ( !Reveal.isLastSlide() || config.loop === true ) ) {
|
||||
autoSlideTimeout = setTimeout( navigateNext, autoSlide );
|
||||
autoSlideStartTime = Date.now();
|
||||
}
|
||||
|
||||
if( autoSlidePlayer ) {
|
||||
autoSlidePlayer.setPlaying( autoSlideTimeout !== -1 );
|
||||
}
|
||||
|
||||
if( autoSlidePlayer ) {
|
||||
autoSlidePlayer.setPlaying( autoSlideTimeout !== -1 );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2285,6 +2287,7 @@ var Reveal = (function(){
|
||||
function cancelAutoSlide() {
|
||||
|
||||
clearTimeout( autoSlideTimeout );
|
||||
autoSlideTimeout = -1;
|
||||
|
||||
}
|
||||
|
||||
@@ -2530,8 +2533,6 @@ var Reveal = (function(){
|
||||
*/
|
||||
function onTouchStart( event ) {
|
||||
|
||||
onUserInput( event );
|
||||
|
||||
touch.startX = event.touches[0].clientX;
|
||||
touch.startY = event.touches[0].clientY;
|
||||
touch.startCount = event.touches.length;
|
||||
@@ -2557,6 +2558,8 @@ var Reveal = (function(){
|
||||
|
||||
// Each touch should only trigger one action
|
||||
if( !touch.captured ) {
|
||||
onUserInput( event );
|
||||
|
||||
var currentX = event.touches[0].clientX;
|
||||
var currentY = event.touches[0].clientY;
|
||||
|
||||
@@ -2852,29 +2855,25 @@ var Reveal = (function(){
|
||||
|
||||
// Start repainting if we're playing
|
||||
if( this.playing ) {
|
||||
this.update();
|
||||
this.animate();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Playback.prototype.setProgress = function( value ) {
|
||||
|
||||
this.progress = value;
|
||||
this.render();
|
||||
|
||||
};
|
||||
|
||||
Playback.prototype.update = function() {
|
||||
Playback.prototype.animate = function() {
|
||||
|
||||
this.progress = this.progressCheck();
|
||||
this.render();
|
||||
|
||||
if( this.playing ) {
|
||||
window.requestAnimationFrame( this.update.bind( this ) );
|
||||
window.requestAnimationFrame( this.animate.bind( this ) );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Renders the current progress and playback state.
|
||||
*/
|
||||
Playback.prototype.render = function() {
|
||||
|
||||
var progress = this.playing ? this.progress : 0;
|
||||
@@ -2933,14 +2932,6 @@ var Reveal = (function(){
|
||||
|
||||
};
|
||||
|
||||
Playback.prototype.destroy = function() {
|
||||
|
||||
if( this.canvas.parentNode ) {
|
||||
this.container.removeChild( this.canvas );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Playback.prototype.on = function( type, listener ) {
|
||||
this.canvas.addEventListener( type, listener, false );
|
||||
};
|
||||
@@ -2949,6 +2940,16 @@ var Reveal = (function(){
|
||||
this.canvas.removeEventListener( type, listener, false );
|
||||
};
|
||||
|
||||
Playback.prototype.destroy = function() {
|
||||
|
||||
this.playing = false;
|
||||
|
||||
if( this.canvas.parentNode ) {
|
||||
this.container.removeChild( this.canvas );
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// --------------------------------------------------------------------//
|
||||
// ------------------------------- API --------------------------------//
|
||||
|
||||
Vendored
+2
-2
@@ -1,8 +1,8 @@
|
||||
/*!
|
||||
* reveal.js 2.6.0-dev (2013-10-13, 14:35)
|
||||
* reveal.js 2.6.0-dev (2013-10-13, 15:05)
|
||||
* http://lab.hakim.se/reveal-js
|
||||
* MIT licensed
|
||||
*
|
||||
* Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|
||||
*/
|
||||
var Reveal=function(){"use strict";function a(a){return b(),$b.transforms2d||$b.transforms3d?(window.addEventListener("load",C,!1),l(Vb,a),l(Vb,Reveal.getQueryHash()),s(),c(),void 0):(document.body.setAttribute("class","no-transforms"),void 0)}function b(){$b.transforms3d="WebkitPerspective"in document.body.style||"MozPerspective"in document.body.style||"msPerspective"in document.body.style||"OPerspective"in document.body.style||"perspective"in document.body.style,$b.transforms2d="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style,$b.requestAnimationFrame="function"==typeof window.requestAnimationFrame,$b.canvas=!!document.createElement("canvas").getContext,Pb=navigator.userAgent.match(/(iphone|ipod|android)/gi)}function c(){function a(){c.length&&head.js.apply(null,c),d()}for(var b=[],c=[],e=0,f=Vb.dependencies.length;f>e;e++){var g=Vb.dependencies[e];(!g.condition||g.condition())&&(g.async?c.push(g.src):b.push(g.src),"function"==typeof g.callback&&head.ready(g.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],g.callback))}b.length?(head.ready(a),head.js.apply(null,b)):a()}function d(){f(),e(),i(),ab(),setTimeout(function(){Zb.slides.classList.remove("no-transition"),Wb=!0,u("ready",{indexh:Lb,indexv:Mb,currentSlide:Ob})},1)}function e(){var a=m(document.querySelectorAll(Sb));a.forEach(function(a){var b=m(a.querySelectorAll("section"));b.forEach(function(a,b){b>0&&a.classList.add("future")})})}function f(){Zb.theme=document.querySelector("#theme"),Zb.wrapper=document.querySelector(".reveal"),Zb.slides=document.querySelector(".reveal .slides"),Zb.slides.classList.add("no-transition"),Zb.background=g(Zb.wrapper,"div","backgrounds",null),Zb.progress=g(Zb.wrapper,"div","progress","<span></span>"),Zb.progressbar=Zb.progress.querySelector("span"),g(Zb.wrapper,"aside","controls",'<div class="navigate-left"></div><div class="navigate-right"></div><div class="navigate-up"></div><div class="navigate-down"></div>'),g(Zb.wrapper,"div","state-background",null),g(Zb.wrapper,"div","pause-overlay",null),Zb.controls=document.querySelector(".reveal .controls"),Zb.controlsLeft=m(document.querySelectorAll(".navigate-left")),Zb.controlsRight=m(document.querySelectorAll(".navigate-right")),Zb.controlsUp=m(document.querySelectorAll(".navigate-up")),Zb.controlsDown=m(document.querySelectorAll(".navigate-down")),Zb.controlsPrev=m(document.querySelectorAll(".navigate-prev")),Zb.controlsNext=m(document.querySelectorAll(".navigate-next"))}function g(a,b,c,d){var e=a.querySelector("."+c);return e||(e=document.createElement(b),e.classList.add(c),null!==d&&(e.innerHTML=d),a.appendChild(e)),e}function h(){function a(a,b){var c={background:a.getAttribute("data-background"),backgroundSize:a.getAttribute("data-background-size"),backgroundImage:a.getAttribute("data-background-image"),backgroundColor:a.getAttribute("data-background-color"),backgroundRepeat:a.getAttribute("data-background-repeat"),backgroundPosition:a.getAttribute("data-background-position"),backgroundTransition:a.getAttribute("data-background-transition")},d=document.createElement("div");return d.className="slide-background",c.background&&(/^(http|file|\/\/)/gi.test(c.background)||/\.(svg|png|jpg|jpeg|gif|bmp)$/gi.test(c.background)?d.style.backgroundImage="url("+c.background+")":d.style.background=c.background),c.backgroundSize&&(d.style.backgroundSize=c.backgroundSize),c.backgroundImage&&(d.style.backgroundImage='url("'+c.backgroundImage+'")'),c.backgroundColor&&(d.style.backgroundColor=c.backgroundColor),c.backgroundRepeat&&(d.style.backgroundRepeat=c.backgroundRepeat),c.backgroundPosition&&(d.style.backgroundPosition=c.backgroundPosition),c.backgroundTransition&&d.setAttribute("data-background-transition",c.backgroundTransition),b.appendChild(d),d}r()&&document.body.classList.add("print-pdf"),Zb.background.innerHTML="",Zb.background.classList.add("no-transition"),m(document.querySelectorAll(Sb)).forEach(function(b){var c;c=r()?a(b,b):a(b,Zb.background),m(b.querySelectorAll("section")).forEach(function(b){r()?a(b,b):a(b,c)})}),Vb.parallaxBackgroundImage?(Zb.background.style.backgroundImage='url("'+Vb.parallaxBackgroundImage+'")',Zb.background.style.backgroundSize=Vb.parallaxBackgroundSize,setTimeout(function(){Zb.wrapper.classList.add("has-parallax-background")},1)):(Zb.background.style.backgroundImage="",Zb.wrapper.classList.remove("has-parallax-background"))}function i(a){if(Zb.wrapper.classList.remove(Vb.transition),"object"==typeof a&&l(Vb,a),$b.transforms3d===!1&&(Vb.transition="linear"),Zb.wrapper.classList.add(Vb.transition),Zb.wrapper.setAttribute("data-transition-speed",Vb.transitionSpeed),Zb.wrapper.setAttribute("data-background-transition",Vb.backgroundTransition),Zb.controls.style.display=Vb.controls?"block":"none",Zb.progress.style.display=Vb.progress?"block":"none",Vb.rtl?Zb.wrapper.classList.add("rtl"):Zb.wrapper.classList.removeLine truncated
|
||||
var Reveal=function(){"use strict";function a(a){return b(),$b.transforms2d||$b.transforms3d?(window.addEventListener("load",C,!1),l(Vb,a),l(Vb,Reveal.getQueryHash()),s(),c(),void 0):(document.body.setAttribute("class","no-transforms"),void 0)}function b(){$b.transforms3d="WebkitPerspective"in document.body.style||"MozPerspective"in document.body.style||"msPerspective"in document.body.style||"OPerspective"in document.body.style||"perspective"in document.body.style,$b.transforms2d="WebkitTransform"in document.body.style||"MozTransform"in document.body.style||"msTransform"in document.body.style||"OTransform"in document.body.style||"transform"in document.body.style,$b.requestAnimationFrame="function"==typeof window.requestAnimationFrame,$b.canvas=!!document.createElement("canvas").getContext,Pb=navigator.userAgent.match(/(iphone|ipod|android)/gi)}function c(){function a(){c.length&&head.js.apply(null,c),d()}for(var b=[],c=[],e=0,f=Vb.dependencies.length;f>e;e++){var g=Vb.dependencies[e];(!g.condition||g.condition())&&(g.async?c.push(g.src):b.push(g.src),"function"==typeof g.callback&&head.ready(g.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],g.callback))}b.length?(head.ready(a),head.js.apply(null,b)):a()}function d(){f(),e(),i(),ab(),setTimeout(function(){Zb.slides.classList.remove("no-transition"),Wb=!0,u("ready",{indexh:Lb,indexv:Mb,currentSlide:Ob})},1)}function e(){var a=m(document.querySelectorAll(Sb));a.forEach(function(a){var b=m(a.querySelectorAll("section"));b.forEach(function(a,b){b>0&&a.classList.add("future")})})}function f(){Zb.theme=document.querySelector("#theme"),Zb.wrapper=document.querySelector(".reveal"),Zb.slides=document.querySelector(".reveal .slides"),Zb.slides.classList.add("no-transition"),Zb.background=g(Zb.wrapper,"div","backgrounds",null),Zb.progress=g(Zb.wrapper,"div","progress","<span></span>"),Zb.progressbar=Zb.progress.querySelector("span"),g(Zb.wrapper,"aside","controls",'<div class="navigate-left"></div><div class="navigate-right"></div><div class="navigate-up"></div><div class="navigate-down"></div>'),g(Zb.wrapper,"div","state-background",null),g(Zb.wrapper,"div","pause-overlay",null),Zb.controls=document.querySelector(".reveal .controls"),Zb.controlsLeft=m(document.querySelectorAll(".navigate-left")),Zb.controlsRight=m(document.querySelectorAll(".navigate-right")),Zb.controlsUp=m(document.querySelectorAll(".navigate-up")),Zb.controlsDown=m(document.querySelectorAll(".navigate-down")),Zb.controlsPrev=m(document.querySelectorAll(".navigate-prev")),Zb.controlsNext=m(document.querySelectorAll(".navigate-next"))}function g(a,b,c,d){var e=a.querySelector("."+c);return e||(e=document.createElement(b),e.classList.add(c),null!==d&&(e.innerHTML=d),a.appendChild(e)),e}function h(){function a(a,b){var c={background:a.getAttribute("data-background"),backgroundSize:a.getAttribute("data-background-size"),backgroundImage:a.getAttribute("data-background-image"),backgroundColor:a.getAttribute("data-background-color"),backgroundRepeat:a.getAttribute("data-background-repeat"),backgroundPosition:a.getAttribute("data-background-position"),backgroundTransition:a.getAttribute("data-background-transition")},d=document.createElement("div");return d.className="slide-background",c.background&&(/^(http|file|\/\/)/gi.test(c.background)||/\.(svg|png|jpg|jpeg|gif|bmp)$/gi.test(c.background)?d.style.backgroundImage="url("+c.background+")":d.style.background=c.background),c.backgroundSize&&(d.style.backgroundSize=c.backgroundSize),c.backgroundImage&&(d.style.backgroundImage='url("'+c.backgroundImage+'")'),c.backgroundColor&&(d.style.backgroundColor=c.backgroundColor),c.backgroundRepeat&&(d.style.backgroundRepeat=c.backgroundRepeat),c.backgroundPosition&&(d.style.backgroundPosition=c.backgroundPosition),c.backgroundTransition&&d.setAttribute("data-background-transition",c.backgroundTransition),b.appendChild(d),d}r()&&document.body.classList.add("print-pdf"),Zb.background.innerHTML="",Zb.background.classList.add("no-transition"),m(document.querySelectorAll(Sb)).forEach(function(b){var c;c=r()?a(b,b):a(b,Zb.background),m(b.querySelectorAll("section")).forEach(function(b){r()?a(b,b):a(b,c)})}),Vb.parallaxBackgroundImage?(Zb.background.style.backgroundImage='url("'+Vb.parallaxBackgroundImage+'")',Zb.background.style.backgroundSize=Vb.parallaxBackgroundSize,setTimeout(function(){Zb.wrapper.classList.add("has-parallax-background")},1)):(Zb.background.style.backgroundImage="",Zb.wrapper.classList.remove("has-parallax-background"))}function i(a){if(Zb.wrapper.classList.remove(Vb.transition),"object"==typeof a&&l(Vb,a),$b.transforms3d===!1&&(Vb.transition="linear"),Zb.wrapper.classList.add(Vb.transition),Zb.wrapper.setAttribute("data-transition-speed",Vb.transitionSpeed),Zb.wrapper.setAttribute("data-background-transition",Vb.backgroundTransition),Zb.controls.style.display=Vb.controls?"block":"none",Zb.progress.style.display=Vb.progress?"block":"none",Vb.rtl?Zb.wrapper.classList.add("rtl"):Zb.wrapper.classList.removeLine truncated
|
||||
Reference in new issue
Block a user