mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* Add rumorz mod
* ANSI/pipe working properly in VerticalMenuView * Fix bug in renderStringLength() * Make initSequence() part of prototype chain for inheritance * Use proper 'desc' field vs 'status' for menus when setting client/user status * Move pipeToAnsi() to setItems/setFocusItems vs every render * Add %RR random rumor MCI * Predefined MCI's can be init @ startup - RR uses random as a test bed * Add some StatLog functionality for ordering, keep forever, etc. * Fix TextView redraw issue * Better VerticalMenuView drawItem() logic * Add 'key press' emit for View * Enable formats for BBS list - works with MCI * Remove old system_property.js
This commit is contained in:
parent
2b68201f7d
commit
30ba609fb4
13 changed files with 492 additions and 241 deletions
|
@ -236,7 +236,8 @@ exports.stringFormatExtensions = stringFormatExtensions;
|
|||
|
||||
// :TODO: Add other codes from ansi_escape_parser
|
||||
const ANSI_REGEXP = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
||||
const ANSI_OR_PIPE_REGEXP = new RegExp(ANSI_REGEXP.source + '\\|[A-Z\d]{2}', 'g');
|
||||
const PIPE_REGEXP = /\|[A-Z\d]{2}/g;
|
||||
const ANSI_OR_PIPE_REGEXP = new RegExp(ANSI_REGEXP.source + '|' + PIPE_REGEXP.source, 'g');
|
||||
|
||||
//
|
||||
// Similar to substr() but works with ANSI/Pipe code strings
|
||||
|
@ -279,10 +280,8 @@ function renderSubstr(str, start, length) {
|
|||
// Pipe and ANSI color codes. Note that currently ANSI *movement*
|
||||
// codes are not considred!
|
||||
//
|
||||
// :TODO: consolidate ANSI code RegExp's and such
|
||||
const PIPE_AND_ANSI_RE = ANSI_OR_PIPE_REGEXP;// /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\|[A-Z\d]{2}/g
|
||||
function renderStringLength(str) {
|
||||
return str.replace(PIPE_AND_ANSI_RE, '').length;
|
||||
return str.replace(ANSI_OR_PIPE_REGEXP, '').length;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue