* Not much ... few minor changes

This commit is contained in:
Bryan Ashby 2015-08-26 23:04:04 -06:00
parent 9442760679
commit 3be271aab5
6 changed files with 84 additions and 7 deletions

View File

@ -128,7 +128,7 @@ function logoff(callingMenu, formData, extraArgs) {
// //
client.term.write( client.term.write(
ansi.normal() + '\n' + ansi.normal() + '\n' +
require('crypto').randomBytes(Math.floor(Math.random() * 35) + 10).toString(client.term.outputEncoding) + require('crypto').randomBytes(Math.floor(Math.random() * 65) + 20).toString(client.term.outputEncoding) +
'NO CARRIER'); 'NO CARRIER');
client.end(); client.end();

View File

@ -521,7 +521,11 @@ ViewController.prototype.loadFromPromptConfig = function(options, cb) {
ViewController.prototype.loadFromMenuConfig = function(options, cb) { ViewController.prototype.loadFromMenuConfig = function(options, cb) {
assert(_.isObject(options)); assert(_.isObject(options));
assert(_.isObject(options.mciMap));
if(!_.isObject(options.mciMap)) {
cb(new Error('Missing option: mciMap'));
return;
}
var self = this; var self = this;
var formIdKey = options.formId ? options.formId.toString() : '0'; var formIdKey = options.formId ? options.formId.toString() : '0';

BIN
mods/art/msg_list.ans Normal file

Binary file not shown.

View File

@ -266,6 +266,10 @@
"value" : { "command" : "C" }, "value" : { "command" : "C" },
"action" : "@menu:messageAreaChangeCurrentArea" "action" : "@menu:messageAreaChangeCurrentArea"
}, },
{
"value" : { "command" : "L" },
"action" : "@menu:messageAreaMessageList"
},
/*{ /*{
"value" : { "command" : "A" }, "value" : { "command" : "A" },
"action" : "@method:changeArea" "action" : "@method:changeArea"
@ -312,6 +316,26 @@
} }
} }
}, },
"messageAreaMessageList" : {
"module" : "msg_list",
"art" : "msg_list",
"options" : { "cls" : true },
"fallback" : "messageArea",
"config" : {
},
"form" : {
"0" : {
"VM" : {
"mci" : {
"VM1" : {
"height" : 10
}
}
}
}
}
},
// :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu // :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
"messageAreaNewPost" : { "messageAreaNewPost" : {
"module" : "msg_area_post_fse", "module" : "msg_area_post_fse",

View File

@ -19,6 +19,20 @@ exports.moduleInfo = {
author : 'NuSkooler', author : 'NuSkooler',
}; };
/*
:TODO:
Obv/2 has the following:
CHANGE .ANS - Message base changing ansi
|SN Current base name
|SS Current base sponsor
|NM Number of messages in current base
|UP Number of posts current user made (total)
|LR Last read message by current user
|DT Current date
|TI Current time
*/
function MessageAreaListModule(options) { function MessageAreaListModule(options) {
MenuModule.call(this, options); MenuModule.call(this, options);

View File

@ -2,6 +2,12 @@
'use strict'; 'use strict';
var MenuModule = require('../core/menu_module.js').MenuModule; var MenuModule = require('../core/menu_module.js').MenuModule;
var ViewController = require('../core/view_controller.js').ViewController;
//var moment = require('moment');
var async = require('async');
var assert = require('assert');
var _ = require('lodash');
exports.getModule = MessageListModule; exports.getModule = MessageListModule;
@ -14,20 +20,24 @@ exports.moduleInfo = {
// //
// :TODO: // :TODO:
// * Avail data: // * Avail data:
// To // To - {to}
// From // From - {from}
// Subject // Subject
// Date // Date
// Status (New/Read) // Status (New/Read)
// Message Num (Area) // Message Num (Area)
// Message Total (Area) // Message Total (Area)
// Message Area desc // Message Area desc - {areaDesc} / %TL2
// Message Area Name // Message Area Name - {areaName}
// //
// Ideas // Ideas
// * Module config can define custom formats for items & focused items (inc. Pipe Codes) // * Module config can define custom formats for items & focused items (inc. Pipe Codes)
// * Single list view // * Single list view with advanced formatting (would need textOverflow stuff)
// * Multiple LV's in sync with keyboard input
// * New Table LV (TV)
// * // *
//
// See Obv/2, Iniq, and Mystic docs
function MessageListModule(options) { function MessageListModule(options) {
MenuModule.call(this, options); MenuModule.call(this, options);
@ -37,3 +47,28 @@ function MessageListModule(options) {
require('util').inherits(MessageListModule, MenuModule); require('util').inherits(MessageListModule, MenuModule);
MessageListModule.prototype.mciReady = function(mciData, cb) {
var self = this;
var vc = self.viewControllers.msgList = new ViewController( { client : self.client } );
async.series(
[
function callParentMciReady(callback) {
MessageListModule.super_.prototype.mciReady.call(this, mciData, callback);
},
function loadFromConfig(callback) {
var loadOpts = {
callingMenu : self,
mciMap : mciData.menu
};
vc.loadFromMenuConfig(loadOpts, callback);
}
],
function complete(err) {
cb(err);
}
);
};