From 82b4658faf6b8e8092aa6a3a2282b9ca01e715df Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Tue, 7 Aug 2012 01:27:22 -0400 Subject: [PATCH] use minified version of js --- index.html | 2 +- js/reveal.min.js | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 js/reveal.min.js diff --git a/index.html b/index.html index d047f4a..6e3ec07 100644 --- a/index.html +++ b/index.html @@ -326,7 +326,7 @@ function linkify( selector ) { scripts.push( 'lib/js/data-markdown.js' ); } - scripts.push( 'js/reveal.js' ); + scripts.push( 'js/reveal.min.js' ); // If we're runnning the notes server we need to include some additional JS // TODO Is there a better way to determine if we're running the notes server? diff --git a/js/reveal.min.js b/js/reveal.min.js new file mode 100644 index 0000000..cadd612 --- /dev/null +++ b/js/reveal.min.js @@ -0,0 +1,67 @@ +/*! + * reveal.js 1.5 r15 + * http://lab.hakim.se/reveal-js + * MIT licensed + * + * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se + */ +var Reveal=(function(){var j=".reveal .slides>section",a=".reveal .slides>section.present>section",e=!!("ontouchstart" in window),K={controls:true,progress:true,history:false,keyboard:true,loop:false,autoSlide:0,mouseWheel:true,rollingLinks:true,theme:"default",transition:"default"},k=0,c=0,v,C,W=[],d={},M="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,l="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,y=!!document.body.classList; +mouseWheelTimeout=0,autoSlideTimeout=0,writeURLTimeout=0,touch={startX:0,startY:0,startSpan:0,startCount:0,handled:false,threshold:40};function h(Y){if((!l&&!M)||!y){document.body.setAttribute("class","no-transforms"); +return;}d.wrapper=document.querySelector(".reveal");d.progress=document.querySelector(".reveal .progress");d.progressbar=document.querySelector(".reveal .progress span"); +if(K.controls){d.controls=document.querySelector(".reveal .controls");d.controlsLeft=document.querySelector(".reveal .controls .left");d.controlsRight=document.querySelector(".reveal .controls .right"); +d.controlsUp=document.querySelector(".reveal .controls .up");d.controlsDown=document.querySelector(".reveal .controls .down");}A();q(K,Y);F();E();H();if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow="scroll"; +document.body.style.height="120%";window.addEventListener("load",S,false);window.addEventListener("orientationchange",S,false);}}function F(){if(M===false){K.transition="linear"; +}if(K.controls&&d.controls){d.controls.style.display="block";}if(K.progress&&d.progress){d.progress.style.display="block";}if(K.transition!=="default"){d.wrapper.classList.add(K.transition); +}if(K.theme!=="default"){document.documentElement.classList.add("theme-"+K.theme);}if(K.mouseWheel){document.addEventListener("DOMMouseScroll",m,false); +document.addEventListener("mousewheel",m,false);}if(K.rollingLinks){G();}}function A(){document.addEventListener("touchstart",w,false);document.addEventListener("touchmove",U,false); +document.addEventListener("touchend",O,false);window.addEventListener("hashchange",t,false);if(K.keyboard){document.addEventListener("keydown",V,false); +}if(K.controls&&d.controls){d.controlsLeft.addEventListener("click",n(x),false);d.controlsRight.addEventListener("click",n(i),false);d.controlsUp.addEventListener("click",n(r),false); +d.controlsDown.addEventListener("click",n(B),false);}}function N(){document.removeEventListener("keydown",V,false);document.removeEventListener("touchstart",w,false); +document.removeEventListener("touchmove",U,false);document.removeEventListener("touchend",O,false);window.removeEventListener("hashchange",t,false);if(K.controls&&d.controls){d.controlsLeft.removeEventListener("click",n(x),false); +d.controlsRight.removeEventListener("click",n(i),false);d.controlsUp.removeEventListener("click",n(r),false);d.controlsDown.removeEventListener("click",n(B),false); +}}function q(Z,Y){for(var aa in Y){Z[aa]=Y[aa];}}function L(aa,Y){var ab=aa.x-Y.x,Z=aa.y-Y.y;return Math.sqrt(ab*ab+Z*Z);}function n(Y){return function(Z){Z.preventDefault(); +Y.call();};}function S(){setTimeout(function(){window.scrollTo(0,1);},0);}function V(Z){if(Z.target.contentEditable!="inherit"||Z.shiftKey||Z.altKey||Z.ctrlKey||Z.metaKey){return; +}var Y=false;switch(Z.keyCode){case 80:case 33:Q();Y=true;break;case 78:case 34:u();Y=true;break;case 72:case 37:x();Y=true;break;case 76:case 39:i();Y=true; +break;case 75:case 38:r();Y=true;break;case 74:case 40:B();Y=true;break;case 36:I(0);Y=true;break;case 35:I(Number.MAX_VALUE);Y=true;break;case 32:R()?T():u(); +Y=true;break;case 13:if(R()){T();Y=true;}break;}if(Y){Z.preventDefault();}else{if(Z.keyCode===27&&M){P();Z.preventDefault();}}H();}function w(Y){touch.startX=Y.touches[0].clientX; +touch.startY=Y.touches[0].clientY;touch.startCount=Y.touches.length;if(Y.touches.length===2){touch.startSpan=L({x:Y.touches[1].clientX,y:Y.touches[1].clientY},{x:touch.startX,y:touch.startY}); +}}function U(ad){if(!touch.handled){var ab=ad.touches[0].clientX;var aa=ad.touches[0].clientY;if(ad.touches.length===2&&touch.startCount===2){var ac=L({x:ad.touches[1].clientX,y:ad.touches[1].clientY},{x:touch.startX,y:touch.startY}); +if(Math.abs(touch.startSpan-ac)>touch.threshold){touch.handled=true;if(actouch.threshold&&Math.abs(Z)>Math.abs(Y)){touch.handled=true;x();}else{if(Z<-touch.threshold&&Math.abs(Z)>Math.abs(Y)){touch.handled=true;i();}else{if(Y>touch.threshold){touch.handled=true; +r();}else{if(Y<-touch.threshold){touch.handled=true;B();}}}}}}ad.preventDefault();}}function O(Y){touch.handled=false;}function m(Y){clearTimeout(mouseWheelTimeout); +mouseWheelTimeout=setTimeout(function(){var Z=Y.detail||-Y.wheelDelta;if(Z>0){u();}else{Q();}},100);}function t(Y){E();}function G(){if(M&&!("msPerspective" in document.body.style)){var Z=document.querySelectorAll(".reveal .slides section a:not(.image)"); +for(var aa=0,Y=Z.length;aa'+ab.innerHTML+"";}}}}function D(){d.wrapper.classList.add("overview");var Y=Array.prototype.slice.call(document.querySelectorAll(j)); +for(var ad=0,ab=Y.length;ad3?"none":"block"; +}ad[ac].classList.remove("past");ad[ac].classList.remove("present");ad[ac].classList.remove("future");if(acab){ad[ac].classList.add("future"); +}}if(Y.querySelector("section")){ad[ac].classList.add("stack");}}ad[ab].classList.add("present");var aa=ad[ab].getAttribute("data-state");if(aa){W=W.concat(aa.split(" ")); +}}else{ab=0;}return ab;}function b(ae,ai){v=C;var ab=W.concat();W.length=0;var ah=k,Z=c;k=X(j,ae===undefined?k:ae);c=X(a,ai===undefined?c:ai);stateLoop:for(var ac=0,af=W.length; +ac0,right:k0,down:c0||c>0){Y+=k;}if(c>0){Y+="/"+c;}window.location.hash=Y; +}}function o(Z,Y){var aa=document.createEvent("HTMLEvents",1,2);aa.initEvent(Z,true,true);q(aa,Y);d.wrapper.dispatchEvent(aa);}function s(){if(document.querySelector(a+".present")){var Z=document.querySelectorAll(a+".present .fragment:not(.visible)"); +if(Z.length){Z[0].classList.add("visible");o("fragmentshown",{fragment:Z[0]});return true;}}else{var Y=document.querySelectorAll(j+".present .fragment:not(.visible)"); +if(Y.length){Y[0].classList.add("visible");o("fragmentshown",{fragment:Y[0]});return true;}}return false;}function J(){if(document.querySelector(a+".present")){var Z=document.querySelectorAll(a+".present .fragment.visible"); +if(Z.length){Z[Z.length-1].classList.remove("visible");o("fragmenthidden",{fragment:Z[Z.length-1]});return true;}}else{var Y=document.querySelectorAll(j+".present .fragment.visible"); +if(Y.length){Y[Y.length-1].classList.remove("visible");o("fragmenthidden",{fragment:Y[Y.length-1]});return true;}}return false;}function H(){clearTimeout(autoSlideTimeout); +if(K.autoSlide){autoSlideTimeout=setTimeout(u,K.autoSlide);}}function I(Z,Y){b(Z,Y);}function x(){if(R()||J()===false){b(k-1,0);}}function i(){if(R()||s()===false){b(k+1,0); +}}function r(){if(R()||J()===false){b(k,c-1);}}function B(){if(R()||s()===false){b(k,c+1);}}function Q(){if(J()===false){if(f().up){r();}else{var Y=document.querySelector(".reveal .slides>section.past:nth-child("+k+")"); +if(Y){c=(Y.querySelectorAll("section").length+1)||0;k--;b();}}}}function u(){if(s()===false){f().down?B():i();}H();}function P(){if(R()){T();}else{D(); +}}return{initialize:h,navigateTo:I,navigateLeft:x,navigateRight:i,navigateUp:r,navigateDown:B,navigatePrev:Q,navigateNext:u,toggleOverview:P,addEventListeners:A,removeEventListeners:N,getIndices:function(){return{h:k,v:c}; +},getPreviousSlide:function(){return v;},getCurrentSlide:function(){return C;},getQueryHash:function(){var Y={};location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(Z){Y[Z.split("=").shift()]=Z.split("=").pop(); +});return Y;},addEventListener:function(Z,aa,Y){if("addEventListener" in window){(d.wrapper||document.querySelector(".reveal")).addEventListener(Z,aa,Y); +}},removeEventListener:function(Z,aa,Y){if("addEventListener" in window){(d.wrapper||document.querySelector(".reveal")).removeEventListener(Z,aa,Y);}}}; +})(); \ No newline at end of file