better track the resulting javascript too.
This commit is contained in:
parent
a06a65bb95
commit
d2092d9189
12 changed files with 1265 additions and 0 deletions
51
16col/bin.js
Normal file
51
16col/bin.js
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
// Generated by CoffeeScript 1.7.1
|
||||
(function() {
|
||||
var __hasProp = {}.hasOwnProperty,
|
||||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
||||
|
||||
this.ImageTextModeBin = (function(_super) {
|
||||
__extends(ImageTextModeBin, _super);
|
||||
|
||||
function ImageTextModeBin(options) {
|
||||
var k, v;
|
||||
ImageTextModeBin.__super__.constructor.apply(this, arguments);
|
||||
this.linewrap = 160;
|
||||
for (k in options) {
|
||||
if (!__hasProp.call(options, k)) continue;
|
||||
v = options[k];
|
||||
this[k] = v;
|
||||
}
|
||||
}
|
||||
|
||||
ImageTextModeBin.prototype.parse = function(content) {
|
||||
var attr, ch, i, x, y, _i, _ref;
|
||||
x = 0;
|
||||
y = 0;
|
||||
this.screen[y] = [];
|
||||
for (i = _i = 0, _ref = content.length - 2; _i <= _ref; i = _i += 2) {
|
||||
ch = content.substr(i, 1);
|
||||
if (ch === "\x1a") {
|
||||
break;
|
||||
}
|
||||
attr = this.getByteAt(content, i + 1);
|
||||
this.screen[y][x] = {
|
||||
'ch': ch,
|
||||
'attr': attr
|
||||
};
|
||||
x++;
|
||||
if (x === this.linewrap) {
|
||||
x = 0;
|
||||
y++;
|
||||
this.screen[y] = [];
|
||||
}
|
||||
}
|
||||
if (this.screen[y].length === 0) {
|
||||
return this.screen.pop();
|
||||
}
|
||||
};
|
||||
|
||||
return ImageTextModeBin;
|
||||
|
||||
})(this.ImageTextMode);
|
||||
|
||||
}).call(this);
|
||||
Loading…
Add table
Add a link
Reference in a new issue