* Switching back to module system for FSE... broken now, but hopefully this model sticks
This commit is contained in:
parent
6257208c5e
commit
d9b39fcaa6
43
core/fse.js
43
core/fse.js
|
@ -12,6 +12,10 @@ var async = require('async');
|
||||||
var assert = require('assert');
|
var assert = require('assert');
|
||||||
var _ = require('lodash');
|
var _ = require('lodash');
|
||||||
|
|
||||||
|
exports.FullScreenEditorModule = FullScreenEditorModule;
|
||||||
|
|
||||||
|
// :TODO: clean this up:
|
||||||
|
|
||||||
exports.getModule = FullScreenEditorModule;
|
exports.getModule = FullScreenEditorModule;
|
||||||
|
|
||||||
exports.moduleInfo = {
|
exports.moduleInfo = {
|
||||||
|
@ -24,32 +28,25 @@ function FullScreenEditorModule(options) {
|
||||||
MenuModule.call(this, options);
|
MenuModule.call(this, options);
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
//this.menuConfig = options.menuConfig; // :TODO: MenuModule does this...
|
var config = this.menuConfig.config;
|
||||||
|
|
||||||
//
|
//
|
||||||
// menuConfig.config:
|
// menuConfig.config:
|
||||||
// editorType : email | area
|
// editorType : email | area
|
||||||
|
// editorMode : view | edit | quote (private: editMenu | ... )
|
||||||
//
|
//
|
||||||
this.editorType = this.menuConfig.config.editorType;
|
// extraArgs:
|
||||||
|
// messageAreaId
|
||||||
this.artNames = [ 'header', 'body', 'footerEdit', 'footerEditMenu', 'footerView' ];
|
// messageNumber / messageTotal
|
||||||
|
|
||||||
// :TODO: The following needs to be passed in via args:
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// options.extraArgs:
|
//
|
||||||
// editorMode : edit | view
|
this.editorType = config.editorType;
|
||||||
|
this.editorMode = config.editorMode;
|
||||||
this.editorMode = 'edit'; // view | edit | editMenu | quote
|
|
||||||
this.isLocal = true;
|
|
||||||
|
|
||||||
this.toUserId = options.toUserId || 0;
|
|
||||||
this.fromUserId = options.fromUserId || 0;
|
|
||||||
|
|
||||||
|
|
||||||
|
this.mciData = {};
|
||||||
|
|
||||||
// netMail/crashMail | echoMail
|
// netMail/crashMail | echoMail
|
||||||
this.messageAreaId = 'netMail' === this.editorType ? Message.WellKnownAreaIds.Private : options.messageAreaId;
|
//this.messageAreaId = 'netMail' === this.editorType ? Message.WellKnownAreaIds.Private : options.messageAreaId;
|
||||||
|
|
||||||
this.getFooterName = function(editorMode) {
|
this.getFooterName = function(editorMode) {
|
||||||
editorMode = editorMode || this.editorMode;
|
editorMode = editorMode || this.editorMode;
|
||||||
|
@ -72,7 +69,7 @@ function FullScreenEditorModule(options) {
|
||||||
var headerValues = self.viewControllers.header.getFormData().value;
|
var headerValues = self.viewControllers.header.getFormData().value;
|
||||||
|
|
||||||
var messageOpts = {
|
var messageOpts = {
|
||||||
areaId : self.messageAreaId,
|
// areaId : self.messageAreaId,
|
||||||
toUserName : headerValues.to,
|
toUserName : headerValues.to,
|
||||||
fromUserName : headerValues.from,
|
fromUserName : headerValues.from,
|
||||||
subject : headerValues.subject,
|
subject : headerValues.subject,
|
||||||
|
@ -239,15 +236,17 @@ function FullScreenEditorModule(options) {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
function complete(err) {
|
function complete(err) {
|
||||||
|
console.log(err)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
this.mciReadyHandlerNetMail = function(mciData) {
|
this.mciReadyHandler = function(mciData) {
|
||||||
|
|
||||||
var menuLoadOpts = { callingMenu : self };
|
var menuLoadOpts = { callingMenu : self };
|
||||||
|
|
||||||
|
console.log('mciReadyHandler...')
|
||||||
|
|
||||||
async.series(
|
async.series(
|
||||||
[
|
[
|
||||||
function header(callback) {
|
function header(callback) {
|
||||||
|
@ -287,6 +286,7 @@ function FullScreenEditorModule(options) {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
function complete(err) {
|
function complete(err) {
|
||||||
|
console.log(err)
|
||||||
var bodyView = self.viewControllers.body.getView(1);
|
var bodyView = self.viewControllers.body.getView(1);
|
||||||
self.updateTextEditMode(bodyView.getTextEditMode());
|
self.updateTextEditMode(bodyView.getTextEditMode());
|
||||||
self.updateEditModePosition(bodyView.getEditPosition());
|
self.updateEditModePosition(bodyView.getEditPosition());
|
||||||
|
@ -436,6 +436,7 @@ FullScreenEditorModule.prototype.enter = function(client) {
|
||||||
};
|
};
|
||||||
|
|
||||||
FullScreenEditorModule.prototype.mciReady = function(mciData) {
|
FullScreenEditorModule.prototype.mciReady = function(mciData) {
|
||||||
this['mciReadyHandler' + _.capitalize(this.editorType)](mciData);
|
this.mciReadyHandler(mciData);
|
||||||
|
//this['mciReadyHandler' + _.capitalize(this.editorType)](mciData);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -264,10 +264,10 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"messageAreaNewPost" : {
|
"messageAreaNewPost" : {
|
||||||
"module" : "msg_area_post",
|
"module" : "msg_area_post_fse",
|
||||||
"options" : { "cls" : true },
|
"options" : { "cls" : true },
|
||||||
"config" : {
|
"config" : {
|
||||||
"fseArt" : {
|
"art" : {
|
||||||
"header" : "msg_area_post_header",
|
"header" : "msg_area_post_header",
|
||||||
"body" : "demo_fse_netmail_body.ans",
|
"body" : "demo_fse_netmail_body.ans",
|
||||||
"footerEdit" : "demo_fse_netmail_footer_edit.ans",
|
"footerEdit" : "demo_fse_netmail_footer_edit.ans",
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
/* jslint node: true */
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var FullScreenEditorModule = require('../core/fse.js').FullScreenEditorModule;
|
||||||
|
|
||||||
|
exports.getModule = AreaPostFSEModule;
|
||||||
|
|
||||||
|
exports.moduleInfo = {
|
||||||
|
name : 'Message Area Post',
|
||||||
|
desc : 'Module posting a new message to an area',
|
||||||
|
author : 'NuSkooler',
|
||||||
|
};
|
||||||
|
|
||||||
|
function AreaPostFSEModule(options) {
|
||||||
|
FullScreenEditorModule.call(this, options);
|
||||||
|
|
||||||
|
// we're posting, so always start with 'edit' mode
|
||||||
|
this.editorMode = 'edit';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
require('util').inherits(AreaPostFSEModule, FullScreenEditorModule);
|
||||||
|
|
Loading…
Reference in New Issue