ansilove.js

A script to display ANSi and artscene related file formats on web pages
Log | Files | Refs | README | LICENSE

commit bf39b99974b56fe06d15c4a9b912d7cf8b1d192f
parent 0d77b6acba87930f28cf54dd3e8086d4a8bbc7cf
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Mon, 28 Oct 2013 22:26:21 +0000

Grab column width from sauce record, if available.

Diffstat:
Mansilove.js | 10+++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -951,6 +951,8 @@ var AnsiLove = (function () { function ans(bytes, options) { var file, escaped, escapeCode, j, code, values, columns, imageData, topOfScreen, x, y, savedX, savedY, foreground, background, bold, blink, inverse, palette; + file = new File(bytes); + function resetAttributes() { foreground = 7; background = 0; @@ -979,12 +981,14 @@ var AnsiLove = (function () { escapeCode = ""; escaped = false; - columns = (options.mode === "ced") ? 78 : 80; + if (options.mode === "ced") { + columns = 78; + } else { + columns = file.sauce.tInfo1 || 80; + } imageData = new ScreenData(columns); topOfScreen = 0; - file = new File(bytes); - function getValues() { return escapeCode.substr(1, escapeCode.length - 2).split(";").map(function (value) { var parsedValue;