diff --git a/core/client.js b/core/client.js index 3cf7575e..f5873825 100644 --- a/core/client.js +++ b/core/client.js @@ -474,21 +474,20 @@ Client.prototype.fallbackMenuModule = function(options, cb) { var modOpts; - if(_.isString(self.currentMenuModule.menuConfig.fallback)()) { + if(_.isString(self.currentMenuModule.menuConfig.fallback)) { modOpts = { name : self.currentMenuModule.menuConfig.fallback, extraArgs : options.extraArgs, }; - - self.gotoMenuModule(modOpts, cb); - } else if(self.lastMenuModuleInfo) { modOpts = { name : self.lastMenuModuleInfo.menuName, extraArgs : self.lastMenuModuleInfo.extraArgs, savedState : self.lastMenuModuleInfo.savedState, }; + } + if(modOpts) { self.gotoMenuModule(modOpts, cb); } else { cb(new Error('Nothing to fallback to!')); diff --git a/core/fse.js b/core/fse.js index b01cfcae..0dbba218 100644 --- a/core/fse.js +++ b/core/fse.js @@ -809,6 +809,7 @@ function FullScreenEditorModule(options) { self.switchFromQuoteBuilderToBody(); }); }, + /* replyDiscard : function(formData, extraArgs) { // :TODO: need to prompt yes/no // :TODO: @method for fallback would be better @@ -816,6 +817,7 @@ function FullScreenEditorModule(options) { console.log(err) }); }, + */ editModeMenuHelp : function(formData, extraArgs) { self.viewControllers.footerEditorMenu.setFocus(false); self.displayHelp(); diff --git a/core/menu_util.js b/core/menu_util.js index 08bbaf13..ad89e3f3 100644 --- a/core/menu_util.js +++ b/core/menu_util.js @@ -172,7 +172,9 @@ function callModuleMenuMethod(client, asset, path, formData, extraArgs) { } try { - client.log.trace( { methodName : asset.asset, formData : formData, extraArgs : extraArgs } ); + client.log.trace( + { path : path, methodName : asset.asset, formData : formData, extraArgs : extraArgs }, + 'Calling menu method'); var methodMod = require(path); methodMod[asset.asset](client.currentMenuModule, formData || { }, extraArgs); diff --git a/core/predefined_mci.js b/core/predefined_mci.js index f8a8886a..5fe57652 100644 --- a/core/predefined_mci.js +++ b/core/predefined_mci.js @@ -25,6 +25,10 @@ function getPredefinedMCIValue(client, code) { VL : function versionLabel() { return 'ENiGMA½ v' + packageJson.version; }, VN : function version() { return packageJson.version; }, + // :TODO: SysOp username + // :TODO: SysOp real name + + UN : function userName() { return client.user.username; }, UI : function userId() { return client.user.userId.toString(); }, UG : function groups() { return _.values(client.user.groups).join(', '); }, diff --git a/core/system_menu_method.js b/core/system_menu_method.js index 5d9ee756..31ddd896 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -10,6 +10,7 @@ var async = require('async'); exports.login = login; exports.logoff = logoff; +exports.fallbackMenu = fallbackMenu; function login(callingMenu, formData, extraArgs) { var client = callingMenu.client; @@ -138,7 +139,7 @@ function logoff(callingMenu, formData, extraArgs) { function fallbackMenu(callingMenu, formData, extraArgs) { callingMenu.client.fallbackMenuModule( { extraArgs : extraArgs }, function result(err) { if(err) { - callingMenu.client.log.error( { error : err }, 'Error attempting to ') + callingMenu.client.log.error( { error : err }, 'Error attempting to fallback!'); } }); -} \ No newline at end of file +} diff --git a/mods/menu.hjson b/mods/menu.hjson index 2c0600a4..dabf0203 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -160,7 +160,7 @@ */ newUserApplication: { art: NUA - next: newUserFeedbackToSysOp + next: newUserFeedbackToSysOpPreamble form: { 0: { mci: { @@ -242,10 +242,16 @@ } } + newUserFeedbackToSysOpPreamble: { + art: NUAFDBK + options: { pause: true } + next: newUserFeedbackToSysOp + } + newUserFeedbackToSysOp: { status: Feedback to SysOp module: msg_area_post_fse - "fallback" : "messageArea", // :TODO: remove once default fallback is in place + fallback: mainMenu config: { art: { header: MSGEHDR @@ -256,9 +262,9 @@ }, editorMode: edit editorType: area - }, - "form" : { - "0" : { + } + form: { + 0: { mci: { TL1: { width: 27 @@ -268,30 +274,30 @@ width: 27 argName: to focus: true - text: All - // :TODO: @systemMethod:getSysOpUsername + text: @config:general.sysOp.username // :TODO: readOnly: true } - "ET3" : { - "width" : 27, - "argName" : "subject", - "maxLength" : 72, - "submit" : true + ET3: { + width: 27 + argName: subject + maxLength: 72 + submit: true + text: New user feedback }, "MA5" : { "width" : 27, "textOverflow" : "..." } - }, - "submit" : { - "3" : [ + } + submit: { + 3: [ { "value" : { "subject" : null }, "action" : "@method:headerSubmit" } ] } - }, + } "1" : { "mci" : { MT1: { @@ -323,36 +329,31 @@ } } } - }, - "3" : { - "HM" : { - "mci" : { - "HM1" : { - // :TODO: Continue, Save, Discard, Clear, Quote, Help - "items" : [ "Save", "Discard", "Quote", "Help" ] + } + 3: { + HM: { + mci: { + HM1: { + items: [ "Save", "Discard", "Help" ] } - }, - "submit" : { - "*" : [ + } + submit: { + *: [ { - "value" : { "1" : 0 }, - "action" : "@method:editModeMenuSave" - }, + value: { 1: 0 } + action: @method:editModeMenuSave + } { - "value" : { "1" : 1 }, - "action" : "@menu:messageArea" - }, + value: { 1: 1 } + action: @systemMethod:fallbackMenu + } { - value: { 1: 2 }, - action: @method:editModeQuote - }, - { - "value" : { "1" : 3 }, - "action" : "@method:editModeMenuHelp" + value: { 1: 2 } + action: @method:editModeMenuHelp } ] - }, - actionKeys: [ // :TODO: Need better name + } + actionKeys: [ { keys: [ "escape" ] action: @method:editModeEscPressed @@ -362,13 +363,6 @@ action: @method:editModeMenuHelp } ] - // :TODO: something like the following for overriding keymap - // this should only override specified entries. others will default - /* - "keyMap" : { - "accept" : [ "return" ] - } - */ } } } @@ -809,7 +803,8 @@ } { value: { 1: 1 } - action: @method:replyDiscard + action: @systemMethod:fallbackMenu + //action: @method:replyDiscard } { value: { 1: 2 }, @@ -833,7 +828,8 @@ } { keys: [ "d", "shift + d" ] - action: @method:replyDiscard + //action: @method:replyDiscard + action: @systemMethod:fallbackMenu } { keys: [ "q", "shift + q" ] diff --git a/mods/themes/NU-MAYA/NUAFDBK.ANS b/mods/themes/NU-MAYA/NUAFDBK.ANS new file mode 100644 index 00000000..f1ce7bc1 Binary files /dev/null and b/mods/themes/NU-MAYA/NUAFDBK.ANS differ