enigma-bbs/mods/menu.json

194 lines
3.9 KiB
JSON

{
/*
Menu Configuration
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
"draw" : {
"normal" : ...,
"focus" : ...
}
..note that script/methods should be part of a *theme* - or at least checked first with fallback
.....why?
}
}
*/
"connected" : {
"art" : "connect",
"next" : "matrix",
"options" : {
"clearScreen" : true,
"nextTimeout" : 1500
}
},
"matrix" : {
"art" : "matrix",
"form" : {
"0" : { // :TODO: Make form "0" the default if missing (e.g. optional)
"VM1" : {
"mci" : {
"VM1" : {
"submit" : true,
"focus" : true,
// :TODO: need a good way to localize these ... Standard Orig->Lookup seems good.
"items" : [ "Login", "Apply", "Log Off" ]
}
},
"submit" : {
"*" : [
{
"value" : { "1" : 0 },
"action" : "@menu:login"
},
{
"value" : { "1" : 1 },
"action" : "@menu:apply"
},
{
"value" : { "1" : 2 },
"action" : "@menu:logoff"
}
]
}
}
}
},
"options" : {
"clearScreen" : true
}
},
"login" : {
//"art" : "login", // TODO: rename to login_form
"prompt" : "userCredentials",
"fallback" : "matrix",
"next" : "newUserActive",
//"module" : "login",
/*
"form" : {
"0" : {
"BT3BT4ET1ET2TL5" :{
"mci" :{
// :TODO: LIke prompts, assign "argName" values here, e.g.:
// "argName" : "username", ...
"ET1" : {
"focus" : true
},
"BT3" : {
"submit" : true,
"text" : "Login"
},
"BT4" : {
"submit" : true,
"text" : "Cancel"
}
},
"submit" : {
"3" : [ // Login
{
"value" : { "3" : null },
"action" : "@method:attemptLogin",
// :TODO: see above about argName;
// any other args should be "extraArgs"
"args" : {
"next" : {
// :TODO: just use menu.next
"success" : "newUserActive"
},
"username" : "{1}",
"password" : "{2}"
}
}
],
"4" : [ // Cancel
{
"value" : { "4" : null },
"action" : "@menu:matrix"
// :TODO: Just use menu.fallback, e.g. @fallback
}
]
}
}
}
},
*/
"options" : {
"clearScreen" : true
}
},
"logoff" : {
"art" : "logoff",
"module" : "logoff"
},
"apply" : {
"art" : "apply",
"module" : "apply",
"form" : {
"0" : {
"BT12BT13ET1ET10ET2ET3ET4ET5ET6ET7ET8ET9TL11" : {
"mci" : {
"ET1" : {
"focus" : true
},
"BT12" : {
"submit" : true,
"text" : "Apply"
},
"BT13" : {
"submit" : true,
"text" : "Cancel"
}
},
"submit" : {
"12" : [ // Apply
{
"value" : { "12" : null },
"action" : "@method:submitApplication",
"args" : {
"next" : {
"inactive" : "userNeedsActivated",
"active" : "newUserActive",
"error" : "newUserCreateError"
},
"username" : "{1}",
"realName" : "{2}",
"age" : "{3}",
"sex" : "{4}",
"location" : "{5}",
"affils" : "{6}",
"email" : "{7}",
"web" : "{8}",
"pw" : "{9}",
"pwConfirm" : "{10}"
}
}
],
"13" : [ // Cancel
{
"value" : { "13" : null }, // :TODO: allow just "13" (number)
"action" : "@menu:matrix"
}
]
}
}
}
},
"options" : {
"clearScreen" : true
}
},
"newUserActive" : {
"art" : "STATS",
"options" : {
// :TODO: implement MCI codes for this
"clearScreen" : true
}
}
}