Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

AMD module support, closes #18

  • Loading branch information...
commit 8928f97069037d7e75f379a0fe81c92d576d7613 1 parent 229cce9
Joel Fillmore joelfillmore authored
10 PxLoader.js
View
@@ -369,6 +369,13 @@ function PxLoaderTags(values) {
}
}
+// AMD module support
+if (typeof define === 'function' && define.amd) {
+ define('PxLoader', [], function() {
+ return PxLoader;
+ });
+}
+
// shims to ensure we have newer Array utility methods
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
if (!Array.isArray) {
@@ -376,3 +383,6 @@ if (!Array.isArray) {
return Object.prototype.toString.call(arg) == '[object Array]';
};
}
+
+
+
9 PxLoaderImage.js
View
@@ -99,4 +99,11 @@ PxLoader.prototype.addImage = function(url, tags, priority) {
// return the img element to the caller
return imageLoader.img;
-};
+};
+
+// AMD module support
+if (typeof define === 'function' && define.amd) {
+ define('PxLoaderImage', [], function() {
+ return PxLoaderImage;
+ });
+}
9 PxLoaderSound.js
View
@@ -88,4 +88,11 @@ PxLoader.prototype.addSound = function(id, url, tags, priority) {
var soundLoader = new PxLoaderSound(id, url, tags, priority);
this.add(soundLoader);
return soundLoader.sound;
-};
+};
+
+// AMD module support
+if (typeof define === 'function' && define.amd) {
+ define('PxLoaderSound', [], function() {
+ return PxLoaderSound;
+ });
+}
9 PxLoaderVideo.js
View
@@ -108,4 +108,11 @@ PxLoader.prototype.addVideo = function(url, tags, priority) {
// return the vid element to the caller
return videoLoader.vid;
-};
+};
+
+// AMD module support
+if (typeof define === 'function' && define.amd) {
+ define('PxLoaderVideo', [], function() {
+ return PxLoaderVideo;
+ });
+}
Please sign in to comment.
Something went wrong with that request. Please try again.