From 047d8fae899e039dc2c5524dd8f30972e14a740b Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 5 Nov 2018 21:54:04 -0700 Subject: [PATCH] File Transfer protocol: use itemFormat + docs --- art/themes/luciano_blocktronics/theme.hjson | 7 ++----- core/file_transfer_protocol_select.js | 9 ++------- docs/_includes/nav.md | 1 + docs/modding/file-transfer-protocol-select.md | 13 +++++++++++++ 4 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 docs/modding/file-transfer-protocol-select.md diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index f8e1faeb..06e6a011 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -912,17 +912,14 @@ } fileTransferProtocolSelection: { - config: { - protListFormat: "|00|03{name}" - protListFocusFormat: "|00|19|15{name}" - } - 0: { mci: { VM1: { height: 15 width: 30 focusTextStyle: first lower + itemFormat: "|00|03{name}" + focusItemFormat: "|00|19|15{name}" } } } diff --git a/core/file_transfer_protocol_select.js b/core/file_transfer_protocol_select.js index d8500dc5..13e30a74 100644 --- a/core/file_transfer_protocol_select.js +++ b/core/file_transfer_protocol_select.js @@ -4,7 +4,6 @@ // enigma-bbs const MenuModule = require('./menu_module.js').MenuModule; const Config = require('./config.js').get; -const stringFormat = require('./string_format.js'); const ViewController = require('./view_controller.js').ViewController; // deps @@ -110,12 +109,7 @@ exports.getModule = class FileTransferProtocolSelectModule extends MenuModule { function populateList(callback) { const protListView = vc.getView(MciViewIds.protList); - const protListFormat = self.config.protListFormat || '{name}'; - const protListFocusFormat = self.config.protListFocusFormat || protListFormat; - - protListView.setItems(self.protocols.map(p => stringFormat(protListFormat, p) ) ); - protListView.setFocusItems(self.protocols.map(p => stringFormat(protListFocusFormat, p) ) ); - + protListView.setItems(self.protocols); protListView.redraw(); return callback(null); @@ -131,6 +125,7 @@ exports.getModule = class FileTransferProtocolSelectModule extends MenuModule { loadAvailProtocols() { this.protocols = _.map(Config().fileTransferProtocols, (protInfo, protocol) => { return { + text : protInfo.name, // standard protocol : protocol, name : protInfo.name, hasBatch : _.has(protInfo, 'external.recvArgs'), diff --git a/docs/_includes/nav.md b/docs/_includes/nav.md index dbca7889..15641234 100644 --- a/docs/_includes/nav.md +++ b/docs/_includes/nav.md @@ -71,6 +71,7 @@ - [Message Area List]({{ site.baseurl }}{% link modding/msg-area-list.md %}) - [BBS List]({{ site.baseurl }}{% link modding/bbs-list.md %}) - [Rumorz]({{ site.baseurl }}{% link modding/rumorz.md %}) + - [File Transfer Protocol Select]({{ site.baseurl }}{% link modding/file-transfer-protocol-select.md %}) - Administration - [oputil]({{ site.baseurl }}{% link admin/oputil.md %}) diff --git a/docs/modding/file-transfer-protocol-select.md b/docs/modding/file-transfer-protocol-select.md new file mode 100644 index 00000000..72b8d124 --- /dev/null +++ b/docs/modding/file-transfer-protocol-select.md @@ -0,0 +1,13 @@ +--- +layout: page +title: File Transfer Protocol Select +--- +## The Rumorz Module +The built in `file_transfer_protocol_select` module provides a way to select a legacy file transfer protocol (X/Y/Z-Modem, etc.) for upload/downloads. + +## Configuration + +### Theming +The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) (the protocol list): +* `name`: The name of the protocol. Each entry is +op defined in `config.hjson` with defaults found in `config.js`. Note that the standard `{text}` field also contains this value. +