* New concept of 'actionKeys' replacing broken 'submit' stuff -- WIP, currently broken but should be quick fix soon

This commit is contained in:
Bryan Ashby
2015-07-09 23:23:37 -06:00
parent 696e4157d9
commit 0d2d2602cd
4 changed files with 140 additions and 30 deletions

View File

@@ -33,14 +33,14 @@ function FullScreenEditorModule(options) {
return 'footer' + _.capitalize(editorMode); // e.g.. 'footerEditMenu'
};
this.getFormId = function(whatFor) {
this.getFormId = function(name) {
return {
header : 0,
body : 1,
footerEdit : 2,
footerEditMenu : 3,
fotoerView : 4,
}[whatFor];
}[name];
};
this.redrawFooter = function(options, cb) {
@@ -252,10 +252,8 @@ function FullScreenEditorModule(options) {
self.observeEditEvents();
},
editModeEscPressed : function(formData, extraArgs) {
console.log('editorModeBefore=' + self.editorMode)
self.editorMode = 'edit' === self.editorMode ? 'editMenu' : 'edit';
console.log('editorModeAfter=' + self.editorMode)
//self.editorMode = 'editMenu';
self.switchFooter(function next(err) {
if(err) {
// :TODO:... what now?
@@ -282,7 +280,7 @@ function FullScreenEditorModule(options) {
});
},
editModeMenu : function(formData, extraArgs) {
console.log('menu 1')
console.log('menu ' + formData.value['1'])
}
};
}

View File

@@ -290,8 +290,7 @@
},
"BT5" : {
"width" : 8,
"text" : "< Back",
"submit" : [ "escape" ]
"text" : "< Back"
}
},
"submit" : {
@@ -301,7 +300,13 @@
"action" : "@menu:demoMain"
}
]
}
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"viewId" : 5
}
]
}
}
}
@@ -325,8 +330,7 @@
"hotKeys" : { "Y" : 0, "N" : 1 }
},
"BT8" : {
"text" : "< Back",
"submit" : [ "escape" ]
"text" : "< Back"
}
},
"submit" : {
@@ -336,7 +340,13 @@
"action" : "@menu:demoMain"
}
]
}
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"viewId" : 8
}
]
}
}
}
@@ -354,8 +364,7 @@
"styleSGR2" : "|00|45|01"
},
"BT5" : {
"text" : "< Back",
"submit" : [ "escape" ]
"text" : "< Back"
}
},
"submit" : {
@@ -365,7 +374,13 @@
"action" : "@menu:demoMain"
}
]
}
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"viewId" : 5
}
]
}
}
}
@@ -385,8 +400,7 @@
"focus" : true
},
"BT5" : {
"text" : "< Back",
"submit" : [ "escape" ]
"text" : "< Back"
}
},
"submit" : {
@@ -396,7 +410,13 @@
"action" : "@menu:demoMain"
}
]
}
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"viewId" : 5
}
]
}
}
}
@@ -417,8 +437,7 @@
"hotKeys" : { "U" : 0, "D" : 1, "T" : 2 }
},
"BT5" : {
"text" : "< Back",
"submit" : [ "escape" ]
"text" : "< Back"
}
},
"submit" : {
@@ -428,7 +447,13 @@
"action" : "@menu:demoMain"
}
]
}
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"viewId" : 5
}
]
}
}
}
@@ -515,8 +540,7 @@
"MT1" : {
"width" : 79,
"height" : 17,
"text" : "", // :TODO: should not be req.
"submit" : [ "escape" ]
"text" : "" // :TODO: should not be req.
}
},
"submit" : {
@@ -526,7 +550,13 @@
"action" : "@method:editModeEscPressed"
}
]
}
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"viewId" : 1
}
]
}
},
"2" : {
@@ -545,8 +575,7 @@
"HM1" : {
"mci" : {
"HM1" : {
"items" : [ "Menu 1", "Menu 2", "Menu 3", "Menu 4" ],
"submit" : [ "escape" ]
"items" : [ "Menu 1", "Menu 2", "Menu 3", "Menu 4" ]
}
},
"submit" : {
@@ -555,12 +584,34 @@
"value" : { "1" : 0 },
"action" : "@method:editModeMenu"
},
{
"value" : { "1" : 1 },
"action" : "@method:editModeMenu"
},
{
"value" : { "1" : 2 },
"action" : "@method:editModeMenu"
},
{
"value" : { "1" : 3 },
"action" : "@method:editModeMenu"
},
{
"value" : 1,
"action" : "@method:editModeEscPressed"
}
]
}
},
//
// :TODO: concept to replace "submit" per view
// existing submit would remain only as boolean
// ...need general way to override keys for a view -- submit, next, etc.
"actionKeys" : [ // :TODO: Need better name
{
"keys" : [ "escape" ],
"action" : "@method:editModeEscPressed"
}
]
}
}
}