* 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 : { ViewModeFooter : {
MsgNum : 6, MsgNum : 6,
MsgTotal : 7, MsgTotal : 7,
},
ReplyEditModeHeader : {
From : 1,
To : 2,
Subject : 3,
} }
}; };
@ -154,8 +161,6 @@ function FullScreenEditorModule(options) {
}; };
this.setMessage = function(message) { this.setMessage = function(message) {
//console.log(message)
self.message = message; self.message = message;
if(self.isReady) { if(self.isReady) {
@ -406,7 +411,7 @@ function FullScreenEditorModule(options) {
callback(null); callback(null);
}, },
function setInitialData(callback) { function setInitialData(callback) {
switch(self.editorMode) { switch(self.editorMode) {
case 'view' : case 'view' :
if(self.message) { if(self.message) {
@ -422,6 +427,10 @@ function FullScreenEditorModule(options) {
case 'edit' : case 'edit' :
self.viewControllers.header.getView(1).setText(self.client.user.username); // from self.viewControllers.header.getView(1).setText(self.client.user.username); // from
if(self.replyToMessage) {
self.initHeaderReplyEditMode();
}
break; break;
} }
@ -513,6 +522,21 @@ function FullScreenEditorModule(options) {
setHeaderText(MCICodeIds.ViewModeHeader.ReplyToMsgID, self.message.replyToMessageId); 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() { this.initFooterViewMode = function() {
function setFooterText(id, text) { 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) { editModeMenuQuote : function(formData, extraArgs) {
}, },
@ -629,6 +648,8 @@ function FullScreenEditorModule(options) {
if(_.has(options, 'extraArgs.message')) { if(_.has(options, 'extraArgs.message')) {
this.setMessage(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: { messageAreaReplyPost: {
module: msg_area_reply_fse //module: msg_area_reply_fse
module: msg_area_post_fse
config: { config: {
art: { art: {
header: MSGEHDR header: MSGEHDR
@ -603,7 +604,29 @@
textOverflow: ... 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 // :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
@ -617,7 +640,6 @@
body: MSGBODY body: MSGBODY
footerEditor: MSGEFTR footerEditor: MSGEFTR
footerEditorMenu: MSGEMFT footerEditorMenu: MSGEMFT
footerView: demo_fse_netmail_footer_view.ans
help: demo_fse_netmail_help.ans help: demo_fse_netmail_help.ans
}, },
editorMode: edit editorMode: edit

View File

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