enigma-bbs/mods/menu.json

424 lines
8.5 KiB
JSON
Raw Normal View History

{
/*
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 @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"
}
}
}
}
}
}
*/
"connected" : {
"art" : "CONNECT",
"next" : "matrix",
"options" : {
"cls" : true,
"nextTimeout" : 1500
}
},
"matrix" : {
"art" : "matrix",
"form" : {
"0" : { // :TODO: Make form "0" the default if missing (e.g. optional)... not sure how with current structure though
"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" ]//,
//"itemSpacing" : 1
}
},
"submit" : {
"*" : [
{
"value" : { "1" : 0 },
"action" : "@menu:login"
},
{
"value" : { "1" : 1 },
"action" : "@menu:apply"
},
{
"value" : { "1" : 2 },
"action" : "@menu:logoff"
}
]
}
}
}
},
"options" : {
"cls" : true
}
},
"login" : {
// :TODO: may want { "prompt" : { "name" : "blah", "action" : ... }}
"prompt" : "userCredentials",
"fallback" : "matrix",
"next" : "newUserActive",
2015-04-21 05:24:15 +00:00
"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" : { "1" : "thing" },
"action" : "@method:doThings"
}
],
"options" : {
"cls" : true
}
},
"logoff" : {
"art" : "LOGOFF",
//"module" : "logoff",
2015-04-21 05:24:15 +00:00
"action" : "@systemMethod:logoff",
"options" : { "cls" : true }
2015-04-07 04:29:45 +00:00
},
"apply" : {
"art" : "APPLY",
"next" : "newUserActive",
2015-04-07 04:29:45 +00:00
"form" : {
"0" : {
"BT12BT13ET1ET10ET2ET3ET4ET5ET6ET7ET8ET9TL11" : {
//
// :TODO: defaults { width : XX, ... } kinda thing would be nice
//
// "beforeViewsDraw" : "@method:location.js/myBeforeViewsDraw" -> myBeforeViewsDraw(views)
2015-04-07 04:29:45 +00:00
"mci" : {
"ET1" : {
"focus" : true,
"argName" : "username",
//"width" : 15,
"maxLength" : "@config:users.usernameMax"
},
"ET2" : {
"width" : 15,
"argName" : "realName",
//"width" : 15,
"maxLength" : 32
},
"ET3" : {
"argName" : "age",
"width" : 3,
"maxLength" : 3
},
"ET4" : {
"argName" : "sex",
"width" : 1,
"maxLength" : 1
},
"ET5" : {
"argName" : "location",
//"width" : 15,
"maxLength" : 32
},
"ET6" : {
"argName" : "affils",
//"width" : 15,
"maxLength" : 32
},
"ET7" : {
"argName" : "email",
//"width" : 15,
"maxLength" : 255
},
"ET8" : {
"argName" : "web",
//"width" : 15,
"maxLength" : 255
},
"ET9" : {
"argName" : "password",
"password" : true,
//"width" : 15,
"maxLength" : "@config:users.passwordMax"
},
"ET10" : {
"argName" : "passwordConfirm",
"password" : true,
//"width" : 15,
"maxLength" : "@config:users.passwordMax"
},
"BT12" : {
"submit" : true,
"text" : "Apply"
},
"BT13" : {
"submit" : [ "esc" ],
"text" : "Cancel"
2015-04-07 04:29:45 +00:00
}
},
"submit" : {
"12" : [ // Apply
{
"value" : 12, // :TODO: better, this should be optional; if not present it's a any match
"action" : "@method:apply/submitApplication",
"extraArgs" : {
"inactive" : "userNeedsActivated",
"error" : "newUserCreateError"
}
}
],
"13" : [ // Cancel
{
"value" : 13,
"action" : "@menu:matrix"
}
]
2015-04-07 04:29:45 +00:00
}
}
}
},
"options" : {
"cls" : true
2015-04-07 04:29:45 +00:00
}
},
"newUserActive" : {
"art" : "STATS",
"prompt" : "pause",
"options" : {
// :TODO: implement MCI codes for this
"cls" : true
}
},
"demoMain" : {
"art" : "demo_selection_vm.ans",
"options" : { "cls" : true },
"form" : {
"0" : {
"VM1" : {
"mci" : {
"VM1" : {
2015-04-28 23:18:02 +00:00
"items" : [
"Single Line Text Editing Views",
"Spinner & Toggle Views",
"Vertical Menu Views",
"Horizontal Menu Views",
"Art Display",
"Some More Stuff",
2015-04-28 23:18:02 +00:00
"Other"
],
"height" : 10,
"itemSpacing" : 1,
"justify" : "center",
2015-04-28 23:21:24 +00:00
"focusTextStyle" : "small i"
}
2015-04-25 20:44:48 +00:00
},
"submit" : {
"*" : [
{
"value" : { "1" : 0 },
"action" : "@menu:demoEditTextView"
2015-04-29 03:15:36 +00:00
},
{
"value" : { "1" : 1 },
"action" : "@menu:demoSpinAndToggleView"
},
{
"value" : { "1" : 2 },
"action" : "@menu:demoArtDisplay"
2015-04-25 20:44:48 +00:00
}
]
}
}
}
}
2015-04-25 20:44:48 +00:00
},
"demoEditTextView" : {
"art" : "demo_edit_text_view1.ans",
"options" : { "cls" : true },
"form" : {
"0" : {
"BT5ET1ET2ET3ET4" : {
"mci" : {
"ET1" : {
"width" : 20,
"maxLength" : 20
},
"ET2" : {
"width" : 20,
"maxLength" : 40,
"textOverflow" : "..."
},
"ET3" : {
"width" : 20,
"fillChar" : "-",
// :TODO: fillColor
"maxLength" : 20
},
"ET4" : {
"width" : 20,
"maxLength" : 20,
"password" : true
},
"BT5" : {
"width" : 8,
2015-04-28 23:18:02 +00:00
"text" : "< Back",
"submit" : [ "esc" ]
}
},
"submit" : {
"*" : [
{
2015-04-28 23:18:02 +00:00
"value" : 5,
2015-04-29 03:15:36 +00:00
"action" : "@menu:demoMain"
}
]
}
}
}
}
},
"demoSpinAndToggleView" : {
"art" : "demo_spin_and_toggle.ans",
"options" : { "cls" : true },
"form" : {
"0" : {
"BT8SM1SM2TM3" : {
"mci" : {
"SM1" : {
"items" : [ "Henry Morgan", "François l'Ollonais", "Roche Braziliano", "Black Bart", "Blackbeard" ]
},
"SM2" : {
"items" : [ "Razor 1911", "DrinkOrDie", "TRSI" ]
},
"TM3" : {
"items" : [ "Yarly", "Nowaii" ],
"styleSGR1" : "|00|30|01",
"hotkeys" : { "Y" : 0, "N" : 1 }
2015-04-29 03:15:36 +00:00
},
"BT8" : {
"text" : "< Back",
"submit" : [ "esc" ]
}
},
"submit" : {
"*" : [
{
"value" : 8,
"action" : "@menu:demoMain"
}
]
}
}
}
}
},
"demoArtDisplay" : {
"art" : "demo_selection_vm.ans",
"options" : { "cls" : true },
"form" : {
"0" : {
"VM1" : {
"mci" : {
"VM1" : {
"items" : [
"Defaults - DOS ANSI",
"Defaults - Amiga",
"Pause at Term Height"
],
// :TODO: justify not working??
"focusTextStyle" : "small i"
}
},
"submit" : {
"*" : [
{
"value" : { "1" : 0 },
"action" : "@menu:demoDefaultsDosAnsi"
}
]
}
}
}
}
},
"demoDefaultsDosAnsi" : {
"art" : "WE-CIZB.ANS",
"options" : { "cls" : true }
}
/*
:TODO: conceptual simplified menus -- actions/etc. without forms
2015-04-28 23:18:02 +00:00
{
"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
}
}
}
}
*/
/*
2015-04-25 20:44:48 +00:00
"demoEditTextView" : {
"art" : "demo_edit_text_view.ans",
"options" : { "cls" : true },
"form" : {
"0" : {
"ET1ET2ET3ET5SM4TM6" : {
"mci" : {
"ET1" : { "maxLength" : 1 },
"ET2" : { "maxLength" : 1 },
"ET3" : { "maxLength" : 1 },
"SM4" : {
"items" : [ "One", "Two", "Three", "Four" ]
},
"ET5" : {
"password" : true,
"submit" : [ "esc" ],
"fillChar" : "#"
},
"TM6" : {
"items" : [ "Yes", "No" ],
"hotkeys" : { "Y" : 0, "n" : 1 }
}
}
2015-04-25 20:44:48 +00:00
}
}
}
}
*/
}