Browse Source

Merge pull request #48 from wbinnssmith/wbinnssmith/umd

Add UMD wrapper for module loaders
pull/50/head
James Cryer 9 years ago
parent
commit
d3e0474cbf
  1. 17
      resemble.js

17
resemble.js

@ -3,7 +3,15 @@ James Cryer / Huddle 2014
URL: https://github.com/Huddle/Resemble.js URL: https://github.com/Huddle/Resemble.js
*/ */
(function(_this){ (function (root, factory) {
if (typeof define === 'function' && define.amd) {
define([], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory();
} else {
root.resemble = factory();
}
}(this, function () {
'use strict'; 'use strict';
var pixelTransparency = 1; var pixelTransparency = 1;
@ -63,7 +71,7 @@ URL: https://github.com/Huddle/Resemble.js
var document = typeof window != "undefined" ? window.document : {}; var document = typeof window != "undefined" ? window.document : {};
var documentDomainRegex = new RegExp('^https?://' + document.domain); var documentDomainRegex = new RegExp('^https?://' + document.domain);
_this['resemble'] = function( fileData ){ var resemble = function( fileData ){
var data = {}; var data = {};
var images = []; var images = [];
@ -633,7 +641,7 @@ URL: https://github.com/Huddle/Resemble.js
}; };
_this['resemble'].outputSettings = function(options){ resemble.outputSettings = function(options){
var key; var key;
var undefined; var undefined;
@ -656,4 +664,5 @@ URL: https://github.com/Huddle/Resemble.js
return this; return this;
}; };
}(this)); return resemble;
}));

Loading…
Cancel
Save