From: Hakim El Hattab Date: Mon, 15 Oct 2012 00:17:49 +0000 (-0400) Subject: merge full screen key binding (f) X-Git-Tag: 2.1.0~35 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e15beb47f0ca0e3db22d70b0b6a5d21d02f514ab;p=reveal.js.git merge full screen key binding (f) --- e15beb47f0ca0e3db22d70b0b6a5d21d02f514ab diff --cc js/reveal.js index 43e29f4,e95092e..3372029 --- a/js/reveal.js +++ b/js/reveal.js @@@ -740,6 -734,6 +742,26 @@@ var Reveal = (function() return dom.wrapper.classList.contains( 'overview' ); } ++ /** ++ * Handling the fullscreen functionality via the fullscreen API ++ * ++ * @see http://fullscreen.spec.whatwg.org/ ++ * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode ++ */ ++ function enterFullscreen() { ++ var element = document.body; ++ ++ // Check which implementation is available ++ var requestMethod = element.requestFullScreen || ++ element.webkitRequestFullScreen || ++ element.mozRequestFullScreen || ++ element.msRequestFullScreen; ++ ++ if( requestMethod ) { ++ requestMethod.apply( element ); ++ } ++ } ++ /** * Enters the paused mode which fades everything on screen to * black. @@@ -1209,7 -1194,25 +1231,7 @@@ // another timeout cueAutoSlide(); } - + - /** - * Handling the fullscreen functionality via the fullscreen API - * @see http://fullscreen.spec.whatwg.org/ - * @see https://developer.mozilla.org/en-US/docs/DOM/Using_fullscreen_mode - */ - function enterFullscreen() { - var element = document.body; - - // Check which implementation is available - var requestMethod = element.requestFullScreen || - element.webkitRequestFullScreen || - element.mozRequestFullScreen || - element.msRequestFullScreen; - if (requestMethod) { - requestMethod.apply(element); - } - } - // Expose some methods publicly return { initialize: initialize, diff --cc js/reveal.min.js index 14d3ab4,3338ba3..b4f4083 --- a/js/reveal.min.js +++ b/js/reveal.min.js @@@ -4,76 -4,4 +4,77 @@@ * MIT licensed * * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se - */var Reveal=function(){"use strict";function v(e){if(!l&&!f){document.body.setAttribute("class","no-transforms");return}x(n,e);m();g();y()}function m(){a.theme=document.querySelector("#theme");a.wrapper=document.querySelector(".reveal");if(!a.wrapper.querySelector(".progress")&&n.progress){var e=document.createElement("div");e.classList.add("progress");e.innerHTML="";a.wrapper.appendChild(e)}if(!a.wrapper.querySelector(".controls")&&n.controls){var t=document.createElement("aside");t.classList.add("controls");t.innerHTML='';a.wrapper.appendChild(t)}if(!a.wrapper.querySelector(".state-background")){var r=document.createElement("div");r.classList.add("state-background");a.wrapper.appendChild(r)}if(!a.wrapper.querySelector(".pause-overlay")){var i=document.createElement("div");i.classList.add("pause-overlay");a.wrapper.appendChild(i)}a.progress=document.querySelector(".reveal .progress");a.progressbar=document.querySelector(".reveal .progress span");if(n.controls){a.controls=document.querySelector(".reveal .controls");a.controlsLeft=document.querySelector(".reveal .controls .left");a.controlsRight=document.querySelector(".reveal .controls .right");a.controlsUp=document.querySelector(".reveal .controls .up");a.controlsDown=document.querySelector(".reveal .controls .down")}}function g(){if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow="scroll";document.body.style.height="120%";window.addEventListener("load",C,!1);window.addEventListener("orientationchange",C,!1)}}function y(){function o(){head.js.apply(null,t);b()}var e=[],t=[];for(var r=0,i=n.dependencies.length;rd.threshold){d.handled=!0;rd.threshold&&Math.abs(i)>Math.abs(s)){d.handled=!0;et()}else if(i<-d.threshold&&Math.abs(i)>Math.abs(s)){d.handled=!0;tt()}else if(s>d.threshold){d.handled=!0;nt()}else if(s<-d.threshold){d.handled=!0;rt()}}e.preventDefault()}else navigator.userAgent.match(/android/gi)&&e.preventDefault()}function M(e){d.handled=!1}function _(e){clearTimeout(c);c=setTimeout(function(){var t=e.detail||-e.wheelDelta;t>0?st():it()},100)}function D(e){J()}function P(e){if(I()){e.preventDefault();j();r=this.getAttribute("data-index-h");i=this.getAttribute("data-index-v");X()}}function H(){if(f&&!("msPerspective"in document.body.style)){var e=document.querySelectorAll(".reveal .slides section a:not(.image)");for(var t=0,n=e.length;t'+r.innerHTML+""}}}}function B(){if(n.overview){a.wrapper.classList.add("overview");var t=document.querySelectorAll(e);for(var s=0,o=t.length;s3?"none":"block"}r[s].classList.remove("past");r[s].classList.remove("present");r[s].classList.remove("future");st&&r[s].classList.add("future");o.querySelector("section")&&r[s].classList.add("stack")}r[t].classList.add("present");var f=r[t].getAttribute("data-state");f&&(u=u.concat(f.split(" ")))}else t=0;return t}function X(f,l){s=o;var c=u.concat();u.length=0;var h=r,d=i;r=W(e,f===undefined?r:f);i=W(t,l===undefined?i:l);e:for(var v=0,m=u.length;v0,right:r0,down:i0||i>0)e+=r;i>0&&(e+="/"+i);window.location.hash=e}}function Q(){if(document.querySelector(t+".present")){var n=document.querySelectorAll(t+".present .fragment:not(.visible)");if(n.length){n[0].classList.add("visible");k("fragmentshown",{fragment:n[0]});return!0}}else{var r=document.querySelectorAll(e+".present .fragment:not(.visible)");if(r.length){r[0].classList.add("visible");k("fragmentshown",{fragment:r[0]});return!0}}return!1}function G(){if(document.querySelector(t+".present")){var n=document.querySelectorAll(t+".present .fragment.visible");if(n.length){n[n.length-1].classList.remove("visible");k("fragmenthidden",{fragment:n[n.length-1]});return!0}}else{var r=document.querySelectorAll(e+".present .fragment.visible");if(r.length){r[r.length-1].classList.remove("visible");k("fragmenthidden",{fragment:r[r.length-1]});return!0}}return!1}function Y(){clearTimeout(h);n.autoSlide&&(h=setTimeout(st,n.autoSlide))}function Z(e,t){X(e,t)}function et(){(I()||G()===!1)&&X(r-1,0)}function tt(){(I()||Q()===!1)&&X(r+1,0)}function nt(){(I()||G()===!1)&&X(r,i-1)}function rt(){(I()||Q()===!1)&&X(r,i+1)}function it(){if(G()===!1)if($().up)nt();else{var e=document.querySelector(".reveal .slides>section.past:nth-child("+r+")");if(e){i=e.querySelectorAll("section").length+1||0;r--;X()}}}function st(){Q()===!1&&($().down?rt():tt());Y()}function ot(){var e=document.body,t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;t&&t.apply(e)}var e=".reveal .slides>section",t=".reveal .slides>section.present>section",n={controls:!0,progress:!0,history:!1,keyboard:!0,overview:!0,loop:!1,autoSlide:0,mouseWheel:!0,rollingLinks:!0,theme:null,transition:"default",dependencies:[]},r=0,i=0,s,o,u=[],a={},f="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,c=0,h=0,p=0,d={startX:0,startY:0,startSpan:0,startCount:0,handled:!1,threshold:40};return{initialize:v,navigateTo:Z,navigateLeft:et,navigateRight:tt,navigateUp:nt,navigateDown:rt,navigatePrev:it,navigateNext:st,toggleOverview:F,addEventListeners:E,removeEventListeners:S,getIndices:function(t){var n=r,s=i;if(t){var o=!!t.parentNode.nodeName.match(/section/gi),u=o?t.parentNode:t,a=Array.prototype.slice.call(document.querySelectorAll(e));n=Math.max(a.indexOf(u),0);o&&(s=Math.max(Array.prototype.slice.call(t.parentNode.children).indexOf(t),0))}return{h:n,v:s}},getPreviousSlide:function(){return s},getCurrentSlide:function(){return o},getQueryHash:function(){var e={};location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(t){e[t.split("=").shift()]=t.split("=").pop()});return e},addEventListener:function(e,t,n){"addEventListener"in window&&(a.wrapper||document.querySelector(".reveal")).addEventListener(e,t,n)},removeEventListener:function(e,t,n){"addEventListener"in window&&(a.wrapper||document.querySelector(".reveal")).removeEventListener(e,t,n)}}}(); + */ - var Reveal=(function(){var l=".reveal .slides>section",b=".reveal .slides>section.present>section",R={controls:true,progress:true,history:false,keyboard:true,overview:true,loop:false,autoSlide:0,mouseWheel:true,rollingLinks:true,theme:null,transition:"default",dependencies:[]},Y=R.autoSlide,m=0,e=0,y,G,ai=[],f={},T="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,n="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,z=0,k=0,D=0,ab={startX:0,startY:0,startSpan:0,startCount:0,handled:false,threshold:80}; - function i(aj){if((!n&&!T)){document.body.setAttribute("class","no-transforms");return;}t(R,aj);P();d();V();}function P(){f.theme=document.querySelector("#theme"); - f.wrapper=document.querySelector(".reveal");if(!f.wrapper.querySelector(".progress")&&R.progress){var am=document.createElement("div");am.classList.add("progress"); - am.innerHTML="";f.wrapper.appendChild(am);}if(!f.wrapper.querySelector(".controls")&&R.controls){var al=document.createElement("aside");al.classList.add("controls"); - al.innerHTML=''; - f.wrapper.appendChild(al);}if(!f.wrapper.querySelector(".state-background")){var ak=document.createElement("div");ak.classList.add("state-background"); - f.wrapper.appendChild(ak);}if(!f.wrapper.querySelector(".pause-overlay")){var aj=document.createElement("div");aj.classList.add("pause-overlay");f.wrapper.appendChild(aj); ++var Reveal=(function(){var l=".reveal .slides>section",b=".reveal .slides>section.present>section",R={controls:true,progress:true,history:false,keyboard:true,overview:true,loop:false,autoSlide:0,mouseWheel:true,rollingLinks:true,theme:null,transition:"default",dependencies:[]},Y=R.autoSlide,m=0,e=0,y,G,aj=[],f={},T="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,n="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,z=0,k=0,D=0,ac={startX:0,startY:0,startSpan:0,startCount:0,handled:false,threshold:80}; ++function i(ak){if((!n&&!T)){document.body.setAttribute("class","no-transforms");return;}t(R,ak);P();d();V();}function P(){f.theme=document.querySelector("#theme"); ++f.wrapper=document.querySelector(".reveal");if(!f.wrapper.querySelector(".progress")&&R.progress){var an=document.createElement("div");an.classList.add("progress"); ++an.innerHTML="";f.wrapper.appendChild(an);}if(!f.wrapper.querySelector(".controls")&&R.controls){var am=document.createElement("aside");am.classList.add("controls"); ++am.innerHTML=''; ++f.wrapper.appendChild(am);}if(!f.wrapper.querySelector(".state-background")){var al=document.createElement("div");al.classList.add("state-background"); ++f.wrapper.appendChild(al);}if(!f.wrapper.querySelector(".pause-overlay")){var ak=document.createElement("div");ak.classList.add("pause-overlay");f.wrapper.appendChild(ak); +}f.progress=document.querySelector(".reveal .progress");f.progressbar=document.querySelector(".reveal .progress span");if(R.controls){f.controls=document.querySelector(".reveal .controls"); +f.controlsLeft=document.querySelector(".reveal .controls .left");f.controlsRight=document.querySelector(".reveal .controls .right");f.controlsUp=document.querySelector(".reveal .controls .up"); +f.controlsDown=document.querySelector(".reveal .controls .down");}}function d(){if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow="scroll"; - document.body.style.height="120%";window.addEventListener("load",ac,false);window.addEventListener("orientationchange",ac,false);}}function V(){var ak=[],ao=[]; - for(var al=0,aj=R.dependencies.length;alab.threshold){ab.handled=true;if(anab.threshold&&Math.abs(ak)>Math.abs(aj)){ab.handled=true;B();}else{if(ak<-ab.threshold&&Math.abs(ak)>Math.abs(aj)){ab.handled=true;j();}else{if(aj>ab.threshold){ab.handled=true; - u();}else{if(aj<-ab.threshold){ab.handled=true;F();}}}}ao.preventDefault();}}}else{if(navigator.userAgent.match(/android/gi)){ao.preventDefault();}}}function W(aj){ab.handled=false; - }function p(aj){clearTimeout(z);z=setTimeout(function(){var ak=aj.detail||-aj.wheelDelta;if(ak>0){x();}else{Z();}},100);}function w(aj){J();}function C(aj){if(L()){aj.preventDefault(); - ad();m=this.getAttribute("data-index-h");e=this.getAttribute("data-index-v");a();}}function M(){if(T&&!("msPerspective" in document.body.style)){var ak=document.querySelectorAll(".reveal .slides section a:not(.image)"); - for(var al=0,aj=ak.length;al'+am.innerHTML+"";}}}}function I(){if(R.overview){f.wrapper.classList.add("overview");var aj=document.querySelectorAll(l); - for(var ao=0,am=aj.length;ao3?"none":"block";}ak[ao].classList.remove("past"); - ak[ao].classList.remove("present");ak[ao].classList.remove("future");if(aoar){ak[ao].classList.add("future"); - }}if(ap.querySelector("section")){ak[ao].classList.add("stack");}}ak[ar].classList.add("present");var al=ak[ar].getAttribute("data-state");if(al){ai=ai.concat(al.split(" ")); - }var an=ak[ar].getAttribute("data-autoslide");if(an){Y=parseInt(an);}else{Y=R.autoSlide;}}else{ar=0;}return ar;}function a(ap,au){y=G;var am=ai.concat(); - ai.length=0;var at=m,ak=e;m=ah(l,ap===undefined?m:ap);e=ah(b,au===undefined?e:au);stateLoop:for(var an=0,aq=ai.length;anac.threshold){ac.handled=true;if(aoac.threshold&&Math.abs(al)>Math.abs(ak)){ac.handled=true;B();}else{if(al<-ac.threshold&&Math.abs(al)>Math.abs(ak)){ac.handled=true;j();}else{if(ak>ac.threshold){ac.handled=true; ++u();}else{if(ak<-ac.threshold){ac.handled=true;F();}}}}ap.preventDefault();}}}else{if(navigator.userAgent.match(/android/gi)){ap.preventDefault();}}}function W(ak){ac.handled=false; ++}function p(ak){clearTimeout(z);z=setTimeout(function(){var al=ak.detail||-ak.wheelDelta;if(al>0){x();}else{Z();}},100);}function w(ak){J();}function C(ak){if(L()){ak.preventDefault(); ++ae();m=this.getAttribute("data-index-h");e=this.getAttribute("data-index-v");a();}}function M(){if(T&&!("msPerspective" in document.body.style)){var al=document.querySelectorAll(".reveal .slides section a:not(.image)"); ++for(var am=0,ak=al.length;am'+an.innerHTML+"";}}}}function I(){if(R.overview){f.wrapper.classList.add("overview");var ak=document.querySelectorAll(l); ++for(var ap=0,an=ak.length;ap3?"none":"block";}al[ap].classList.remove("past"); ++al[ap].classList.remove("present");al[ap].classList.remove("future");if(apat){al[ap].classList.add("future"); ++}}if(aq.querySelector("section")){al[ap].classList.add("stack");}}al[at].classList.add("present");var am=al[at].getAttribute("data-state");if(am){aj=aj.concat(am.split(" ")); ++}var ao=al[at].getAttribute("data-autoslide");if(ao){Y=parseInt(ao);}else{Y=R.autoSlide;}}else{at=0;}return at;}function a(aq,av){y=G;var an=aj.concat(); ++aj.length=0;var au=m,al=e;m=ai(l,aq===undefined?m:aq);e=ai(b,av===undefined?e:av);stateLoop:for(var ao=0,ar=aj.length;ao0,right:m0,down:e0||e>0){aj+=m;}if(e>0){aj+="/"+e;}window.location.hash=aj;}}function v(){if(document.querySelector(b+".present")){var ak=document.querySelectorAll(b+".present .fragment:not(.visible)"); - if(ak.length){ak[0].classList.add("visible");r("fragmentshown",{fragment:ak[0]});return true;}}else{var aj=document.querySelectorAll(l+".present .fragment:not(.visible)"); - if(aj.length){aj[0].classList.add("visible");r("fragmentshown",{fragment:aj[0]});return true;}}return false;}function Q(){if(document.querySelector(b+".present")){var ak=document.querySelectorAll(b+".present .fragment.visible"); - if(ak.length){ak[ak.length-1].classList.remove("visible");r("fragmenthidden",{fragment:ak[ak.length-1]});return true;}}else{var aj=document.querySelectorAll(l+".present .fragment.visible"); - if(aj.length){aj[aj.length-1].classList.remove("visible");r("fragmenthidden",{fragment:aj[aj.length-1]});return true;}}return false;}function N(){clearTimeout(k); - if(Y){k=setTimeout(x,Y);}}function O(ak,aj){a(ak,aj);}function B(){if(L()||Q()===false){a(m-1,0);}}function j(){if(L()||v()===false){a(m+1,0);}}function u(){if(L()||Q()===false){a(m,e-1); - }}function F(){if(L()||v()===false){a(m,e+1);}}function Z(){if(Q()===false){if(g().up){u();}else{var aj=document.querySelector(".reveal .slides>section.past:nth-child("+m+")"); - if(aj){e=(aj.querySelectorAll("section").length+1)||0;m--;a();}}}}function x(){if(v()===false){g().down?F():j();}N();}return{initialize:i,navigateTo:O,navigateLeft:B,navigateRight:j,navigateUp:u,navigateDown:F,navigatePrev:Z,navigateNext:x,toggleOverview:X,addEventListeners:E,removeEventListeners:U,getIndices:function(aj){var an=m,al=e; - if(aj){var ao=!!aj.parentNode.nodeName.match(/section/gi);var am=ao?aj.parentNode:aj;var ak=Array.prototype.slice.call(document.querySelectorAll(l));an=Math.max(ak.indexOf(am),0); - if(ao){al=Math.max(Array.prototype.slice.call(aj.parentNode.children).indexOf(aj),0);}}return{h:an,v:al};},getPreviousSlide:function(){return y;},getCurrentSlide:function(){return G; - },getQueryHash:function(){var aj={};location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(ak){aj[ak.split("=").shift()]=ak.split("=").pop();});return aj; - },addEventListener:function(ak,al,aj){if("addEventListener" in window){(f.wrapper||document.querySelector(".reveal")).addEventListener(ak,al,aj);}},removeEventListener:function(ak,al,aj){if("addEventListener" in window){(f.wrapper||document.querySelector(".reveal")).removeEventListener(ak,al,aj); ++D=setTimeout(h,1500);var ak=document.querySelectorAll(l);var at=ak[m],ap=at.querySelectorAll("section");G=ap[e]||at;if(m!==au||e!==al){r("slidechanged",{indexh:m,indexv:e,previousSlide:y,currentSlide:G}); ++}else{y=null;}if(y){y.classList.remove("present");}}function s(){if(!R.controls||!f.controls){return;}var ak=g();[f.controlsLeft,f.controlsRight,f.controlsUp,f.controlsDown].forEach(function(al){al.classList.remove("enabled"); ++});if(ak.left){f.controlsLeft.classList.add("enabled");}if(ak.right){f.controlsRight.classList.add("enabled");}if(ak.up){f.controlsUp.classList.add("enabled"); ++}if(ak.down){f.controlsDown.classList.add("enabled");}}function g(){var ak=document.querySelectorAll(l),al=document.querySelectorAll(b);return{left:m>0,right:m0,down:e0||e>0){ak+=m;}if(e>0){ak+="/"+e;}window.location.hash=ak;}}function v(){if(document.querySelector(b+".present")){var al=document.querySelectorAll(b+".present .fragment:not(.visible)"); ++if(al.length){al[0].classList.add("visible");r("fragmentshown",{fragment:al[0]});return true;}}else{var ak=document.querySelectorAll(l+".present .fragment:not(.visible)"); ++if(ak.length){ak[0].classList.add("visible");r("fragmentshown",{fragment:ak[0]});return true;}}return false;}function Q(){if(document.querySelector(b+".present")){var al=document.querySelectorAll(b+".present .fragment.visible"); ++if(al.length){al[al.length-1].classList.remove("visible");r("fragmenthidden",{fragment:al[al.length-1]});return true;}}else{var ak=document.querySelectorAll(l+".present .fragment.visible"); ++if(ak.length){ak[ak.length-1].classList.remove("visible");r("fragmenthidden",{fragment:ak[ak.length-1]});return true;}}return false;}function N(){clearTimeout(k); ++if(Y){k=setTimeout(x,Y);}}function O(al,ak){a(al,ak);}function B(){if(L()||Q()===false){a(m-1,0);}}function j(){if(L()||v()===false){a(m+1,0);}}function u(){if(L()||Q()===false){a(m,e-1); ++}}function F(){if(L()||v()===false){a(m,e+1);}}function Z(){if(Q()===false){if(g().up){u();}else{var ak=document.querySelector(".reveal .slides>section.past:nth-child("+m+")"); ++if(ak){e=(ak.querySelectorAll("section").length+1)||0;m--;a();}}}}function x(){if(v()===false){g().down?F():j();}N();}return{initialize:i,navigateTo:O,navigateLeft:B,navigateRight:j,navigateUp:u,navigateDown:F,navigatePrev:Z,navigateNext:x,toggleOverview:X,addEventListeners:E,removeEventListeners:U,getIndices:function(ak){var ao=m,am=e; ++if(ak){var ap=!!ak.parentNode.nodeName.match(/section/gi);var an=ap?ak.parentNode:ak;var al=Array.prototype.slice.call(document.querySelectorAll(l));ao=Math.max(al.indexOf(an),0); ++if(ap){am=Math.max(Array.prototype.slice.call(ak.parentNode.children).indexOf(ak),0);}}return{h:ao,v:am};},getPreviousSlide:function(){return y;},getCurrentSlide:function(){return G; ++},getQueryHash:function(){var ak={};location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(al){ak[al.split("=").shift()]=al.split("=").pop();});return ak; ++},addEventListener:function(al,am,ak){if("addEventListener" in window){(f.wrapper||document.querySelector(".reveal")).addEventListener(al,am,ak);}},removeEventListener:function(al,am,ak){if("addEventListener" in window){(f.wrapper||document.querySelector(".reveal")).removeEventListener(al,am,ak); +}}};})();