diff --git a/core/client_term.js b/core/client_term.js index 7b367583..2cf90ac3 100644 --- a/core/client_term.js +++ b/core/client_term.js @@ -159,7 +159,7 @@ ClientTerminal.prototype.rawWrite = function(s) { }; ClientTerminal.prototype.pipeWrite = function(s, spec) { - spec = spec || 'enigma'; + spec = spec || 'renegade'; var conv = { enigma : enigmaToAnsi, diff --git a/core/color_codes.js b/core/color_codes.js index 1efbb071..3ccb9029 100644 --- a/core/color_codes.js +++ b/core/color_codes.js @@ -7,10 +7,10 @@ var getPredefinedMCIValue = require('./predefined_mci.js').getPredefinedMCIValue var assert = require('assert'); var _ = require('lodash'); -exports.pipeToAnsi = exports.enigmaToAnsi = enigmaToAnsi; +exports.enigmaToAnsi = enigmaToAnsi; exports.stripPipeCodes = exports.stripEnigmaCodes = stripEnigmaCodes; exports.pipeStrLen = exports.enigmaStrLen = enigmaStrLen; -exports.renegadeToAnsi = renegadeToAnsi; +exports.pipeToAnsi = exports.renegadeToAnsi = renegadeToAnsi; // :TODO: Not really happy with the module name of "color_codes". Would like something better @@ -83,13 +83,13 @@ function enigmaStrLen(s) { return stripEnigmaCodes(s).length; } -function renegadeToAnsi(s) { -if(-1 == s.indexOf('|')) { +function renegadeToAnsi(s, client) { + if(-1 == s.indexOf('|')) { return s; // no pipe codes present } var result = ''; - var re = /\|(\d{2}|\|)/g; + var re = /\|([A-Z\d]{2}|\|)/g; var m; var lastIndex = 0; while((m = re.exec(s))) { @@ -101,42 +101,46 @@ if(-1 == s.indexOf('|')) { } // convert to number - val = parseInt(val, 10); + val = parseInt(val, 10); if(isNaN(val)) { - val = 0; + val = getPredefinedMCIValue(client, m[1]) || ('|' + m[1]); // value itself or literal } - assert(val >= 0 && val <= 23); - var attr = ansi.sgr({ - 0 : [ 'reset', 'black' ], - 1 : [ 'reset', 'blue' ], - 2 : [ 'reset', 'green' ], - 3 : [ 'reset', 'cyan' ], - 4 : [ 'reset', 'red' ], - 5 : [ 'reset', 'magenta' ], - 6 : [ 'reset', 'yellow' ], - 7 : [ 'reset', 'white' ], + if(_.isString(val)) { + result += s.substr(lastIndex, m.index - lastIndex) + val; + } else { + var attr = ansi.sgr({ + 0 : [ 'reset', 'black' ], + 1 : [ 'reset', 'blue' ], + 2 : [ 'reset', 'green' ], + 3 : [ 'reset', 'cyan' ], + 4 : [ 'reset', 'red' ], + 5 : [ 'reset', 'magenta' ], + 6 : [ 'reset', 'yellow' ], + 7 : [ 'reset', 'white' ], - 8 : [ 'bold', 'black' ], - 9 : [ 'bold', 'blue' ], - 10 : [ 'bold', 'green' ], - 11 : [ 'bold', 'cyan' ], - 12 : [ 'bold', 'red' ], - 13 : [ 'bold', 'magenta' ], - 14 : [ 'bold', 'yellow' ], - 15 : [ 'bold', 'white' ], + 8 : [ 'bold', 'black' ], + 9 : [ 'bold', 'blue' ], + 10 : [ 'bold', 'green' ], + 11 : [ 'bold', 'cyan' ], + 12 : [ 'bold', 'red' ], + 13 : [ 'bold', 'magenta' ], + 14 : [ 'bold', 'yellow' ], + 15 : [ 'bold', 'white' ], - 16 : [ 'blackBG' ], - 17 : [ 'blueBG' ], - 18 : [ 'greenBG' ], - 19 : [ 'cyanBG' ], - 20 : [ 'redBG' ], - 21 : [ 'magentaBG' ], - 22 : [ 'yellowBG' ], - 23 : [ 'whiteBG' ], - }[val] || 'normal'); + 16 : [ 'blackBG' ], + 17 : [ 'blueBG' ], + 18 : [ 'greenBG' ], + 19 : [ 'cyanBG' ], + 20 : [ 'redBG' ], + 21 : [ 'magentaBG' ], + 22 : [ 'yellowBG' ], + 23 : [ 'whiteBG' ], + }[val] || 'normal'); + + result += s.substr(lastIndex, m.index - lastIndex) + attr; + } - result += s.substr(lastIndex, m.index - lastIndex) + attr; lastIndex = re.lastIndex; } diff --git a/core/connect.js b/core/connect.js index cd20a619..67ab1c1f 100644 --- a/core/connect.js +++ b/core/connect.js @@ -78,9 +78,9 @@ function prepareTerminal(term) { function displayBanner(term) { term.pipeWrite( - '|33Conected to |32EN|33|01i|00|32|22GMA|32|01½|00 |33BBS version|31|01 |VN\n' + - '|00|33Copyright (c) 2014-2015 Bryan Ashby |33|01- |31|01http://l33t.codes/\n' + - '|00|33Updates & source |01- |31|01https://github.com/NuSkooler/enigma-bbs/\n' + + '|06Conected to |02EN|10i|02GMA|10½ |06BBS version |12|VN\n' + + '|06Copyright (c) 2014-2015 Bryan Ashby |14- |12http://l33t.codes/\n' + + '|06Updates & source |14- |12https://github.com/NuSkooler/enigma-bbs/\n' + '|00'); } diff --git a/core/vertical_menu_view.js b/core/vertical_menu_view.js index 90fc566e..72bc2a40 100644 --- a/core/vertical_menu_view.js +++ b/core/vertical_menu_view.js @@ -89,8 +89,8 @@ function VerticalMenuView(options) { // :TODO: Need to support pad() // :TODO: shoudl we detect if pipe codes are used? self.client.term.write( - ansi.goto(item.row, self.position.col) + - colorCodes.enigmaToAnsi(text) + ansi.goto(item.row, self.position.col) + + colorCodes.pipeToAnsi(text, self.client) ); } else { diff --git a/mods/themes/NU-MAYA/APPLY1.ANS b/mods/themes/NU-MAYA/APPLY1.ANS deleted file mode 100644 index c6196ea4..00000000 Binary files a/mods/themes/NU-MAYA/APPLY1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/LASTCALL.ANS b/mods/themes/NU-MAYA/LASTCALL.ANS deleted file mode 100644 index ce09facd..00000000 Binary files a/mods/themes/NU-MAYA/LASTCALL.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MATRIX.ANS b/mods/themes/NU-MAYA/MATRIX.ANS deleted file mode 100644 index 456eddf8..00000000 Binary files a/mods/themes/NU-MAYA/MATRIX.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MMENU1.ANS b/mods/themes/NU-MAYA/MMENU1.ANS deleted file mode 100644 index 68c690f3..00000000 Binary files a/mods/themes/NU-MAYA/MMENU1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MNUPRMT.ANS b/mods/themes/NU-MAYA/MNUPRMT.ANS deleted file mode 100644 index 5b10c3d0..00000000 Binary files a/mods/themes/NU-MAYA/MNUPRMT.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGBODY.ANS b/mods/themes/NU-MAYA/MSGBODY.ANS deleted file mode 100644 index 78771ade..00000000 Binary files a/mods/themes/NU-MAYA/MSGBODY.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGEFTR1.ANS b/mods/themes/NU-MAYA/MSGEFTR1.ANS deleted file mode 100644 index 29582329..00000000 Binary files a/mods/themes/NU-MAYA/MSGEFTR1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGEHDR1.ANS b/mods/themes/NU-MAYA/MSGEHDR1.ANS deleted file mode 100644 index 69546953..00000000 Binary files a/mods/themes/NU-MAYA/MSGEHDR1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGEHLP.ANS b/mods/themes/NU-MAYA/MSGEHLP.ANS deleted file mode 100644 index 121250ca..00000000 Binary files a/mods/themes/NU-MAYA/MSGEHLP.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGEMFT1.ANS b/mods/themes/NU-MAYA/MSGEMFT1.ANS deleted file mode 100644 index 6c334204..00000000 Binary files a/mods/themes/NU-MAYA/MSGEMFT1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGHDR1.ANS b/mods/themes/NU-MAYA/MSGHDR1.ANS deleted file mode 100644 index 4fa6ef7f..00000000 Binary files a/mods/themes/NU-MAYA/MSGHDR1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGQUOT.ANS b/mods/themes/NU-MAYA/MSGQUOT.ANS deleted file mode 100644 index f7d62a3d..00000000 Binary files a/mods/themes/NU-MAYA/MSGQUOT.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGVFTR1.ANS b/mods/themes/NU-MAYA/MSGVFTR1.ANS deleted file mode 100644 index 3b1c4094..00000000 Binary files a/mods/themes/NU-MAYA/MSGVFTR1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGVHDR1.ANS b/mods/themes/NU-MAYA/MSGVHDR1.ANS deleted file mode 100644 index 6bb0f635..00000000 Binary files a/mods/themes/NU-MAYA/MSGVHDR1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/MSGVHLP.ANS b/mods/themes/NU-MAYA/MSGVHLP.ANS deleted file mode 100644 index 5fed6314..00000000 Binary files a/mods/themes/NU-MAYA/MSGVHLP.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/NUA.ANS b/mods/themes/NU-MAYA/NUA.ANS deleted file mode 100644 index 780ad55d..00000000 Binary files a/mods/themes/NU-MAYA/NUA.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/NUAFDBK.ANS b/mods/themes/NU-MAYA/NUAFDBK.ANS deleted file mode 100644 index f1ce7bc1..00000000 Binary files a/mods/themes/NU-MAYA/NUAFDBK.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/PAUSE.ANS b/mods/themes/NU-MAYA/PAUSE.ANS deleted file mode 100644 index e0bc33cf..00000000 Binary files a/mods/themes/NU-MAYA/PAUSE.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/STATUS.ANS b/mods/themes/NU-MAYA/STATUS.ANS deleted file mode 100644 index e14289d9..00000000 Binary files a/mods/themes/NU-MAYA/STATUS.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/SYSSTAT1.ANS b/mods/themes/NU-MAYA/SYSSTAT1.ANS deleted file mode 100644 index 57211932..00000000 Binary files a/mods/themes/NU-MAYA/SYSSTAT1.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/USERLOG.ANS b/mods/themes/NU-MAYA/USERLOG.ANS deleted file mode 100644 index cd090c7e..00000000 Binary files a/mods/themes/NU-MAYA/USERLOG.ANS and /dev/null differ diff --git a/mods/themes/NU-MAYA/theme.hjson b/mods/themes/NU-MAYA/theme.hjson deleted file mode 100644 index 96a03e51..00000000 --- a/mods/themes/NU-MAYA/theme.hjson +++ /dev/null @@ -1,119 +0,0 @@ -{ - info: { - name: Nu Mayan - author: NuSkooler - } - - customization: { - - defaults: { - general: { - passwordChar: φ - } - - dateFormat: { - short: YYYY-MMM-DD - } - - timeFormat: { - short: h:mm:ss a - } - - mci: { - TM: { - styleSGR1: |00|30|01 - } - } - } - - menus: { - matrix: { - VM1: { - itemSpacing: 1 - justify: center - width: 12 - focusTextStyle: l33t - } - } - - apply: { - ET1: { width: 21 } - - ET2: { width: 21 } - - ME3: { - styleSGR1: |00|30|01 - styleSGR2: |00|37 - fillChar: "#" - } - - ET4: { width: 1 } - ET5: { width: 21 } - ET6: { width: 21 } - ET7: { width: 21 } - ET8: { width: 21 } - ET9: { width: 21 } - ET10: { width: 21 } - } - - newUserApplication: { - ET1: { width: 38 } - - ET2: { width: 38 } - - /*ME3: { - styleSGR1: |00|30|01 - styleSGR2: |00|37 - fillChar: "#" - }*/ - - //ET4: { width: 1 } - ET5: { width: 38 } - ET6: { width: 38 } - ET7: { width: 38 } - ET8: { width: 38 } - ET9: { width: 38 } - ET10: { width: 38 } - TM12: { - focusTextStyle: first lower - } - } - - lastCallers: { - TL1: { - resizable: false - width: 16 - textOverflow: ... - } - - TL2: { - resizable: false - width: 19 - textOverflow: ... - } - - TL3: { - resizable: false - width: 17 - textOverflow: ... - } - } - - messageAreaViewPost: { - 0: { - TL3: { - width: 27 - textOverflow: ... - } - } - } - } - - prompts: { - userCredentials: { - ET1: { width: 21 } - ET2: { width: 21 } - } - } - } -} diff --git a/mods/themes/luciano_blocktronics/theme.hjson b/mods/themes/luciano_blocktronics/theme.hjson index 375fb479..53a33ce5 100644 --- a/mods/themes/luciano_blocktronics/theme.hjson +++ b/mods/themes/luciano_blocktronics/theme.hjson @@ -114,7 +114,7 @@ mainMenuLastCallers: { config: { - listFormat: "|00|01|36{userName:<17.17}{location:<20.20}{affils:<17.17}{ts:<15}" + listFormat: "|00|11{userName:<17.17}|03{location:<20.20}|11{affils:<17.17}|03{ts:<15}" dateTimeFormat: MMM Do h:mma } mci: { @@ -124,8 +124,8 @@ mainMenuUserList: { config: { - listFormat: "|00|01|36{userName:<17.17}{affils:<21.21}{note:<19.19}{lastLoginTs}" - focusListFormat: "|00|42|30{userName:<17.17}{affils:<21.21}{note:<19.19}{lastLoginTs}" + listFormat: "|00|11{userName:<17.17}|03{affils:<21.21}|11{note:<19.19}|03{lastLoginTs}" + focusListFormat: "|00|19|15{userName:<17.17}{affils:<21.21}{note:<19.19}{lastLoginTs}" dateTimeFormat: MMM Do h:mma } mci: { @@ -135,7 +135,7 @@ mainMenuWhosOnline: { config: { - listFormat: "|00|01|36{node:<6.6}{userName:<17.17}{affils:<19.19}{action:<20.20}{timeOn:<8}" + listFormat: "|00|03{node:<6.6}|11{userName:<17.17}|03{affils:<19.19}|11{action:<20.20}|03{timeOn:<8}" } mci: { VM1: { height: 10 } @@ -144,8 +144,8 @@ messageAreaMessageList: { config: { - listFormat: "|00|01|37{msgNum:>4} |00|37- |36{subj:<29.29} {from:<20.20} {ts} |01|31{newIndicator}" - focusListFormat: "|00|42|30{msgNum:>4} - {subj:<29.29} {from:<20.20} {ts} {newIndicator}" + listFormat: "|00|15{msgNum:>4} |03{subj:<29.29} |11{from:<20.20} |03{ts} |01|31{newIndicator}" + focusListFormat: "|00|19|15{msgNum:>4} {subj:<29.29} {from:<20.20} {ts} {newIndicator}" dateTimeFormat: ddd MMM Do } mci: { @@ -157,8 +157,8 @@ messageAreaChangeCurrentArea: { config: { - listFormat: "|00|01|37{index} |00|37- |36{desc}" - focusListFormat: "|00|42|30{index} - {desc}" + listFormat: "|00|15{index} |07- |03{desc}" + focusListFormat: "|00|19|15{index} - {desc}" } mci: { VM1: { @@ -240,7 +240,7 @@ fullLoginSequenceLastCallers: { config: { - listFormat: "|00|01|36{userName:<17.17}{location:<20.20}{affils:<17.17}{ts:<15}" + listFormat: "|00|11{userName:<17.17}|03{location:<20.20}|11{affils:<17.17}|03{ts:<15}" dateTimeFormat: MMM Do h:mma } mci: { @@ -250,7 +250,7 @@ fullLoginSequenceWhosOnline: { config: { - listFormat: "|00|01|36{node:<6.6}{userName:<17.17}{affils:<19.19}{action:<20.20}{timeOn:<8}" + listFormat: "|00|03{node:<6.6}|11{userName:<17.17}|03{affils:<19.19}|11{action:<20.20}|03{timeOn:<8}" } mci: { VM1: { height: 10 } diff --git a/mods/user_list.js b/mods/user_list.js index 7cb6a687..59826753 100644 --- a/mods/user_list.js +++ b/mods/user_list.js @@ -84,10 +84,11 @@ UserListModule.prototype.mciReady = function(mciData, cb) { userId : ue.userId, userName : ue.userName, affils : ue.affiliation, + location : ue.location, // :TODO: the rest! note : ue.note || '', lastLoginTs : moment(ue.last_login_timestamp).format(dateTimeFormat), - } + }; } userListView.setItems(_.map(userList, function formatUserEntry(ue) {