fa20-bt/js/reveal.min.js

7 lines
14 KiB
JavaScript
Raw Normal View History

/*!
2012-06-01 17:33:10 +00:00
reveal.js 1.3
http://lab.hakim.se/reveal-js
MIT licensed
Copyright (C) 2012 Hakim El Hattab, http://hakim.se
*/var Reveal=(function(){var HORIZONTAL_SLIDES_SELECTOR='#reveal .slides>section',VERTICAL_SLIDES_SELECTOR='#reveal .slides>section.present>section',IS_TOUCH_DEVICE=!!('ontouchstart'in window),indexh=0,indexv=0,config={controls:false,progress:false,history:false,loop:false,mouseWheel:true,rollingLinks:true,transition:'default',theme:'default',swipeDist:40},state=[],dom={},supports3DTransforms=document.body.style['perspectiveProperty']!==undefined||document.body.style['WebkitPerspective']!==undefined||document.body.style['MozPerspective']!==undefined||document.body.style['msPerspective']!==undefined||document.body.style['OPerspective']!==undefined,supports2DTransforms=document.body.style['transformProperty']!==undefined||document.body.style['WebkitTransform']!==undefined||document.body.style['MozTransform']!==undefined||document.body.style['msTransform']!==undefined||document.body.style['OTransform']!==undefined,mouseWheelTimeout=0,writeURLTimeout=0;function initialize(options){if(!supports2DTransforms&&!supports3DTransforms){document.body.setAttribute('class','no-transforms');return;}dom.wrapper=document.querySelector('#reveal');dom.progress=document.querySelector('#reveal .progress');dom.progressbar=document.querySelector('#reveal .progress span');dom.controls=document.querySelector('#reveal .controls');dom.controlsLeft=document.querySelector('#reveal .controls .left');dom.controlsRight=document.querySelector('#reveal .controls .right');dom.controlsUp=document.querySelector('#reveal .controls .up');dom.controlsDown=document.querySelector('#reveal .controls .down');addEvents();extend(config,options);if(supports3DTransforms===false){config.transition='linear';}if(config.controls){dom.controls.style.display='block';}if(config.progress){dom.progress.style.display='block';}if(config.transition!=='default'){dom.wrapper.classList.add(config.transition);}if(config.theme!=='default'){dom.wrapper.classList.add(config.theme);}if(config.mouseWheel){document.addEventListener('DOMMouseScroll',onDocumentMouseScroll,false);document.addEventListener('mousewheel',onDocumentMouseScroll,false);}if(config.rollingLinks){linkify();}readURL();if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow='scroll';document.body.style.height='120%';window.addEventListener('load',removeAddressBar,false);window.addEventListener('orientationchange',removeAddressBar,false);}}function addEvents(){document.addEventListener('keydown',onDocumentKeyDown,false);document.addEventListener('touchstart',onDocumentTouchStart,false);document.addEventListener('touchmove',onDocumentTouchMove,false);document.addEventListener('touchend',onDocumentTouchEnd,false);window.addEventListener('hashchange',onWindowHashChange,false);dom.controlsLeft.addEventListener('click',preventAndForward(navigateLeft),false);dom.controlsRight.addEventListener('click',preventAndForward(navigateRight),false);dom.controlsUp.addEventListener('click',preventAndForward(navigateUp),false);dom.controlsDown.addEventListener('click',preventAndForward(navigateDown),false);}function removeEvents(){document.removeEventListener('keydown',onDocumentKeyDown,false);document.removeEventListener('touchstart',onDocumentTouchStart,false);document.removeEventListener('touchmove',onDocumentTouchMove,false);document.removeEventListener('touchend',onDocumentTouchEnd,false);window.removeEventListener('hashchange',onWindowHashChange,false);dom.controlsLeft.removeEventListener('click',preventAndForward(navigateLeft),false);dom.controlsRight.removeEventListener('click',preventAndForward(navigateRight),false);dom.controlsUp.removeEventListener('click',preventAndForward(navigateUp),false);dom.controlsDown.removeEventListener('click',preventAndForward(navigateDown),false);}function extend(a,b){for(var i in b){a[i]=b[i];}}function preventAndForward(delegate){return function(event){event.preventDefault();delegate.call();}}function removeAddressBar(){setTimeout(function(){window.scrollTo(0,1);},0);}function onDocumentKeyDown(event){if(event.target.contentEditable!='inherit'||event.shift