diff options
author | Hakim El Hattab | 2014-04-27 20:38:20 +0200 |
---|---|---|
committer | Hakim El Hattab | 2014-04-27 20:38:20 +0200 |
commit | 6aaff6395ac35c9f554dc2d6ab3531eab4b08c08 (patch) | |
tree | 5a2130203d35552fff472742db74a5a27f91b2ad | |
parent | 860580d4d0d10646b59a9b3663c0c1cc504bc1c2 (diff) | |
parent | c67e6d2e490f95e0f3e679f07ba347572a840c97 (diff) |
merge umd wrapping
-rw-r--r-- | Gruntfile.js | 4 | ||||
-rw-r--r-- | js/reveal.js | 24 |
2 files changed, 24 insertions, 4 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index b6738b0..a497524 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -70,7 +70,9 @@ module.exports = function(grunt) { head: false, module: false, console: false, - unescape: false + unescape: false, + define: false, + exports: false } }, files: [ 'Gruntfile.js', 'js/reveal.js' ] diff --git a/js/reveal.js b/js/reveal.js index d1f2fb0..01472a6 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -5,10 +5,26 @@ * * Copyright (C) 2014 Hakim El Hattab, http://hakim.se */ -var Reveal = (function(){ +(function( root, factory ) { + if( typeof define === 'function' && define.amd ) { + // AMD. Register as an anonymous module. + define( function() { + root.Reveal = factory(); + return root.Reveal; + } ); + } else if( typeof exports === 'object' ) { + // Node. Does not work with strict CommonJS. + module.exports = factory(); + } else { + // Browser globals. + root.Reveal = factory(); + } +}( this, function() { 'use strict'; + var Reveal; + var SLIDES_SELECTOR = '.reveal .slides section', HORIZONTAL_SLIDES_SELECTOR = '.reveal .slides>section', VERTICAL_SLIDES_SELECTOR = '.reveal .slides>section.present>section', @@ -3735,7 +3751,7 @@ var Reveal = (function(){ // --------------------------------------------------------------------// - return { + Reveal = { initialize: initialize, configure: configure, sync: sync, @@ -3889,4 +3905,6 @@ var Reveal = (function(){ } }; -})(); + return Reveal; + +})); |