Skip to content

Instantly share code, notes, and snippets.

@planeguy
Created June 28, 2020 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save planeguy/827cb774f81473a75316276771057e85 to your computer and use it in GitHub Desktop.
Save planeguy/827cb774f81473a75316276771057e85 to your computer and use it in GitHub Desktop.
a _menu with a problem
{
/*
./\/\.' ENiGMA½ Menu Configuration -/--/-------- - -- -
_____________________ _____ ____________________ __________\_ /
\__ ____/\_ ____ \ /____/ / _____ __ \ / ______/ // /___jp!
// __|___// | \// |// | \// | | \// \ /___ /_____
/____ _____| __________ ___|__| ____| \ / _____ \
---- \______\ -- |______\ ------ /______/ ---- |______\ - |______\ /__/ // ___/
/__ _\
<*> ENiGMA½ // HTTPS://GITHUB.COM/NUSKOOLER/ENIGMA-BBS <*> /__/
*-----------------------------------------------------------------------------*
General Information
------------------------------- - -
This configuration is in HJSON (http://hjson.org/) format. Strict to-spec
JSON is also perfectly valid. Use 'hjson' from npm to convert to/from JSON.
See http://hjson.org/ for more information and syntax.
Various editors and IDEs such as Sublime Text 3, Visual Studio Code, and so
on have syntax highlighting for the HJSON format which are highly recommended.
------------------------------- -- - -
Menu Configuration
------------------------------- - -
ENiGMA½ makes no assumptions about specific menu types (main, doors, etc.),
but instead allows full customization of all menus throughout the system.
Some menus such as a main menu are considered "standard" while others are
backed by a specific module. SysOps can tweak various settings about these
modules (look & feel, keyboard interation, and so on) or even fully replace
the module with something else.
This file starts out as an example setup. Look at the examples, change
settings, menu ordering/flow, add/remove menus, implement ACS control,
etc.!
Remember you can *live edit* this file. That is, make a change and save
while you're logged into the system and it will take effect on the next
menu change or screen refresh.
Please see RTFM ...er, uh... see the documentation for more information, and
don't be shy to ask for help:
BBS : Xibalba @ xibalba.l33t.codes
FTN : BBS Discussion on fsxNet
IRC : #enigma-bbs / FreeNode
Email : bryan@l33t.codes
*/
menus:
{
login:
{
art: login
next: mainmenu
config:
{
tooNodeMenu: loginAttemptTooManyNodes
inactive: loginAttemptAccountInactive
disabled: loginAttemptAccountDisabled
locked: loginAttemptAccountLocked
}
form:
{
0:
{
mci:
{
ET1:
{
maxLength: @config:users.usernameMax
argName: username
focus: true
}
ET2:
{
password: true
maxLength: @config:users.passwordMax
argName: password
submit: true
}
}
submit:
{
*:
[
{
value:
{
password: null
}
action: @systemMethod:login
}
]
}
actionKeys:
[
{
keys:
[
escape
]
action: @systemMethod:prevMenu
}
]
}
}
}
loginAttemptTooManyNodes:
{
art: toomanynodes
config:
{
cls: true
nextTimeout: 2000
}
next: logoff
}
loginAttemptAccountLocked:
{
art: accountlocked
config:
{
cls: true
nextTimeout: 2000
}
next: logoff
}
loginAttemptAccountDisabled:
{
art: accountdisabled
config:
{
cls: true
nextTimeout: 2000
}
next: logoff
}
loginAttemptAccountInactive:
{
art: accountinactive
config:
{
cls: true
nextTimeout: 2000
}
next: logoff
}
logoff:
{
art: LOGOFF
desc: Logging Off
next: @systemMethod:logoff
}
mainmenu:
{
art: mainmenu
desc: Main Menu
prompt: menuCommand
config:
{
font: cp437
interrupt: realtime
}
submit:
[
{
value:
{
command: M
}
action: @menu:messages
}
{
value:
{
command: Q
}
action: @menu:logoff
}
{
value:
{
command: P
}
action: @menu:poast
}
{
value: 1
action: @menu:mainmenu
}
]
}
matrix:
{
art: matrix
form:
{
0:
{
VM:
{
mci:
{
VM1:
{
submit: true
focus: true
argName: navSelect
items:
[
{
text: login
data: login
}
{
text: apply
data: apply
}
{
text: log off
data: logoff
}
]
}
}
submit:
{
*:
[
{
value:
{
navSelect: login
}
action: @menu:login
}
{
value:
{
navSelect: apply
}
action: @menu:newUserApplication
}
{
value:
{
navSelect: logoff
}
action: @menu:logoff
}
]
}
}
}
}
}
messages:
{
module: msg_list
art: MSGLIST
config:
{
menuViewPost: viewPost
}
form:
{
0:
{
mci:
{
VM1:
{
focus: true
submit: true
argName: message
}
}
submit:
{
*:
[
{
value:
{
message: null
}
action: @method:selectMessage
}
]
}
actionKeys:
[
{
keys:
[
escape
q
shift + q
]
action: @systemMethod:prevMenu
}
{
keys:
[
shift + a
]
action: @menu:poast
}
{
keys:
[
>
.
]
action: @systemMethod:nextArea
}
{
keys:
[
<
","
]
action: @systemMethod:prevArea
}
{
keys:
[
p
shift + p
]
action: @menu:poast
}
{
keys:
[
shift + c
]
action: @menu:mainmenu
}
]
}
}
}
newUserApplication:
{
module: nua
art: newuser
next:
[
{
// Initial SysOp does not send feedback to themselves
acs: ID1
next: mainmenu
}
{
// ...everyone else does
next: newUserFeedbackToSysOpPreamble
}
]
form:
{
0:
{
mci:
{
ET1:
{
focus: true
argName: username
maxLength: @config:users.usernameMax
validate: @systemMethod:validateUserNameAvail
}
ET2:
{
argName: realName
maxLength: @config:users.realNameMax
validate: @systemMethod:validateNonEmpty
}
MET3:
{
argName: birthdate
maskPattern: "####/##/##"
validate: @systemMethod:validateBirthdate
}
// ME4: {
// argName: sex
// maskPattern: A
// textStyle: upper
// validate: @systemMethod:validateNonEmpty
// }
ET5:
{
argName: location
maxLength: @config:users.locationMax
validate: @systemMethod:validateNonEmpty
}
ET6:
{
argName: affils
maxLength: @config:users.affilsMax
}
ET7:
{
argName: email
maxLength: @config:users.emailMax
validate: @systemMethod:validateEmailAvail
}
ET8:
{
argName: web
maxLength: @config:users.webMax
}
ET9:
{
argName: password
password: true
maxLength: @config:users.passwordMax
validate: @systemMethod:validatePasswordSpec
}
ET10:
{
argName: passwordConfirm
password: true
maxLength: @config:users.passwordMax
validate: @method:validatePassConfirmMatch
}
TM12:
{
argName: submission
items:
[
apply
cancel
]
submit: true
}
}
submit:
{
*:
[
{
value:
{
submission: 0
}
action: @method:submitApplication
extraArgs:
{
inactive: userNeedsActivated
error: newUserCreateError
}
}
{
value:
{
submission: 1
}
action: @systemMethod:prevMenu
}
]
}
actionKeys:
[
{
keys:
[
escape
]
action: @systemMethod:prevMenu
}
]
}
}
}
poast:
{
desc: post message
module: msg_area_post_fse
config:
{
art:
{
header: MSGEHDR
body: MSGBODY
footerEditor: MSGEFTR
footerEditorMenu: MSGEMFT
help: MSGEHLP
}
editorMode: edit
editorType: area
}
form:
{
0:
{
mci:
{
TL1:
{
argName: from
}
ET2:
{
argName: to
focus: true
text: All
validate: @systemMethod:validateNonEmpty
maxLength: 36
}
ET3:
{
argName: subject
maxLength: 72
submit: true
validate: "@systemMethod:validateNonEmpty" // :TODO: Validate -> close/cancel if empty
}
}
submit:
{
3:
[
{
value:
{
subject: null
}
action: @method:headerSubmit
}
]
}
actionKeys:
[
{
keys:
[
escape
]
action: @systemMethod:prevMenu
}
]
}
1:
{
mci:
{
MT1:
{
width: 79
argName: message
mode: edit
}
}
submit:
{
*:
[
{
value: message
action: @method:editModeEscPressed
}
]
}
actionKeys:
[
{
keys:
[
escape
]
viewId: 1
}
]
}
2:
{
TLTL:
{
mci:
{
TL1:
{
width: 5
}
TL2:
{
width: 4
}
}
}
}
3:
{
HM:
{
mci:
{
HM1:
{
// :TODO: clear
items:
[
save
discard
help
]
}
}
submit:
{
*:
[
{
value:
{
1: 0
}
action: @method:editModeMenuSave
}
{
value:
{
1: 1
}
action: @systemMethod:prevMenu
}
{
value:
{
1: 2
}
action: @method:editModeMenuHelp
}
]
}
actionKeys:
[
{
keys:
[
escape
]
action: @method:editModeEscPressed
}
{
keys:
[
?
]
action: @method:editModeMenuHelp
}
]
// :TODO: something like the following for overriding keymap
// this should only override specified entries. others will default
/*
"keyMap" : {
"accept" : [ "return" ]
}
*/
}
}
}
}
sshConnected:
{
art: connected
next:
[
{
next: mainmenu
}
]
config:
{
nextTimeout: 1500
}
}
telnetConnected:
{
art: connected
next: matrix
config:
{
nextTimeout: 1500
}
}
viewPost:
{
module: msg_area_view_fse
config:
{
art:
{
header: MSGVHDR
body: MSGBODY
footerView: MSGVFTR
help: MSGVHLP
}
editorMode: view
editorType: area
}
form:
{
0:
{
mci:
{
// :TODO: ensure this block isn't even req. for theme to apply...
}
}
1:
{
mci:
{
MT1:
{
width: 79
mode: preview
}
}
submit:
{
*:
[
{
value: message
action: @method:editModeEscPressed
}
]
}
actionKeys:
[
{
keys:
[
escape
]
viewId: 1
}
]
}
2:
{
TLTL:
{
mci:
{
TL1:
{
width: 5
}
TL2:
{
width: 4
}
}
}
}
4:
{
mci:
{
HM1:
{
// :TODO: (#)Jump/(L)Index (msg list)/Last
items:
[
prev
next
reply
quit
help
]
focusItemIndex: 1
}
}
submit:
{
*:
[
{
value:
{
1: 0
}
action: @method:prevMessage
}
{
value:
{
1: 1
}
action: @method:nextMessage
}
{
value:
{
1: 2
}
action: @method:replyMessage
extraArgs:
{
menu: messageAreaReplyPost
}
}
{
value:
{
1: 3
}
action: @systemMethod:prevMenu
}
{
value:
{
1: 4
}
action: @method:viewModeMenuHelp
}
]
}
actionKeys:
[
{
keys:
[
p
shift + p
]
action: @method:prevMessage
}
{
keys:
[
n
shift + n
]
action: @method:nextMessage
}
{
keys:
[
r
shift + r
]
action: @method:replyMessage
extraArgs:
{
menu: messageAreaReplyPost
}
}
{
keys:
[
escape
q
shift + q
]
action: @systemMethod:prevMenu
}
{
keys:
[
?
]
action: @method:viewModeMenuHelp
}
{
keys:
[
down arrow
up arrow
page up
page down
]
action: @method:movementKeyPressed
}
]
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment