ansilove.js

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

commit 170907f4c119fc02a06b84bdebfb957f755e1146
parent 736b44f2394ad4ff8b18c89af7703448cf3c80c3
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Tue, 15 Oct 2013 21:30:56 +0100

Add ability to load a new ans when playing an animation.

Diffstat:
Mansilove.js | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/ansilove.js b/ansilove.js @@ -1376,6 +1376,13 @@ var AnsiLove = (function () { } drawChunk(); }, + "load": function (bytes, callback) { + clearTimeout(timer); + file = new File(bytes); + if (callback) { + callback(); + } + }, "sauce": file.sauce }; } @@ -1389,6 +1396,11 @@ var AnsiLove = (function () { return { "play": function (baud, callback, clearScreen) { ansimation.play(baud, callback, clearScreen); + }, + "load": function (url, callback) { + httpGet(url, function (bytes) { + ansimation.load(bytes, callback); + }); } }; }