* Lots of experimental stuff with message area in relation of FSE. Have a fairly good idea now how this can work... a few missing pieces

This commit is contained in:
Bryan Ashby 2015-08-09 19:32:38 -06:00
parent dbb3e04166
commit 901f83453c
4 changed files with 100 additions and 64 deletions

View File

@ -24,18 +24,23 @@ function FullScreenEditorModule(options) {
MenuModule.call(this, options); MenuModule.call(this, options);
var self = this; var self = this;
this.menuConfig = options.menuConfig; // :TODO: MenuModule does this... //this.menuConfig = options.menuConfig; // :TODO: MenuModule does this...
// //
// Editor Type ('editorType'): // menuConfig.config:
// * netMail : User to user, optionally remote // editorType : email | area
// * //
this.editorType = this.menuConfig.config.editorType; this.editorType = this.menuConfig.config.editorType;
this.artNames = [ 'header', 'body', 'footerEdit', 'footerEditMenu', 'footerView' ]; this.artNames = [ 'header', 'body', 'footerEdit', 'footerEditMenu', 'footerView' ];
// :TODO: The following needs to be passed in via args: // :TODO: The following needs to be passed in via args:
this.editorMode = 'edit'; // view | edit | editMenu |
//
// options.extraArgs:
// editorMode : edit | view
this.editorMode = 'edit'; // view | edit | editMenu | quote
this.isLocal = true; this.isLocal = true;
this.toUserId = options.toUserId || 0; this.toUserId = options.toUserId || 0;
@ -63,7 +68,7 @@ function FullScreenEditorModule(options) {
}[name]; }[name];
}; };
this.getMessageData = function() { this.getMessage = function() {
var headerValues = self.viewControllers.header.getFormData().value; var headerValues = self.viewControllers.header.getFormData().value;
var messageOpts = { var messageOpts = {
@ -72,23 +77,9 @@ function FullScreenEditorModule(options) {
fromUserName : headerValues.from, fromUserName : headerValues.from,
subject : headerValues.subject, subject : headerValues.subject,
message : self.viewControllers.body.getFormData().value.message, message : self.viewControllers.body.getFormData().value.message,
}; };
console.log(messageOpts); return new Message(messageOpts);
var msg = new Message(messageOpts);
if(self.isLocal) {
msg.meta.System.local_to_user_id = self.toUserId;
msg.meta.System.local_from_user_id = self.fromUserId;
}
/*msg.persist(function persisted(err, msgId) {
});*/
}; };
this.redrawFooter = function(options, cb) { this.redrawFooter = function(options, cb) {
@ -425,7 +416,8 @@ function FullScreenEditorModule(options) {
}); });
}, },
editModeMenuSave : function(formData, extraArgs) { editModeMenuSave : function(formData, extraArgs) {
self.getMessageData(); var msg = self.getMessage();
console.log(msg);
}, },
editModeMenuQuote : function(formData, extraArgs) { editModeMenuQuote : function(formData, extraArgs) {

View File

@ -42,13 +42,15 @@ function MenuModule(options) {
self.menuConfig.art, self.menuConfig.art,
self.client, self.client,
{ font : self.menuConfig.font }, { font : self.menuConfig.font },
function displayed(err, artData) function displayed(err, artData) {
{ if(err) {
if(!err) { self.client.log.debug( { art : self.menuConfig.arg, err : err }, 'Could not display art');
} else {
mciData.menu = artData.mciMap; mciData.menu = artData.mciMap;
} }
callback(err); callback(null); // non-fatal
}); }
);
} else { } else {
callback(null); callback(null);
} }

View File

@ -220,42 +220,6 @@
"mainMenu" : { "mainMenu" : {
"art" : "MAINMENU", "art" : "MAINMENU",
"options" : { "cls" : true }, "options" : { "cls" : true },
/*
"form" : {
"0" : {
"ET" : {
"mci" : {
"ET1" : {
"focus" : true,
"submit" : true,
"textStyle" : "lower",
"width" : 20,
"maxLength" : 20
}
},
"submit" : {
"*" : [
{
"value" : { "1" : "g" },
"action" : "@menu:logoff"
},
{
"value" : { "1" : "d" },
"action" : "@menu:doorPimpWars"
},
{
"value" : { "1" : "l" },
"action" : "@menu:doorLORD"
},
{
"value" : 1,
"action" : "@menu:mainMenu"
}
]
}
}
}
},*/
"prompt" : "menuCommand", "prompt" : "menuCommand",
"submit" : [ "submit" : [
{ {
@ -270,12 +234,78 @@
"value" : { "command" : "L" }, "value" : { "command" : "L" },
"action" : "@menu:doorLORD" "action" : "@menu:doorLORD"
}, },
{
"value" : { "command" : "M" },
"action" : "@menu:messageAreaMenu"
},
{ {
"value" : 1, "value" : 1,
"action" : "@menu:mainMenu" "action" : "@menu:mainMenu"
} }
] ]
}, },
///////////////////////////////////////////////////////////////////////
// Message Area Related
///////////////////////////////////////////////////////////////////////
"messageAreaMenu" : {
"module" : "message_area",
"art" : "MSGAREA",
"options" : { "cls" : true },
"prompt" : "menuCommand",
"config" : {
"fseArt" : {
"header" : "demo_fse_netmail_header.ans",
"body" : "demo_fse_netmail_body.ans",
"footerEdit" : "demo_fse_netmail_footer_edit.ans",
"footerEditMenu" : "demo_fse_netmail_footer_edit_menu.ans",
"footerView" : "demo_fse_netmail_footer_view.ans",
"help" : "demo_fse_netmail_help.ans"
}
},
"submit" : [
{
"value" : { "command" : "R" },
"action" : "@method:readMessages"
},
{
"value" : { "command" : "P" },
"action" : "@method:postMessage"
}
]
},
"messageAreaNewFSE" : {
"module" : "fse",
"options" : { "cls" : true },
"config" : {
"editorType" : "area",
"art" : {
"header" : "fse_area_header",
"body" : "fse_area_body",
"footerEdit" : "fse_footer_edit",
"footerEditMenu" : "fse_footer_edit_menu",
"help" : "fse_help"
}
}
}
/*"messageAreaEmailFSE" : {
"module" : "fse",
"options" : { "cls" : true },
"config" : {
"editorType" : "email",
"art" : {
"header" : "fse_email_header",
"body" : "fse_email_body",
"footerEdit" : "fse_email_footer_edit",
"footerEditMenu" : "fse_email_footer_edit_menu",
"footerView" : "fse_email_footer_view",
"help" : "fse_help"
}
}
},
*/
///////////////////////////////////////////////////////////////////////
// Doors
///////////////////////////////////////////////////////////////////////
"doorPimpWars" : { "doorPimpWars" : {
"module" : "abracadabra", "module" : "abracadabra",
"fallback" : "mainMenu", "fallback" : "mainMenu",
@ -662,7 +692,6 @@
}, },
"demoFullScreenEditor" : { "demoFullScreenEditor" : {
"module" : "@systemModule:fse", "module" : "@systemModule:fse",
//"art" : "demo_fse_local_user.ans",
"options" : { "cls" : true }, "options" : { "cls" : true },
"config" : { "config" : {
"editorType" : "netMail", "editorType" : "netMail",

View File

@ -28,6 +28,19 @@
} }
} }
}, },
"newAreaPostPrompt" : {
"art" : "message_area_new_post",
"mci" : {
"ET1" : {
"argName" : "to",
"width" : 20
},
"ET2" : {
"argName" : "subject",
"width" : 20
}
}
},
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////
// Standard / Required // Standard / Required
/////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////