Forráskód Böngészése

merge umd wrapping

Hakim El Hattab 10 éve
szülő
commit
6aaff6395a
2 módosított fájl, 24 hozzáadás és 4 törlés
  1. 3 1
      Gruntfile.js
  2. 21 3
      js/reveal.js

+ 3 - 1
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' ]

+ 21 - 3
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;
+
+}));