Skip to content

Commit

Permalink
Fixing AMD loading
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidwork committed Mar 4, 2012
1 parent 319e420 commit 5c177a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions debug/filesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* filesize.js
*
* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @version 1.1
* @version 1.2
*/
(function (window) {
"use strict";
Expand Down Expand Up @@ -66,8 +66,9 @@
}

return result;
};
},
fn = function () { window.filesize = filesize; };

// AMD support
typeof define === "function" ? define("filesize", [], function () { return filesize; }) : window.filesize = filesize;
typeof define === "function" ? define("filesize", fn) : fn();
})(window);
4 changes: 2 additions & 2 deletions production/filesize.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
* filesize.js
*
* @author Jason Mulligan <jason.mulligan@avoidwork.com>
* @version 1.1
* @version 1.2
*/
(function(a){"use strict";var b=function(a,b){var c=String(a).indexOf(".")>-1?parseFloat(a):parseInt(a),d=[{B:0},{KB:1024},{MB:1048576},{GB:1073741824},{TB:1099511627776}],e=d.length,f="",g,h,i,j;b=typeof b=="undefined"?2:parseInt(b);while(e--){j=d[e];for(i in j)if(j.hasOwnProperty(i)){g=j[i],h=i;break}if(c>=g){f=(h==="B"?c:(c/g).toFixed(b))+h;break}}return f};typeof define=="function"?define("filesize",[],function(){return b}):a.filesize=b})(window)
(function(a){"use strict";var b=function(a,b){var c=String(a).indexOf(".")>-1?parseFloat(a):parseInt(a),d=[{B:0},{KB:1024},{MB:1048576},{GB:1073741824},{TB:1099511627776}],e=d.length,f="",g,h,i,j;b=typeof b=="undefined"?2:parseInt(b);while(e--){j=d[e];for(i in j)if(j.hasOwnProperty(i)){g=j[i],h=i;break}if(c>=g){f=(h==="B"?c:(c/g).toFixed(b))+h;break}}return f},c=function(){a.filesize=b};typeof define=="function"?define("filesize",c):c()})(window)

0 comments on commit 5c177a9

Please sign in to comment.