Let users scroll desc in file browser

This commit is contained in:
Bryan Ashby 2020-11-27 16:44:40 -07:00
parent cd3b495e6c
commit d55e8fb3e0
No known key found for this signature in database
GPG Key ID: B49EB437951D2542
5 changed files with 27 additions and 1 deletions

View File

@ -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. * 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! * 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. * 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 ## 0.0.11-beta
* Upgraded from `alpha` to `beta` -- The software is far along and mature enough at this point! * Upgraded from `alpha` to `beta` -- The software is far along and mature enough at this point!

View File

@ -144,7 +144,10 @@ exports.getModule = class FileAreaList extends MenuModule {
}, },
displayHelp : (formData, extraArgs, cb) => { displayHelp : (formData, extraArgs, cb) => {
return this.displayHelpPage(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) { fetchAndDisplayWebDownloadLink(cb) {
const self = this; const self = this;

View File

@ -73,6 +73,7 @@
mci: { mci: {
MT1: { MT1: {
mode: preview mode: preview
acceptsFocus: false
} }
HM2: { HM2: {
@ -152,6 +153,10 @@
keys: [ "?" ] keys: [ "?" ]
action: @method:displayHelp action: @method:displayHelp
} }
{
keys: [ "down arrow", "up arrow", "page up", "page down" ]
action: @method:movementKeyPressed
}
] ]
} }