2015-08-14 20:49:06 +00:00
|
|
|
/* jslint node: true */
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var FullScreenEditorModule = require('../core/fse.js').FullScreenEditorModule;
|
2015-08-16 19:35:34 +00:00
|
|
|
var Message = require('../core/message.js').Message;
|
|
|
|
|
|
|
|
var _ = require('lodash');
|
2015-08-14 20:49:06 +00:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2015-08-16 19:35:34 +00:00
|
|
|
var self = this;
|
|
|
|
|
2015-08-14 20:49:06 +00:00
|
|
|
// we're posting, so always start with 'edit' mode
|
|
|
|
this.editorMode = 'edit';
|
|
|
|
|
2015-08-16 19:35:34 +00:00
|
|
|
this.menuMethods.editModeMenuSave = function(formData, extraArgs) {
|
|
|
|
var msg = self.getMessage();
|
|
|
|
console.log(msg);
|
|
|
|
};
|
2015-08-14 20:49:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
require('util').inherits(AreaPostFSEModule, FullScreenEditorModule);
|
|
|
|
|
2015-08-18 03:45:11 +00:00
|
|
|
AreaPostFSEModule.prototype.enter = function(client) {
|
|
|
|
//
|
|
|
|
// If messageAreaId is passed in extraArgs, use it. Otherwise, look
|
|
|
|
// to the client user for current area ID
|
|
|
|
//
|
|
|
|
if(_.isNumber(client.user.properties.message_area_id)) {
|
|
|
|
this.messageAreaId = client.user.properties.message_area_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
AreaPostFSEModule.super_.prototype.enter.call(this, client);
|
|
|
|
};
|