diff --git a/WHATSNEW.md b/WHATSNEW.md index 293c9dc5..b1ec8ce6 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -29,6 +29,19 @@ This document attempts to track **major** changes and additions in ENiGMA½. For ``` * `idleLogoutSeconds` and `preAuthIdleLogoutSeconds` can now be set to `0` to fully disable the idle monitor. * Switched default archive handler for zip files from 7zip to InfoZip (`zip` and `unzip`) commands. See [UPGRADE](UPGRADE.md). +* Menu submit `action`'s can now in addition to being a simple string such as `@menu:someMenu`, or an array of objects with ACS checks, be a simple array of strings. In this case, a random match will be made. For example: +```hjson +submit: [ + { + value: { command: "FOO" } + action: [ + // one of the following actions will be matched: + "@menu:menuStyle1" + "@menu:menuStyle2" + ] + } +] +``` ## 0.0.9-alpha * Development is now against Node.js 10.x LTS. While other Node.js series may continue to work, you're own your own and YMMV! diff --git a/docs/configuration/menu-hjson.md b/docs/configuration/menu-hjson.md index 37b7f669..8ddda2d8 100644 --- a/docs/configuration/menu-hjson.md +++ b/docs/configuration/menu-hjson.md @@ -74,6 +74,23 @@ Submit actions are declared using the `action` member of a submit handler block. | `@method:methodName` | Executes *methodName* local to the calling module. That is, the module set by the `module` member of a menu entry. | | `@method:/path/to/some_module.js:methodName` | Executes *methodName* exported by the module at */path/to/some_module.js*. | +#### Advanced Action Handling +In addition to simple simple actions, `action` may also be: +* An array of objects containing ACS checks and a sub `action` if that ACS is matched. See **Action Matches** in the ACS documentation below for details. +* An array of actions. In this case a random selection will be made. Example: +```hjson +submit: [ + { + value: { command: "FOO" } + action: [ + // one of the following actions will be matched: + "@menu:menuStyle1" + "@menu:menuStyle2" + ] + } +] +``` + #### Method Signature Methods executed using `@method`, or `@systemMethod` have the following signature: ```