{ /* 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 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" : { "art" : "CONNECT", "connected" : { "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" ]//, } }, "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", "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", "action" : "@systemMethod:logoff", "options" : { "cls" : true } }, "apply" : { "art" : "APPLY", "next" : "newUserActive", "form" : { "0" : { "BT12BT13ET1ET10ET2ET3ET4ET5ET6ET7ET8ET9TL11" : { "mci" : { "ET1" : { "focus" : true, "argName" : "username", "maxLength" : "@config:users.usernameMax" }, "ET2" : { "argName" : "realName", "maxLength" : 32 }, "ET3" : { "argName" : "age", "width" : 3, "maxLength" : 3 }, "ET4" : { "argName" : "sex", "width" : 1, "maxLength" : 1 }, "ET5" : { "argName" : "location", "maxLength" : 32 }, "ET6" : { "argName" : "affils", "maxLength" : 32 }, "ET7" : { "argName" : "email", "maxLength" : 255 }, "ET8" : { "argName" : "web", "maxLength" : 255 }, "ET9" : { "argName" : "password", "password" : true, "maxLength" : "@config:users.passwordMax" }, "ET10" : { "argName" : "passwordConfirm", "password" : true, "maxLength" : "@config:users.passwordMax" }, "BT12" : { "submit" : true, "text" : "Apply" }, "BT13" : { "submit" : [ "escape" ], "text" : "Cancel" } }, "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" } ] } } } }, "options" : { "cls" : true } }, "newUserActive" : { "art" : "userstats", //"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" : { "items" : [ "Single Line Text Editing Views", "Spinner & Toggle Views", "Mask Edit Views", "Multi Line Text Editor", "Vertical Menu Views", "Horizontal Menu Views", "Art Display", "Full Screen Editor", "Some More Stuff", "Other" ], "height" : 10, "itemSpacing" : 1, "justify" : "center", "focusTextStyle" : "small i" } }, "submit" : { "*" : [ { "value" : { "1" : 0 }, "action" : "@menu:demoEditTextView" }, { "value" : { "1" : 1 }, "action" : "@menu:demoSpinAndToggleView" }, { "value" : { "1" : 2 }, "action" : "@menu:demoMaskEditView" }, { "value" : { "1" : 3 }, "action" : "@menu:demoMultiLineEditTextView" }, { "value" : { "1" : 5 }, "action" : "@menu:demoHorizontalMenuView" }, { "value" : { "1" : 6 }, "action" : "@menu:demoArtDisplay" }, { "value" : { "1" : 7 }, "action" : "@menu:demoFullScreenEditor" } ] } } } } }, "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" : "-", "styleSGR1" : "|00|36", "maxLength" : 20 }, "ET4" : { "width" : 20, "maxLength" : 20, "password" : true }, "BT5" : { "width" : 8, "text" : "< Back" } }, "submit" : { "*" : [ { "value" : 5, "action" : "@menu:demoMain" } ] }, "actionKeys" : [ { "keys" : [ "escape" ], "viewId" : 5 } ] } } } }, "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 } }, "BT8" : { "text" : "< Back" } }, "submit" : { "*" : [ { "value" : 8, "action" : "@menu:demoMain" } ] }, "actionKeys" : [ { "keys" : [ "escape" ], "viewId" : 8 } ] } } } }, "demoMaskEditView" : { "art" : "demo_mask_edit_text_view1.ans", "options" : { "cls" : true }, "form" : { "0" : { "BT5ME1ME2" : { "mci" : { "ME1" : { "maskPattern" : "##/##/##", "styleSGR1" : "|00|30|01", "styleSGR2" : "|00|45|01" }, "BT5" : { "text" : "< Back" } }, "submit" : { "*" : [ { "value" : 5, "action" : "@menu:demoMain" } ] }, "actionKeys" : [ { "keys" : [ "escape" ], "viewId" : 5 } ] } } } }, "demoMultiLineEditTextView" : { "art" : "demo_multi_line_edit_text_view1.ans", "options" : { "cls" : true }, "form" : { "0" : { "BT5MT1" : { "mci" : { "MT1" : { "width" : 70, "height" : 17, "text" : "@art:demo_multi_line_edit_text_view_text.txt", //"text" : "Hints:\n * Press CTRL-Y to clear a line\n * Arrow keys to move around\n\nTry editing the text below:\nThis\tis\ttabbbed!\nLet me be sick... I want to get up. Get me something to be sick in... Stop the film... Please stop it... I can't stand it any more. Stop it please... please.\n\nWell, that was a very promising start. By my calculations, you should be starting to feel alright again. Yes? Dr. Brodsky's pleased with you. Now \ttomorrow \tthere'll \tbe \ttwo \tsessions, \tof\t course, morning and afternoon.\n\nYou mean, I have to viddy two sessions in one day?\n\nI imagine you'll be feeling a little bit limp by the end of the day. But we have to be hard on you. You have to be cured.\n", "focus" : true }, "BT5" : { "text" : "< Back" } }, "submit" : { "*" : [ { "value" : 5, "action" : "@menu:demoMain" } ] }, "actionKeys" : [ { "keys" : [ "escape" ], "viewId" : 5 } ] } } } }, "demoHorizontalMenuView" : { "art" : "demo_horizontal_menu_view1.ans", "options" : { "cls" : true }, "form" : { "0" : { "BT5HM1HM2" : { "mci" : { "HM1" : { "items" : [ "One", "Two", "Three" ], "hotKeys" : { "1" : 0, "2" : 1, "3" : 2 } }, "HM2" : { "items" : [ "Uno", "Dos", "Tres" ], "hotKeys" : { "U" : 0, "D" : 1, "T" : 2 } }, "BT5" : { "text" : "< Back" } }, "submit" : { "*" : [ { "value" : 5, "action" : "@menu:demoMain" } ] }, "actionKeys" : [ { "keys" : [ "escape" ], "viewId" : 5 } ] } } } }, "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 } }, "demoFullScreenEditor" : { "module" : "fse", "art" : "demo_fse_local_user.ans", "options" : { "cls" : true }, "config" : { "editorType" : "netMail", "art" : { "header" : "demo_fse_netmail_header.ans", "body" : "demo_fse_netmail_body.ans", "footerEdit" : "demo_fse_netmail_footer_edit.ans", "footerEditMenu" : "demo_fse_netmail_footer_edit_menu.ans", "footerView" : "demo_fse_netmail_footer_view.ans", "help" : "demo_fse_netmail_help.ans" } }, "form" : { "0" : { "ET1ET2ET3" : { "mci" : { "ET1" : { // :TODO: from/to may be set by args // :TODO: focus may change dep on view vs edit "width" : 36, "focus" : true, "argName" : "to" }, "ET2" : { "width" : 36, "argName" : "from" }, "ET3" : { "width" : 65, "maxLength" : 72, "submit" : [ "enter" ], "argName" : "subject" } }, "submit" : { "3" : [ { "value" : { "subject" : null }, "action" : "@method:headerSubmit" } ] } } }, "1" : { "MT1" : { "mci" : { "MT1" : { "width" : 79, "height" : 17, "text" : "", // :TODO: should not be req. "argName" : "message" } }, "submit" : { "*" : [ { "value" : "message", "action" : "@method:editModeEscPressed" } ] }, "actionKeys" : [ { "keys" : [ "escape" ], "viewId" : 1 } ] } }, "2" : { "TL1TL2" : { "mci" : { "TL1" : { "width" : 5 }, "TL2" : { "width" : 4 } } } }, "3" : { "HM1" : { "mci" : { "HM1" : { // :TODO: Continue, Save, Discard, Clear, Quote, Help "items" : [ "Save", "Discard", "Quote", "Help" ] } }, "submit" : { "*" : [ { "value" : { "1" : 0 }, "action" : "@method:editModeMenuSave" }, { "value" : { "1" : 1 }, "action" : "@menu:demoMain" }, { "value" : { "1" : 2 }, "action" : "@method:editModeMenuQuote" }, { "value" : { "1" : 3 }, "action" : "@method:editModeMenuHelp" }, { "value" : 1, "action" : "@method:editModeEscPressed" } ] }, "actionKeys" : [ // :TODO: Need better name { "keys" : [ "escape" ], "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", "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" : [ "escape" ], "fillChar" : "#" }, "TM6" : { "items" : [ "Yes", "No" ], "hotkeys" : { "Y" : 0, "n" : 1 } } } } } } } */ } }