aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williams <dinosaur@riseup.net>2014-04-08 17:08:21 -0700
committerMichael Williams <dinosaur@riseup.net>2014-04-08 17:08:21 -0700
commit613a05f1544d21d5a16ffcefd960c24daec91873 (patch)
treeb9e322b1327639d90ed06eac9630cabbe5022661
parent9da952fea30906090446d038430186b11dba7f13 (diff)
downloadfreenode-live-2017-presentation-613a05f1544d21d5a16ffcefd960c24daec91873.tar
freenode-live-2017-presentation-613a05f1544d21d5a16ffcefd960c24daec91873.tar.gz
add UMD support. fix #787
-rw-r--r--Gruntfile.js4
-rw-r--r--js/reveal.js26
2 files changed, 26 insertions, 4 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 1baf966..0e67363 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 5cbb3ff..2fd07a8 100644
--- a/js/reveal.js
+++ b/js/reveal.js
@@ -5,10 +5,28 @@
*
* 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, but
+ // only CommonJS-like enviroments that support module.exports,
+ // like Node.
+ 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',
@@ -3232,7 +3250,7 @@ var Reveal = (function(){
// --------------------------------------------------------------------//
- return {
+ Reveal = {
initialize: initialize,
configure: configure,
sync: sync,
@@ -3379,4 +3397,6 @@ var Reveal = (function(){
}
};
-})();
+ return Reveal;
+
+}));