From e447187c20fc0ecebfc0e7bc28ebac32d15da9d4 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Thu, 18 Oct 2012 23:15:28 +0200 Subject: Change source from reveal.min.js to reveal.js for testing purposes --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 3ea2412..46ba921 100644 --- a/index.html +++ b/index.html @@ -325,7 +325,7 @@ function linkify( selector ) { - + -- cgit v1.2.3 From 82bd8e4fb07c789d54aca58198963e977ffbd589 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:12:53 +0200 Subject: Renaming key within fragmentData Might be better to use one variable with different values. --- plugin/speakernotes/client.js | 4 ++-- plugin/speakernotes/notes.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin/speakernotes/client.js b/plugin/speakernotes/client.js index 757e6cd..156cb9a 100644 --- a/plugin/speakernotes/client.js +++ b/plugin/speakernotes/client.js @@ -11,7 +11,7 @@ // Fires when a fragment is shown Reveal.addEventListener( 'fragmentshown', function( event ) { var fragmentData = { - showFragment : true, + fragment : 'next', socketId : socketId }; socket.emit('fragmentchanged', fragmentData); @@ -20,7 +20,7 @@ // Fires when a fragment is hidden Reveal.addEventListener( 'fragmenthidden', function( event ) { var fragmentData = { - hideFragment : true, + fragment : 'previous', socketId : socketId }; socket.emit('fragmentchanged', fragmentData); diff --git a/plugin/speakernotes/notes.html b/plugin/speakernotes/notes.html index af42480..f3b610d 100644 --- a/plugin/speakernotes/notes.html +++ b/plugin/speakernotes/notes.html @@ -128,10 +128,10 @@ console.dir(data); if (data.socketId !== socketId) { return; } - if (data.showFragment === true) { + if (data.fragment === 'next') { currentSlide.contentWindow.Reveal.nextFragment(); } - else if (data.hideFragment === true) { + else if (data.fragment === 'previous') { currentSlide.contentWindow.Reveal.previousFragment(); } }); -- cgit v1.2.3 From c39f5fc0b0ba4f32854b5e58c71beda6fb295270 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:14:46 +0200 Subject: Oops. Delete console output. --- plugin/speakernotes/notes.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugin/speakernotes/notes.html b/plugin/speakernotes/notes.html index f3b610d..9198386 100644 --- a/plugin/speakernotes/notes.html +++ b/plugin/speakernotes/notes.html @@ -110,7 +110,6 @@ socket.on('slidedata', function(data) { // ignore data from sockets that aren't ours - console.dir(data); if (data.socketId !== socketId) { return; } if (data.markdown) { @@ -125,7 +124,6 @@ }); socket.on('fragmentdata', function(data) { // ignore data from sockets that aren't ours - console.dir(data); if (data.socketId !== socketId) { return; } if (data.fragment === 'next') { -- cgit v1.2.3 From b957d0b8580bafb35fbb808ef1d7acf424f73895 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:24:13 +0200 Subject: Rename API method from Reveal.previousFragment() to Reveal.prevFragment() Because of consistency with the existent methods Reveal.prev() and Reveal.next() --- js/reveal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/reveal.js b/js/reveal.js index 653fbb2..eee950b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -1293,8 +1293,8 @@ var Reveal = (function(){ down: navigateDown, prev: navigatePrev, next: navigateNext, + prevFragment: previousFragment, nextFragment: nextFragment, - previousFragment: previousFragment, // Deprecated aliases navigateTo: slide, -- cgit v1.2.3 From 54588f5feaccbfdf418e040af6b9212f14695375 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:26:28 +0200 Subject: Update README.md Add the new API Methods Reveal.prevFragment() and Reveal.nextFragment() --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9a7007e..8850a64 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,8 @@ Reveal.up(); Reveal.down(); Reveal.prev(); Reveal.next(); +Reveal.prevFragment(); +Reveal.nextFragment(); Reveal.toggleOverview(); // Retrieves the previous and current slide elements -- cgit v1.2.3 From ff8ccbb02e4375c1601028db322fae4934342955 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:35:23 +0200 Subject: Update renamed API method See b957d0b8580bafb35fbb808ef1d7acf424f73895 --- plugin/speakernotes/notes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/speakernotes/notes.html b/plugin/speakernotes/notes.html index 9198386..d71d7f8 100644 --- a/plugin/speakernotes/notes.html +++ b/plugin/speakernotes/notes.html @@ -130,7 +130,7 @@ currentSlide.contentWindow.Reveal.nextFragment(); } else if (data.fragment === 'previous') { - currentSlide.contentWindow.Reveal.previousFragment(); + currentSlide.contentWindow.Reveal.prevFragment(); } }); -- cgit v1.2.3 From dc57e4c51c9125f742fb1c655209dc3550594055 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:38:33 +0200 Subject: Apply latest change to the minified version Using the latest Uglify JS with --no-seqs and deleting 'use strict' statement for use in production. --- js/reveal.min.js | 76 +------------------------------------------------------- 1 file changed, 1 insertion(+), 75 deletions(-) diff --git a/js/reveal.min.js b/js/reveal.min.js index 73053d3..312eaa3 100644 --- a/js/reveal.min.js +++ b/js/reveal.min.js @@ -4,78 +4,4 @@ * MIT licensed * * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se - */ -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);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",ad,false);window.addEventListener("orientationchange",ad,false);}}function V(){var al=[],ap=[]; -for(var am=0,ak=R.dependencies.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 s(){if(R.controls&&f.controls){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 M(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};}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 O(){clearTimeout(k); -if(Y){k=setTimeout(x,Y);}}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();}O();}function ah(al){if(document.querySelector(":focus")!==null||al.shiftKey||al.altKey||al.ctrlKey||al.metaKey){return; -}var ak=true;switch(al.keyCode){case 80:case 33:Z();break;case 78:case 34:x();break;case 72:case 37:B();break;case 76:case 39:j();break;case 75:case 38:u(); -break;case 74:case 40:F();break;case 36:a(0);break;case 35:a(Number.MAX_VALUE);break;case 32:L()?ae():x();break;case 13:L()?ae():ak=false;break;case 66:case 190:aa(); -break;case 70:ab();break;default:ak=false;}if(ak){al.preventDefault();}else{if(al.keyCode===27&&T){X();al.preventDefault();}}O();}function A(ak){ac.startX=ak.touches[0].clientX; -ac.startY=ak.touches[0].clientY;ac.startCount=ak.touches.length;if(ak.touches.length===2&&R.overview){ac.startSpan=S({x:ak.touches[1].clientX,y:ak.touches[1].clientY},{x:ac.startX,y:ac.startY}); -}}function af(ap){if(!ac.handled){var an=ap.touches[0].clientX;var am=ap.touches[0].clientY;if(ap.touches.length===2&&ac.startCount===2&&R.overview){var ao=S({x:ap.touches[1].clientX,y:ap.touches[1].clientY},{x:ac.startX,y:ac.startY}); -if(Math.abs(ac.startSpan-ao)>ac.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 o(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();}}return{initialize:i,slide:a,left:B,right:j,up:u,down:F,prev:Z,next:x,navigateTo:a,navigateLeft:B,navigateRight:j,navigateUp:u,navigateDown:F,navigatePrev:Z,navigateNext:x,toggleOverview:X,addEventListeners:E,removeEventListeners:U,getIndices:M,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); -}}};})(); \ No newline at end of file + */var Reveal=function(){function m(e){if(!c&&!l){document.body.setAttribute("class","no-transforms");return}T(n,e);y();b()}function g(){f.theme=document.querySelector("#theme");f.wrapper=document.querySelector(".reveal");if(!f.wrapper.querySelector(".progress")&&n.progress){var e=document.createElement("div");e.classList.add("progress");e.innerHTML="";f.wrapper.appendChild(e)}if(!f.wrapper.querySelector(".controls")&&n.controls){var t=document.createElement("aside");t.classList.add("controls");t.innerHTML='';f.wrapper.appendChild(t)}if(!f.wrapper.querySelector(".state-background")){var r=document.createElement("div");r.classList.add("state-background");f.wrapper.appendChild(r)}if(!f.wrapper.querySelector(".pause-overlay")){var i=document.createElement("div");i.classList.add("pause-overlay");f.wrapper.appendChild(i)}f.progress=document.querySelector(".reveal .progress");f.progressbar=document.querySelector(".reveal .progress span");if(n.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 y(){if(navigator.userAgent.match(/(iphone|ipod|android)/i)){document.documentElement.style.overflow="scroll";document.body.style.height="120%";window.addEventListener("load",k,!1);window.addEventListener("orientationchange",k,!1)}}function b(){function o(){head.js.apply(null,t);w()}var e=[],t=[];for(var r=0,i=n.dependencies.length;r'+r.innerHTML+""}}}}function O(){if(n.overview){f.wrapper.classList.add("overview");var t=document.querySelectorAll(e);for(var r=0,o=t.length;r3?"none":"block"}i[o].classList.remove("past");i[o].classList.remove("present");i[o].classList.remove("future");ot&&i[o].classList.add("future");u.querySelector("section")&&i[o].classList.add("stack")}i[t].classList.add("present");var l=i[t].getAttribute("data-state");l&&(a=a.concat(l.split(" ")));var c=i[t].getAttribute("data-autoslide");c?r=parseInt(c):r=n.autoSlide}else t=0;return t}function R(){if(n.controls&&f.controls){var e=U();[f.controlsLeft,f.controlsRight,f.controlsUp,f.controlsDown].forEach(function(e){e.classList.remove("enabled")});e.left&&f.controlsLeft.classList.add("enabled");e.right&&f.controlsRight.classList.add("enabled");e.up&&f.controlsUp.classList.add("enabled");e.down&&f.controlsDown.classList.add("enabled")}}function U(){var n=document.querySelectorAll(e),r=document.querySelectorAll(t);return{left:i>0,right:i0,down:s0||s>0)e+=i;s>0&&(e+="/"+s);window.location.hash=e}}function X(t){var n=i,r=s;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&&(r=Math.max(Array.prototype.slice.call(t.parentNode.children).indexOf(t),0))}return{h:n,v:r}}function V(){if(document.querySelector(t+".present")){var n=document.querySelectorAll(t+".present .fragment:not(.visible)");if(n.length){n[0].classList.add("visible");L("fragmentshown",{fragment:n[0]});return!0}}else{var r=document.querySelectorAll(e+".present .fragment:not(.visible)");if(r.length){r[0].classList.add("visible");L("fragmentshown",{fragment:r[0]});return!0}}return!1}function $(){if(document.querySelector(t+".present")){var n=document.querySelectorAll(t+".present .fragment.visible");if(n.length){n[n.length-1].classList.remove("visible");L("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");L("fragmenthidden",{fragment:r[r.length-1]});return!0}}return!1}function J(){clearTimeout(p);r&&(p=setTimeout(et,r))}function K(){(D()||$()===!1)&&I(i-1,0)}function Q(){(D()||V()===!1)&&I(i+1,0)}function G(){(D()||$()===!1)&&I(i,s-1)}function Y(){(D()||V()===!1)&&I(i,s+1)}function Z(){if($()===!1)if(U().up)G();else{var e=document.querySelector(".reveal .slides>section.past:nth-child("+i+")");if(e){s=e.querySelectorAll("section").length+1||0;i--;I()}}}function et(){V()===!1&&(U().down?Y():Q());J()}function tt(e){if(document.querySelector(":focus")!==null||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)return;var t=!0;switch(e.keyCode){case 80:case 33:Z();break;case 78:case 34:et();break;case 72:case 37:K();break;case 76:case 39:Q();break;case 75:case 38:G();break;case 74:case 40:Y();break;case 36:I(0);break;case 35:I(Number.MAX_VALUE);break;case 32:D()?M():et();break;case 13:D()?M():t=!1;break;case 66:case 190:j();break;case 70:P();break;default:t=!1}if(t)e.preventDefault();else if(e.keyCode===27&&l){_();e.preventDefault()}J()}function nt(e){v.startX=e.touches[0].clientX;v.startY=e.touches[0].clientY;v.startCount=e.touches.length;e.touches.length===2&&n.overview&&(v.startSpan=N({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:v.startX,y:v.startY}))}function rt(e){if(!v.handled){var t=e.touches[0].clientX,r=e.touches[0].clientY;if(e.touches.length===2&&v.startCount===2&&n.overview){var i=N({x:e.touches[1].clientX,y:e.touches[1].clientY},{x:v.startX,y:v.startY});if(Math.abs(v.startSpan-i)>v.threshold){v.handled=!0;iv.threshold&&Math.abs(s)>Math.abs(o)){v.handled=!0;K()}else if(s<-v.threshold&&Math.abs(s)>Math.abs(o)){v.handled=!0;Q()}else if(o>v.threshold){v.handled=!0;G()}else if(o<-v.threshold){v.handled=!0;Y()}e.preventDefault()}}else navigator.userAgent.match(/android/gi)&&e.preventDefault()}function it(e){v.handled=!1}function st(e){clearTimeout(h);h=setTimeout(function(){var t=e.detail||-e.wheelDelta;t>0?et():Z()},100)}function ot(e){z()}function ut(e){if(D()){e.preventDefault();M();i=this.getAttribute("data-index-h");s=this.getAttribute("data-index-v");I()}}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=n.autoSlide,i=0,s=0,o,u,a=[],f={},l="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,c="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,h=0,p=0,d=0,v={startX:0,startY:0,startSpan:0,startCount:0,handled:!1,threshold:80};return{initialize:m,slide:I,left:K,right:Q,up:G,down:Y,prev:Z,next:et,prevFragment:$,nextFragment:V,navigateTo:I,navigateLeft:K,navigateRight:Q,navigateUp:G,navigateDown:Y,navigatePrev:Z,navigateNext:et,toggleOverview:_,addEventListeners:S,removeEventListeners:x,getIndices:X,getPreviousSlide:function(){return o},getCurrentSlide:function(){return u},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&&(f.wrapper||document.querySelector(".reveal")).addEventListener(e,t,n)},removeEventListener:function(e,t,n){"addEventListener"in window&&(f.wrapper||document.querySelector(".reveal")).removeEventListener(e,t,n)}}}(); \ No newline at end of file -- cgit v1.2.3 From 379f5d38ff8c66c10c22a0a18227b481e945dc02 Mon Sep 17 00:00:00 2001 From: Michael Kühnel Date: Fri, 19 Oct 2012 00:39:11 +0200 Subject: Change source from from reveal.js back to reveal.min.js --- index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.html b/index.html index 46ba921..3ea2412 100644 --- a/index.html +++ b/index.html @@ -325,7 +325,7 @@ function linkify( selector ) { - +