* New fallback with default vs explicit working
* New @systemMethod:fallbackMenu working * Work on NUA flow: added preamble and some work on FSE related stuff
This commit is contained in:
@@ -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!'));
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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(', '); },
|
||||
|
||||
@@ -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!');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user