From 5af2fdc6c55402444029199fc3c25455872a6da1 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 5 Nov 2018 21:35:12 -0700 Subject: [PATCH] More itemFormat & doc work --- art/themes/luciano_blocktronics/theme.hjson | 11 +++++----- core/rumorz.js | 12 +++++------ docs/modding/bbs-list.md | 24 +++++++++++++++++++++ docs/modding/rumorz.md | 12 +++++++++++ 4 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 docs/modding/bbs-list.md create mode 100644 docs/modding/rumorz.md diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index 60bede01..1abcd879 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -290,13 +290,14 @@ } mainMenuRumorz: { - config: { - listFormat: "|00|11 {rumor}" - focusListFormat: "|00|15> |14{rumor}" - } 0: { mci: { - VM1: { height: 14, width: 70 } + VM1: { + height: 14, + width: 70 + itemFormat: "|00|11 {rumor}" + focusItemFormat: "|00|15> |14{rumor}" + } TM2: { focusTextStyle: upper items: [ "yes", "no" ] diff --git a/core/rumorz.js b/core/rumorz.js index 153a74ee..31aea104 100644 --- a/core/rumorz.js +++ b/core/rumorz.js @@ -8,7 +8,6 @@ const theme = require('./theme.js'); const resetScreen = require('./ansi_term.js').resetScreen; const StatLog = require('./stat_log.js'); const renderStringLength = require('./string_util.js').renderStringLength; -const stringFormat = require('./string_format.js'); // deps const async = require('async'); @@ -155,12 +154,13 @@ exports.getModule = class RumorzModule extends MenuModule { }); }, function populateEntries(entriesView, entries, callback) { - const config = self.config; - const listFormat = config.listFormat || '{rumor}'; - const focusListFormat = config.focusListFormat || listFormat; + entriesView.setItems(entries.map(e => { + return { + text : e.log_value, // standard + rumor : e.log_value, + } + })); - entriesView.setItems(entries.map( e => stringFormat(listFormat, { rumor : e.log_value } ) ) ); - entriesView.setFocusItems(entries.map(e => stringFormat(focusListFormat, { rumor : e.log_value } ) ) ); entriesView.redraw(); return callback(null); diff --git a/docs/modding/bbs-list.md b/docs/modding/bbs-list.md new file mode 100644 index 00000000..4b61e616 --- /dev/null +++ b/docs/modding/bbs-list.md @@ -0,0 +1,24 @@ +--- +layout: page +title: BBS List +--- +## The BBS List Module +The built in `bbs_list` module provides the ability for users to manage entries to other Bulletin Board Systems. + +## Configuration +### Config Block +Available `config` block entries: +* `youSubmittedFormat`: Provides a format for entries that were submitted (and therefor ediable) by the current user. Defaults to `'{submitter} (You!)'`. Utilizes the same `itemFormat` object as entries described below. + +### Theming +The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) (the BBS list): +* `id`: Row ID +* `bbsName`: System name. Note that `{text}` also contains this value. +* `sysOp`: System Operator +* `telnet`: Telnet address +* `www`: Web address +* `location`: System location +* `software`: System's software +* `submitter`: Username of entry submitter +* `submitterUserId`: User ID of submitter +* `notes`: Any additional notes about the system diff --git a/docs/modding/rumorz.md b/docs/modding/rumorz.md new file mode 100644 index 00000000..f930edcc --- /dev/null +++ b/docs/modding/rumorz.md @@ -0,0 +1,12 @@ +--- +layout: page +title: Rumorz +--- +## The Rumorz Module +The built in `rumorz` module provides a classic interface for users to add and view rumorz! + +## Configuration + +### Theming +The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) (the rumor list): +* `rumor`: The rumor text. Also available in the standard `{text}` field.