ansilove.js

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

commit 08549403d6ff615dd1424e94e2e850d01f042080
parent c16f34db26a7dbc71f97d3a01ac65bfb019237f3
Author: Andy Herbert <andy.herbert@gmail.com>
Date:   Sun, 27 Oct 2013 13:29:55 +0000

Added an option to pass raw bytes to animate with.

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

diff --git a/ansilove.js b/ansilove.js @@ -1591,6 +1591,26 @@ var AnsiLove = (function () { "animate": function (url, callback, options, callbackFail) { return animate(url, callback, options || {}, callbackFail); }, + "animateBytes": function (bytes, callback, options) { + var ansimation; + ansimation = new Ansimation(bytes, options || {}); + setTimeout(function () { + callback(ansimation.canvas, ansimation.sauce); + }, 250); + return { + "play": function (baud, callback, clearScreen) { + ansimation.play(baud, callback, clearScreen); + }, + "stop": function () { + ansimation.stop(); + }, + "load": function (url, callback, callbackFail) { + httpGet(url, function (bytes) { + ansimation.load(bytes, callback); + }, callbackFail); + } + }; + }, "sauce": sauce }; }()); \ No newline at end of file