mirror of
https://github.com/Tonejs/Tone.js
synced 2024-11-15 16:17:58 +00:00
moving UMD to header
[skip ci]
This commit is contained in:
parent
90c0b5febe
commit
f88f68081d
3 changed files with 22 additions and 28 deletions
|
@ -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;
|
||||
}));
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}));
|
Loading…
Reference in a new issue