Add configure options for healthcheck
[functest.git] / docs / com / plugin / remotes / remotes.js
1 /**
2  * Touch-based remote controller for your presentation courtesy 
3  * of the folks at http://remotes.io
4  */
5
6 (function(window){
7
8     /**
9      * Detects if we are dealing with a touch enabled device (with some false positives)
10      * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js   
11      */
12     var hasTouch  = (function(){
13         return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
14     })();
15
16     /**
17      * Detects if notes are enable and the current page is opened inside an /iframe
18      * this prevents loading Remotes.io several times
19      */
20     var isNotesAndIframe = (function(){
21         return window.RevealNotes && !(self == top);
22     })();
23
24     if(!hasTouch && !isNotesAndIframe){
25         head.ready( 'remotes.ne.min.js', function() {
26             new Remotes("preview")
27                 .on("swipe-left", function(e){ Reveal.right(); })
28                 .on("swipe-right", function(e){ Reveal.left(); })
29                 .on("swipe-up", function(e){ Reveal.down(); })
30                 .on("swipe-down", function(e){ Reveal.up(); })
31                 .on("tap", function(e){ Reveal.next(); })
32                 .on("zoom-out", function(e){ Reveal.toggleOverview(true); })
33                 .on("zoom-in", function(e){ Reveal.toggleOverview(false); })
34             ;
35         } );
36
37         head.js('https://hakim-static.s3.amazonaws.com/reveal-js/remotes.ne.min.js');
38     }
39 })(window);