lib/resources/assets/revealjs-redhat/lib/js/reveal.min.js in hyla-1.0.7 vs lib/resources/assets/revealjs-redhat/lib/js/reveal.min.js in hyla-1.0.8

- old
+ new

@@ -1,6 +1,6 @@ -(function(root,factory){if(typeof define==='function'&&define.amd){define(function(){root.Reveal=factory();return root.Reveal;});}else if(typeof exports==='object'){module.exports=factory();}else{root.Reveal=factory();}}(this,function(){'use strict';var Reveal;var SLIDES_SELECTOR='.slides section',HORIZONTAL_SLIDES_SELECTOR='.slides>section',VERTICAL_SLIDES_SELECTOR='.slides>section.present>section',HOME_SLIDE_SELECTOR='.slides>section:first-of-type',config={width:960,height:700,margin:0.1,marginTop:'',marginLeft:'',minScale:0.2,maxScale:1.5,controls:true,progress:true,slideNumber:false,history:false,keyboard:true,keyboardCondition:null,overview:true,center:true,touch:true,loop:false,rtl:false,fragments:true,embedded:false,help:true,pause:true,autoSlide:0,autoSlideStoppable:true,mouseWheel:false,rollingLinks:false,hideAddressBar:true,previewLinks:false,postMessage:true,postMessageEvents:false,focusBodyOnPageVisibilityChange:true,transition:'slide',transitionSpeed:'default',backgroundTransition:'fade',parallaxBackgroundImage:'',parallaxBackgroundSize:'',parallaxBackgroundHorizontal:null,parallaxBackgroundVertical:null,viewDistance:3,dependencies:[]},loaded=false,overview=false,indexh,indexv,previousSlide,currentSlide,previousBackground,state=[],scale=1,slidesTransform={layout:'',overview:''},dom={},features={},isMobileDevice,lastMouseWheelStep=0,writeURLTimeout=0,eventsAreBound=false,autoSlide=0,autoSlidePlayer,autoSlideTimeout=0,autoSlideStartTime=-1,autoSlidePaused=false,touch={startX:0,startY:0,startSpan:0,startCount:0,captured:false,threshold:40},keyboardShortcuts={'N , SPACE':'Next slide','P':'Previous slide','&#8592; , H':'Navigate left','&#8594; , L':'Navigate right','&#8593; , K':'Navigate up','&#8595; , J':'Navigate down','Home':'First slide','End':'Last slide','B , .':'Pause','F':'Fullscreen','ESC, O':'Slide overview'};function initialize(options){checkCapabilities();if(!features.transforms2d&&!features.transforms3d){document.body.setAttribute('class','no-transforms');var images=document.getElementsByTagName('img');for(var i=0,len=images.length;i<len;i++){var image=images[i];if(image.getAttribute('data-src')){image.setAttribute('src',image.getAttribute('data-src'));image.removeAttribute('data-src');}} +(function(root,factory){if(typeof define==='function'&&define.amd){define(function(){root.Reveal=factory();return root.Reveal;});}else if(typeof exports==='object'){module.exports=factory();}else{root.Reveal=factory();}}(this,function(){'use strict';var Reveal;var SLIDES_SELECTOR='.slides section',HORIZONTAL_SLIDES_SELECTOR='.slides>section',VERTICAL_SLIDES_SELECTOR='.slides>section.present>section',HOME_SLIDE_SELECTOR='.slides>section:first-of-type',config={width:960,height:700,margin:0.1,minScale:0.2,maxScale:1.5,controls:true,progress:true,slideNumber:false,history:false,keyboard:true,keyboardCondition:null,overview:true,center:true,touch:true,loop:false,rtl:false,fragments:true,embedded:false,help:true,pause:true,autoSlide:0,autoSlideStoppable:true,mouseWheel:false,rollingLinks:false,hideAddressBar:true,previewLinks:false,postMessage:true,postMessageEvents:false,focusBodyOnPageVisibilityChange:true,transition:'slide',transitionSpeed:'default',backgroundTransition:'fade',parallaxBackgroundImage:'',parallaxBackgroundSize:'',parallaxBackgroundHorizontal:null,parallaxBackgroundVertical:null,viewDistance:3,dependencies:[]},loaded=false,overview=false,indexh,indexv,previousSlide,currentSlide,previousBackground,state=[],scale=1,slidesTransform={layout:'',overview:''},dom={},features={},isMobileDevice,lastMouseWheelStep=0,writeURLTimeout=0,eventsAreBound=false,autoSlide=0,autoSlidePlayer,autoSlideTimeout=0,autoSlideStartTime=-1,autoSlidePaused=false,touch={startX:0,startY:0,startSpan:0,startCount:0,captured:false,threshold:40},keyboardShortcuts={'N , SPACE':'Next slide','P':'Previous slide','&#8592; , H':'Navigate left','&#8594; , L':'Navigate right','&#8593; , K':'Navigate up','&#8595; , J':'Navigate down','Home':'First slide','End':'Last slide','B , .':'Pause','F':'Fullscreen','ESC, O':'Slide overview'};function initialize(options){checkCapabilities();if(!features.transforms2d&&!features.transforms3d){document.body.setAttribute('class','no-transforms');var images=toArray(document.getElementsByTagName('img')),iframes=toArray(document.getElementsByTagName('iframe'));var lazyLoadable=images.concat(iframes);for(var i=0,len=lazyLoadable.length;i<len;i++){var element=lazyLoadable[i];if(element.getAttribute('data-src')){element.setAttribute('src',element.getAttribute('data-src'));element.removeAttribute('data-src');}} return;} dom.wrapper=document.querySelector('.reveal');dom.slides=document.querySelector('.reveal .slides');window.addEventListener('load',layout,false);var query=Reveal.getQueryHash();if(typeof query['dependencies']!=='undefined')delete query['dependencies'];extend(config,options);extend(config,query);hideAddressBar();load();} function checkCapabilities(){features.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;features.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;features.requestAnimationFrameMethod=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;features.requestAnimationFrame=typeof features.requestAnimationFrameMethod==='function';features.canvas=!!document.createElement('canvas').getContext;features.touch=!!('ontouchstart'in window);features.overviewTransitions=!/Version\/[\d\.]+.*Safari/.test(navigator.userAgent);isMobileDevice=/(iphone|ipod|ipad|android)/gi.test(navigator.userAgent);} function load(){var scripts=[],scriptsAsync=[],scriptsToPreload=0;function proceed(){if(scriptsAsync.length){head.js.apply(null,scriptsAsync);} start();} @@ -106,20 +106,20 @@ function showPreview(url){closeOverlay();dom.overlay=document.createElement('div');dom.overlay.classList.add('overlay');dom.overlay.classList.add('overlay-preview');dom.wrapper.appendChild(dom.overlay);dom.overlay.innerHTML=['<header>','<a class="close" href="#"><span class="icon"></span></a>','<a class="external" href="'+url+'" target="_blank"><span class="icon"></span></a>','</header>','<div class="spinner"></div>','<div class="viewport">','<iframe src="'+url+'"></iframe>','</div>'].join('');dom.overlay.querySelector('iframe').addEventListener('load',function(event){dom.overlay.classList.add('loaded');},false);dom.overlay.querySelector('.close').addEventListener('click',function(event){closeOverlay();event.preventDefault();},false);dom.overlay.querySelector('.external').addEventListener('click',function(event){closeOverlay();},false);setTimeout(function(){dom.overlay.classList.add('visible');},1);} function showHelp(){if(config.help){closeOverlay();dom.overlay=document.createElement('div');dom.overlay.classList.add('overlay');dom.overlay.classList.add('overlay-help');dom.wrapper.appendChild(dom.overlay);var html='<p class="title">Keyboard Shortcuts</p><br/>';html+='<table><th>KEY</th><th>ACTION</th>';for(var key in keyboardShortcuts){html+='<tr><td>'+key+'</td><td>'+keyboardShortcuts[key]+'</td></tr>';} html+='</table>';dom.overlay.innerHTML=['<header>','<a class="close" href="#"><span class="icon"></span></a>','</header>','<div class="viewport">','<div class="viewport-inner">'+html+'</div>','</div>'].join('');dom.overlay.querySelector('.close').addEventListener('click',function(event){closeOverlay();event.preventDefault();},false);setTimeout(function(){dom.overlay.classList.add('visible');},1);}} function closeOverlay(){if(dom.overlay){dom.overlay.parentNode.removeChild(dom.overlay);dom.overlay=null;}} function layout(){if(dom.wrapper&&!isPrintingPDF()){var size=getComputedSlideSize();var slidePadding=20;layoutSlideContents(config.width,config.height,slidePadding);dom.slides.style.width=size.width+'px';dom.slides.style.height=size.height+'px';scale=Math.min(size.presentationWidth/size.width,size.presentationHeight/size.height);scale=Math.max(scale,config.minScale);scale=Math.min(scale,config.maxScale);if(scale===1){dom.slides.style.zoom='';dom.slides.style.left='';dom.slides.style.top='';dom.slides.style.bottom='';dom.slides.style.right='';transformSlides({layout:''});} -else{if(!isMobileDevice&&/chrome/i.test(navigator.userAgent)&&typeof dom.slides.style.zoom!=='undefined'){dom.slides.style.zoom=scale;dom.slides.style.marginTop=config.marginTop;dom.slides.style.marginLeft=config.marginLeft;transformSlides({layout:''});} -else{dom.slides.style.marginTop=config.marginTop;dom.slides.style.marginLeft=config.marginLeft;dom.slides.style.marginBottom='auto';dom.slides.style.marginRight='auto';transformSlides({layout:'translate(-50%, -50%) scale('+scale+') translate(50%, 50%)'});}} +else{if(!isMobileDevice&&/chrome/i.test(navigator.userAgent)&&typeof dom.slides.style.zoom!=='undefined'){dom.slides.style.zoom=scale;transformSlides({layout:''});} +else{dom.slides.style.left='50%';dom.slides.style.top='50%';dom.slides.style.bottom='auto';dom.slides.style.right='auto';transformSlides({layout:'translate(-50%, -50%) scale('+scale+')'});}} var slides=toArray(dom.wrapper.querySelectorAll(SLIDES_SELECTOR));for(var i=0,len=slides.length;i<len;i++){var slide=slides[i];if(slide.style.display==='none'){continue;} if(config.center||slide.classList.contains('center')){if(slide.classList.contains('stack')){slide.style.top=0;} else{slide.style.top=Math.max(((size.height-getAbsoluteHeight(slide))/2)-slidePadding,0)+'px';}} else{slide.style.top='';}} updateProgress();updateParallax();}} function layoutSlideContents(width,height,padding){toArray(dom.slides.querySelectorAll('section > .stretch')).forEach(function(element){var remainingHeight=getRemainingHeight(element,height);if(/(img|video)/gi.test(element.nodeName)){var nw=element.naturalWidth||element.videoWidth,nh=element.naturalHeight||element.videoHeight;var es=Math.min(width/nw,remainingHeight/nh);element.style.width=(nw*es)+'px';element.style.height=(nh*es)+'px';} else{element.style.width=width+'px';element.style.height=remainingHeight+'px';}});} -function getComputedSlideSize(presentationWidth,presentationHeight){var size={width:config.width,height:config.height,presentationWidth:presentationWidth||dom.wrapper.offsetWidth,presentationHeight:presentationHeight||dom.wrapper.offsetHeight};size.presentationWidth-=(size.presentationHeight*config.margin);size.presentationHeight-=(size.presentationHeight*config.margin);if(typeof size.width==='string'&&/%$/.test(size.width)){size.width=parseInt(size.width,10)/100*size.presentationWidth;} +function getComputedSlideSize(presentationWidth,presentationHeight){var size={width:config.width,height:config.height,presentationWidth:presentationWidth||dom.wrapper.offsetWidth,presentationHeight:presentationHeight||dom.wrapper.offsetHeight};size.presentationWidth-=(size.presentationWidth*config.margin);size.presentationHeight-=(size.presentationHeight*config.margin);if(typeof size.width==='string'&&/%$/.test(size.width)){size.width=parseInt(size.width,10)/100*size.presentationWidth;} if(typeof size.height==='string'&&/%$/.test(size.height)){size.height=parseInt(size.height,10)/100*size.presentationHeight;} return size;} function setPreviousVerticalIndex(stack,v){if(typeof stack==='object'&&typeof stack.setAttribute==='function'){stack.setAttribute('data-previous-indexv',v||0);}} function getPreviousVerticalIndex(stack){if(typeof stack==='object'&&typeof stack.setAttribute==='function'&&stack.classList.contains('stack')){var attributeName=stack.hasAttribute('data-start-indexv')?'data-start-indexv':'data-previous-indexv';return parseInt(stack.getAttribute(attributeName)||0,10);} return 0;} @@ -153,11 +153,11 @@ var slideChanged=(indexh!==indexhBefore||indexv!==indexvBefore);if(slideChanged){dispatchEvent('slidechanged',{'indexh':indexh,'indexv':indexv,'previousSlide':previousSlide,'currentSlide':currentSlide,'origin':o});} else{previousSlide=null;} if(previousSlide){previousSlide.classList.remove('present');previousSlide.setAttribute('aria-hidden','true');if(dom.wrapper.querySelector(HOME_SLIDE_SELECTOR).classList.contains('present')){setTimeout(function(){var slides=toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR+'.stack')),i;for(i in slides){if(slides[i]){setPreviousVerticalIndex(slides[i],0);}}},0);}} if(slideChanged||!previousSlide){stopEmbeddedContent(previousSlide);startEmbeddedContent(currentSlide);} dom.statusDiv.textContent=currentSlide.textContent;updateControls();updateProgress();updateBackground();updateParallax();updateSlideNumber();writeURL();cueAutoSlide();} -function sync(){removeEventListeners();addEventListeners();layout();autoSlide=config.autoSlide;cueAutoSlide();createBackgrounds();writeURL();sortAllFragments();updateControls();updateProgress();updateBackground(true);updateSlideNumber();updateSlidesVisibility();formatEmbeddedContent();if(isOverview()){layoutOverview();}} +function sync(){removeEventListeners();addEventListeners();layout();autoSlide=config.autoSlide;cueAutoSlide();createBackgrounds();writeURL();sortAllFragments();updateControls();updateProgress();updateBackground(true);updateSlideNumber();updateSlidesVisibility();formatEmbeddedContent();startEmbeddedContent(currentSlide);if(isOverview()){layoutOverview();}} function resetVerticalSlides(){var horizontalSlides=toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR));horizontalSlides.forEach(function(horizontalSlide){var verticalSlides=toArray(horizontalSlide.querySelectorAll('section'));verticalSlides.forEach(function(verticalSlide,y){if(y>0){verticalSlide.classList.remove('present');verticalSlide.classList.remove('past');verticalSlide.classList.add('future');verticalSlide.setAttribute('aria-hidden','true');}});});} function sortAllFragments(){var horizontalSlides=toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR));horizontalSlides.forEach(function(horizontalSlide){var verticalSlides=toArray(horizontalSlide.querySelectorAll('section'));verticalSlides.forEach(function(verticalSlide,y){sortFragments(verticalSlide.querySelectorAll('.fragment'));});if(verticalSlides.length===0)sortFragments(horizontalSlide.querySelectorAll('.fragment'));});} function updateSlides(selector,index){var slides=toArray(dom.wrapper.querySelectorAll(selector)),slidesLength=slides.length;var printMode=isPrintingPDF();if(slidesLength){if(config.loop){index%=slidesLength;if(index<0){index=slidesLength+index;}} index=Math.max(Math.min(index,slidesLength-1),0);for(var i=0;i<slidesLength;i++){var element=slides[i];var reverse=config.rtl&&!isVerticalSlide(element);element.classList.remove('past');element.classList.remove('present');element.classList.remove('future');element.setAttribute('hidden','');element.setAttribute('aria-hidden','true');if(element.querySelector('section')){element.classList.add('stack');} if(printMode){element.classList.add('present');continue;} @@ -173,11 +173,11 @@ else{hideSlide(horizontalSlide);} if(verticalSlidesLength){var oy=getPreviousVerticalIndex(horizontalSlide);for(var y=0;y<verticalSlidesLength;y++){var verticalSlide=verticalSlides[y];distanceY=x===(indexh||0)?Math.abs((indexv||0)-y):Math.abs(y-oy);if(distanceX+distanceY<viewDistance){showSlide(verticalSlide);} else{hideSlide(verticalSlide);}}}}}} function updateProgress(){if(config.progress&&dom.progressbar){dom.progressbar.style.width=getProgress()*dom.wrapper.offsetWidth+'px';}} function updateSlideNumber(){if(config.slideNumber&&dom.slideNumber){var format='c';if(typeof config.slideNumber==='string'){format=config.slideNumber;} -var totalSlides=getTotalSlides();dom.slideNumber.innerHTML=format.replace(/h/g,indexh).replace(/v/g,indexv).replace(/c/g,Math.round(getProgress()*totalSlides)+1).replace(/t/g,totalSlides+1);}} +dom.slideNumber.innerHTML=format.replace(/h/g,indexh).replace(/v/g,indexv).replace(/c/g,getSlidePastCount()+1).replace(/t/g,getTotalSlides());}} function updateControls(){var routes=availableRoutes();var fragments=availableFragments();dom.controlsLeft.concat(dom.controlsRight).concat(dom.controlsUp).concat(dom.controlsDown).concat(dom.controlsPrev).concat(dom.controlsNext).forEach(function(node){node.classList.remove('enabled');node.classList.remove('fragmented');});if(routes.left)dom.controlsLeft.forEach(function(el){el.classList.add('enabled');});if(routes.right)dom.controlsRight.forEach(function(el){el.classList.add('enabled');});if(routes.up)dom.controlsUp.forEach(function(el){el.classList.add('enabled');});if(routes.down)dom.controlsDown.forEach(function(el){el.classList.add('enabled');});if(routes.left||routes.up)dom.controlsPrev.forEach(function(el){el.classList.add('enabled');});if(routes.right||routes.down)dom.controlsNext.forEach(function(el){el.classList.add('enabled');});if(currentSlide){if(fragments.prev)dom.controlsPrev.forEach(function(el){el.classList.add('fragmented','enabled');});if(fragments.next)dom.controlsNext.forEach(function(el){el.classList.add('fragmented','enabled');});if(isVerticalSlide(currentSlide)){if(fragments.prev)dom.controlsUp.forEach(function(el){el.classList.add('fragmented','enabled');});if(fragments.next)dom.controlsDown.forEach(function(el){el.classList.add('fragmented','enabled');});} else{if(fragments.prev)dom.controlsLeft.forEach(function(el){el.classList.add('fragmented','enabled');});if(fragments.next)dom.controlsRight.forEach(function(el){el.classList.add('fragmented','enabled');});}}} function updateBackground(includeAll){var currentBackground=null;var horizontalPast=config.rtl?'future':'past',horizontalFuture=config.rtl?'past':'future';toArray(dom.background.childNodes).forEach(function(backgroundh,h){backgroundh.classList.remove('past');backgroundh.classList.remove('present');backgroundh.classList.remove('future');if(h<indexh){backgroundh.classList.add(horizontalPast);} else if(h>indexh){backgroundh.classList.add(horizontalFuture);} else{backgroundh.classList.add('present');currentBackground=backgroundh;} @@ -196,27 +196,31 @@ var slideWidth=dom.background.offsetWidth,horizontalSlideCount=horizontalSlides.length,horizontalOffsetMultiplier,horizontalOffset;if(typeof config.parallaxBackgroundHorizontal==='number'){horizontalOffsetMultiplier=config.parallaxBackgroundHorizontal;} else{horizontalOffsetMultiplier=(backgroundWidth-slideWidth)/(horizontalSlideCount-1);} horizontalOffset=horizontalOffsetMultiplier*indexh*-1;var slideHeight=dom.background.offsetHeight,verticalSlideCount=verticalSlides.length,verticalOffsetMultiplier,verticalOffset;if(typeof config.parallaxBackgroundVertical==='number'){verticalOffsetMultiplier=config.parallaxBackgroundVertical;} else{verticalOffsetMultiplier=(backgroundHeight-slideHeight)/(verticalSlideCount-1);} verticalOffset=verticalSlideCount>0?verticalOffsetMultiplier*indexv*1:0;dom.background.style.backgroundPosition=horizontalOffset+'px '+-verticalOffset+'px';}} -function showSlide(slide){slide.style.display='block';toArray(slide.querySelectorAll('img[data-src], video[data-src], audio[data-src], iframe[data-src]')).forEach(function(element){element.setAttribute('src',element.getAttribute('data-src'));element.removeAttribute('data-src');});toArray(slide.querySelectorAll('video, audio')).forEach(function(media){var sources=0;toArray(media.querySelectorAll('source[data-src]')).forEach(function(source){source.setAttribute('src',source.getAttribute('data-src'));source.removeAttribute('data-src');sources+=1;});if(sources>0){media.load();}});var indices=getIndices(slide);var background=getSlideBackground(indices.h,indices.v);if(background){background.style.display='block';if(background.hasAttribute('data-loaded')===false){background.setAttribute('data-loaded','true');var backgroundImage=slide.getAttribute('data-background-image'),backgroundVideo=slide.getAttribute('data-background-video'),backgroundVideoLoop=slide.hasAttribute('data-background-video-loop'),backgroundIframe=slide.getAttribute('data-background-iframe');if(backgroundImage){background.style.backgroundImage='url('+backgroundImage+')';} +function showSlide(slide){slide.style.display='block';toArray(slide.querySelectorAll('img[data-src], video[data-src], audio[data-src]')).forEach(function(element){element.setAttribute('src',element.getAttribute('data-src'));element.removeAttribute('data-src');});toArray(slide.querySelectorAll('video, audio')).forEach(function(media){var sources=0;toArray(media.querySelectorAll('source[data-src]')).forEach(function(source){source.setAttribute('src',source.getAttribute('data-src'));source.removeAttribute('data-src');sources+=1;});if(sources>0){media.load();}});var indices=getIndices(slide);var background=getSlideBackground(indices.h,indices.v);if(background){background.style.display='block';if(background.hasAttribute('data-loaded')===false){background.setAttribute('data-loaded','true');var backgroundImage=slide.getAttribute('data-background-image'),backgroundVideo=slide.getAttribute('data-background-video'),backgroundVideoLoop=slide.hasAttribute('data-background-video-loop'),backgroundIframe=slide.getAttribute('data-background-iframe');if(backgroundImage){background.style.backgroundImage='url('+backgroundImage+')';} else if(backgroundVideo&&!isSpeakerNotes()){var video=document.createElement('video');if(backgroundVideoLoop){video.setAttribute('loop','');} backgroundVideo.split(',').forEach(function(source){video.innerHTML+='<source src="'+source+'">';});background.appendChild(video);} else if(backgroundIframe){var iframe=document.createElement('iframe');iframe.setAttribute('src',backgroundIframe);iframe.style.width='100%';iframe.style.height='100%';iframe.style.maxHeight='100%';iframe.style.maxWidth='100%';background.appendChild(iframe);}}}} function hideSlide(slide){slide.style.display='none';var indices=getIndices(slide);var background=getSlideBackground(indices.h,indices.v);if(background){background.style.display='none';}} function availableRoutes(){var horizontalSlides=dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR),verticalSlides=dom.wrapper.querySelectorAll(VERTICAL_SLIDES_SELECTOR);var routes={left:indexh>0||config.loop,right:indexh<horizontalSlides.length-1||config.loop,up:indexv>0,down:indexv<verticalSlides.length-1};if(config.rtl){var left=routes.left;routes.left=routes.right;routes.right=left;} return routes;} function availableFragments(){if(currentSlide&&config.fragments){var fragments=currentSlide.querySelectorAll('.fragment');var hiddenFragments=currentSlide.querySelectorAll('.fragment:not(.visible)');return{prev:fragments.length-hiddenFragments.length>0,next:!!hiddenFragments.length};} else{return{prev:false,next:false};}} -function formatEmbeddedContent(){toArray(dom.slides.querySelectorAll('iframe[src*="youtube.com/embed/"]')).forEach(function(el){var src=el.getAttribute('src');if(!/enablejsapi\=1/gi.test(src)){el.setAttribute('src',src+(!/\?/.test(src)?'?':'&')+'enablejsapi=1');}});toArray(dom.slides.querySelectorAll('iframe[src*="player.vimeo.com/"]')).forEach(function(el){var src=el.getAttribute('src');if(!/api\=1/gi.test(src)){el.setAttribute('src',src+(!/\?/.test(src)?'?':'&')+'api=1');}});} -function startEmbeddedContent(slide){if(slide&&!isSpeakerNotes()){toArray(slide.querySelectorAll('img[src$=".gif"]')).forEach(function(el){el.setAttribute('src',el.getAttribute('src'));});toArray(slide.querySelectorAll('video, audio')).forEach(function(el){if(el.hasAttribute('data-autoplay')){el.play();}});toArray(slide.querySelectorAll('iframe')).forEach(function(el){el.contentWindow.postMessage('slide:start','*');});toArray(slide.querySelectorAll('iframe[src*="youtube.com/embed/"]')).forEach(function(el){if(el.hasAttribute('data-autoplay')){el.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}','*');}});toArray(slide.querySelectorAll('iframe[src*="player.vimeo.com/"]')).forEach(function(el){if(el.hasAttribute('data-autoplay')){el.contentWindow.postMessage('{"method":"play"}','*');}});}} -function stopEmbeddedContent(slide){if(slide&&slide.parentNode){toArray(slide.querySelectorAll('video, audio')).forEach(function(el){if(!el.hasAttribute('data-ignore')){el.pause();}});toArray(slide.querySelectorAll('iframe')).forEach(function(el){el.contentWindow.postMessage('slide:stop','*');});toArray(slide.querySelectorAll('iframe[src*="youtube.com/embed/"]')).forEach(function(el){if(!el.hasAttribute('data-ignore')&&typeof el.contentWindow.postMessage==='function'){el.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}','*');}});toArray(slide.querySelectorAll('iframe[src*="player.vimeo.com/"]')).forEach(function(el){if(!el.hasAttribute('data-ignore')&&typeof el.contentWindow.postMessage==='function'){el.contentWindow.postMessage('{"method":"pause"}','*');}});}} -function getProgress(){var horizontalSlides=toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR));var totalCount=getTotalSlides();var pastCount=0;mainLoop:for(var i=0;i<horizontalSlides.length;i++){var horizontalSlide=horizontalSlides[i];var verticalSlides=toArray(horizontalSlide.querySelectorAll('section'));for(var j=0;j<verticalSlides.length;j++){if(verticalSlides[j].classList.contains('present')){break mainLoop;} +function formatEmbeddedContent(){var _appendParamToIframeSource=function(sourceAttribute,sourceURL,param){toArray(dom.slides.querySelectorAll('iframe['+sourceAttribute+'*="'+sourceURL+'"]')).forEach(function(el){var src=el.getAttribute(sourceAttribute);if(src&&src.indexOf(param)===-1){el.setAttribute(sourceAttribute,src+(!/\?/.test(src)?'?':'&')+param);}});};_appendParamToIframeSource('src','youtube.com/embed/','enablejsapi=1');_appendParamToIframeSource('data-src','youtube.com/embed/','enablejsapi=1');_appendParamToIframeSource('src','player.vimeo.com/','api=1');_appendParamToIframeSource('data-src','player.vimeo.com/','api=1');} +function startEmbeddedContent(slide){if(slide&&!isSpeakerNotes()){toArray(slide.querySelectorAll('img[src$=".gif"]')).forEach(function(el){el.setAttribute('src',el.getAttribute('src'));});toArray(slide.querySelectorAll('video, audio')).forEach(function(el){if(el.hasAttribute('data-autoplay')&&typeof el.play==='function'){el.play();}});toArray(slide.querySelectorAll('iframe[src]')).forEach(function(el){startEmbeddedIframe({target:el});});toArray(slide.querySelectorAll('iframe[data-src]')).forEach(function(el){if(el.getAttribute('src')!==el.getAttribute('data-src')){el.removeEventListener('load',startEmbeddedIframe);el.addEventListener('load',startEmbeddedIframe);el.setAttribute('src',el.getAttribute('data-src'));}});}} +function startEmbeddedIframe(event){var iframe=event.target;if(/youtube\.com\/embed\//.test(iframe.getAttribute('src'))&&iframe.hasAttribute('data-autoplay')){iframe.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}','*');} +else if(/player\.vimeo\.com\//.test(iframe.getAttribute('src'))&&iframe.hasAttribute('data-autoplay')){iframe.contentWindow.postMessage('{"method":"play"}','*');} +else{iframe.contentWindow.postMessage('slide:start','*');}} +function stopEmbeddedContent(slide){if(slide&&slide.parentNode){toArray(slide.querySelectorAll('video, audio')).forEach(function(el){if(!el.hasAttribute('data-ignore')&&typeof el.pause==='function'){el.pause();}});toArray(slide.querySelectorAll('iframe')).forEach(function(el){el.contentWindow.postMessage('slide:stop','*');el.removeEventListener('load',startEmbeddedIframe);});toArray(slide.querySelectorAll('iframe[src*="youtube.com/embed/"]')).forEach(function(el){if(!el.hasAttribute('data-ignore')&&typeof el.contentWindow.postMessage==='function'){el.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}','*');}});toArray(slide.querySelectorAll('iframe[src*="player.vimeo.com/"]')).forEach(function(el){if(!el.hasAttribute('data-ignore')&&typeof el.contentWindow.postMessage==='function'){el.contentWindow.postMessage('{"method":"pause"}','*');}});toArray(slide.querySelectorAll('iframe[data-src]')).forEach(function(el){el.setAttribute('src','about:blank');el.removeAttribute('src');});}} +function getSlidePastCount(){var horizontalSlides=toArray(dom.wrapper.querySelectorAll(HORIZONTAL_SLIDES_SELECTOR));var pastCount=0;mainLoop:for(var i=0;i<horizontalSlides.length;i++){var horizontalSlide=horizontalSlides[i];var verticalSlides=toArray(horizontalSlide.querySelectorAll('section'));for(var j=0;j<verticalSlides.length;j++){if(verticalSlides[j].classList.contains('present')){break mainLoop;} pastCount++;} if(horizontalSlide.classList.contains('present')){break;} if(horizontalSlide.classList.contains('stack')===false){pastCount++;}} -if(currentSlide){var allFragments=currentSlide.querySelectorAll('.fragment');if(allFragments.length>0){var visibleFragments=currentSlide.querySelectorAll('.fragment.visible');var fragmentWeight=0.9;pastCount+=(visibleFragments.length/allFragments.length)*fragmentWeight;}} +return pastCount;} +function getProgress(){var totalCount=getTotalSlides();var pastCount=getSlidePastCount();if(currentSlide){var allFragments=currentSlide.querySelectorAll('.fragment');if(allFragments.length>0){var visibleFragments=currentSlide.querySelectorAll('.fragment.visible');var fragmentWeight=0.9;pastCount+=(visibleFragments.length/allFragments.length)*fragmentWeight;}} return pastCount/(totalCount-1);} function isSpeakerNotes(){return!!window.location.search.match(/receiver/gi);} function readURL(){var hash=window.location.hash;var bits=hash.slice(2).split('/'),name=hash.replace(/#|\//gi,'');if(isNaN(parseInt(bits[0],10))&&name.length){var element;if(/^[a-zA-Z][\w:.-]*$/.test(name)){element=document.getElementById(name);} if(element){var indices=Reveal.getIndices(element);slide(indices.h,indices.v);} else{slide(indexh||0,indexv||0);}} @@ -256,10 +260,11 @@ function previousFragment(){return navigateFragment(null,-1);} function cueAutoSlide(){cancelAutoSlide();if(currentSlide){var currentFragment=currentSlide.querySelector('.current-fragment');var fragmentAutoSlide=currentFragment?currentFragment.getAttribute('data-autoslide'):null;var parentAutoSlide=currentSlide.parentNode?currentSlide.parentNode.getAttribute('data-autoslide'):null;var slideAutoSlide=currentSlide.getAttribute('data-autoslide');if(fragmentAutoSlide){autoSlide=parseInt(fragmentAutoSlide,10);} else if(slideAutoSlide){autoSlide=parseInt(slideAutoSlide,10);} else if(parentAutoSlide){autoSlide=parseInt(parentAutoSlide,10);} else{autoSlide=config.autoSlide;} -toArray(currentSlide.querySelectorAll('video, audio')).forEach(function(el){if(el.hasAttribute('data-autoplay')){if(autoSlide&&el.duration*1000>autoSlide){autoSlide=(el.duration*1000)+1000;}}});if(autoSlide&&!autoSlidePaused&&!isPaused()&&!isOverview()&&(!Reveal.isLastSlide()||availableFragments().next||config.loop===true)){autoSlideTimeout=setTimeout(navigateNext,autoSlide);autoSlideStartTime=Date.now();} +if(currentSlide.querySelectorAll('.fragment').length===0){toArray(currentSlide.querySelectorAll('video, audio')).forEach(function(el){if(el.hasAttribute('data-autoplay')){if(autoSlide&&el.duration*1000>autoSlide){autoSlide=(el.duration*1000)+1000;}}});} +if(autoSlide&&!autoSlidePaused&&!isPaused()&&!isOverview()&&(!Reveal.isLastSlide()||availableFragments().next||config.loop===true)){autoSlideTimeout=setTimeout(navigateNext,autoSlide);autoSlideStartTime=Date.now();} if(autoSlidePlayer){autoSlidePlayer.setPlaying(autoSlideTimeout!==-1);}}} function cancelAutoSlide(){clearTimeout(autoSlideTimeout);autoSlideTimeout=-1;} function pauseAutoSlide(){if(autoSlide&&!autoSlidePaused){autoSlidePaused=true;dispatchEvent('autoslidepaused');clearTimeout(autoSlideTimeout);if(autoSlidePlayer){autoSlidePlayer.setPlaying(false);}}} function resumeAutoSlide(){if(autoSlide&&autoSlidePaused){autoSlidePaused=false;dispatchEvent('autoslideresumed');cueAutoSlide();}} function navigateLeft(){if(config.rtl){if((isOverview()||nextFragment()===false)&&availableRoutes().left){slide(indexh+1);}} \ No newline at end of file