2015-08-12 03:36:08 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var MenuModule = require('../core/menu_module.js').MenuModule;
|
|
|
|
var FullScreenEditor = require('../core/fse--class.js'); // :TODO: fix this
|
|
|
|
//var theme = require('../core/theme.js');
|
|
|
|
|
|
|
|
var async = require('async');
|
|
|
|
var assert = require('assert');
|
|
|
|
var _ = require('lodash');
|
|
|
|
|
|
|
|
exports.getModule = MessageAreaPostModule;
|
|
|
|
|
|
|
|
exports.moduleInfo = {
|
|
|
|
name : 'Message Area Post',
|
|
|
|
desc : 'Module posting a new message to an area',
|
|
|
|
author : 'NuSkooler',
|
|
|
|
};
|
|
|
|
|
|
|
|
function MessageAreaPostModule(options) {
|
|
|
|
MenuModule.call(this, options);
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
|
|
this.initSequence = function() {
|
2015-08-14 04:30:55 +00:00
|
|
|
self.fse = new FullScreenEditor( {
|
|
|
|
callingMenu : this,
|
2015-08-12 03:36:08 +00:00
|
|
|
client : this.client,
|
2015-08-14 04:30:55 +00:00
|
|
|
// :TODO: should pass in full config? want access to keymap/etc. as well
|
2015-08-12 03:36:08 +00:00
|
|
|
art : this.menuConfig.config.fseArt,
|
|
|
|
font : this.menuConfig.font,
|
|
|
|
editorType : 'area',
|
|
|
|
editorMode : 'edit',
|
|
|
|
});
|
|
|
|
|
2015-08-14 04:30:55 +00:00
|
|
|
self.fse.on('error', function fseError(err) {
|
|
|
|
console.log('fse error: ' + err)
|
2015-08-12 03:36:08 +00:00
|
|
|
});
|
|
|
|
|
2015-08-14 04:30:55 +00:00
|
|
|
self.fse.enter();
|
2015-08-12 03:36:08 +00:00
|
|
|
};
|
2015-08-13 04:08:33 +00:00
|
|
|
|
|
|
|
this.menuMethods = {
|
2015-08-14 04:30:55 +00:00
|
|
|
// :TODO: is there a cleaner way to achieve this?
|
2015-08-13 04:08:33 +00:00
|
|
|
fseSubmitProxy : function(formData, extraArgs) {
|
2015-08-14 04:30:55 +00:00
|
|
|
self.fse.submitHandler(formData, extraArgs);
|
2015-08-13 04:08:33 +00:00
|
|
|
}
|
|
|
|
};
|
2015-08-12 03:36:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
require('util').inherits(MessageAreaPostModule, MenuModule);
|
|
|
|
|
|
|
|
/*
|
|
|
|
MessageAreaPostModule.prototype.mciReady = function(mciData, cb) {
|
|
|
|
this.standardMCIReadyHandler(mciData, cb);
|
|
|
|
};
|
|
|
|
*/
|
|
|
|
|