moving UMD to header

[skip ci]
This commit is contained in:
Yotam Mann 2016-03-24 11:41:02 -04:00
parent 90c0b5febe
commit f88f68081d
3 changed files with 22 additions and 28 deletions

View file

@ -1,12 +1,3 @@
//UMD
if ( typeof define === "function" && define.amd ) {
define(function() {
return Tone;
});
} else if (typeof module === "object") {
module.exports = Tone;
} else {
root.Tone = Tone;
}
} (this));
return Tone;
}));

View file

@ -1,5 +1,20 @@
(function (root) {
(function(root, factory){
//UMD
if ( typeof define === "function" && define.amd ) {
define(function() {
return factory();
});
} else if (typeof module === "object") {
module.exports = factory();
} else {
root.Tone = factory();
}
}(this, function(){
"use strict";
var Tone;
//constructs the main Tone object
function Main(func){
@ -8,4 +23,4 @@
//invokes each of the modules with the main Tone object as the argument
function Module(func){
func(Tone);
}
}

View file

@ -1,17 +1,5 @@
//UMD
if ( typeof define === "function" && define.amd ) {
define( "Tone", [], function() {
return Tone;
});
} else if (typeof module === "object") {
module.exports = Tone;
} else {
root.Tone = Tone;
}
///////////////////////////////////////////////////////////////////////////
// P5 SHIM
// P5 PRELOAD SHIM
///////////////////////////////////////////////////////////////////////////
Tone.registeredPreload = function(callback){
@ -43,5 +31,5 @@
p5.prototype.registerPreloadMethod("registeredPreload", Tone);
} (this));
return Tone
}));