Giter Site home page Giter Site logo

bengarrett / retrotxt Goto Github PK

View Code? Open in Web Editor NEW
149.0 5.0 12.0 84.77 MB

RetroTxt is the WebExtension that turns ANSI, ASCII, NFO text into web documents.

Home Page: https://retrotxt.com

License: GNU Lesser General Public License v3.0

JavaScript 66.15% HTML 21.93% CSS 11.41% AGS Script 0.18% Rouge 0.24% Python 0.09%
chrome nfo firefox ascii text-art amiga atari-st vga xterm ibm-pc

retrotxt's Introduction

retrotxt's People

Contributors

bengarrett avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

retrotxt's Issues

Attempt to transform file being viewed via file:// causes endless spinner

If I open a text file via a file:// URL in Chrome 57.0.2987.133 32-bit in Windows 7, and then click on the RetroTxt toolbar button, the tab goes black and there is a big progress spinner. It seems this would go on forever, with nothing actually happening. I can use the mouse to highlight the un-transformed black-on-black text forming the black background and make it visible. This happens with both .nfo and .txt extensions.

I tried starting Chrome with --allow-file-access-from-files in case that was necessary and confirmed the option took effect, but this did not change anything.

If instead use python -m SimpleHTTPServer and access the same files via http:// then I can view and transform .txt files, though if I try .nfo then Chrome wants to download it.

ECMA-48 detection bug

test/example_files/ecma-48.txt says:
The start of the file MUST begin with an ECMA-48 escape sequence.

Could not find the requirement in standard (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf)

Moreover, if the file does not begin with an escape sequence, there is no way to view it coloured in RetroTxt.

Steps to reproduce: erase the first ๏ฟฝ[0; from test/example_files/ecma-48.txt and see the ugly unformatted text.

Correct behaviour: There should be some way to force ECMA-48 coloring of the file that does not begin with an escape sequence.

ยฉ

In the Options, turn [C] icon to a a href direct link pointing to the licence file.

Update store page example screenshots and README.md

The example screenshots on the store pages are out of date and need updating for use with RetroTxt 2.1.

Capture the screenshots featuring the browser border, tabs and toolbar to make it clear as to the function of the application.

Fix: SAUCE record corruption

Parts of the SAUCE record that rely on unsigned binary values can become corrupted. This is due to the browser loading the files as UTF-16 text instead of binary data. SAUCE TInfo1 and TInfo2 are common candidates for corruption when their values rely on 2 or more bytes.

The solution would be to re-download the file again using the Fetch API and extract the SAUCE record using its arrayBuffer method to extract the needed data.

The issue with this workaround would be with large ANSI artworks that would require a re-download and the extra memory overhead just to extract a few bytes of data.

Documentation

To add

  • Add table to technical.md confirming support for SAUCE ANSiFlags
  • Add IRC and Twitter contact information to the bottom of the readme.
  • Add screenshot art credits to the bottom of the readme.
  • Chrome or the V8 engine malforms cp437 conversion half way through the file
  • Chrome performance issues vs Firefox with ANSI and possible web extension speed throttling?
  • Information on browsers forcing the wrong Document.characterSet, how Chrome 55 drop option for user configuration

Split encoding in Chrome

Chrome has this strange bug where it swaps document.characterSet in the middle of the document.

In this example it swaps between ISO-8859-5 and Windows-1252
titan-artpack3/ascii/iks&2m-konami.ans

2017-03-01_11-50-49
2017-03-01_11-50-18

scanlines

can we have 25% - 50% - 75% scanlines?

Drop support for the Mozilla Add-on & instead self-host for Firefox?

The current release v.2.4 has been denied approval on Mozilla's Add-on page.

2 4 not approved

Due to some changes in their tools, as of a few months ago RetroTxt triggers a number UNSAFE_VAR_ASSIGNMENT Unsafe assignment to innerHTML warnings. These are not errors and have been approved in the past. But due to the fact each release submission review is done by a different volunteer, there is no guarantee a release will be approved, despite the code being open and my own reassurances.

There have been previous issues too, such as when the submission of v2.1.6 took 5 weeks to get approval.

Correct UI and style quirks in the Options

  • The current Options menu is too busy and suffers from too much text.
  • The mouseleave when previewing fonts needs to reset correctly.
  • The credits are too small.
  • Stylings and logos need to be more sympathetic to the browser's default schemes.
  • Need to update Readme.md to reflect the various name changes.

ANSI columns detection needs improvement.

See configMaxColumns() in text_emca48.js

Possible solutions is to create another separate loop through the textAsArray to determine the document's width before running the for loop block.

for (let i = 0, len = textAsArray.length; i < len; i++) {}

/blocktronics_block_n_roll/N-BTSLDS.ANS in is 210 columns but fails in RetroTxt.
/blocktronics_baud_dudes/WZ - Kali.ans 160 columns.

Complete X-bit multiple colour range support for ECMA48/ANSI art

  • 24-bit RGB colour, as specified by ISO-8613-3 and implemented by xterm [search text for These ISO-8613-3 controls are supported:]. This is easy to implement due to native CSS3 support for [background-]color: RGB(x,x,x);
  • 24-bit RGB colour, as specified by Picoe Software, ESC[(0|1);R;G;Bt
  • 2-bit colours, as specified by ANSI.SYS ESC[=4h aka CGA, see text_ecma48.js line 1047.

Note: CGA 2-bit allowed either, Cyan Magenta Black and White or Red Green Black and Yellow.
Maybe create a 16 colour ANSI proof sheet and display it in DOSBox & PCem in CGA to see the results.

Use system fixed width font by default

I think that it would be better if the defaults settings would be to use system fixed width font instead of using other fonts.

My need is to be able to parse console logs what have coloring (saved with tee) and the best user experience would be if it would be as close as possible to the rendering mode of the text files in the browser, just to convert ANSI escapes to HTML tags, nothing more.

Complete Node API interface support

Currently, parts of RetroTxt use a less secure but an easier to implement method of building an HTML document. It takes an ANSI/ECMA48 encoded document and replaces their escape codes with text representing HTML and injects them into the DOM innerHTML.

It is a hack and not considered good practice and now flags up issues with Mozilla's tools. In the long term, RetroTxt should use the Node API interface to build the HTML from scratch while iterating over each ANSI/ECMA48 escape sequence.

It will require a lot rewritten code but could enable the RetroTxt to support more escape sequences such as cursor movement back and up. These are currently lacking in the extension and break its ability to display ANSImations which are commonly used in early 1990s ANSI art.

A temporary Firefox fix?: https://developer.mozilla.org/en-US/docs/Archive/B2G_OS/Security/Security_Automation

Port to Node.js as a command line tool.

Share the source on this repo but keep it as self-contained Node script within a subdirectory.
But share font resources and CSS?

Strip out all the WebExtension browser functionality. Clone relevant Options menu items into command line options.

Refactor the RetroTxt files to use webextension, node.js or npm naming conventions?

Output could be of 3 ways below, and also to screen, to automatic filename, or user supplied filename.

  • Default, self-contained, compressed markup where all CSS, used fonts, etc are embedded into a single HTML5 file.
  • Developer, same as above but split out all CSS, fonts assets into separate linked files.
  • DIV, outputs the markup into a contained
    or . It will include CSS classes that point to CSS and font assets but not contain links to the files.

Monitor changes to saved Options.

Monitor changes for saved RetroTxt Options and settings. If any are deleted say by browser clean-up add-ons or user intervention. Replace the deletions with RetroTxt defaults.

Improve RetroTxt's detection of opened text file's encoding

Currently, RetroTxt will mistakenly attempt to convert existing UTF encoded files into UTF encoding. Which then scrambles the body of the text. Unfortunately, Chrome API is JavaScript based and JS's internal encoding is UTF-16. So any text loaded into JS for annalist will already be converted into UTF-16. This makes it difficult to determine which files are encoded into which character set if the source web server does not provide the accurate information.

The possible best option is to incorporate a stripped down version the node.js jschardet library?
https://github.com/aadsm/jschardet

Weird behavior when local file is deleted

Steps to reproduce:

  1. Open any local .NFO file in a browser tab
  2. Move the source file to recycle bin
  3. Reload (F5) the tab with the source file

Result: The tab goes into some kind of looping state where the tab label is flickering constantly.

Loosen file extension requirements

Loosen file extension requirements for autorun on pre-approve websites? Instead assume all hosted plaintext files which don't begin with the characters < or { are text?

< most probably is markdown.
{ most probably is json.

PCBoard/Wildcat sometimes fails

@ encoded text will fail if the start of the document includes newline characters.

Example



@CLS@@code@

The functions BuildBBS() & findControlSequences() will need to be modified to fix.

Fix: Context menu ticks not being removed

Context menu ticks are failing to work as expected in Chrome 62.

  • They do not tick default options on load.
  • The only tick after user selections of an item.
  • Once a tick is triggered, they are never removed.

Maybe the context menu API has changed?

https://developer.mozilla.org/en-US/Add-ons/WebExtensions/user_interface/Context_menu_items
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/OnClickData
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/menus/update

Firefox 48+ specific issues

  • When loading a text file for the first time. If you press the RetroTxt toolbar button to revert the text file back to its original form, the page's background colour is not reverted. This only happens once and then everything works as expected.
  • Line height 'normal' is padded.

Create a plain text welcome screen

Whenever RetroTxt is installed for the first time, an embedded plain text file should loadup in a new tab. This text file will be encoded as DOS CP-437 and include its unique glyphs for display. The text will also include some welcome text and maybe some help.

The text file should also be referenced with a link in the Options screen in between the Help and Github links.

Refactor JS direct style edits to CSS classes

Wherever possible move all JavaScript functionality of style manipulation to classes contained in separate and user edit-friendly CSS files.

These include the edits to the main tag, font width, height and line-spacing adjustments.

add extra space between lines

My retro side is telling me it's against the rules,
but an option to add a few extra pixels between each lines would increase readability
and would satisfy my visual side ;)

ANSI.SYS issues

Currently the work-in-progress MS-DOS ANSI.SYS support is accurate for around 5070% of documents. The following are a list of issues that maybe fixable. RetroTxt will never have the same level of compatibility as ANSILove due to the nature of rendering HTML tags vs the output to a terminal or a HTML <canvas>.

  • There is a speed rendering issue with large files. The JavaScript could probably be further optimised but it could also break the readability of the source.
  • No 24-bit RGB colour support; both ISO-8613-3 format and Picoe format
  • Currently support relies on CSS to fix the display of text to 80 characters-per-line. But it is not reliable.
  • Newer ANSI art from 2000+ are often encoded in European code pages such as CP-852. Currently Retrotxt only decodes CP437 and so these documents break.
  • No support for anything other than fixed 40/80 column display.

Options, credit links.

Add HTML element title=""s to font credit links that give more information on what they are being credited for.

Add 2x or double-size option.

Create a checkbox to double the size of RetroTxts output on-screen. It would append an extra CSS class double-sized that would add 2em and 200% to all existing CSS properties.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.