2014-11-04 05:53:01 +00:00
|
|
|
/* 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) {
|
2015-04-21 04:50:58 +00:00
|
|
|
theme.getThemeArt('MCI_VM1.ANS', client.user.properties.theme_id, function onArt(err, theArt) {
|
2014-11-04 05:53:01 +00:00
|
|
|
callback(err, theArt);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
function displayArt(theArt, callback) {
|
2014-11-05 06:50:42 +00:00
|
|
|
art.display( { art : theArt, client : client }, function onDisplayed(err, mci) {
|
2014-11-04 05:53:01 +00:00
|
|
|
callback(err, mci);
|
|
|
|
});
|
|
|
|
},
|
|
|
|
function artDisplayed(mci, callback) {
|
|
|
|
var vc = new viewController.ViewController(client);
|
|
|
|
vc.loadFromMCIMap(mci);
|
2014-11-04 07:34:54 +00:00
|
|
|
vc.getView(1).setItems(['Item 1', 'Item Two', 'The Third']);
|
2014-11-04 05:53:01 +00:00
|
|
|
vc.setViewOrder();
|
|
|
|
vc.switchFocus(1);
|
|
|
|
}
|
|
|
|
],
|
|
|
|
function onComplete(err) {
|
|
|
|
console.log(err);
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|