* LOTS of menu.hjson cleanup

* login2 renamed to login
* Use config for msg view menu entry @ message list
This commit is contained in:
Bryan Ashby 2015-10-27 20:21:58 -06:00
parent 377d391033
commit bddc575158
3 changed files with 113 additions and 329 deletions

View File

@ -6,49 +6,6 @@
perfectly valid. The hjson npm can be used to convert to/from JSON. perfectly valid. The hjson npm can be used to convert to/from JSON.
See http://hjson.org/ for more information and syntax. See http://hjson.org/ for more information and syntax.
*/
/*
:TODO: Fully convert to HJSON
Menu Configuration
Tip: demjson's jsonlint is an excellent tool for linting JSON files
that contains comments:
jsonlint -S menu.json
Some concept/ideas:
"mci" : {
"BT1" : {
...
"draw" : "@script:blah.js/drawButton"
// @method:scriptName[.js]/methodName (foreign .js)
// @art:artName
// @method:/methodName (local to module.js)
// ... pass isFocused/etc. into draw method
NOte that @draw & @art should check theme first.
@draw:myMethod -> theme/draw.js::myMethod(opts)
priority:
@draw:location.js/myMethod -> outside of theme
@draw:myMethod -> checks theme -> local first
-OR- just inside themes for customization...
e.g;
{
"myTheme" {
"views" : {
"VerticalMenuView" : {
"draw" : "@method:location.js/myMethod"
}
}
}
}
}
}
*/ */
menus: { menus: {
// //
@ -81,13 +38,11 @@
options: { nextTimeout: 1500 } options: { nextTimeout: 1500 }
} }
// Ye ol' standard matrix
matrix: { matrix: {
art: matrix art: matrix
options: {
}
form: { form: {
0: { // :TODO: Make form "0" the default if missing (e.g. optional)... not sure how with current structure though 0: {
VM: { VM: {
mci: { mci: {
VM1: { VM1: {
@ -97,18 +52,16 @@
items: [ "login", "apply", "log off" ] items: [ "login", "apply", "log off" ]
} }
} }
submit: { submit: {
*: [ *: [
{ {
value: { 1: 0 } value: { 1: 0 }
action: @menu:login2 action: @menu:login
}, }
{ {
value: { 1: 1 }, value: { 1: 1 },
action: @menu:newUserApplication action: @menu:newUserApplication
//action: @menu:apply }
},
{ {
value: { 1: 2 }, value: { 1: 2 },
action: @menu:logoff action: @menu:logoff
@ -120,29 +73,10 @@
} }
} }
"login" : { login: {
"prompt" : "userLoginCredentials",
"fallback" : "matrix",
"next" : "fullLoginSequenceLoginArt",
"action" : "@systemMethod:login",
// :TODO: support alt submit method for prompts
// if present, standard filters apply. No need for multiple submit ID's
// since a prompt can only utilize one:
/*"submit" : [
{
"value" : { "password" : null },
"action" : "@systemMethod:login"
}
]*/
},
login2: {
art: USERLOG art: USERLOG
//next: messageArea
next: fullLoginSequenceLoginArt next: fullLoginSequenceLoginArt
config: { config: {
//tooNodeArt: TOONODE
tooNode: { tooNode: {
art: TOONODE art: TOONODE
} }
@ -162,7 +96,6 @@
submit: true submit: true
} }
} }
submit: { submit: {
*: [ *: [
{ {
@ -181,14 +114,14 @@
} }
} }
"logoff" : { logoff: {
"art" : "LOGOFF", art: LOGOFF
"next" : "@systemMethod:logoff", next: @systemMethod:logoff
}, }
/* /*
nua -> send sysop mail -> { active } -> matrix nua -> send sysop mail -> { active } -> matrix
-> you must active -> matrix -> you must active -> matrix
TODO: display PRINT before this (Obv/2) TODO: display PRINT before this (Obv/2) or NEWUSER1 (Mystic)
*/ */
newUserApplication: { newUserApplication: {
art: NUA art: NUA
@ -504,17 +437,11 @@
art: STATUS art: STATUS
options: { pause: true } options: { pause: true }
next: mainMenu next: mainMenu
}, }
"newUserActive" : {
"art" : "SO-CC1.ANS", ///////////////////////////////////////////////////////////////////////
"options" : { "pause" : true }, // Main Menu
"next" : "currentUserStats" ///////////////////////////////////////////////////////////////////////
},
"currentUserStats" : {
"art" : "userstats",
"options" : { "pause" : true }
//"action" : "@menu:lastCallers"
},
mainMenu: { mainMenu: {
art: MMENU art: MMENU
desc: Main Menu desc: Main Menu
@ -532,12 +459,6 @@
value: { command: "D" } value: { command: "D" }
action: @menu:doorMenu action: @menu:doorMenu
} }
/*
{
"value" : { "command" : "L" },
"action" : "@menu:doorLORD"
},
*/
{ {
value: { command: "U" } value: { command: "U" }
action: @menu:mainMenuUserList action: @menu:mainMenuUserList
@ -645,6 +566,9 @@
} }
} }
} }
///////////////////////////////////////////////////////////////////////
// Doors Menu
///////////////////////////////////////////////////////////////////////
doorMenu: { doorMenu: {
desc: Doors Menu desc: Doors Menu
art: DOORMNU art: DOORMNU
@ -668,8 +592,40 @@
} }
] ]
} }
/*
The 'abracadabra' module's config.args accepts the following format objects:
{dropfile} - Path to generated dropfile
{node} - Node number
*/
doorPimpWars: {
desc: Playing PimpWars
module: abracadabra
config: {
name: PimpWars
dropFileType: DORINFO
cmd: /usr/bin/dosemu
args: [
"-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\PW\\START.BAT {dropfile} {node}"
],
nodeMax: 1
// :TODO: Obv/2 name for this?
tooManyArt: doortoomany.ans
}
},
doorLORD: {
desc: Playing L.O.R.D.
module: abracadabra
config: {
name: LORD
dropFileType: DOOR
cmd: /usr/bin/dosemu
args: [
"-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\LORD\\START.BAT {node}"
]
}
}
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// Message Area Related // Message Area Menu
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
messageArea: { messageArea: {
module: msg_area module: msg_area
@ -706,24 +662,24 @@
messageAreaChangeCurrentArea: { messageAreaChangeCurrentArea: {
art: CHANGE art: CHANGE
module: msg_area_list module: msg_area_list
"form" : { form: {
"0" : { 0: {
"mci" : { mci: {
"VM1" : { VM1: {
"focus" : true, focus: true
"submit" : true, submit: true
"argName" : "area" argName: area
} }
}, }
"submit" : { submit: {
"*" : [ *: [
{ {
"value" : { "area" : null }, value: { area: null }
"action" : "@method:changeArea" action: @method:changeArea
} }
] ]
}, }
"actionKeys" : [ actionKeys: [
{ {
keys: [ "escape", "q", "shift + q" ] keys: [ "escape", "q", "shift + q" ]
action: @systemMethod:fallbackMenu action: @systemMethod:fallbackMenu
@ -731,12 +687,13 @@
] ]
} }
} }
}, }
messageAreaMessageList: { messageAreaMessageList: {
module: msg_list module: msg_list
art: MSGLIST art: MSGLIST
config: { config: {
listType: public listType: public
menuViewPost: messageAreaViewPost
} }
form: { form: {
0: { 0: {
@ -787,15 +744,14 @@
mci: { mci: {
MT1: { MT1: {
width: 79 width: 79
//"height" : 14,
mode: preview mode: preview
} }
} }
submit: { submit: {
*: [ *: [
{ {
"value" : "message", value: message
"action" : "@method:editModeEscPressed" action: @method:editModeEscPressed
} }
] ]
} }
@ -818,7 +774,6 @@
mci: { mci: {
HM1: { HM1: {
// :TODO: (#)Jump/(L)Index (msg list)/Last // :TODO: (#)Jump/(L)Index (msg list)/Last
// (p)rev, (n)ext, (r)eply, (q)uit/ESC, (?)help
items: [ "prev", "next", "reply", "quit", "help" ] items: [ "prev", "next", "reply", "quit", "help" ]
} }
} }
@ -868,7 +823,6 @@
{ {
keys: [ "escape", "q", "shift + q" ] keys: [ "escape", "q", "shift + q" ]
action: @systemMethod:fallbackMenu action: @systemMethod:fallbackMenu
//action: @menu:messageArea
} }
{ {
keys: [ "?" ] keys: [ "?" ]
@ -899,13 +853,11 @@
form: { form: {
0: { 0: {
mci: { mci: {
// :TODO: use appropriate system properties for these lenghts // :TODO: use appropriate system properties for max lengths
TL1: { TL1: {
//width: 27
argName: from argName: from
} }
ET2: { ET2: {
//width: 27
argName: to argName: to
focus: true focus: true
} }
@ -919,10 +871,6 @@
//width: 27 //width: 27
//textOverflow: ... //textOverflow: ...
} }
MA5: {
//width: 27
//textOverflow: ...
}
} }
submit: { submit: {
3: [ { "value" : { "subject" : null }, "action" : "@method:headerSubmit" } ] 3: [ { "value" : { "subject" : null }, "action" : "@method:headerSubmit" } ]
@ -1038,7 +986,6 @@
messageAreaNewPost: { messageAreaNewPost: {
status: Posting message, status: Posting message,
module: msg_area_post_fse module: msg_area_post_fse
//"fallback" : "messageArea", // :TODO: remove once default fallback is in place
config: { config: {
art: { art: {
header: MSGEHDR header: MSGEHDR
@ -1067,11 +1014,11 @@
submit: true submit: true
} }
} }
"submit" : { submit: {
"3" : [ 3: [
{ {
"value" : { "subject" : null }, value: { subject: null }
"action" : "@method:headerSubmit" action: @method:headerSubmit
} }
] ]
} }
@ -1088,51 +1035,47 @@
submit: { submit: {
*: [ { "value": "message", "action": "@method:editModeEscPressed" } ] *: [ { "value": "message", "action": "@method:editModeEscPressed" } ]
}, }
actionKeys: [ actionKeys: [
{ {
"keys" : [ "escape" ], keys: [ "escape" ]
"viewId" : 1 viewId: 1
} }
] ]
}, }
"2" : { 2: {
"TLTL" : { TLTL: {
"mci" : { mci: {
"TL1" : { TL1: { width: 5 }
"width" : 5 TL2: { width: 4 }
},
"TL2" : {
"width" : 4
} }
} }
} }
}, 3: {
"3" : { HM: {
"HM" : { mci: {
"mci" : { HM1: {
"HM1" : {
// :TODO: clear // :TODO: clear
"items" : [ "save", "discard", "help" ] "items" : [ "save", "discard", "help" ]
} }
}, }
"submit" : { submit: {
"*" : [ *: [
{ {
"value" : { "1" : 0 }, value: { 1: 0 }
"action" : "@method:editModeMenuSave" action: @method:editModeMenuSave
},
{
"value" : { "1" : 1 },
"action" : "@menu:messageArea"
} }
{ {
"value" : { "1" : 2 }, value: { 1: 1 }
"action" : "@method:editModeMenuHelp" action: @menu:messageArea
}
{
value: { 1: 2 }
action: @method:editModeMenuHelp
} }
] ]
}, }
actionKeys: [ // :TODO: Need better name actionKeys: [
{ {
keys: [ "escape" ] keys: [ "escape" ]
action: @method:editModeEscPressed action: @method:editModeEscPressed
@ -1152,89 +1095,17 @@
} }
} }
} }
},
///////////////////////////////////////////////////////////////////////
// Doors
///////////////////////////////////////////////////////////////////////
doorPimpWars: {
desc: Playing PimpWars
module: abracadabra
config: {
name: PimpWars
dropFileType: DORINFO
cmd: /usr/bin/dosemu
args: [
"-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\PW\\START.BAT {dropfile} {node}"
],
nodeMax: 1
// :TODO: Obv/2 name for this?
tooManyArt: doortoomany.ans
}
},
"doorLORD" : {
"module" : "abracadabra",
"fallback" : "mainMenu",
"config" : {
"name" : "LORD",
"dropFileType" : "DOOR",
"cmd" : "/usr/bin/dosemu",
"args" : [
"-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\LORD\\START.BAT {node}"
]
}
},
doorTestExample: {
module: abracadabra
config: {
name: example
dropFileType: DOOR
cmd: "/usr/bin/dosemu"
args: [ "-quiet", "-f", "/home/nuskooler/DOS/X/LORD/dosemu.conf", "X:\\SLOWMO.EXE 1 120 X:\\LORD\\LAIRANS.ANS"]
}
} }
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Mods // Required entries
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
idleLogoff: { idleLogoff: {
art: IDLELOG art: IDLELOG
next: @systemMethod:logoff next: @systemMethod:logoff
},
////////////////////////////////////////////////////////////////////////
// Mods
////////////////////////////////////////////////////////////////////////
"lastCallers" :{
"module" : "last_callers",
"art" : "LASTCALL.ANS",
"options" : { "pause" : true },
"config" : {
"dateTimeFormat" : "ddd MMM Do H:mm a"
},
"form" : {
"0" : {
"TLTLTLTL" : {
"mci" : {
// :TODO: Bug: Without any keys here, theme customization does not apply!!!!
"TL1" : {
"styleSGR1" : "|00|24"
},
"TL2" : {
"styleSGR1" : "|00|24"
},
"TL3" : {
"styleSGR1" : "|00|24"
},
"TL4" : {
"styleSGR1" : "|00|24"
} }
}
}
}
}
},
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
// Demo Section // Demo Section
// :TODO: This entire section needs updated!!!
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
"demoMain" : { "demoMain" : {
"art" : "demo_selection_vm.ans", "art" : "demo_selection_vm.ans",
@ -1708,96 +1579,9 @@
"action" : "@method:editModeEscPressed" "action" : "@method:editModeEscPressed"
} }
] ]
// :TODO: something like the following for overriding keymap
// this should only override specified entries. others will default
/*
"keyMap" : {
"accept" : [ "return" ]
}
*/
}
}
}
/*
"form" : {
"0" : {
"ET1ET2MT3" : {
"mci" : {
"ET1" : {
"width" : 20,
"placeholder" : "TODO support this",
"focus" : true
},
"ET2" : {
"width" : 20
},
"MT3" : {
"width" : 79,
"height" : 17,
"text" : "",
"submit" : [ "escape" ]
}
},
"submit" : {
// :TODO: It may be nice to have a way to submit without data - e.g. we just care about the key press.
"3" : [
{
"value" : 3,
"action" : "@method:editorEscPressed"
}
]
}
}
}
}
*/
}
/*
:TODO: conceptual simplified menus -- actions/etc. without forms
{
"myMenu" : {
"art" : "MENUART",
"mci" : { // lack of "form": direct to form:0 {}
"VM1" : {
"items" : [ "Hello", "Goodbye" ],
"action" : "@method:someMethod" // implies { "submit" : true }
},
"submit" : {
// alternate form with filters
}
}
}
}
*/
/*
"demoEditTextView" : {
"art" : "demo_edit_text_view.ans",
"form" : {
"0" : {
"ET1ET2ET3ET5SM4TM6" : {
"mci" : {
"ET1" : { "maxLength" : 1 },
"ET2" : { "maxLength" : 1 },
"ET3" : { "maxLength" : 1 },
"SM4" : {
"items" : [ "One", "Two", "Three", "Four" ]
},
"ET5" : {
"password" : true,
"submit" : [ "escape" ],
"fillChar" : "#"
},
"TM6" : {
"items" : [ "Yes", "No" ],
"hotkeys" : { "Y" : 0, "n" : 1 }
} }
} }
} }
} }
} }
} }
*/
}
}

View File

@ -60,7 +60,7 @@ function MessageListModule(options) {
selectMessage : function(formData, extraArgs) { selectMessage : function(formData, extraArgs) {
if(1 === formData.submitId) { if(1 === formData.submitId) {
var modOpts = { var modOpts = {
name : 'messageAreaViewPost', // :TODO: should come from config!!! name : config.menuViewPost || 'messageAreaViewPost',//'messageAreaViewPost', // :TODO: should come from config!!!
extraArgs : { extraArgs : {
messageAreaName : self.messageAreaName, messageAreaName : self.messageAreaName,
messageList : self.messageList, messageList : self.messageList,

View File

@ -77,7 +77,7 @@
} }
} }
login2: { login: {
mci: { mci: {
ET1: { width: 14 } ET1: { width: 14 }
ET2: { width: 14 } ET2: { width: 14 }