From 370f8039db0abf1a8445baca339c9544c71a9876 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 18 Nov 2018 14:19:34 -0700 Subject: [PATCH] * Use itemFormat/focusItemFormat for set newscan message/file conf/areas * Docs for set_newscan_date module --- .../luciano_blocktronics/SETMNSDATE.ANS | Bin 512 -> 526 bytes art/themes/luciano_blocktronics/theme.hjson | 10 ++++++ core/set_newscan_date.js | 11 +++---- docs/_includes/nav.md | 1 + docs/modding/file-base-download-manager.md | 2 +- .../modding/file-base-web-download-manager.md | 2 +- docs/modding/set-newscan-date.md | 29 ++++++++++++++++++ misc/menu_template.in.hjson | 1 - 8 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 docs/modding/set-newscan-date.md diff --git a/art/themes/luciano_blocktronics/SETMNSDATE.ANS b/art/themes/luciano_blocktronics/SETMNSDATE.ANS index 4d3b43a314582ba6d98d9721010a2432cb717c88..61cbb3daa0239aa4e58983984875677507959ae2 100644 GIT binary patch delta 33 ocmZo*>0_A?EMV#^9c^fBY?Lb}FCA@=tFSS&m637kGOMpXbjr3O0y diff --git a/art/themes/luciano_blocktronics/theme.hjson b/art/themes/luciano_blocktronics/theme.hjson index 2316eac9..31a67054 100644 --- a/art/themes/luciano_blocktronics/theme.hjson +++ b/art/themes/luciano_blocktronics/theme.hjson @@ -254,6 +254,16 @@ } } + messageAreaSetNewScanDate: { + mci: { + SM2: { + width: 54 + itemFormat: "|00|07{conf.name} |08- |07{area.name}" + focusItemFormat: "|00|15{conf.name} |07- |15{area.name}" + } + } + } + mailMenuCreateMessage: { 0: { mci: { diff --git a/core/set_newscan_date.js b/core/set_newscan_date.js index 27a27c21..c86b8e26 100644 --- a/core/set_newscan_date.js +++ b/core/set_newscan_date.js @@ -153,11 +153,13 @@ exports.getModule = class SetNewScanDate extends MenuModule { selections.push({ conf : { confTag : conf.confTag, + text : conf.conf.name, // standard name : conf.conf.name, desc : conf.conf.desc, }, area : { areaTag : area.areaTag, + text : area.area.name, // standard name : area.area.name, desc : area.area.desc, } @@ -168,11 +170,13 @@ exports.getModule = class SetNewScanDate extends MenuModule { selections.unshift({ conf : { confTag : '', + text : 'All conferences', name : 'All conferences', desc : 'All conferences', }, area : { areaTag : '', + text : 'All areas', name : 'All areas', desc : 'All areas', } @@ -236,14 +240,9 @@ exports.getModule = class SetNewScanDate extends MenuModule { scanDateView.setText(today.format(scanDateFormat)); if('message' === self.target) { - const messageSelectionsFormat = self.menuConfig.config.messageSelectionsFormat || '{conf.name} - {area.name}'; - const messageSelectionFocusFormat = self.menuConfig.config.messageSelectionFocusFormat || messageSelectionsFormat; - const targetSelectionView = vc.getView(MciViewIds.main.targetSelection); - targetSelectionView.setItems(self.targetSelections.map(targetSelection => stringFormat(messageSelectionFocusFormat, targetSelection))); - targetSelectionView.setFocusItems(self.targetSelections.map(targetSelection => stringFormat(messageSelectionFocusFormat, targetSelection))); - + targetSelectionView.setItems(self.targetSelections); targetSelectionView.setFocusItemIndex(0); } diff --git a/docs/_includes/nav.md b/docs/_includes/nav.md index a42520bb..fe587900 100644 --- a/docs/_includes/nav.md +++ b/docs/_includes/nav.md @@ -76,6 +76,7 @@ - [Show Art]({{ site.baseurl }}{% link modding/show-art.md %}) - [Download Manager]({{ site.baseurl }}{% link modding/file-base-download-manager.md %}) - [Web Download Manager]({{ site.baseurl }}{% link modding/file-base-web-download-manager.md %}) + - [Set Newscan Date]({{ site.baseurl }}{% link modding/set-newscan-date.md %}) - Administration - [oputil]({{ site.baseurl }}{% link admin/oputil.md %}) diff --git a/docs/modding/file-base-download-manager.md b/docs/modding/file-base-download-manager.md index 22d634a0..023ae478 100644 --- a/docs/modding/file-base-download-manager.md +++ b/docs/modding/file-base-download-manager.md @@ -19,5 +19,5 @@ The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) and MCI 10+ * `fileName`: Entry filename. * `path`: Full file path. * `byteSize`: Size in bytes of file. -* `webDlLink`: Web download link including VTX style ANSI ESC sequences. +* `webDlLink`: Web download link including [VTX style ANSI ESC sequences](https://raw.githubusercontent.com/codewar65/VTX_ClientServer/master/vtx.txt). * `webDlExpire`: Expiration date/time for this link. Formatted using `webDlExpireTimeFormat`. \ No newline at end of file diff --git a/docs/modding/file-base-web-download-manager.md b/docs/modding/file-base-web-download-manager.md index 09b8f22c..1dadca00 100644 --- a/docs/modding/file-base-web-download-manager.md +++ b/docs/modding/file-base-web-download-manager.md @@ -21,6 +21,6 @@ The following `itemFormat` object is provided to MCI 1 (ie: `%VM1`) and custom r * `path`: Full file path. * `byteSize`: Size in bytes of file. * `webDlLinkRaw`: Web download link. -* `webDlLink`: Web download link including VTX style ANSI ESC sequences. +* `webDlLink`: Web download link including [VTX style ANSI ESC sequences](https://raw.githubusercontent.com/codewar65/VTX_ClientServer/master/vtx.txt). * `webDlExpire`: Expiration date/time for this link. Formatted using `webDlExpireTimeFormat`. diff --git a/docs/modding/set-newscan-date.md b/docs/modding/set-newscan-date.md new file mode 100644 index 00000000..5649edac --- /dev/null +++ b/docs/modding/set-newscan-date.md @@ -0,0 +1,29 @@ +--- +layout: page +title: Set Newscan Date Module +--- +## Set Newscan Date Module +The `set_newscan_date` module allows setting newscan dates (aka pointers) for message conferences and areas as well as within the file base. Users can select specific conferences/areas or all (where applicable). + +## Configuration +### Configuration Block +Available `config` block entries are as follows: +* `target`: Choose from `message` for message conferences & areas, or `file` for file base areas. +* `scanDateFormat`: Format for scan date. This format must align with the **output** of the MaskEditView (`%ME1`) MCI utilized for input. Defaults to `YYYYMMDD` (which matches mask of `####/##/##`). + +### Theming +#### Message Conference & Areas +When `target` is `message`, the following `itemFormat` object is provided to MCI 2 (ie: `%SM2`): +* `conf`: An object containing: + * `confTag`: Conference tag. + * `name`: Conference name. Also available in `{text}`. + * `desc`: Conference description. +* `area`: An object containing: + * `areaTag`: Area tag. + * `name`: Area name. Also available in `{text}`. + * `desc`: Area description. + +When dealing with the file base, ENiGMA½ does not currently have the ability to set newscan dates for specific areas. No `%SM2` is used in this case. + +### Submit Actions +Submit action should map to `@method:scanDateSubmit` and provide `scanDate` in form data. For message conf/areas (`target` of `message`), `targetSelection` should be also be provided in form data: An index to the selected conf/area. diff --git a/misc/menu_template.in.hjson b/misc/menu_template.in.hjson index 8f1aca3b..e7653081 100644 --- a/misc/menu_template.in.hjson +++ b/misc/menu_template.in.hjson @@ -1921,7 +1921,6 @@ SM2: { argName: targetSelection submit: false - justify: right } } submit: {