From 27f48f644039baddabf4de9a0f168779a81e0305 Mon Sep 17 00:00:00 2001 From: Hakim El Hattab Date: Wed, 25 Apr 2012 23:24:29 -0400 Subject: [PATCH] significantly smaller js file header, added minified js --- js/reveal.js | 43 +++++-------------------------------------- js/reveal.min.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 38 deletions(-) create mode 100644 js/reveal.min.js diff --git a/js/reveal.js b/js/reveal.js index 2aab0b1..f6de51d 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1,42 +1,9 @@ -/** +/*! + * reveal.js 1.3 + * http://lab.hakim.se/reveal-js + * MIT licensed + * * Copyright (C) 2011 Hakim El Hattab, http://hakim.se - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * ############################################################################# - * - * Reveal.js is an easy to use HTML based slideshow enhanced by - * sexy CSS 3D transforms. - * - * Slides are given unique hash based URL's so that they can be - * opened directly. - * - * Public facing methods: - * - Reveal.initialize( { ... options ... } ); - * - Reveal.navigateTo( indexh, indexv ); - * - Reveal.navigateLeft(); - * - Reveal.navigateRight(); - * - Reveal.navigateUp(); - * - Reveal.navigateDown(); - * - * @author Hakim El Hattab | http://hakim.se - * @version 1.3 */ var Reveal = (function(){ diff --git a/js/reveal.min.js b/js/reveal.min.js new file mode 100644 index 0000000..955891c --- /dev/null +++ b/js/reveal.min.js @@ -0,0 +1,48 @@ +/*! + * reveal.js 1.3 + * http://lab.hakim.se/reveal-js + * MIT licensed + * + * Copyright (C) 2011 Hakim El Hattab, http://hakim.se + */ +var Reveal=(function(){var i="#reveal .slides>section",a="#reveal .slides>section.present>section",j=0,c=0,E={controls:false,progress:false,history:false,transition:"default",theme:"default",mouseWheel:true,rollingLinks:true},K=[],d={},F=document.body.style.perspectiveProperty!==undefined||document.body.style.WebkitPerspective!==undefined||document.body.style.MozPerspective!==undefined||document.body.style.msPerspective!==undefined,k=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,t=0,w=0; +function g(M){if(!k&&!F){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");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"); +document.addEventListener("keydown",J,false);document.addEventListener("touchstart",u,false);window.addEventListener("hashchange",r,false);d.controlsLeft.addEventListener("click",m(v),false); +d.controlsRight.addEventListener("click",m(h),false);d.controlsUp.addEventListener("click",m(p),false);d.controlsDown.addEventListener("click",m(y),false); +o(E,M);if(F===false){E.transition="linear";}if(E.controls){d.controls.style.display="block";}if(E.progress){d.progress.style.display="block";}if(E.transition!=="default"){d.wrapper.classList.add(E.transition); +}if(E.theme!=="default"){d.wrapper.classList.add(E.theme);}if(E.mouseWheel){document.addEventListener("DOMMouseScroll",l,false);document.addEventListener("mousewheel",l,false); +}if(E.rollingLinks){B();}A();}function o(N,M){for(var O in M){N[O]=M[O];}}function m(M){return function(N){N.preventDefault();M.call();};}function J(M){if(M.target.contentEditable==="inherit"){if(M.keyCode>=33&&M.keyCode<=40){switch(M.keyCode){case 33:G(); +break;case 34:s();break;case 37:v();break;case 39:h();break;case 38:p();break;case 40:y();break;}M.preventDefault();}else{if(M.keyCode===32&&F){if(H()){I(); +}else{z();}M.preventDefault();}}}}function u(P){if(P.touches.length===1){if(P.target.tagName.toLowerCase()==="a"||P.target.tagName.toLowerCase()==="img"){return; +}P.preventDefault();var N={x:P.touches[0].clientX,y:P.touches[0].clientY};var M=window.innerWidth*0.3;var O=window.innerHeight*0.3;if(N.xwindow.innerWidth-M){h(); +}else{if(N.ywindow.innerHeight-O){y();}}}}b();}}function l(M){clearTimeout(t);t=setTimeout(function(){var N=M.detail||-M.wheelDelta; +if(N>0){s();}else{G();}},100);}function r(M){A();}function B(){if(F){var N=document.querySelectorAll("#reveal .slides section a:not(.image)");for(var O=0,M=N.length; +O'+P.innerHTML+""; +}}}}function z(){d.wrapper.classList.add("overview");var M=Array.prototype.slice.call(document.querySelectorAll(i));for(var R=0,P=M.length;R3?"none":"block"; +}R[Q].classList.remove("past");R[Q].classList.remove("present");R[Q].classList.remove("future");if(QP){R[Q].classList.add("future"); +}}if(M.querySelector("section")){R[Q].classList.add("stack");}}R[P].classList.add("present");var O=R[P].dataset.state;if(O){K=K.concat(O.split(" "));}}else{P=0; +}return P;}function b(){var Q=K.concat();K.length=0;j=L(i,j);c=L(a,c);stateLoop:for(var O=0,M=K.length;O0,right:j0,down:c0||c>0){M+=j; +}if(c>0){M+="/"+c;}window.location.hash=M;}}function q(){if(document.querySelector(a+".present")){var N=document.querySelectorAll(a+".present .fragment:not(.visible)"); +if(N.length){N[0].classList.add("visible");return true;}}else{var M=document.querySelectorAll(i+".present .fragment:not(.visible)");if(M.length){M[0].classList.add("visible"); +return true;}}return false;}function D(){if(document.querySelector(a+".present")){var N=document.querySelectorAll(a+".present .fragment.visible");if(N.length){N[N.length-1].classList.remove("visible"); +return true;}}else{var M=document.querySelectorAll(i+".present .fragment.visible");if(M.length){M[M.length-1].classList.remove("visible");return true;}}return false; +}function C(N,M){j=N===undefined?j:N;c=M===undefined?c:M;b();}function v(){if(H()||D()===false){j--;c=0;b();}}function h(){if(H()||q()===false){j++;c=0; +b();}}function p(){if(H()||D()===false){c--;b();}}function y(){if(H()||q()===false){c++;b();}}function G(){if(D()===false){if(e().up){p();}else{var M=document.querySelector("#reveal .slides>section.past:nth-child("+j+")"); +if(M){c=(M.querySelectorAll("section").length+1)||0;j--;b();}}}}function s(){if(q()===false){e().down?y():h();}}return{initialize:g,navigateTo:C,navigateLeft:v,navigateRight:h,navigateUp:p,navigateDown:y}; +})(); \ No newline at end of file