From d55e8fb3e05bd94b1b5a61d4cc6fb24a18058e80 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Fri, 27 Nov 2020 16:44:40 -0700 Subject: [PATCH] Let users scroll desc in file browser --- WHATSNEW.md | 1 + art/themes/luciano_blocktronics/FBHELP.ANS | Bin 664 -> 663 bytes art/themes/luciano_blocktronics/FBRWSE.ANS | Bin 899 -> 1005 bytes core/file_area_list.js | 22 ++++++++++++++++++++- misc/menu_templates/file_base.in.hjson | 5 +++++ 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/WHATSNEW.md b/WHATSNEW.md index dcf4af4d..f6dd1fc0 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -10,6 +10,7 @@ This document attempts to track **major** changes and additions in ENiGMA½. For * The `message` arg used by `msg_list` has been deprecated. Please starting using `messageIndex` for this purpose. Support for `message` will be removed in the future. * Added ability to export/download messages. This is enabled in the default menu. See `messageAreaViewPost` in [the default message base template](./misc/menu_templates/message_base.in.hjson) and look for the download options (`@method:addToDownloadQueue`, etc.) for details on adding to your system! * The Gopher server has had a revamp! Standard `gophermap` files are now served along with any other content you configure for your Gopher Hole! A default [gophermap](https://en.wikipedia.org/wiki/Gopher_(protocol)#Source_code_of_a_menu) can be found [in the misc directory](./misc/gophermap) that behaves like the previous implementation. See [Gopher docs](./docs/servers/gopher.md) for more information. +* Default file browser up/down/pageUp/pageDown scrolls description (e.g. FILE_ID.DIZ) ## 0.0.11-beta * Upgraded from `alpha` to `beta` -- The software is far along and mature enough at this point! diff --git a/art/themes/luciano_blocktronics/FBHELP.ANS b/art/themes/luciano_blocktronics/FBHELP.ANS index 5dc95322fdf79ea5b521cea023e5e6c61c138728..08ea5885f343a4d8958204e84adc8c2a855f3871 100644 GIT binary patch delta 127 zcmbQiI-PYwUXX%xv|+BCymYj&L9RZKG|w$a4=q69y5yJVfd%w{0I1&BEVo!X+Q1q} yCl}@CCHa5%6NX$!5RRBq*K}9lCb5e>Y s9`Fz~Gz4lgHqV9WmX0=ewg>8+tj8F`Z3>e!G@Lw<@d2aCf6G3>TGYhCSvuO#+Sn{tK|w(}+8|dt+Q@XGt%R@3=7h;bOs^SRCdVa0% delta 55 zcmaFM-poG1dNL<7@5E?cCJX0@)t1brCe9mABrr}s%qTY5pGghGpWMl0&uBXN4%2H! JsmUjpRRPvC5bXc} diff --git a/core/file_area_list.js b/core/file_area_list.js index a62271ca..12abfd0d 100644 --- a/core/file_area_list.js +++ b/core/file_area_list.js @@ -144,7 +144,10 @@ exports.getModule = class FileAreaList extends MenuModule { }, displayHelp : (formData, extraArgs, cb) => { return this.displayHelpPage(cb); - } + }, + movementKeyPressed : (formData, extraArgs, cb) => { + return this._handleMovementKeyPress(_.get(formData, 'key.name'), cb); + }, }; } @@ -505,6 +508,23 @@ exports.getModule = class FileAreaList extends MenuModule { ); } + _handleMovementKeyPress(keyName, cb) { + const descView = this.viewControllers.browse.getView(MciViewIds.browse.desc); + if (!descView) { + return cb(null); + } + + switch (keyName) { + case 'down arrow' : descView.scrollDocumentUp(); break; + case 'up arrow' : descView.scrollDocumentDown(); break; + case 'page up' : descView.keyPressPageUp(); break; + case 'page down' : descView.keyPressPageDown(); break; + } + + this.viewControllers.browse.switchFocus(MciViewIds.browse.navMenu); + return cb(null); + } + fetchAndDisplayWebDownloadLink(cb) { const self = this; diff --git a/misc/menu_templates/file_base.in.hjson b/misc/menu_templates/file_base.in.hjson index 572abf97..afd497d0 100644 --- a/misc/menu_templates/file_base.in.hjson +++ b/misc/menu_templates/file_base.in.hjson @@ -73,6 +73,7 @@ mci: { MT1: { mode: preview + acceptsFocus: false } HM2: { @@ -152,6 +153,10 @@ keys: [ "?" ] action: @method:displayHelp } + { + keys: [ "down arrow", "up arrow", "page up", "page down" ] + action: @method:movementKeyPressed + } ] }