update future classes when syncing
This commit is contained in:
1 parent
0fcff33a61
commit
d41a5ca87f
2 files changed
+91
-89
No files matched your search
+88
-86
@@ -305,7 +305,7 @@ var Reveal = (function(){
|
|||||||
setupDOM();
|
setupDOM();
|
||||||
|
|
||||||
// Decorate the slide DOM elements with state classes (past/future)
|
// Decorate the slide DOM elements with state classes (past/future)
|
||||||
setupSlides();
|
formatSlides();
|
||||||
|
|
||||||
// Updates the presentation to match the current configuration values
|
// Updates the presentation to match the current configuration values
|
||||||
configure();
|
configure();
|
||||||
@@ -333,30 +333,6 @@ var Reveal = (function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Iterates through and decorates slides DOM elements with
|
|
||||||
* appropriate classes.
|
|
||||||
*/
|
|
||||||
function setupSlides() {
|
|
||||||
|
|
||||||
var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
|
|
||||||
horizontalSlides.forEach( function( horizontalSlide ) {
|
|
||||||
|
|
||||||
var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
|
|
||||||
verticalSlides.forEach( function( verticalSlide, y ) {
|
|
||||||
|
|
||||||
if( y > 0 ) verticalSlide.classList.add( 'future' );
|
|
||||||
|
|
||||||
sortFragments( verticalSlide.querySelectorAll( '.fragment' ) );
|
|
||||||
|
|
||||||
} );
|
|
||||||
|
|
||||||
if( verticalSlides.length === 0 ) sortFragments( horizontalSlide.querySelectorAll( '.fragment' ) );
|
|
||||||
|
|
||||||
} );
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds and stores references to DOM elements which are
|
* Finds and stores references to DOM elements which are
|
||||||
* required by the presentation. If a required element is
|
* required by the presentation. If a required element is
|
||||||
@@ -1031,67 +1007,6 @@ var Reveal = (function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return a sorted fragments list, ordered by an increasing
|
|
||||||
* "data-fragment-index" attribute.
|
|
||||||
*
|
|
||||||
* Fragments will be revealed in the order that they are returned by
|
|
||||||
* this function, so you can use the index attributes to control the
|
|
||||||
* order of fragment appearance.
|
|
||||||
*
|
|
||||||
* To maintain a sensible default fragment order, fragments are presumed
|
|
||||||
* to be passed in document order. This function adds a "fragment-index"
|
|
||||||
* attribute to each node if such an attribute is not already present,
|
|
||||||
* and sets that attribute to an integer value which is the position of
|
|
||||||
* the fragment within the fragments list.
|
|
||||||
*/
|
|
||||||
function sortFragments( fragments ) {
|
|
||||||
|
|
||||||
fragments = toArray( fragments );
|
|
||||||
|
|
||||||
var ordered = [],
|
|
||||||
unordered = [],
|
|
||||||
sorted = [];
|
|
||||||
|
|
||||||
// Group ordered and unordered elements
|
|
||||||
fragments.forEach( function( fragment, i ) {
|
|
||||||
if( fragment.hasAttribute( 'data-fragment-index' ) ) {
|
|
||||||
var index = parseInt( fragment.getAttribute( 'data-fragment-index' ), 10 );
|
|
||||||
|
|
||||||
if( !ordered[index] ) {
|
|
||||||
ordered[index] = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
ordered[index].push( fragment );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
unordered.push( [ fragment ] );
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
|
|
||||||
// Append fragments without explicit indices in their
|
|
||||||
// DOM order
|
|
||||||
ordered = ordered.concat( unordered );
|
|
||||||
|
|
||||||
// Manually count the index up per group to ensure there
|
|
||||||
// are no gaps
|
|
||||||
var index = 0;
|
|
||||||
|
|
||||||
// Push all fragments in their sorted order to an array,
|
|
||||||
// this flattens the groups
|
|
||||||
ordered.forEach( function( group ) {
|
|
||||||
group.forEach( function( fragment ) {
|
|
||||||
sorted.push( fragment );
|
|
||||||
fragment.setAttribute( 'data-fragment-index', index );
|
|
||||||
} );
|
|
||||||
|
|
||||||
index ++;
|
|
||||||
} );
|
|
||||||
|
|
||||||
return sorted;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies JavaScript-controlled layout rules to the
|
* Applies JavaScript-controlled layout rules to the
|
||||||
* presentation.
|
* presentation.
|
||||||
@@ -1676,6 +1591,8 @@ var Reveal = (function(){
|
|||||||
// Re-create the slide backgrounds
|
// Re-create the slide backgrounds
|
||||||
createBackgrounds();
|
createBackgrounds();
|
||||||
|
|
||||||
|
formatSlides();
|
||||||
|
|
||||||
updateControls();
|
updateControls();
|
||||||
updateProgress();
|
updateProgress();
|
||||||
updateBackground( true );
|
updateBackground( true );
|
||||||
@@ -1683,6 +1600,30 @@ var Reveal = (function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Iterates through and decorates slides DOM elements with
|
||||||
|
* appropriate classes.
|
||||||
|
*/
|
||||||
|
function formatSlides() {
|
||||||
|
|
||||||
|
var horizontalSlides = toArray( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
|
||||||
|
horizontalSlides.forEach( function( horizontalSlide ) {
|
||||||
|
|
||||||
|
var verticalSlides = toArray( horizontalSlide.querySelectorAll( 'section' ) );
|
||||||
|
verticalSlides.forEach( function( verticalSlide, y ) {
|
||||||
|
|
||||||
|
if( y > 0 ) verticalSlide.classList.add( 'future' );
|
||||||
|
|
||||||
|
sortFragments( verticalSlide.querySelectorAll( '.fragment' ) );
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
|
if( verticalSlides.length === 0 ) sortFragments( horizontalSlide.querySelectorAll( '.fragment' ) );
|
||||||
|
|
||||||
|
} );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates one dimension of slides by showing the slide
|
* Updates one dimension of slides by showing the slide
|
||||||
* with the specified index.
|
* with the specified index.
|
||||||
@@ -2306,6 +2247,67 @@ var Reveal = (function(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return a sorted fragments list, ordered by an increasing
|
||||||
|
* "data-fragment-index" attribute.
|
||||||
|
*
|
||||||
|
* Fragments will be revealed in the order that they are returned by
|
||||||
|
* this function, so you can use the index attributes to control the
|
||||||
|
* order of fragment appearance.
|
||||||
|
*
|
||||||
|
* To maintain a sensible default fragment order, fragments are presumed
|
||||||
|
* to be passed in document order. This function adds a "fragment-index"
|
||||||
|
* attribute to each node if such an attribute is not already present,
|
||||||
|
* and sets that attribute to an integer value which is the position of
|
||||||
|
* the fragment within the fragments list.
|
||||||
|
*/
|
||||||
|
function sortFragments( fragments ) {
|
||||||
|
|
||||||
|
fragments = toArray( fragments );
|
||||||
|
|
||||||
|
var ordered = [],
|
||||||
|
unordered = [],
|
||||||
|
sorted = [];
|
||||||
|
|
||||||
|
// Group ordered and unordered elements
|
||||||
|
fragments.forEach( function( fragment, i ) {
|
||||||
|
if( fragment.hasAttribute( 'data-fragment-index' ) ) {
|
||||||
|
var index = parseInt( fragment.getAttribute( 'data-fragment-index' ), 10 );
|
||||||
|
|
||||||
|
if( !ordered[index] ) {
|
||||||
|
ordered[index] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
ordered[index].push( fragment );
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unordered.push( [ fragment ] );
|
||||||
|
}
|
||||||
|
} );
|
||||||
|
|
||||||
|
// Append fragments without explicit indices in their
|
||||||
|
// DOM order
|
||||||
|
ordered = ordered.concat( unordered );
|
||||||
|
|
||||||
|
// Manually count the index up per group to ensure there
|
||||||
|
// are no gaps
|
||||||
|
var index = 0;
|
||||||
|
|
||||||
|
// Push all fragments in their sorted order to an array,
|
||||||
|
// this flattens the groups
|
||||||
|
ordered.forEach( function( group ) {
|
||||||
|
group.forEach( function( fragment ) {
|
||||||
|
sorted.push( fragment );
|
||||||
|
fragment.setAttribute( 'data-fragment-index', index );
|
||||||
|
} );
|
||||||
|
|
||||||
|
index ++;
|
||||||
|
} );
|
||||||
|
|
||||||
|
return sorted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Navigate to the specified slide fragment.
|
* Navigate to the specified slide fragment.
|
||||||
*
|
*
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
/*!
|
/*!
|
||||||
* reveal.js 2.6.0-dev (2013-11-25, 15:09)
|
* reveal.js 2.6.0-dev (2013-11-25, 15:39)
|
||||||
* http://lab.hakim.se/reveal-js
|
* http://lab.hakim.se/reveal-js
|
||||||
* MIT licensed
|
* MIT licensed
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|
* Copyright (C) 2013 Hakim El Hattab, http://hakim.se
|
||||||
*/
|
*/
|
||||||
var Reveal=function(){"use strict";function a(a){if(b(),!dc.transforms2d&&!dc.transforms3d)return document.body.setAttribute("class","no-transforms"),void 0;window.addEventListener("load",C,!1);var d=Reveal.getQueryHash();"undefined"!=typeof d.dependencies&&delete d.dependencies,l($b,a),l($b,d),s(),c()}function b(){dc.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,dc.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,dc.requestAnimationFrameMethod=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,dc.requestAnimationFrame="function"==typeof dc.requestAnimationFrameMethod,dc.canvas=!!document.createElement("canvas").getContext,Ub=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=$b.dependencies.length;f>e;e++){var g=$b.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(),cb(),X(!0),setTimeout(function(){cc.slides.classList.remove("no-transition"),_b=!0,u("ready",{indexh:Pb,indexv:Qb,currentSlide:Sb})},1)}function e(){var a=m(document.querySelectorAll(Xb));a.forEach(function(a){var b=m(a.querySelectorAll("section"));b.forEach(function(a,b){b>0&&a.classList.add("future"),B(a.querySelectorAll(".fragment"))}),0===b.length&&B(a.querySelectorAll(".fragment"))})}function f(){cc.theme=document.querySelector("#theme"),cc.wrapper=document.querySelector(".reveal"),cc.slides=document.querySelector(".reveal .slides"),cc.slides.classList.add("no-transition"),cc.background=g(cc.wrapper,"div","backgrounds",null),cc.progress=g(cc.wrapper,"div","progress","<span></span>"),cc.progressbar=cc.progress.querySelector("span"),g(cc.wrapper,"aside","controls",'<div class="navigate-left"></div><div class="navigate-right"></div><div class="navigate-up"></div><div class="navigate-down"></div>'),cc.slideNumber=g(cc.wrapper,"div","slide-number",""),g(cc.wrapper,"div","state-background",null),g(cc.wrapper,"div","pause-overlay",null),cc.controls=document.querySelector(".reveal .controls"),cc.controlsLeft=m(document.querySelectorAll(".navigate-left")),cc.controlsRight=m(document.querySelectorAll(".navigate-right")),cc.controlsUp=m(document.querySelectorAll(".navigate-up")),cc.controlsDown=m(document.querySelectorAll(".navigate-down")),cc.controlsPrev=m(document.querySelectorAll(".navigate-prev")),cc.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.background||c.backgroundColor||c.backgroundImage)&&d.setAttribute("data-background-hash",c.background+c.backgroundSize+c.backgroundImage+c.backgroundColor+c.backgroundRepeat+c.backgroundPosition+c.backgroundTransition),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"),cc.background.innerHTML="",cc.background.classList.add("no-transition"),m(document.querySelectorAll(Xb)).forEach(function(b){var c;c=r()?a(b,b):a(b,cc.background),m(b.querySelectorAll("section")).forEach(function(b){r()?a(b,b):a(b,c)})}),$b.parallaxBackgroundImage?(cc.background.style.backgroundImage='url("'+$b.parallaxBackgroundImage+'")',cc.background.style.backgroundSize=$b.parallaxBackgroundSize,setTimeout(function(){cc.wrapper.classList.add("has-parallax-background")},1)):(cc.background.style.backgroundImLine truncated
|
var Reveal=function(){"use strict";function a(a){if(b(),!dc.transforms2d&&!dc.transforms3d)return document.body.setAttribute("class","no-transforms"),void 0;window.addEventListener("load",A,!1);var d=Reveal.getQueryHash();"undefined"!=typeof d.dependencies&&delete d.dependencies,k($b,a),k($b,d),r(),c()}function b(){dc.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,dc.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,dc.requestAnimationFrameMethod=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,dc.requestAnimationFrame="function"==typeof dc.requestAnimationFrameMethod,dc.canvas=!!document.createElement("canvas").getContext,Ub=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=$b.dependencies.length;f>e;e++){var g=$b.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(){e(),Q(),h(),bb(),W(!0),setTimeout(function(){cc.slides.classList.remove("no-transition"),_b=!0,t("ready",{indexh:Pb,indexv:Qb,currentSlide:Sb})},1)}function e(){cc.theme=document.querySelector("#theme"),cc.wrapper=document.querySelector(".reveal"),cc.slides=document.querySelector(".reveal .slides"),cc.slides.classList.add("no-transition"),cc.background=f(cc.wrapper,"div","backgrounds",null),cc.progress=f(cc.wrapper,"div","progress","<span></span>"),cc.progressbar=cc.progress.querySelector("span"),f(cc.wrapper,"aside","controls",'<div class="navigate-left"></div><div class="navigate-right"></div><div class="navigate-up"></div><div class="navigate-down"></div>'),cc.slideNumber=f(cc.wrapper,"div","slide-number",""),f(cc.wrapper,"div","state-background",null),f(cc.wrapper,"div","pause-overlay",null),cc.controls=document.querySelector(".reveal .controls"),cc.controlsLeft=l(document.querySelectorAll(".navigate-left")),cc.controlsRight=l(document.querySelectorAll(".navigate-right")),cc.controlsUp=l(document.querySelectorAll(".navigate-up")),cc.controlsDown=l(document.querySelectorAll(".navigate-down")),cc.controlsPrev=l(document.querySelectorAll(".navigate-prev")),cc.controlsNext=l(document.querySelectorAll(".navigate-next"))}function f(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 g(){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.background||c.backgroundColor||c.backgroundImage)&&d.setAttribute("data-background-hash",c.background+c.backgroundSize+c.backgroundImage+c.backgroundColor+c.backgroundRepeat+c.backgroundPosition+c.backgroundTransition),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}q()&&document.body.classList.add("print-pdf"),cc.background.innerHTML="",cc.background.classList.add("no-transition"),l(document.querySelectorAll(Xb)).forEach(function(b){var c;c=q()?a(b,b):a(b,cc.background),l(b.querySelectorAll("section")).forEach(function(b){q()?a(b,b):a(b,c)})}),$b.parallaxBackgroundImage?(cc.background.style.backgroundImage='url("'+$b.parallaxBackgroundImage+'")',cc.background.style.backgroundSize=$b.parallaxBackgroundSize,setTimeout(function(){cc.wrapper.classList.add("has-parallax-background")},1)):(cc.background.style.backgroundImage="",cc.wrapper.classList.remove("has-parallax-background"))}function h(a){var b=document.querySelectorAll(Wb).length;if(cc.wrapper.classList.remove($b.transition),"object"==typeof a&&k($b,a),dc.transforms3d===!1&&($b.transition="linear"),cc.wrapper.clasLine truncated
|
||||||
},getQueryHash:function(){var a={};location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(b){a[b.split("=").shift()]=b.split("=").pop()});for(var b in a){var c=a[b];"null"===c?a[b]=null:"true"===c?a[b]=!0:"false"===c?a[b]=!1:isNaN(parseFloat(c))||(a[b]=parseFloat(c))}return a},isFirstSlide:function(){return null==document.querySelector(Wb+".past")?!0:!1},isLastSlide:function(){return Sb?Sb.nextElementSibling?!1:K(Sb)&&Sb.parentNode.nextElementSibling?!1:!0:!1},isReady:function(){return _b},addEventListener:function(a,b,c){"addEventListener"in window&&(cc.wrapper||document.querySelector(".reveal")).addEventListener(a,b,c)},removeEventListener:function(a,b,c){"addEventListener"in window&&(cc.wrapper||document.querySelector(".reveal")).removeEventListener(a,b,c)}}}();
|
},getQueryHash:function(){var a={};location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(b){a[b.split("=").shift()]=b.split("=").pop()});for(var b in a){var c=a[b];"null"===c?a[b]=null:"true"===c?a[b]=!0:"false"===c?a[b]=!1:isNaN(parseFloat(c))||(a[b]=parseFloat(c))}return a},isFirstSlide:function(){return null==document.querySelector(Wb+".past")?!0:!1},isLastSlide:function(){return Sb?Sb.nextElementSibling?!1:I(Sb)&&Sb.parentNode.nextElementSibling?!1:!0:!1},isReady:function(){return _b},addEventListener:function(a,b,c){"addEventListener"in window&&(cc.wrapper||document.querySelector(".reveal")).addEventListener(a,b,c)},removeEventListener:function(a,b,c){"addEventListener"in window&&(cc.wrapper||document.querySelector(".reveal")).removeEventListener(a,b,c)}}}();
|
||||||
Reference in new issue
Block a user