diff options
author | David Banham | 2013-03-08 10:29:54 +1100 |
---|---|---|
committer | David Banham | 2013-03-08 10:29:54 +1100 |
commit | 61c229a4f969a0720085c2710f8a7cfd8a12b4a6 (patch) | |
tree | 637eeedce43c63a6aa004d566944ad791b984e7d /plugin/remotes | |
parent | 26d5febd7f24223900aa50d24d35e610c7c8a334 (diff) | |
parent | 7081f901da553206f746c40c4a0c1b5773697cf2 (diff) |
Merge branch 'master' of https://github.com/hakimel/reveal.js
Conflicts:
README.md
index.html
js/reveal.js
package.json
plugin/speakernotes/client.js
Diffstat (limited to 'plugin/remotes')
-rw-r--r-- | plugin/remotes/remotes.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/plugin/remotes/remotes.js b/plugin/remotes/remotes.js new file mode 100644 index 0000000..a1f10b8 --- /dev/null +++ b/plugin/remotes/remotes.js @@ -0,0 +1,30 @@ +/** + * Touch-based remote controller for your presentation courtesy + * of the folks at http://remotes.io + */ + +(function(window){ + + /** + * Detects if we are dealing with a touch enabled device (with some false positives) + * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js + */ + var hasTouch = (function(){ + return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch; + })(); + + if(!hasTouch){ + head.ready( 'remotes.ne.min.js', function() { + new Remotes("preview") + .on("swipe-left", function(e){ Reveal.right(); }) + .on("swipe-right", function(e){ Reveal.left(); }) + .on("swipe-up", function(e){ Reveal.down(); }) + .on("swipe-down", function(e){ Reveal.up(); }) + .on("tap", function(e){ + Reveal.toggleOverview(); + }); + } ); + + head.js('https://raw.github.com/Remotes/Remotes/master/dist/remotes.ne.min.js'); + } +})(window);
\ No newline at end of file |