mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-23 19:20:41 +02:00
* Very minor
This commit is contained in:
parent
d71cae5c37
commit
990dffe880
4 changed files with 28 additions and 13 deletions
|
@ -318,8 +318,12 @@ User.prototype.persistProperty = function(propName, propValue, cb) {
|
||||||
|
|
||||||
userDb.run(
|
userDb.run(
|
||||||
'REPLACE INTO user_property (user_id, prop_name, prop_value) ' +
|
'REPLACE INTO user_property (user_id, prop_name, prop_value) ' +
|
||||||
'VALUES (?, ?, ?);', [ this.userId, propName, propValue ], function ran(err) {
|
'VALUES (?, ?, ?);',
|
||||||
cb(err);
|
[ this.userId, propName, propValue ],
|
||||||
|
function ran(err) {
|
||||||
|
if(cb) {
|
||||||
|
cb(err);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -259,8 +259,12 @@
|
||||||
"submit" : [
|
"submit" : [
|
||||||
{
|
{
|
||||||
"value" : { "command" : "N" },
|
"value" : { "command" : "N" },
|
||||||
"action" : "@menu:messageAreaNewPost",
|
"action" : "@menu:messageAreaNewPost"//,
|
||||||
"extraArgs" : { "messageAreaId" : 123 }
|
//"extraArgs" : { "messageAreaId" : 123 }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"value" : { "command" : "A" },
|
||||||
|
"action" : "@method:changeArea"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"value" : { "command" : "Q" },
|
"value" : { "command" : "Q" },
|
||||||
|
@ -268,6 +272,7 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
// :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
|
||||||
"messageAreaNewPost" : {
|
"messageAreaNewPost" : {
|
||||||
"module" : "msg_area_post_fse",
|
"module" : "msg_area_post_fse",
|
||||||
"options" : { "cls" : true },
|
"options" : { "cls" : true },
|
||||||
|
|
|
@ -23,7 +23,10 @@ function MessageAreaModule(options) {
|
||||||
|
|
||||||
this.menuMethods = {
|
this.menuMethods = {
|
||||||
changeArea : function(formData, extraArgs) {
|
changeArea : function(formData, extraArgs) {
|
||||||
|
// :TODO: really, we just need to go to a menu with a list of areas to select from and call a @systemMethod:setMessageArea() call with fallback to here
|
||||||
|
self.client.user.persistProperty('message_area_id', 2, function persisted(err) {
|
||||||
|
|
||||||
|
}); // :TODO: just for testing
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,14 +22,6 @@ function AreaPostFSEModule(options) {
|
||||||
// we're posting, so always start with 'edit' mode
|
// we're posting, so always start with 'edit' mode
|
||||||
this.editorMode = 'edit';
|
this.editorMode = 'edit';
|
||||||
|
|
||||||
//
|
|
||||||
// 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.menuMethods.editModeMenuSave = function(formData, extraArgs) {
|
this.menuMethods.editModeMenuSave = function(formData, extraArgs) {
|
||||||
var msg = self.getMessage();
|
var msg = self.getMessage();
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
|
@ -38,3 +30,14 @@ function AreaPostFSEModule(options) {
|
||||||
|
|
||||||
require('util').inherits(AreaPostFSEModule, FullScreenEditorModule);
|
require('util').inherits(AreaPostFSEModule, FullScreenEditorModule);
|
||||||
|
|
||||||
|
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);
|
||||||
|
};
|
Loading…
Add table
Add a link
Reference in a new issue