diff --git a/README.md b/README.md index 6b7dffc5..f9acc25d 100644 --- a/README.md +++ b/README.md @@ -344,6 +344,17 @@ Reveal.toggleOverview(); ### Fullscreen mode Just press »F« on your keyboard to show your presentation in fullscreen mode. Press the »ESC« key to exit fullscreen mode. +## Multiplexing + +The multiplex plugin allows your audience to view the slides on their own phone, tablet or laptop. As the master navigates the slides, all clients will update in real time. See a demo at [http://revealjs.jit.su/](http://revealjs.jit.su) + +Configuration is via the multiplex object in index.html. To generate unique secret and token values, visit [revealjs.jit.su/token](revealjs.jit.su/token) + +multiplex.secret should only be configured on those pages you wish to be able to control slide navigatoin for all clients. Multi-master configurations work, but if you don't wish your audience to be able to control your slides, set the secret to null. In this master/slave setup, you should create a publicly accessible page with secret set to null, and a protected page containing your secret. + +You are very welcome to use the server running at reveal.jit.su, however availability and stability are not guaranteed. For anything mission critical I recommend you run your own server. It is simple to deploy to nodejitsu or run on your own environment. + +### Known Issues ## PDF Export diff --git a/index.html b/index.html index bc2f3601..9c25caa6 100644 --- a/index.html +++ b/index.html @@ -358,6 +358,14 @@ function linkify( selector ) { theme: Reveal.getQueryHash().theme, // available themes are in /css/theme transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/fade/none + globals: { + // Generate a unique id and secret at http://revealjs.jit.su/token + multiplex: { + id: '7d10234555b923e2', + secret: '13627859051503309760', + url: 'revealjs.jit.su:80' + } + }, // Optional libraries used to extend on reveal.js dependencies: [ @@ -366,8 +374,11 @@ function linkify( selector ) { { src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } }, { src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } }, { src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }, + // { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } }, + // { src: 'socket.io/socket.io.js', async: true, condition: function() { return !!document.body.classList; } }, + // { src: 'plugin/multiplex/client.js', async: true, condition: function() { return !!document.body.classList; } }, + // { src: 'plugin/multiplex/master.js', async: true, condition: function() { return !!document.body.classList; } }, { src: 'plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } } - // { src: 'plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } } ] }); diff --git a/js/reveal.js b/js/reveal.js index 4b56ed1a..b767594a 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -160,6 +160,9 @@ var Reveal = (function(){ // Copy options over to our config object extend( config, options ); + // Push up globals + window.globals = config.globals; + // Hide the address bar in mobile browsers hideAddressBar(); @@ -1019,8 +1022,9 @@ var Reveal = (function(){ * @param {int} v Vertical index of the target slide * @param {int} f Optional index of a fragment within the * target slide to activate + * @param {int} o Optional origin for use in multimaster environments */ - function slide( h, v, f ) { + function slide( h, v, f, o ) { // Remember where we were at before previousSlide = currentSlide; @@ -1115,7 +1119,8 @@ var Reveal = (function(){ 'indexh': indexh, 'indexv': indexv, 'previousSlide': previousSlide, - 'currentSlide': currentSlide + 'currentSlide': currentSlide, + 'origin': o } ); } else { diff --git a/js/reveal.min.js b/js/reveal.min.js index b06364c9..9ca8c72c 100644 --- a/js/reveal.min.js +++ b/js/reveal.min.js @@ -1,8 +1,8 @@ /*! - * reveal.js 2.3.0 (2013-03-05, 09:48) + * reveal.js 2.3.0 (2013-03-08, 18:36) * http://lab.hakim.se/reveal-js * MIT licensed * * Copyright (C) 2013 Hakim El Hattab, http://hakim.se */ -var Reveal=function(){"use strict";function e(e){return At||St?(window.addEventListener("load",h,!1),c(ht,e),n(),r(),void 0):(document.body.setAttribute("class","no-transforms"),void 0)}function t(){if(Et.theme=document.querySelector("#theme"),Et.wrapper=document.querySelector(".reveal"),Et.slides=document.querySelector(".reveal .slides"),!Et.wrapper.querySelector(".progress")&&ht.progress){var e=document.createElement("div");e.classList.add("progress"),e.innerHTML="",Et.wrapper.appendChild(e)}if(!Et.wrapper.querySelector(".controls")&&ht.controls){var t=document.createElement("aside");t.classList.add("controls"),t.innerHTML='
',Et.wrapper.appendChild(t)}if(!Et.wrapper.querySelector(".state-background")){var n=document.createElement("div");n.classList.add("state-background"),Et.wrapper.appendChild(n)}if(!Et.wrapper.querySelector(".pause-overlay")){var r=document.createElement("div");r.classList.add("pause-overlay"),Et.wrapper.appendChild(r)}Et.progress=document.querySelector(".reveal .progress"),Et.progressbar=document.querySelector(".reveal .progress span"),ht.controls&&(Et.controls=document.querySelector(".reveal .controls"),Et.controlsLeft=l(document.querySelectorAll(".navigate-left")),Et.controlsRight=l(document.querySelectorAll(".navigate-right")),Et.controlsUp=l(document.querySelectorAll(".navigate-up")),Et.controlsDown=l(document.querySelectorAll(".navigate-down")),Et.controlsPrev=l(document.querySelectorAll(".navigate-prev")),Et.controlsNext=l(document.querySelectorAll(".navigate-next")))}function n(){/iphone|ipod|android/gi.test(navigator.userAgent)&&!/crios/gi.test(navigator.userAgent)&&(window.addEventListener("load",u,!1),window.addEventListener("orientationchange",u,!1))}function r(){function e(){n.length&&head.js.apply(null,n),o()}for(var t=[],n=[],r=0,s=ht.dependencies.length;s>r;r++){var a=ht.dependencies[r];(!a.condition||a.condition())&&(a.async?n.push(a.src):t.push(a.src),"function"==typeof a.callback&&head.ready(a.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],a.callback))}t.length?(head.ready(e),head.js.apply(null,t)):e()}function o(){t(),a(),s(),O(),setTimeout(function(){v("ready",{indexh:gt,indexv:wt,currentSlide:ut})},1)}function s(e){if(Et.wrapper.classList.remove(ht.transition),"object"==typeof e&&c(ht,e),St===!1&&(ht.transition="linear"),Et.wrapper.classList.add(ht.transition),Et.controls&&(Et.controls.style.display=ht.controls&&Et.controls?"block":"none"),Et.progress&&(Et.progress.style.display=ht.progress&&Et.progress?"block":"none"),ht.rtl?Et.wrapper.classList.add("rtl"):Et.wrapper.classList.remove("rtl"),ht.center?Et.wrapper.classList.add("center"):Et.wrapper.classList.remove("center"),ht.mouseWheel?(document.addEventListener("DOMMouseScroll",J,!1),document.addEventListener("mousewheel",J,!1)):(document.removeEventListener("DOMMouseScroll",J,!1),document.removeEventListener("mousewheel",J,!1)),ht.rollingLinks?f():p(),ht.theme&&Et.theme){var t=Et.theme.getAttribute("href"),n=/[^\/]*?(?=\.css)/,r=t.match(n)[0];ht.theme!==r&&(t=t.replace(n,ht.theme),Et.theme.setAttribute("href",t))}h(),yt=ht.autoSlide,I()}function a(){Pt=!0,window.addEventListener("hashchange",it,!1),window.addEventListener("resize",ct,!1),ht.touch&&(Et.wrapper.addEventListener("touchstart",$,!1),Et.wrapper.addEventListener("touchmove",Z,!1),Et.wrapper.addEventListener("touchend",Q,!1),window.navigator.msPointerEnabled&&(Et.wrapper.addEventListener("MSPointerDown",V,!1),Et.wrapper.addEventListener("MSPointerMove",B,!1),Et.wrapper.addEventListener("MSPointerUp",G,!1))),ht.keyboard&&document.addEventListener("keydown",K,!1),ht.progress&&Et.progress&&Et.progress.addEventListener("click",et,!1),ht.controls&&Et.controls&&["touchstart","click"].forEach(function(e){Et.controlsLeft.forEach(function(t){t.addEventListener(e,tt,!1)}),Et.controlsRight.forEach(function(t){t.addEventListener(e,nt,!1)}),Et.controlsUp.forEach(function(t){t.addEventListener(e,rt,!1)}),Et.controlsDown.forEach(function(t){t.addEventListener(e,ot,!1)}),Et.controlsPrev.forEach(function(t){t.addEventListener(e,st,!1)}),Et.controlsNext.forEach(function(t){t.addEventListener(e,at,!1)})})}function i(){Pt=!1,document.removeEventListener("keydown",K,!1),window.removeEventListener("hashchange",it,!1),window.removeEventListener("resize",ct,!1),ht.touch&&(Et.wrapper.removeEventListener("touchstart",$,!1),Et.wrapper.removeEventListener("touchmove",Z,!1),Et.wrapper.removeEventListener("touchend",Q,!1),window.navigator.msPointerEnabled&&(Et.wrapper.removeEventListener("MSPointerDown",V,!1),Et.wrapper.removeEventListener("MSPointerMove",B,!1),Et.wrapper.removeEventListener("MSPointerUp",G,!1))),ht.progress&&Et.progress&&Et.progress.removeEventListener("click",et,!1),ht.controls&&Et.controls&&["touchstart","click"].forEach(function(e){Et.controlsLeft.forEach(function(t){t.removeEventListener(e,tt,!1)}),Et.controlsRight.forEach(function(t){t.removeEventListener(e,nt,!1)}),Et.controlsUp.forEach(function(t){t.removeEventListener(e,rt,!1)}),Et.controlsDown.forEach(function(t){t.removeEventListener(e,ot,!1)}),Et.controlsPrev.forEach(function(t){t.removeEventListener(e,st,!1)}),Et.controlsNext.forEach(function(t){t.removeEventListener(e,at,!1)})})}function c(e,t){for(var n in t)e[n]=t[n]}function l(e){return Array.prototype.slice.call(e)}function d(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function u(){0===window.orientation?(document.documentElement.style.overflow="scroll",document.body.style.height="120%"):(document.documentElement.style.overflow="",document.body.style.height="100%"),setTimeout(function(){window.scrollTo(0,1)},10)}function v(e,t){var n=document.createEvent("HTMLEvents",1,2);n.initEvent(e,!0,!0),c(n,t),Et.wrapper.dispatchEvent(n)}function f(){if(St&&!("msPerspective"in document.body.style))for(var e=document.querySelectorAll(vt+" a:not(.image)"),t=0,n=e.length;n>t;t++){var r=e[t];if(!(!r.textContent||r.querySelector("*")||r.className&&r.classList.contains(r,"roll"))){var o=document.createElement("span");o.setAttribute("data-title",r.text),o.innerHTML=r.innerHTML,r.classList.add("roll"),r.innerHTML="",r.appendChild(o)}}}function p(){for(var e=document.querySelectorAll(vt+" a.roll"),t=0,n=e.length;n>t;t++){var r=e[t],o=r.querySelector("span");o&&(r.classList.remove("roll"),r.innerHTML=o.innerHTML)}}function m(e){var t=l(e);return t.forEach(function(e,t){e.hasAttribute("data-fragment-index")||e.setAttribute("data-fragment-index",t)}),t.sort(function(e,t){return e.getAttribute("data-fragment-index")-t.getAttribute("data-fragment-index")}),t}function h(){if(Et.wrapper){var e=Et.wrapper.offsetWidth,t=Et.wrapper.offsetHeight;e-=t*ht.margin,t-=t*ht.margin;var n=ht.width,r=ht.height;if("string"==typeof n&&/%$/.test(n)&&(n=parseInt(n,10)/100*e),"string"==typeof r&&/%$/.test(r)&&(r=parseInt(r,10)/100*t),Et.slides.style.width=n+"px",Et.slides.style.height=r+"px",bt=Math.min(e/n,t/r),bt=Math.max(bt,ht.minScale),bt=Math.min(bt,ht.maxScale),void 0===Et.slides.style.zoom||navigator.userAgent.match(/(iphone|ipod|ipad|android)/gi)){var o="translate(-50%, -50%) scale("+bt+") translate(50%, 50%)";Et.slides.style.WebkitTransform=o,Et.slides.style.MozTransform=o,Et.slides.style.msTransform=o,Et.slides.style.OTransform=o,Et.slides.style.transform=o}else Et.slides.style.zoom=bt;for(var s=l(document.querySelectorAll(vt)),a=0,i=s.length;i>a;a++){var c=s[a];"none"!==c.style.display&&(c.style.top=ht.center?c.classList.contains("stack")?0:Math.max(-(c.offsetHeight/2)-20,-r/2)+"px":"")}}}function y(e,t){"object"==typeof e&&"function"==typeof e.setAttribute&&e.setAttribute("data-previous-indexv",t||0)}function g(e){return"object"==typeof e&&"function"==typeof e.setAttribute&&e.classList.contains("stack")?parseInt(e.getAttribute("data-previous-indexv")||0,10):0}function w(){if(ht.overview){R();var e=Et.wrapper.classList.contains("overview");Et.wrapper.classList.add("overview"),Et.wrapper.classList.remove("exit-overview"),clearTimeout(xt),clearTimeout(Mt),xt=setTimeout(function(){for(var t=document.querySelectorAll(ft),n=0,r=t.length;r>n;n++){var o=t[n],s="translateZ(-2500px) translate("+105*(n-gt)+"%, 0%)";if(o.setAttribute("data-index-h",n),o.style.display="block",o.style.WebkitTransform=s,o.style.MozTransform=s,o.style.msTransform=s,o.style.OTransform=s,o.style.transform=s,o.classList.contains("stack"))for(var a=o.querySelectorAll("section"),i=0,c=a.length;c>i;i++){var l=n===gt?wt:g(o),d=a[i],u="translate(0%, "+105*(i-l)+"%)";d.setAttribute("data-index-h",n),d.setAttribute("data-index-v",i),d.style.display="block",d.style.WebkitTransform=u,d.style.MozTransform=u,d.style.msTransform=u,d.style.OTransform=u,d.style.transform=u,d.addEventListener("click",lt,!0)}else o.addEventListener("click",lt,!0)}h(),e||v("overviewshown",{indexh:gt,indexv:wt,currentSlide:ut})},10)}}function L(){if(ht.overview){clearTimeout(xt),clearTimeout(Mt),Et.wrapper.classList.remove("overview"),Et.wrapper.classList.add("exit-overview"),Mt=setTimeout(function(){Et.wrapper.classList.remove("exit-overview")},10);for(var e=l(document.querySelectorAll(vt)),t=0,n=e.length;n>t;t++){var r=e[t];r.style.display="",r.style.WebkitTransform="",r.style.MozTransform="",r.style.msTransform="",r.style.OTransform="",r.style.transform="",r.removeEventListener("click",lt,!0)}x(gt,wt),I(),v("overviewhidden",{indexh:gt,indexv:wt,currentSlide:ut})}}function b(e){"boolean"==typeof e?e?w():L():E()?L():w()}function E(){return Et.wrapper.classList.contains("overview")}function S(){var e=document.body,t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;t&&t.apply(e)}function A(){var e=Et.wrapper.classList.contains("paused");R(),Et.wrapper.classList.add("paused"),e===!1&&v("paused")}function q(){var e=Et.wrapper.classList.contains("paused");I(),Et.wrapper.classList.remove("paused"),e&&v("resumed")}function T(){k()?q():A()}function k(){return Et.wrapper.classList.contains("paused")}function x(e,t,n){dt=ut;var r=document.querySelectorAll(ft);void 0===t&&(t=g(r[e])),dt&&dt.parentNode&&dt.parentNode.classList.contains("stack")&&y(dt.parentNode,wt);var o=Lt.concat();Lt.length=0;var s=gt,a=wt;gt=M(ft,void 0===e?gt:e),wt=M(pt,void 0===t?wt:t),h();e:for(var i=0,c=Lt.length;c>i;i++){for(var d=0;o.length>d;d++)if(o[d]===Lt[i]){o.splice(d,1);continue e}document.documentElement.classList.add(Lt[i]),v(Lt[i])}for(;o.length;)document.documentElement.classList.remove(o.pop());E()&&w(),Y(1500);var u=r[gt],f=u.querySelectorAll("section");if(ut=f[wt]||u,n!==void 0){var p=m(ut.querySelectorAll(".fragment"));l(p).forEach(function(e,t){n>t?e.classList.add("visible"):e.classList.remove("visible")})}gt!==s||wt!==a?v("slidechanged",{indexh:gt,indexv:wt,previousSlide:dt,currentSlide:ut}):dt=null,dt&&(dt.classList.remove("present"),document.querySelector(mt).classList.contains("present")&&setTimeout(function(){var e,t=l(document.querySelectorAll(ft+".stack"));for(e in t)t[e]&&y(t[e],0)},0)),D(),P()}function M(e,t){var n=l(document.querySelectorAll(e)),r=n.length;if(r){ht.loop&&(t%=r,0>t&&(t=r+t)),t=Math.max(Math.min(t,r-1),0);for(var o=0;r>o;o++){var s=n[o];if(E()===!1){var a=Math.abs((t-o)%(r-3))||0;s.style.display=a>3?"none":"block"}n[o].classList.remove("past"),n[o].classList.remove("present"),n[o].classList.remove("future"),t>o?n[o].classList.add("past"):o>t&&n[o].classList.add("future"),s.querySelector("section")&&n[o].classList.add("stack")}n[t].classList.add("present");var i=n[t].getAttribute("data-state");i&&(Lt=Lt.concat(i.split(" ")));var c=n[t].getAttribute("data-autoslide");yt=c?parseInt(c,10):ht.autoSlide}else t=0;return t}function P(){if(ht.progress&&Et.progress){var e=l(document.querySelectorAll(ft)),t=document.querySelectorAll(vt+":not(.stack)").length,n=0;e:for(var r=0;e.length>r;r++){for(var o=e[r],s=l(o.querySelectorAll("section")),a=0;s.length>a;a++){if(s[a].classList.contains("present"))break e;n++}if(o.classList.contains("present"))break;o.classList.contains("stack")===!1&&n++}Et.progressbar.style.width=n/(t-1)*window.innerWidth+"px"}}function D(){if(ht.controls&&Et.controls){var e=N();Et.controlsLeft.concat(Et.controlsRight).concat(Et.controlsUp).concat(Et.controlsDown).concat(Et.controlsPrev).concat(Et.controlsNext).forEach(function(e){e.classList.remove("enabled")}),e.left&&Et.controlsLeft.forEach(function(e){e.classList.add("enabled")}),e.right&&Et.controlsRight.forEach(function(e){e.classList.add("enabled")}),e.up&&Et.controlsUp.forEach(function(e){e.classList.add("enabled")}),e.down&&Et.controlsDown.forEach(function(e){e.classList.add("enabled")}),(e.left||e.up)&&Et.controlsPrev.forEach(function(e){e.classList.add("enabled")}),(e.right||e.down)&&Et.controlsNext.forEach(function(e){e.classList.add("enabled")})}}function N(){var e=document.querySelectorAll(ft),t=document.querySelectorAll(pt);return{left:gt>0||ht.loop,right:e.length-1>gt||ht.loop,up:wt>0,down:t.length-1>wt}}function O(){var e=window.location.hash,t=e.slice(2).split("/"),n=e.replace(/#|\//gi,"");if(isNaN(parseInt(t[0],10))&&n.length){var r=document.querySelector("#"+n);if(r){var o=Reveal.getIndices(r);x(o.h,o.v)}else x(gt,wt)}else{var s=parseInt(t[0],10)||0,a=parseInt(t[1],10)||0;x(s,a)}}function Y(e){if(ht.history)if(clearTimeout(kt),"number"==typeof e)kt=setTimeout(Y,e);else{var t="/";ut&&"string"==typeof ut.getAttribute("id")?t="/"+ut.getAttribute("id"):((gt>0||wt>0)&&(t+=gt),wt>0&&(t+="/"+wt)),window.location.hash=t}}function C(e){var t=gt,n=wt;if(e){var r=!!e.parentNode.nodeName.match(/section/gi),o=r?e.parentNode:e,s=l(document.querySelectorAll(ft));t=Math.max(s.indexOf(o),0),r&&(n=Math.max(l(e.parentNode.querySelectorAll("section")).indexOf(e),0))}return{h:t,v:n}}function X(){if(document.querySelector(pt+".present")){var e=m(document.querySelectorAll(pt+".present .fragment:not(.visible)"));if(e.length)return e[0].classList.add("visible"),v("fragmentshown",{fragment:e[0]}),!0}else{var t=m(document.querySelectorAll(ft+".present .fragment:not(.visible)"));if(t.length)return t[0].classList.add("visible"),v("fragmentshown",{fragment:t[0]}),!0}return!1}function H(){if(document.querySelector(pt+".present")){var e=m(document.querySelectorAll(pt+".present .fragment.visible"));if(e.length)return e[e.length-1].classList.remove("visible"),v("fragmenthidden",{fragment:e[e.length-1]}),!0}else{var t=m(document.querySelectorAll(ft+".present .fragment.visible"));if(t.length)return t[t.length-1].classList.remove("visible"),v("fragmenthidden",{fragment:t[t.length-1]}),!0}return!1}function I(){clearTimeout(Tt),!yt||k()||E()||(Tt=setTimeout(j,yt))}function R(){clearTimeout(Tt)}function z(){N().left&&(E()||H()===!1)&&x(gt-1)}function U(){N().right&&(E()||X()===!1)&&x(gt+1)}function W(){(N().up&&E()||H()===!1)&&x(gt,wt-1)}function _(){(N().down&&E()||X()===!1)&&x(gt,wt+1)}function F(){if(H()===!1)if(N().up)W();else{var e=document.querySelector(ft+".past:nth-child("+gt+")");e&&(wt=e.querySelectorAll("section").length+1||void 0,gt--,x())}}function j(){X()===!1&&(N().down?_():U()),I()}function K(e){document.activeElement;var t=!(!document.activeElement||!document.activeElement.type&&!document.activeElement.href&&"inherit"===document.activeElement.contentEditable);if(!(t||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)){var n=!0;if(k()&&-1===[66,190,191].indexOf(e.keyCode))return!1;switch(e.keyCode){case 80:case 33:F();break;case 78:case 34:j();break;case 72:case 37:z();break;case 76:case 39:U();break;case 75:case 38:W();break;case 74:case 40:_();break;case 36:x(0);break;case 35:x(Number.MAX_VALUE);break;case 32:E()?L():j();break;case 13:E()?L():n=!1;break;case 66:case 190:case 191:T();break;case 70:S();break;default:n=!1}n?e.preventDefault():27===e.keyCode&&St&&(b(),e.preventDefault()),I()}}function $(e){Dt.startX=e.touches[0].clientX,Dt.startY=e.touches[0].clientY,Dt.startCount=e.touches.length,2===e.touches.length&&ht.overview&&(Dt.startSpan=d({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:Dt.startX,y:Dt.startY}))}function Z(e){if(Dt.handled)navigator.userAgent.match(/android/gi)&&e.preventDefault();else{var t=e.touches[0].clientX,n=e.touches[0].clientY;if(2===e.touches.length&&2===Dt.startCount&&ht.overview){var r=d({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:Dt.startX,y:Dt.startY});Math.abs(Dt.startSpan-r)>Dt.threshold&&(Dt.handled=!0,Dt.startSpan>r?w():L()),e.preventDefault()}else if(1===e.touches.length&&2!==Dt.startCount){var o=t-Dt.startX,s=n-Dt.startY;o>Dt.threshold&&Math.abs(o)>Math.abs(s)?(Dt.handled=!0,z()):-Dt.threshold>o&&Math.abs(o)>Math.abs(s)?(Dt.handled=!0,U()):s>Dt.threshold?(Dt.handled=!0,W()):-Dt.threshold>s&&(Dt.handled=!0,_()),e.preventDefault()}}}function Q(){Dt.handled=!1}function V(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],$(e))}function B(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],Z(e))}function G(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],Q(e))}function J(e){clearTimeout(qt),qt=setTimeout(function(){var t=e.detail||-e.wheelDelta;t>0?j():F()},100)}function et(e){e.preventDefault();var t=l(document.querySelectorAll(ft)).length,n=Math.floor(e.clientX/Et.wrapper.offsetWidth*t);x(n)}function tt(e){e.preventDefault(),z()}function nt(e){e.preventDefault(),U()}function rt(e){e.preventDefault(),W()}function ot(e){e.preventDefault(),_()}function st(e){e.preventDefault(),F()}function at(e){e.preventDefault(),j()}function it(){O()}function ct(){h()}function lt(e){if(Pt&&E()){e.preventDefault();for(var t=e.target;t&&!t.nodeName.match(/section/gi);)t=t.parentNode;if(t&&!t.classList.contains("disabled")&&(L(),t.nodeName.match(/section/gi))){var n=parseInt(t.getAttribute("data-index-h"),10),r=parseInt(t.getAttribute("data-index-v"),10);x(n,r)}}}var dt,ut,vt=".reveal .slides section",ft=".reveal .slides>section",pt=".reveal .slides>section.present>section",mt=".reveal .slides>section:first-child",ht={width:960,height:700,margin:.1,minScale:.2,maxScale:1,controls:!0,progress:!0,history:!1,keyboard:!0,overview:!0,center:!0,touch:!0,loop:!1,rtl:!1,autoSlide:0,mouseWheel:!1,rollingLinks:!0,theme:null,transition:"default",dependencies:[]},yt=0,gt=0,wt=0,Lt=[],bt=1,Et={},St="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,At="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,qt=0,Tt=0,kt=0,xt=0,Mt=0,Pt=!1,Dt={startX:0,startY:0,startSpan:0,startCount:0,handled:!1,threshold:80};return{initialize:e,configure:s,slide:x,left:z,right:U,up:W,down:_,prev:F,next:j,prevFragment:H,nextFragment:X,navigateTo:x,navigateLeft:z,navigateRight:U,navigateUp:W,navigateDown:_,navigatePrev:F,navigateNext:j,layout:h,toggleOverview:b,togglePause:T,isOverview:E,isPaused:k,addEventListeners:a,removeEventListeners:i,getIndices:C,getSlide:function(e,t){var n=document.querySelectorAll(ft)[e],r=n&&n.querySelectorAll("section");return t!==void 0?r?r[t]:void 0:n},getPreviousSlide:function(){return dt},getCurrentSlide:function(){return ut},getScale:function(){return bt},getQueryHash:function(){var e={};return location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(t){e[t.split("=").shift()]=t.split("=").pop()}),e},isFirstSlide:function(){return null==document.querySelector(vt+".past")?!0:!1},isLastSlide:function(){return ut&&ut.classList.contains(".stack")?null==ut.querySelector(vt+".future")?!0:!1:null==document.querySelector(vt+".future")?!0:!1},addEventListener:function(e,t,n){"addEventListener"in window&&(Et.wrapper||document.querySelector(".reveal")).addEventListener(e,t,n)},removeEventListener:function(e,t,n){"addEventListener"in window&&(Et.wrapper||document.querySelector(".reveal")).removeEventListener(e,t,n)}}}(); \ No newline at end of file +var Reveal=function(){"use strict";function e(e){return At||St?(window.addEventListener("load",h,!1),c(ht,e),window.globals=ht.globals,n(),r(),void 0):(document.body.setAttribute("class","no-transforms"),void 0)}function t(){if(Et.theme=document.querySelector("#theme"),Et.wrapper=document.querySelector(".reveal"),Et.slides=document.querySelector(".reveal .slides"),!Et.wrapper.querySelector(".progress")&&ht.progress){var e=document.createElement("div");e.classList.add("progress"),e.innerHTML="",Et.wrapper.appendChild(e)}if(!Et.wrapper.querySelector(".controls")&&ht.controls){var t=document.createElement("aside");t.classList.add("controls"),t.innerHTML='',Et.wrapper.appendChild(t)}if(!Et.wrapper.querySelector(".state-background")){var n=document.createElement("div");n.classList.add("state-background"),Et.wrapper.appendChild(n)}if(!Et.wrapper.querySelector(".pause-overlay")){var r=document.createElement("div");r.classList.add("pause-overlay"),Et.wrapper.appendChild(r)}Et.progress=document.querySelector(".reveal .progress"),Et.progressbar=document.querySelector(".reveal .progress span"),ht.controls&&(Et.controls=document.querySelector(".reveal .controls"),Et.controlsLeft=l(document.querySelectorAll(".navigate-left")),Et.controlsRight=l(document.querySelectorAll(".navigate-right")),Et.controlsUp=l(document.querySelectorAll(".navigate-up")),Et.controlsDown=l(document.querySelectorAll(".navigate-down")),Et.controlsPrev=l(document.querySelectorAll(".navigate-prev")),Et.controlsNext=l(document.querySelectorAll(".navigate-next")))}function n(){/iphone|ipod|android/gi.test(navigator.userAgent)&&!/crios/gi.test(navigator.userAgent)&&(window.addEventListener("load",u,!1),window.addEventListener("orientationchange",u,!1))}function r(){function e(){n.length&&head.js.apply(null,n),o()}for(var t=[],n=[],r=0,s=ht.dependencies.length;s>r;r++){var a=ht.dependencies[r];(!a.condition||a.condition())&&(a.async?n.push(a.src):t.push(a.src),"function"==typeof a.callback&&head.ready(a.src.match(/([\w\d_\-]*)\.?js$|[^\\\/]*$/i)[0],a.callback))}t.length?(head.ready(e),head.js.apply(null,t)):e()}function o(){t(),a(),s(),O(),setTimeout(function(){v("ready",{indexh:gt,indexv:wt,currentSlide:ut})},1)}function s(e){if(Et.wrapper.classList.remove(ht.transition),"object"==typeof e&&c(ht,e),St===!1&&(ht.transition="linear"),Et.wrapper.classList.add(ht.transition),Et.controls&&(Et.controls.style.display=ht.controls&&Et.controls?"block":"none"),Et.progress&&(Et.progress.style.display=ht.progress&&Et.progress?"block":"none"),ht.rtl?Et.wrapper.classList.add("rtl"):Et.wrapper.classList.remove("rtl"),ht.center?Et.wrapper.classList.add("center"):Et.wrapper.classList.remove("center"),ht.mouseWheel?(document.addEventListener("DOMMouseScroll",J,!1),document.addEventListener("mousewheel",J,!1)):(document.removeEventListener("DOMMouseScroll",J,!1),document.removeEventListener("mousewheel",J,!1)),ht.rollingLinks?f():p(),ht.theme&&Et.theme){var t=Et.theme.getAttribute("href"),n=/[^\/]*?(?=\.css)/,r=t.match(n)[0];ht.theme!==r&&(t=t.replace(n,ht.theme),Et.theme.setAttribute("href",t))}h(),yt=ht.autoSlide,I()}function a(){Pt=!0,window.addEventListener("hashchange",it,!1),window.addEventListener("resize",ct,!1),ht.touch&&(Et.wrapper.addEventListener("touchstart",$,!1),Et.wrapper.addEventListener("touchmove",Z,!1),Et.wrapper.addEventListener("touchend",Q,!1),window.navigator.msPointerEnabled&&(Et.wrapper.addEventListener("MSPointerDown",V,!1),Et.wrapper.addEventListener("MSPointerMove",B,!1),Et.wrapper.addEventListener("MSPointerUp",G,!1))),ht.keyboard&&document.addEventListener("keydown",K,!1),ht.progress&&Et.progress&&Et.progress.addEventListener("click",et,!1),ht.controls&&Et.controls&&["touchstart","click"].forEach(function(e){Et.controlsLeft.forEach(function(t){t.addEventListener(e,tt,!1)}),Et.controlsRight.forEach(function(t){t.addEventListener(e,nt,!1)}),Et.controlsUp.forEach(function(t){t.addEventListener(e,rt,!1)}),Et.controlsDown.forEach(function(t){t.addEventListener(e,ot,!1)}),Et.controlsPrev.forEach(function(t){t.addEventListener(e,st,!1)}),Et.controlsNext.forEach(function(t){t.addEventListener(e,at,!1)})})}function i(){Pt=!1,document.removeEventListener("keydown",K,!1),window.removeEventListener("hashchange",it,!1),window.removeEventListener("resize",ct,!1),ht.touch&&(Et.wrapper.removeEventListener("touchstart",$,!1),Et.wrapper.removeEventListener("touchmove",Z,!1),Et.wrapper.removeEventListener("touchend",Q,!1),window.navigator.msPointerEnabled&&(Et.wrapper.removeEventListener("MSPointerDown",V,!1),Et.wrapper.removeEventListener("MSPointerMove",B,!1),Et.wrapper.removeEventListener("MSPointerUp",G,!1))),ht.progress&&Et.progress&&Et.progress.removeEventListener("click",et,!1),ht.controls&&Et.controls&&["touchstart","click"].forEach(function(e){Et.controlsLeft.forEach(function(t){t.removeEventListener(e,tt,!1)}),Et.controlsRight.forEach(function(t){t.removeEventListener(e,nt,!1)}),Et.controlsUp.forEach(function(t){t.removeEventListener(e,rt,!1)}),Et.controlsDown.forEach(function(t){t.removeEventListener(e,ot,!1)}),Et.controlsPrev.forEach(function(t){t.removeEventListener(e,st,!1)}),Et.controlsNext.forEach(function(t){t.removeEventListener(e,at,!1)})})}function c(e,t){for(var n in t)e[n]=t[n]}function l(e){return Array.prototype.slice.call(e)}function d(e,t){var n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function u(){0===window.orientation?(document.documentElement.style.overflow="scroll",document.body.style.height="120%"):(document.documentElement.style.overflow="",document.body.style.height="100%"),setTimeout(function(){window.scrollTo(0,1)},10)}function v(e,t){var n=document.createEvent("HTMLEvents",1,2);n.initEvent(e,!0,!0),c(n,t),Et.wrapper.dispatchEvent(n)}function f(){if(St&&!("msPerspective"in document.body.style))for(var e=document.querySelectorAll(vt+" a:not(.image)"),t=0,n=e.length;n>t;t++){var r=e[t];if(!(!r.textContent||r.querySelector("*")||r.className&&r.classList.contains(r,"roll"))){var o=document.createElement("span");o.setAttribute("data-title",r.text),o.innerHTML=r.innerHTML,r.classList.add("roll"),r.innerHTML="",r.appendChild(o)}}}function p(){for(var e=document.querySelectorAll(vt+" a.roll"),t=0,n=e.length;n>t;t++){var r=e[t],o=r.querySelector("span");o&&(r.classList.remove("roll"),r.innerHTML=o.innerHTML)}}function m(e){var t=l(e);return t.forEach(function(e,t){e.hasAttribute("data-fragment-index")||e.setAttribute("data-fragment-index",t)}),t.sort(function(e,t){return e.getAttribute("data-fragment-index")-t.getAttribute("data-fragment-index")}),t}function h(){if(Et.wrapper){var e=Et.wrapper.offsetWidth,t=Et.wrapper.offsetHeight;e-=t*ht.margin,t-=t*ht.margin;var n=ht.width,r=ht.height;if("string"==typeof n&&/%$/.test(n)&&(n=parseInt(n,10)/100*e),"string"==typeof r&&/%$/.test(r)&&(r=parseInt(r,10)/100*t),Et.slides.style.width=n+"px",Et.slides.style.height=r+"px",bt=Math.min(e/n,t/r),bt=Math.max(bt,ht.minScale),bt=Math.min(bt,ht.maxScale),void 0===Et.slides.style.zoom||navigator.userAgent.match(/(iphone|ipod|ipad|android)/gi)){var o="translate(-50%, -50%) scale("+bt+") translate(50%, 50%)";Et.slides.style.WebkitTransform=o,Et.slides.style.MozTransform=o,Et.slides.style.msTransform=o,Et.slides.style.OTransform=o,Et.slides.style.transform=o}else Et.slides.style.zoom=bt;for(var s=l(document.querySelectorAll(vt)),a=0,i=s.length;i>a;a++){var c=s[a];"none"!==c.style.display&&(c.style.top=ht.center?c.classList.contains("stack")?0:Math.max(-(c.offsetHeight/2)-20,-r/2)+"px":"")}}}function y(e,t){"object"==typeof e&&"function"==typeof e.setAttribute&&e.setAttribute("data-previous-indexv",t||0)}function g(e){return"object"==typeof e&&"function"==typeof e.setAttribute&&e.classList.contains("stack")?parseInt(e.getAttribute("data-previous-indexv")||0,10):0}function w(){if(ht.overview){R();var e=Et.wrapper.classList.contains("overview");Et.wrapper.classList.add("overview"),Et.wrapper.classList.remove("exit-overview"),clearTimeout(xt),clearTimeout(Mt),xt=setTimeout(function(){for(var t=document.querySelectorAll(ft),n=0,r=t.length;r>n;n++){var o=t[n],s="translateZ(-2500px) translate("+105*(n-gt)+"%, 0%)";if(o.setAttribute("data-index-h",n),o.style.display="block",o.style.WebkitTransform=s,o.style.MozTransform=s,o.style.msTransform=s,o.style.OTransform=s,o.style.transform=s,o.classList.contains("stack"))for(var a=o.querySelectorAll("section"),i=0,c=a.length;c>i;i++){var l=n===gt?wt:g(o),d=a[i],u="translate(0%, "+105*(i-l)+"%)";d.setAttribute("data-index-h",n),d.setAttribute("data-index-v",i),d.style.display="block",d.style.WebkitTransform=u,d.style.MozTransform=u,d.style.msTransform=u,d.style.OTransform=u,d.style.transform=u,d.addEventListener("click",lt,!0)}else o.addEventListener("click",lt,!0)}h(),e||v("overviewshown",{indexh:gt,indexv:wt,currentSlide:ut})},10)}}function L(){if(ht.overview){clearTimeout(xt),clearTimeout(Mt),Et.wrapper.classList.remove("overview"),Et.wrapper.classList.add("exit-overview"),Mt=setTimeout(function(){Et.wrapper.classList.remove("exit-overview")},10);for(var e=l(document.querySelectorAll(vt)),t=0,n=e.length;n>t;t++){var r=e[t];r.style.display="",r.style.WebkitTransform="",r.style.MozTransform="",r.style.msTransform="",r.style.OTransform="",r.style.transform="",r.removeEventListener("click",lt,!0)}x(gt,wt),I(),v("overviewhidden",{indexh:gt,indexv:wt,currentSlide:ut})}}function b(e){"boolean"==typeof e?e?w():L():E()?L():w()}function E(){return Et.wrapper.classList.contains("overview")}function S(){var e=document.body,t=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;t&&t.apply(e)}function A(){var e=Et.wrapper.classList.contains("paused");R(),Et.wrapper.classList.add("paused"),e===!1&&v("paused")}function q(){var e=Et.wrapper.classList.contains("paused");I(),Et.wrapper.classList.remove("paused"),e&&v("resumed")}function T(){k()?q():A()}function k(){return Et.wrapper.classList.contains("paused")}function x(e,t,n,r){dt=ut;var o=document.querySelectorAll(ft);void 0===t&&(t=g(o[e])),dt&&dt.parentNode&&dt.parentNode.classList.contains("stack")&&y(dt.parentNode,wt);var s=Lt.concat();Lt.length=0;var a=gt,i=wt;gt=M(ft,void 0===e?gt:e),wt=M(pt,void 0===t?wt:t),h();e:for(var c=0,d=Lt.length;d>c;c++){for(var u=0;s.length>u;u++)if(s[u]===Lt[c]){s.splice(u,1);continue e}document.documentElement.classList.add(Lt[c]),v(Lt[c])}for(;s.length;)document.documentElement.classList.remove(s.pop());E()&&w(),Y(1500);var f=o[gt],p=f.querySelectorAll("section");if(ut=p[wt]||f,n!==void 0){var L=m(ut.querySelectorAll(".fragment"));l(L).forEach(function(e,t){n>t?e.classList.add("visible"):e.classList.remove("visible")})}gt!==a||wt!==i?v("slidechanged",{indexh:gt,indexv:wt,previousSlide:dt,currentSlide:ut,origin:r}):dt=null,dt&&(dt.classList.remove("present"),document.querySelector(mt).classList.contains("present")&&setTimeout(function(){var e,t=l(document.querySelectorAll(ft+".stack"));for(e in t)t[e]&&y(t[e],0)},0)),D(),P()}function M(e,t){var n=l(document.querySelectorAll(e)),r=n.length;if(r){ht.loop&&(t%=r,0>t&&(t=r+t)),t=Math.max(Math.min(t,r-1),0);for(var o=0;r>o;o++){var s=n[o];if(E()===!1){var a=Math.abs((t-o)%(r-3))||0;s.style.display=a>3?"none":"block"}n[o].classList.remove("past"),n[o].classList.remove("present"),n[o].classList.remove("future"),t>o?n[o].classList.add("past"):o>t&&n[o].classList.add("future"),s.querySelector("section")&&n[o].classList.add("stack")}n[t].classList.add("present");var i=n[t].getAttribute("data-state");i&&(Lt=Lt.concat(i.split(" ")));var c=n[t].getAttribute("data-autoslide");yt=c?parseInt(c,10):ht.autoSlide}else t=0;return t}function P(){if(ht.progress&&Et.progress){var e=l(document.querySelectorAll(ft)),t=document.querySelectorAll(vt+":not(.stack)").length,n=0;e:for(var r=0;e.length>r;r++){for(var o=e[r],s=l(o.querySelectorAll("section")),a=0;s.length>a;a++){if(s[a].classList.contains("present"))break e;n++}if(o.classList.contains("present"))break;o.classList.contains("stack")===!1&&n++}Et.progressbar.style.width=n/(t-1)*window.innerWidth+"px"}}function D(){if(ht.controls&&Et.controls){var e=N();Et.controlsLeft.concat(Et.controlsRight).concat(Et.controlsUp).concat(Et.controlsDown).concat(Et.controlsPrev).concat(Et.controlsNext).forEach(function(e){e.classList.remove("enabled")}),e.left&&Et.controlsLeft.forEach(function(e){e.classList.add("enabled")}),e.right&&Et.controlsRight.forEach(function(e){e.classList.add("enabled")}),e.up&&Et.controlsUp.forEach(function(e){e.classList.add("enabled")}),e.down&&Et.controlsDown.forEach(function(e){e.classList.add("enabled")}),(e.left||e.up)&&Et.controlsPrev.forEach(function(e){e.classList.add("enabled")}),(e.right||e.down)&&Et.controlsNext.forEach(function(e){e.classList.add("enabled")})}}function N(){var e=document.querySelectorAll(ft),t=document.querySelectorAll(pt);return{left:gt>0||ht.loop,right:e.length-1>gt||ht.loop,up:wt>0,down:t.length-1>wt}}function O(){var e=window.location.hash,t=e.slice(2).split("/"),n=e.replace(/#|\//gi,"");if(isNaN(parseInt(t[0],10))&&n.length){var r=document.querySelector("#"+n);if(r){var o=Reveal.getIndices(r);x(o.h,o.v)}else x(gt,wt)}else{var s=parseInt(t[0],10)||0,a=parseInt(t[1],10)||0;x(s,a)}}function Y(e){if(ht.history)if(clearTimeout(kt),"number"==typeof e)kt=setTimeout(Y,e);else{var t="/";ut&&"string"==typeof ut.getAttribute("id")?t="/"+ut.getAttribute("id"):((gt>0||wt>0)&&(t+=gt),wt>0&&(t+="/"+wt)),window.location.hash=t}}function C(e){var t=gt,n=wt;if(e){var r=!!e.parentNode.nodeName.match(/section/gi),o=r?e.parentNode:e,s=l(document.querySelectorAll(ft));t=Math.max(s.indexOf(o),0),r&&(n=Math.max(l(e.parentNode.querySelectorAll("section")).indexOf(e),0))}return{h:t,v:n}}function X(){if(document.querySelector(pt+".present")){var e=m(document.querySelectorAll(pt+".present .fragment:not(.visible)"));if(e.length)return e[0].classList.add("visible"),v("fragmentshown",{fragment:e[0]}),!0}else{var t=m(document.querySelectorAll(ft+".present .fragment:not(.visible)"));if(t.length)return t[0].classList.add("visible"),v("fragmentshown",{fragment:t[0]}),!0}return!1}function H(){if(document.querySelector(pt+".present")){var e=m(document.querySelectorAll(pt+".present .fragment.visible"));if(e.length)return e[e.length-1].classList.remove("visible"),v("fragmenthidden",{fragment:e[e.length-1]}),!0}else{var t=m(document.querySelectorAll(ft+".present .fragment.visible"));if(t.length)return t[t.length-1].classList.remove("visible"),v("fragmenthidden",{fragment:t[t.length-1]}),!0}return!1}function I(){clearTimeout(Tt),!yt||k()||E()||(Tt=setTimeout(j,yt))}function R(){clearTimeout(Tt)}function z(){N().left&&(E()||H()===!1)&&x(gt-1)}function U(){N().right&&(E()||X()===!1)&&x(gt+1)}function W(){(N().up&&E()||H()===!1)&&x(gt,wt-1)}function _(){(N().down&&E()||X()===!1)&&x(gt,wt+1)}function F(){if(H()===!1)if(N().up)W();else{var e=document.querySelector(ft+".past:nth-child("+gt+")");e&&(wt=e.querySelectorAll("section").length+1||void 0,gt--,x())}}function j(){X()===!1&&(N().down?_():U()),I()}function K(e){document.activeElement;var t=!(!document.activeElement||!document.activeElement.type&&!document.activeElement.href&&"inherit"===document.activeElement.contentEditable);if(!(t||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)){var n=!0;if(k()&&-1===[66,190,191].indexOf(e.keyCode))return!1;switch(e.keyCode){case 80:case 33:F();break;case 78:case 34:j();break;case 72:case 37:z();break;case 76:case 39:U();break;case 75:case 38:W();break;case 74:case 40:_();break;case 36:x(0);break;case 35:x(Number.MAX_VALUE);break;case 32:E()?L():j();break;case 13:E()?L():n=!1;break;case 66:case 190:case 191:T();break;case 70:S();break;default:n=!1}n?e.preventDefault():27===e.keyCode&&St&&(b(),e.preventDefault()),I()}}function $(e){Dt.startX=e.touches[0].clientX,Dt.startY=e.touches[0].clientY,Dt.startCount=e.touches.length,2===e.touches.length&&ht.overview&&(Dt.startSpan=d({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:Dt.startX,y:Dt.startY}))}function Z(e){if(Dt.handled)navigator.userAgent.match(/android/gi)&&e.preventDefault();else{var t=e.touches[0].clientX,n=e.touches[0].clientY;if(2===e.touches.length&&2===Dt.startCount&&ht.overview){var r=d({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:Dt.startX,y:Dt.startY});Math.abs(Dt.startSpan-r)>Dt.threshold&&(Dt.handled=!0,Dt.startSpan>r?w():L()),e.preventDefault()}else if(1===e.touches.length&&2!==Dt.startCount){var o=t-Dt.startX,s=n-Dt.startY;o>Dt.threshold&&Math.abs(o)>Math.abs(s)?(Dt.handled=!0,z()):-Dt.threshold>o&&Math.abs(o)>Math.abs(s)?(Dt.handled=!0,U()):s>Dt.threshold?(Dt.handled=!0,W()):-Dt.threshold>s&&(Dt.handled=!0,_()),e.preventDefault()}}}function Q(){Dt.handled=!1}function V(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],$(e))}function B(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],Z(e))}function G(e){e.pointerType===e.MSPOINTER_TYPE_TOUCH&&(e.touches=[{clientX:e.clientX,clientY:e.clientY}],Q(e))}function J(e){clearTimeout(qt),qt=setTimeout(function(){var t=e.detail||-e.wheelDelta;t>0?j():F()},100)}function et(e){e.preventDefault();var t=l(document.querySelectorAll(ft)).length,n=Math.floor(e.clientX/Et.wrapper.offsetWidth*t);x(n)}function tt(e){e.preventDefault(),z()}function nt(e){e.preventDefault(),U()}function rt(e){e.preventDefault(),W()}function ot(e){e.preventDefault(),_()}function st(e){e.preventDefault(),F()}function at(e){e.preventDefault(),j()}function it(){O()}function ct(){h()}function lt(e){if(Pt&&E()){e.preventDefault();for(var t=e.target;t&&!t.nodeName.match(/section/gi);)t=t.parentNode;if(t&&!t.classList.contains("disabled")&&(L(),t.nodeName.match(/section/gi))){var n=parseInt(t.getAttribute("data-index-h"),10),r=parseInt(t.getAttribute("data-index-v"),10);x(n,r)}}}var dt,ut,vt=".reveal .slides section",ft=".reveal .slides>section",pt=".reveal .slides>section.present>section",mt=".reveal .slides>section:first-child",ht={width:960,height:700,margin:.1,minScale:.2,maxScale:1,controls:!0,progress:!0,history:!1,keyboard:!0,overview:!0,center:!0,touch:!0,loop:!1,rtl:!1,autoSlide:0,mouseWheel:!1,rollingLinks:!0,theme:null,transition:"default",dependencies:[]},yt=0,gt=0,wt=0,Lt=[],bt=1,Et={},St="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,At="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,qt=0,Tt=0,kt=0,xt=0,Mt=0,Pt=!1,Dt={startX:0,startY:0,startSpan:0,startCount:0,handled:!1,threshold:80};return{initialize:e,configure:s,slide:x,left:z,right:U,up:W,down:_,prev:F,next:j,prevFragment:H,nextFragment:X,navigateTo:x,navigateLeft:z,navigateRight:U,navigateUp:W,navigateDown:_,navigatePrev:F,navigateNext:j,layout:h,toggleOverview:b,togglePause:T,isOverview:E,isPaused:k,addEventListeners:a,removeEventListeners:i,getIndices:C,getSlide:function(e,t){var n=document.querySelectorAll(ft)[e],r=n&&n.querySelectorAll("section");return t!==void 0?r?r[t]:void 0:n},getPreviousSlide:function(){return dt},getCurrentSlide:function(){return ut},getScale:function(){return bt},getQueryHash:function(){var e={};return location.search.replace(/[A-Z0-9]+?=(\w*)/gi,function(t){e[t.split("=").shift()]=t.split("=").pop()}),e},isFirstSlide:function(){return null==document.querySelector(vt+".past")?!0:!1},isLastSlide:function(){return ut&&ut.classList.contains(".stack")?null==ut.querySelector(vt+".future")?!0:!1:null==document.querySelector(vt+".future")?!0:!1},addEventListener:function(e,t,n){"addEventListener"in window&&(Et.wrapper||document.querySelector(".reveal")).addEventListener(e,t,n)},removeEventListener:function(e,t,n){"addEventListener"in window&&(Et.wrapper||document.querySelector(".reveal")).removeEventListener(e,t,n)}}}(); \ No newline at end of file diff --git a/package.json b/package.json index 633171d8..5c5f6c3d 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,11 @@ "version": "2.3.0", "description": "The HTML Presentation Framework", "homepage": "http://lab.hakim.se/reveal-js", + "subdomain": "revealjs", + "scripts": { + "test": "grunt jshint", + "start": "" + }, "author": { "name": "Hakim El Hattab", "email": "hakim.elhattab@gmail.com", @@ -15,14 +20,11 @@ "engines": { "node": "~0.8.0" }, - "scripts": { - "test": "grunt jshint" - }, "dependencies": { "underscore": "~1.3.3", "express": "~2.5.9", - "socket.io": "~0.9.6", - "mustache": "~0.4.0" + "mustache": "~0.4.0", + "socket.io": "~0.9.13" }, "devDependencies": { "grunt-contrib-jshint": "~0.2.0", diff --git a/plugin/multiplex/client.js b/plugin/multiplex/client.js new file mode 100644 index 00000000..cb7b27ad --- /dev/null +++ b/plugin/multiplex/client.js @@ -0,0 +1,13 @@ +(function() { + var multiplex = window.globals.multiplex; + var socketId = multiplex.id; + var socket = io.connect(multiplex.url); + + socket.on(multiplex.id, function(data) { + // ignore data from sockets that aren't ours + if (data.socketId !== socketId) { return; } + if( window.location.host === 'localhost:1947' ) return; + + Reveal.slide(data.indexh, data.indexv, null, 'remote'); + }); +}()); diff --git a/plugin/multiplex/index.js b/plugin/multiplex/index.js new file mode 100644 index 00000000..bf22cb11 --- /dev/null +++ b/plugin/multiplex/index.js @@ -0,0 +1,48 @@ +var express = require('express'); +var fs = require('fs'); +var io = require('socket.io'); +var crypto = require('crypto'); + +var app = express.createServer(); +var staticDir = express.static; + +io = io.listen(app); + +var opts = { + port: 1948, + baseDir : __dirname + '/../../' +}; + +io.sockets.on('connection', function(socket) { + socket.on('slidechanged', function(slideData) { + if (createHash(slideData.secret) === slideData.socketId) { + slideData.secret = null; + socket.broadcast.emit(slideData.socketId, slideData); + }; + }); +}); + +app.configure(function() { + [ 'css', 'js', 'plugin', 'lib' ].forEach(function(dir) { + app.use('/' + dir, staticDir(opts.baseDir + dir)); + }); +}); + +app.get("/", function(req, res) { + fs.createReadStream(opts.baseDir + '/index.html').pipe(res); +}); + +app.get("/token", function(req,res) { + var ts = new Date().getTime(); + var rand = Math.floor(Math.random()*9999999); + var secret = ts.toString() + rand.toString(); + res.send({secret: secret, socketId: createHash(secret)}); +}); + +var createHash = function(secret) { + var cipher = crypto.createCipher('blowfish', secret); + return(cipher.final('hex')); +}; + +// Actually listen +app.listen(opts.port || null); diff --git a/plugin/multiplex/master.js b/plugin/multiplex/master.js new file mode 100644 index 00000000..5c183908 --- /dev/null +++ b/plugin/multiplex/master.js @@ -0,0 +1,32 @@ +(function() { + // don't emit events from inside the previews themselves + if ( window.location.search.match( /receiver/gi ) ) { return; } + var multiplex = window.globals.multiplex; + + var socket = io.connect(multiplex.url); + + Reveal.addEventListener( 'slidechanged', function( event ) { + var nextindexh; + var nextindexv; + var slideElement = event.currentSlide; + + if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') { + nextindexh = event.indexh; + nextindexv = event.indexv + 1; + } else { + nextindexh = event.indexh + 1; + nextindexv = 0; + } + + var slideData = { + indexh : event.indexh, + indexv : event.indexv, + nextindexh : nextindexh, + nextindexv : nextindexv, + secret: multiplex.secret, + socketId : multiplex.id + }; + + if( typeof event.origin === 'undefined' && event.origin !== 'remote' ) socket.emit('slidechanged', slideData); + } ); +}()); diff --git a/plugin/multiplex/notes.html b/plugin/multiplex/notes.html new file mode 100644 index 00000000..88924c0d --- /dev/null +++ b/plugin/multiplex/notes.html @@ -0,0 +1,109 @@ + + + + + +