Merge pull request #10 from nickdesaulniers/expose

browserify
This commit is contained in:
Vadim Namniak
2015-09-19 18:01:13 -04:00
5 changed files with 26 additions and 4 deletions
+7 -3
View File
@@ -5,7 +5,7 @@
* Copyright (c) 2014 Vadim Namniak
*/
(function() {
(function(root) {
'use strict';
var EL_WIDTH,EL_HEIGHT,MAX_TXT_WIDTH,MAX_TXT_HEIGHT;
@@ -284,5 +284,9 @@
}
};
window.CanvasTextWrapper = CanvasTextWrapper;
})();
if ('module' in root && 'exports' in module) {
module.exports = CanvasTextWrapper;
} else {
root.CanvasTextWrapper = CanvasTextWrapper;
}
})(this);
+1 -1
View File
File diff suppressed because one or more lines are too long
Executable → Regular
View File
+18
View File
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<script src="CanvasTextWrapper.js"></script>
<script >
var ctx = document.createElement('canvas').getContext('2d');
ctx.canvas.width = ctx.canvas.height = 200;
CanvasTextWrapper(ctx.canvas, "hello world how long can this be????");
document.addEventListener('DOMContentLoaded', function () {
document.body.appendChild(ctx.canvas);
});
</script>
</head>
<body>
</body>
</html>
Executable → Regular
View File