diff --git a/core/fse.js b/core/fse.js index 3c6e6960..f133ca2a 100644 --- a/core/fse.js +++ b/core/fse.js @@ -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; } } diff --git a/mods/menu.hjson b/mods/menu.hjson index 4232c5f8..3d21ed5b 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -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 diff --git a/mods/msg_area_view_fse.js b/mods/msg_area_view_fse.js index 37c65d94..66deeae2 100644 --- a/mods/msg_area_view_fse.js +++ b/mods/msg_area_view_fse.js @@ -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);