ansilove.js

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

commit aab812d32cf68039606e0be5a8fe6a3ff5813a9d
parent 4f12dc1cc18e0472b3fd621477e3569d921b4999
Author: Andy Herbert <andyh@iMac.local>
Date:   Sat, 26 Oct 2013 16:09:43 +0100

added filetype option.

Diffstat:
MREADME.md | 17+++++++++++++++++
Mansilove.js | 2+-
2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -140,6 +140,23 @@ Used for .BIN files only. Skip this option when converting other formats. The de A thumbnail image is rendered instead of a full-size image. Does not apply when playing ansimations. +### Filetype options + +- ans +- txt +- nfo +- asc +- diz +- ion +- adf +- bin +- idf +- pcb +- tnd +- xb + +Instead of guessing the filetype based on the name or extension of the url, the chosen rendering method can be chosen from this list by using the option `"filetype": "<type>"`. Using this method, it is possible to display the raw data contained within a file by over-riding this property with `"asc"`. + ### SAUCE record As well as a canvas element, a [SAUCE][3] record is returned as a Javascript object if one is found, and follows this format: diff --git a/ansilove.js b/ansilove.js @@ -1207,7 +1207,7 @@ var AnsiLove = (function () { options.thumbnail = 0; } - switch (name.split(".").pop().toLowerCase()) { + switch (options.filetype || name.split(".").pop().toLowerCase()) { case "txt": case "nfo": case "asc":