mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-05 09:21:30 +02:00
* Progress on FSE / Area Posting
* Proof of concept work on user validation in FSE * Term now has pipeWrite()
This commit is contained in:
parent
ca26cca55b
commit
ec70cc8caa
8 changed files with 96 additions and 28 deletions
Binary file not shown.
|
@ -316,6 +316,7 @@
|
|||
"messageAreaNewPost" : {
|
||||
"module" : "msg_area_post_fse",
|
||||
"options" : { "cls" : true },
|
||||
"fallback" : "messageArea", // :TODO: remove once default fallback is in place
|
||||
"config" : {
|
||||
"art" : {
|
||||
"header" : "msg_area_post_header",
|
||||
|
@ -324,11 +325,12 @@
|
|||
"footerEditMenu" : "demo_fse_netmail_footer_edit_menu.ans",
|
||||
"footerView" : "demo_fse_netmail_footer_view.ans",
|
||||
"help" : "demo_fse_netmail_help.ans"
|
||||
}
|
||||
},
|
||||
"editorType" : "area"
|
||||
},
|
||||
"form" : {
|
||||
"0" : {
|
||||
"ETETTLTL" : {
|
||||
"ETETTL" : {
|
||||
"mci" : {
|
||||
"TL1" : {
|
||||
"width" : 36,
|
||||
|
@ -345,10 +347,15 @@
|
|||
"maxLength" : 72,
|
||||
"submit" : true
|
||||
},
|
||||
"TL4" : {
|
||||
"MA5" : {
|
||||
"width" : 19,
|
||||
"textOverflow" : "..."
|
||||
}
|
||||
/*,
|
||||
"TL4" : {
|
||||
"width" : 19,
|
||||
"textOverflow" : "..."
|
||||
}*/
|
||||
},
|
||||
"submit" : {
|
||||
"3" : [
|
||||
|
|
|
@ -36,9 +36,10 @@ function MessageAreaListModule(options) {
|
|||
changeArea : function(formData, extraArgs) {
|
||||
if(1 === formData.submitId) {
|
||||
var areaId = self.messageAreas[formData.value.area].areaId;
|
||||
|
||||
messageArea.changeCurrentArea(self.client, areaId, function areaChanged(err) {
|
||||
if(err) {
|
||||
self.client.term.write('\nCannot change area: ' + err.message + '\n');
|
||||
self.client.term.pipeWrite('\n|00Cannot change area: ' + err.message + '\n');
|
||||
|
||||
setTimeout(function timeout() {
|
||||
self.client.gotoMenuModule( { name : self.menuConfig.fallback } );
|
||||
|
|
|
@ -3,8 +3,10 @@
|
|||
|
||||
var FullScreenEditorModule = require('../core/fse.js').FullScreenEditorModule;
|
||||
var Message = require('../core/message.js').Message;
|
||||
var user = require('../core/user.js');
|
||||
|
||||
var _ = require('lodash');
|
||||
var async = require('async');
|
||||
|
||||
exports.getModule = AreaPostFSEModule;
|
||||
|
||||
|
@ -24,7 +26,33 @@ function AreaPostFSEModule(options) {
|
|||
|
||||
this.menuMethods.editModeMenuSave = function(formData, extraArgs) {
|
||||
var msg = self.getMessage();
|
||||
console.log(msg);
|
||||
|
||||
async.series(
|
||||
[
|
||||
function prepareMessage(callback) {
|
||||
if(self.isLocalEmail()) {
|
||||
msg.setLocalFromUserId(self.client.user.userId);
|
||||
msg.setLocalToUserId(self.toUserId);
|
||||
}
|
||||
|
||||
callback(null);
|
||||
},
|
||||
function saveMessage(callback) {
|
||||
msg.persist(function persisted(err) {
|
||||
callback(err);
|
||||
});
|
||||
}
|
||||
],
|
||||
function complete(err) {
|
||||
if(err) {
|
||||
// :TODO:... sooooo now what?
|
||||
} else {
|
||||
console.log(msg);
|
||||
}
|
||||
|
||||
self.client.gotoMenuModule( { name : self.menuConfig.fallback } );
|
||||
}
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -40,4 +68,22 @@ AreaPostFSEModule.prototype.enter = function(client) {
|
|||
}
|
||||
|
||||
AreaPostFSEModule.super_.prototype.enter.call(this, client);
|
||||
};
|
||||
|
||||
AreaPostFSEModule.prototype.validateToUserName = function(un, cb) {
|
||||
|
||||
console.log('bazinga')
|
||||
|
||||
|
||||
var self = this;
|
||||
|
||||
if(!self.isLocalEmail()) {
|
||||
cb(null);
|
||||
return;
|
||||
}
|
||||
|
||||
user.getUserIdAndName(un, function uidAndName(err, userId, userName) {
|
||||
self.toUserId = userId;
|
||||
cb(err);
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue