From 88d6e50033ff694e299927527e26b25914437b2a Mon Sep 17 00:00:00 2001 From: Marcin Kulik Date: Wed, 9 Mar 2011 21:54:38 +0100 Subject: [PATCH] Handle cross-frame codes --- public/javascripts/ansi-interpreter.js | 16 +++------------- public/javascripts/player.js | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 19 deletions(-) diff --git a/public/javascripts/ansi-interpreter.js b/public/javascripts/ansi-interpreter.js index 255ea10..20a3dc5 100644 --- a/public/javascripts/ansi-interpreter.js +++ b/public/javascripts/ansi-interpreter.js @@ -163,23 +163,13 @@ SP.AnsiInterpreter.prototype = { } if (handler) { - handler.call(this, data, match); data = data.slice(match[0].length) - } else { - - var s = data.slice(0, 10); - var hex = ''; - for (i=0; i 0) + console.log('rest: ' + rest); + + this.currentData = rest + this.data.slice(this.dataIndex, this.dataIndex + n); this.dataIndex += n; this.frame += 1; + + if (rest.length > 20) { + var s = rest.slice(0, 10); + var hex = ''; + for (i=0; i