diff options
Diffstat (limited to 'js/matrix.js')
| -rw-r--r-- | js/matrix.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/matrix.js b/js/matrix.js index 1aeb929..dbc76c7 100644 --- a/js/matrix.js +++ b/js/matrix.js @@ -250,6 +250,23 @@ Matrix.prototype.ascii = function () { var txt = lines.join("\n") return txt } +Matrix.prototype.ansi = function (opts) { + var lines = this.aa.map(function(row, y){ + var last, line = "" + row.forEach(function(lex, x) { + if (lex.eqColor(last)) { + line += lex.sanitize() + } + else { + line += lex.ansi() + last = lex + } + }) + return line + }) + var txt = lines.filter(function(line){ return line.length > 0 }).join('\\e[0m\\n') + "\\e[0m" + return 'echo -e "' + txt + '"' +} Matrix.prototype.mirc = function (opts) { var cutoff = false var lines = this.aa.map(function(row, y){ |
