* Moved menus -> menus.json::menus

* Move prompts -> prompts.json::prompts
* Default to 80x25 if NAWS/ENV/CPR term size negotiations fail. Seeing this with Netrunner. May need more work.
This commit is contained in:
Bryan Ashby 2015-05-15 23:02:58 -06:00
parent 9ac2e9af6e
commit 0d9add70bd
8 changed files with 511 additions and 454 deletions

View file

@ -48,8 +48,8 @@ function getMenuConfig(name, cb) {
});
},
function locateMenuConfig(menuJson, callback) {
if(_.isObject(menuJson[name])) {
menuConfig = menuJson[name];
if(_.has(menuJson, [ 'menus', name ])) {
menuConfig = menuJson.menus[name];
callback(null);
} else {
callback(new Error('No menu entry for \'' + name + '\''));
@ -66,7 +66,7 @@ function getMenuConfig(name, cb) {
},
function locatePromptConfig(promptJson, callback) {
if(promptJson) {
if(_.isObject(promptJson[menuConfig.prompt])) {
if(_.has(promptJson, [ 'prompts', menuConfig.prompt ])) {
menuConfig.promptConfig = promptJson[menuConfig.prompt];
} else {
callback(new Error('No prompt entry for \'' + menuConfig.prompt + '\''));