* Start work on message area replies

This commit is contained in:
Bryan Ashby 2015-09-12 18:18:46 -06:00
parent 05f666cf29
commit 08beee4274
4 changed files with 95 additions and 7 deletions

View File

@ -520,6 +520,13 @@
"value" : { "1" : 1 }, "value" : { "1" : 1 },
"action" : "@method:nextMessage" "action" : "@method:nextMessage"
}, },
{
value: { 1: 2 },
action: @method:replyMessage
extraArgs: {
menu: messageAreaReplyPost
}
},
{ {
"value" : { "1" : 3 }, "value" : { "1" : 3 },
"action" : "@menu:messageArea" "action" : "@menu:messageArea"
@ -553,6 +560,52 @@
} }
} }
}, },
messageAreaReplyPost: {
module: msg_area_reply_fse
config: {
art: {
header: MSGEHDR
body: MSGBODY
quote: MSGQUOT
footerEditor: MSGEFTR
footerEditorMenu: MSGEMFT
// :TODO: help
}
editorMode: edit
editorType: area
}
form: {
0: {
mci: {
// :TODO: use appropriate system properties for these lenghts
TL1: {
width: 27
argName: from
}
ET2: {
width: 27
argName: to
focus: true
}
ET3: {
width: 27
argName: subject
maxLength: 72
submit: true
}
TL4: {
// :TODO: this is for RE: line
width: 27
textOverflow: ...
}
MA5: {
width: 27
textOverflow: ...
}
}
}
}
}
// :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu // :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
"messageAreaNewPost" : { "messageAreaNewPost" : {
"status" : "Posting message", "status" : "Posting message",
@ -653,17 +706,13 @@
"action" : "@menu:messageArea" "action" : "@menu:messageArea"
}, },
{ {
"value" : { "1" : 2 }, value: { 1: 2 },
"action" : "@method:fseSubmitProxy" action: @method:editModeQuote
}, },
{ {
"value" : { "1" : 3 }, "value" : { "1" : 3 },
"action" : "@method:editModeMenuHelp" "action" : "@method:editModeMenuHelp"
}/*, }
{
"value" : 1,
"action" : "@method:editModeEscPressed"
}*/
] ]
}, },
"actionKeys" : [ // :TODO: Need better name "actionKeys" : [ // :TODO: Need better name

View File

@ -0,0 +1,25 @@
/* jslint node: true */
'use strict';
var FullScreenEditorModule = require('../core/fse.js').FullScreenEditorModule;
var Message = require('../core/message.js');
var messageArea = require('../core/message_area.js');
var user = require('../core/user.js');
var _ = require('lodash');
var async = require('async');
var assert = require('assert');
exports.getModule = AreaReplyFSEModule;
exports.moduleInfo = {
name : 'Message Area Reply',
desc : 'Module for replying to an area message',
author : 'NuSkooler',
};
function AreaReplyFSEModule(options) {
FullScreenEditorModule.call(this, options);
}
require('util').inherits(AreaReplyFSEModule, FullScreenEditorModule);

View File

@ -63,6 +63,20 @@ function AreaViewFSEModule(options) {
} }
}; };
this.menuMethods.replyMessage = function(formData, extraArgs) {
if(_.isString(extraArgs.menu)) {
var modOpts = {
name : extraArgs.menu,
messageArea : self.messageAreaName,
replyToMessage : self.message,
};
self.client.gotoMenuModule(modOpts);
} else {
self.client.log(extraArgs, 'Missing extraArgs.menu');
}
};
this.loadMessageByUuid = function(uuid) { this.loadMessageByUuid = function(uuid) {
var msg = new Message(); var msg = new Message();
msg.load( { uuid : uuid, user : self.client.user }, function loaded(err) { msg.load( { uuid : uuid, user : self.client.user }, function loaded(err) {

Binary file not shown.