mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
* Constant time password DK compare
* Minor View update * Test module. Start work on module switching functionality. NYW!
This commit is contained in:
parent
1264cdde01
commit
eaf2aae48d
4 changed files with 73 additions and 21 deletions
46
mods/test_module1.js
Normal file
46
mods/test_module1.js
Normal file
|
@ -0,0 +1,46 @@
|
|||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
var ansi = require('../core/ansi_term.js');
|
||||
var theme = require('../core/theme.js');
|
||||
var viewController = require('../core/view_controller.js');
|
||||
var art = require('../core/art.js');
|
||||
var async = require('async');
|
||||
|
||||
exports.moduleInfo = {
|
||||
name : 'Test Module 2',
|
||||
desc : 'A Test Module',
|
||||
author : 'NuSkooler',
|
||||
};
|
||||
|
||||
exports.entryPoint = entryPoint;
|
||||
|
||||
function entryPoint(client) {
|
||||
var term = client.term;
|
||||
|
||||
term.write(ansi.resetScreen());
|
||||
|
||||
async.waterfall(
|
||||
[
|
||||
function getArt(callback) {
|
||||
theme.getThemeArt('MCI_VM1.ANS', client.user.properties.art_theme_id, function onArt(err, theArt) {
|
||||
callback(err, theArt);
|
||||
});
|
||||
},
|
||||
function displayArt(theArt, callback) {
|
||||
art.display(theArt, { client : client, mciReplaceChar : ' ' }, function onDisplayed(err, mci) {
|
||||
callback(err, mci);
|
||||
});
|
||||
},
|
||||
function artDisplayed(mci, callback) {
|
||||
var vc = new viewController.ViewController(client);
|
||||
vc.loadFromMCIMap(mci);
|
||||
vc.setViewOrder();
|
||||
vc.switchFocus(1);
|
||||
}
|
||||
],
|
||||
function onComplete(err) {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue