* 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);
var self = this;
this.menuConfig = options.menuConfig; // :TODO: MenuModule does this...
//this.menuConfig = options.menuConfig; // :TODO: MenuModule does this...
//
// Editor Type ('editorType'):
// * netMail : User to user, optionally remote
// *
// menuConfig.config:
// editorType : email | area
//
this.editorType = this.menuConfig.config.editorType;
this.artNames = [ 'header', 'body', 'footerEdit', 'footerEditMenu', 'footerView' ];
// :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.toUserId = options.toUserId || 0;
@ -63,7 +68,7 @@ function FullScreenEditorModule(options) {
}[name];
};
this.getMessageData = function() {
this.getMessage = function() {
var headerValues = self.viewControllers.header.getFormData().value;
var messageOpts = {
@ -72,23 +77,9 @@ function FullScreenEditorModule(options) {
fromUserName : headerValues.from,
subject : headerValues.subject,
message : self.viewControllers.body.getFormData().value.message,
};
console.log(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) {
});*/
return new Message(messageOpts);
};
this.redrawFooter = function(options, cb) {
@ -425,7 +416,8 @@ function FullScreenEditorModule(options) {
});
},
editModeMenuSave : function(formData, extraArgs) {
self.getMessageData();
var msg = self.getMessage();
console.log(msg);
},
editModeMenuQuote : function(formData, extraArgs) {

View File

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

View File

@ -220,42 +220,6 @@
"mainMenu" : {
"art" : "MAINMENU",
"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",
"submit" : [
{
@ -270,12 +234,78 @@
"value" : { "command" : "L" },
"action" : "@menu:doorLORD"
},
{
"value" : { "command" : "M" },
"action" : "@menu:messageAreaMenu"
},
{
"value" : 1,
"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" : {
"module" : "abracadabra",
"fallback" : "mainMenu",
@ -662,7 +692,6 @@
},
"demoFullScreenEditor" : {
"module" : "@systemModule:fse",
//"art" : "demo_fse_local_user.ans",
"options" : { "cls" : true },
"config" : {
"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
///////////////////////////////////////////////////////////////////////