* Minor work on reply area post

This commit is contained in:
Bryan Ashby 2015-09-12 19:18:08 -06:00
parent 08beee4274
commit 88d725f585
3 changed files with 57 additions and 12 deletions

View File

@ -74,6 +74,13 @@ var MCICodeIds = {
ViewModeFooter : {
MsgNum : 6,
MsgTotal : 7,
},
ReplyEditModeHeader : {
From : 1,
To : 2,
Subject : 3,
}
};
@ -154,8 +161,6 @@ function FullScreenEditorModule(options) {
};
this.setMessage = function(message) {
//console.log(message)
self.message = message;
if(self.isReady) {
@ -406,7 +411,7 @@ function FullScreenEditorModule(options) {
callback(null);
},
function setInitialData(callback) {
switch(self.editorMode) {
case 'view' :
if(self.message) {
@ -422,6 +427,10 @@ function FullScreenEditorModule(options) {
case 'edit' :
self.viewControllers.header.getView(1).setText(self.client.user.username); // from
if(self.replyToMessage) {
self.initHeaderReplyEditMode();
}
break;
}
@ -513,6 +522,21 @@ function FullScreenEditorModule(options) {
setHeaderText(MCICodeIds.ViewModeHeader.ReplyToMsgID, self.message.replyToMessageId);
};
this.initHeaderReplyEditMode = function() {
assert(_.isObject(self.replyToMessage));
function setHeaderText(id, text) {
var v = self.viewControllers.header.getView(id);
if(v) {
v.setText(text);
}
}
setHeaderText(MCICodeIds.ReplyEditModeHeader.To, self.replyToMessage.fromUserName);
setHeaderText(MCICodeIds.ReplyEditModeHeader.Subject, 'RE: ' + self.replyToMessage.subject);
};
this.initFooterViewMode = function() {
function setFooterText(id, text) {
@ -604,11 +628,6 @@ function FullScreenEditorModule(options) {
}
});
},
/*
editModeMenuSave : function(formData, extraArgs) {
var msg = self.getMessage();
console.log(msg);
},*/
editModeMenuQuote : function(formData, extraArgs) {
},
@ -629,6 +648,8 @@ function FullScreenEditorModule(options) {
if(_.has(options, 'extraArgs.message')) {
this.setMessage(options.extraArgs.message);
} else if(_.has(options, 'extraArgs.replyToMessage')) {
this.replyToMessage = options.extraArgs.replyToMessage;
}
}

View File

@ -561,7 +561,8 @@
}
},
messageAreaReplyPost: {
module: msg_area_reply_fse
//module: msg_area_reply_fse
module: msg_area_post_fse
config: {
art: {
header: MSGEHDR
@ -603,7 +604,29 @@
textOverflow: ...
}
}
submit: {
3: [ { "value" : { "subject" : null }, "action" : "@method:headerSubmit" } ]
}
}
1: {
mci: {
MT1: {
width: 79
height: 12
argName: message
mode: edit
}
}
submit: {
*: [ { "value": "message", "action": "@method:editModeEscPressed" } ]
}
actionKeys: [
{
keys: [ "escape" ],
viewId: 1
}
]
},
}
}
// :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
@ -617,7 +640,6 @@
body: MSGBODY
footerEditor: MSGEFTR
footerEditorMenu: MSGEMFT
footerView: demo_fse_netmail_footer_view.ans
help: demo_fse_netmail_help.ans
},
editorMode: edit

View File

@ -67,8 +67,10 @@ function AreaViewFSEModule(options) {
if(_.isString(extraArgs.menu)) {
var modOpts = {
name : extraArgs.menu,
messageArea : self.messageAreaName,
replyToMessage : self.message,
extraArgs : {
messageAreaName : self.messageAreaName,
replyToMessage : self.message,
}
};
self.client.gotoMenuModule(modOpts);