* Mostly work on building demo / NU-MAYA theme for testing / working out details / etc.

This commit is contained in:
Bryan Ashby 2015-09-07 21:18:09 -06:00
parent 6517f50e0c
commit 2edc63632b
12 changed files with 180 additions and 49 deletions

View File

@ -431,7 +431,7 @@ Client.prototype.address = function() {
Client.prototype.gotoMenuModule = function(options, cb) {
var self = this;
assert(options.name);
assert(_.isString(options.name), 'Missing options.name');
// Assign a default missing module handler callback if none was provided
var callbackOnErrorOnly = !_.isFunction(cb);
@ -452,9 +452,17 @@ Client.prototype.gotoMenuModule = function(options, cb) {
} else {
self.log.debug( { menuName : options.name }, 'Goto menu module');
modInst.enter(self);
if(self.currentMenuModule) {
self.lastMenuModuleInfo = {
name : self.currentMenuModule.modInfo.name,
extraArgs : self.currentMenuModuleExtraArgs,
};
}
self.currentMenuModule = modInst;
modInst.enter(self);
self.currentMenuModule = modInst; // :TODO: should probably be before enter() above
self.currentMenuModuleExtraArgs = options.extraArgs;
if(!callbackOnErrorOnly) {
cb(null);
@ -464,7 +472,16 @@ Client.prototype.gotoMenuModule = function(options, cb) {
};
Client.prototype.fallbackMenuModule = function(cb) {
var self = this;
if(self.lastMenuModuleInfo) {
var modOpts = {
name : self.lastMenuModuleInfo.name,
extraArgs : self.lastMenuModuleInfo.extraArgs,
};
self.gotoMenuModule(modOpts, cb);
}
};
///////////////////////////////////////////////////////////////////////////////

View File

@ -43,12 +43,18 @@ exports.moduleInfo = {
TL10 - Message ID
TL11 - Reply to message ID
TL12 - User1
TL13 - User2
Footer - Viewing
HM1 - Menu (prev/next/etc.)
TL6 - Message number
TL7 - Message total (in area)
TL12 - User1 (fmt message object)
TL13 - User2
*/
var MCICodeIds = {
@ -64,6 +70,10 @@ var MCICodeIds = {
HashTags : 9,
MessageID : 10,
ReplyToMsgID : 11
},
ViewModeFooter : {
MsgNum : 6,
MsgTotal : 7,
}
};
@ -150,6 +160,7 @@ function FullScreenEditorModule(options) {
if(self.isReady) {
self.initHeaderViewMode();
self.initFooterViewMode();
var bodyMessageView = self.viewControllers.body.getView(1);
if(bodyMessageView && _.has(self, 'message.message')) {
@ -181,7 +192,7 @@ function FullScreenEditorModule(options) {
// Body : We must find this in the config / theme
//
// :TODO: don't hard code this -- allow footer height to be part of theme/etc.
self.client.term.rawWrite(ansi.goto(23, 1));
self.client.term.rawWrite(ansi.goto(24, 1));
callback(null);
},
function clearFooterArea(callback) {
@ -401,6 +412,7 @@ function FullScreenEditorModule(options) {
case 'view' :
if(self.message) {
self.initHeaderViewMode();
self.initFooterViewMode();
var bodyMessageView = self.viewControllers.body.getView(1);
if(bodyMessageView && _.has(self, 'message.message')) {
@ -502,6 +514,19 @@ function FullScreenEditorModule(options) {
setHeaderText(MCICodeIds.ViewModeHeader.ReplyToMsgID, self.message.replyToMessageId);
};
this.initFooterViewMode = function() {
function setFooterText(id, text) {
var v = self.viewControllers.footerView.getView(id);
if(v) {
v.setText(text);
}
}
setFooterText(MCICodeIds.ViewModeFooter.MsgNum, (self.messageIndex + 1).toString());
setFooterText(MCICodeIds.ViewModeFooter.MsgTotal, self.messageTotal.toString());
};
this.displayHelp = function() {
self.client.term.rawWrite(ansi.resetScreen());

View File

@ -62,6 +62,8 @@ MCIViewFactory.prototype.getPredefinedViewLabel = function(code) {
UW : this.client.user.properties.web_address,
UF : this.client.user.properties.affiliation,
UT : this.client.user.properties.theme_id,
UC : this.client.user.properties.login_count.toString(),
MS : moment(this.client.user.properties.account_created).format(this.client.currentTheme.helpers.getDateFormat()),
CS : this.client.currentStatus,
MD : getCurrentMenuDescription(),

View File

@ -16,6 +16,8 @@ var _ = require('lodash');
exports.MenuModule = MenuModule;
// :TODO: some of this is a bit off... should pause after finishedLoading()
function MenuModule(options) {
PluginModule.call(this, options);

View File

@ -63,7 +63,7 @@
"*" : [
{
"value" : { "1" : 0 },
"action" : "@menu:login"
"action" : "@menu:login2"
},
{
"value" : { "1" : 1 },
@ -86,8 +86,8 @@
// :TODO: may want { "prompt" : { "name" : "blah", "action" : ... }}
"prompt" : "userCredentials",
"fallback" : "matrix",
//"next" : "fullLoginSequenceLoginArt",
"next" : "messageArea",
"next" : "fullLoginSequenceLoginArt",
//"next" : "messageArea",
"action" : "@systemMethod:login",
// :TODO: support alt submit method for prompts
@ -104,6 +104,45 @@
"cls" : true
}
},
"login2" : {
"art" : "USRCRED",
"fallback" : "matrix",
"next" : "fullLoginSequenceLoginArt",
"options" : { "cls" : true },
"form" : {
"0" : {
"mci" : {
"ET1" : {
"width" : 20,
"maxLength" : "@config:users.usernameMax",
"argName" : "username",
"focus" : true
},
"ET2" : {
"width" : 20,
"password" : true,
"maxLength" : "@config:users.passwordMax",
"argName" : "password",
"submit" : true
}
},
"submit" : {
"*" : [
{
"value" : { "password" : null },
"action" : "@systemMethod:login"
}
]
},
"actionKeys" : [
{
"keys" : [ "escape" ],
"action" : "@menu:matrix"
}
]
}
}
},
"logoff" : {
"art" : "LOGOFF",
"action" : "@systemMethod:logoff",
@ -205,10 +244,15 @@
"config" : {
"dateTimeFormat" : "ddd MMM Do h:mm a"
},
"action" : "@menu:fullLoginSequenceSysStats"
},
"fullLoginSequenceSysStats" : {
"art" : "SYSSTAT",
"options" : { "cls" : true, "pause" : true },
"action" : "@menu:fullLoginSequenceUserStats"
},
"fullLoginSequenceUserStats" : {
"art" : "userstats",
"art" : "USRSTAT",
"options" : { "cls" : true, "pause" : true },
"action" : "@menu:mainMenu"
},
@ -223,7 +267,8 @@
//"action" : "@menu:lastCallers"
},
"mainMenu" : {
"art" : "MAINMENU",
"art" : "MMENU1",
"desc" : "Main Menu",
"options" : { "cls" : true },
"prompt" : "menuCommand",
"submit" : [
@ -235,10 +280,20 @@
"value" : { "command" : "D" },
"action" : "@menu:doorPimpWars"
},
/*
{
"value" : { "command" : "L" },
"action" : "@menu:doorLORD"
},
*/
{
"value" : { "command" : "L" },
"action" : "@menu:mainMenuLastCallers"
},
{
"value" : { "command" : "U" },
"action" : "@menu:mainMenuUserStats"
},
{
"value" : { "command" : "M" },
"action" : "@menu:messageArea"
@ -249,6 +304,20 @@
}
]
},
"mainMenuLastCallers" : {
"module" : "last_callers",
"art" : "LASTCALL",
"options" : { "cls" : true, "pause" : true },
"config" : {
"dateTimeFormat" : "ddd MMM Do h:mm a"
},
"action" : "@menu:mainMenu"
},
"mainMenuUserStats" : {
"art" : "USRSTAT",
"options" : { "cls" : true, "pause" : true },
"action" : "@menu:mainMenu"
},
///////////////////////////////////////////////////////////////////////
// Message Area Related
///////////////////////////////////////////////////////////////////////
@ -365,11 +434,11 @@
"fallback" : "messageArea", // :TODO: remove once default fallback is in place
"config" : {
"art" : {
"header" : "msg_area_view_header",
"header" : "MSGVHDR",
"body" : "demo_fse_netmail_body.ans",
"footerEdit" : "demo_fse_netmail_footer_edit.ans",
"footerEditMenu" : "demo_fse_netmail_footer_edit_menu.ans",
"footerView" : "msg_area_footer_view.ans",
"footerView" : "MSGVFTR",
"help" : "demo_fse_netmail_help.ans"
},
"editorMode" : "view",
@ -379,20 +448,21 @@
"0" : {
"mci" : {
"TL1" : {
"width" : 36
"width" : 27
},
"TL2" : {
"width" : 36
"width" : 27
},
"TL3" : {
"width" : 39,
//"width" : 39,
"width" : 27,
"textOverflow" : "..."
},
"TL5" : {
"width" : 19
"width" : 27
},
"MA5" : {
"width" : 19,
"width" : 27,
"textOverflow" : "..."
}
}
@ -402,7 +472,7 @@
"mci" : {
"MT1" : {
"width" : 79,
"height" : 17,
"height" : 12,
"mode" : "preview"
}
},
@ -435,43 +505,53 @@
}
},
"4" : {
"HM" : {
"mci" : {
"HM1" : {
// (P)rev/(N)ext/Post/(R)eply/(Q)uit/(?)Help
// (#)Jump/(L)Index (msg list)/Last
"items" : [ "Prev", "Next", "Reply", "Quit", "Help" ]
}
},
"submit" : {
"*" : [
{
"value" : { "1" : 0 },
"action" : "@method:prevMessage"
},
{
"value" : { "1" : 1 },
"action" : "@method:nextMessage"
},
{
"value" : { "1" : 3 },
"action" : "@menu:messageArea"
}
]
},
"actionKeys" : [
/*
"mci" : {
"HM1" : {
// (P)rev/(N)ext/Post/(R)eply/(Q)uit/(?)Help
// (#)Jump/(L)Index (msg list)/Last
"items" : [ "Prev", "Next", "Reply", "Quit", "Help" ]
}
},
"submit" : {
"*" : [
{
"keys" : [ "escape" ],
"action" : "@method:editModeEscPressed" // :TODO: fixme
"value" : { "1" : 0 },
"action" : "@method:prevMessage"
},
{
"value" : { "1" : 1 },
"action" : "@method:nextMessage"
},
*/
{
"keys" : [ "down arrow", "up arrow", "page up", "page down" ],
"action" : "@method:movementKeyPressed"
"value" : { "1" : 3 },
"action" : "@menu:messageArea"
}
]
}
},
"actionKeys" : [
/*
{
"keys" : [ "escape" ],
"action" : "@method:editModeEscPressed" // :TODO: fixme
},
*/
{
"keys" : [ "P", "p" ],
"action" : "@method:prevMessage"
},
{
"keys" : [ "N", "n" ],
"action" : "@method:nextMessage"
},
{
"keys" : [ "escape", "Q", "q" ],
"action" : "@menu:messageArea"
},
{
"keys" : [ "down arrow", "up arrow", "page up", "page down" ],
"action" : "@method:movementKeyPressed"
}
]
}
}
},

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -62,6 +62,11 @@
"width" : 17,
"textOverflow" : "..."
}
},
"messageAreaViewPost" : {
"TL3" : {
"width" : 25
}
}
},
"prompts" : {