From 9bc1e2f3d141e685f264b6a795c276ea327ede01 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Mon, 6 Apr 2015 22:29:45 -0600 Subject: [PATCH] * Mostly placeholder apply menu --- mods/apply.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ mods/menu.json | 15 +++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 mods/apply.js diff --git a/mods/apply.js b/mods/apply.js new file mode 100644 index 00000000..62559456 --- /dev/null +++ b/mods/apply.js @@ -0,0 +1,57 @@ +/* jslint node: true */ +'use strict'; + +var ansi = require('../core/ansi_term.js'); +var art = require('../core/art.js'); +var user = require('../core/user.js'); +var theme = require('../core/theme.js'); +var Log = require('../core/logger.js').log; +var MenuModule = require('../core/menu_module.js').MenuModule; +var ViewController = require('../core/view_controller.js').ViewController; + +//var async = require('async'); + +// :TODO: clean up requires + +exports.moduleInfo = { + name : 'Apply', + desc : 'Application Module', + author : 'NuSkooler', +}; + +exports.getModule = ApplyModule; + + +function ApplyModule(menuConfig) { + MenuModule.call(this, menuConfig); + + var self = this; + + this.clearForm = function() { + [ 1, 2, ].forEach(function onId(id) { + self.viewController.getView(id).clearText(); + }); + }; +} + +require('util').inherits(ApplyModule, MenuModule); + +ApplyModule.prototype.enter = function(client) { + ApplyModule.super_.prototype.enter.call(this, client); +}; + +ApplyModule.prototype.beforeArt = function() { + ApplyModule.super_.prototype.beforeArt.call(this); + + this.client.term.write(ansi.resetScreen()); +}; + +ApplyModule.prototype.mciReady = function(mciMap) { + ApplyModule.super_.prototype.mciReady.call(this, mciMap); + + var self = this; + + self.viewController = self.addViewController(new ViewController(self.client)); + self.viewController.loadFromMCIMapAndConfig( { mciMap : mciMap, menuConfig : self.menuConfig }, function onViewReady(err) { + }); +}; \ No newline at end of file diff --git a/mods/menu.json b/mods/menu.json index 23285523..05ab7759 100644 --- a/mods/menu.json +++ b/mods/menu.json @@ -91,5 +91,20 @@ "logoff" : { "art" : "logoff", "module" : "logoff" + }, + "apply" : { + "art" : "apply", + "module" : "apply", + "form" : { + "0" : { + "ET1ET2ET3ET4ET5ET6ET7ET8ET9TL10TL11TL12" : { + "mci" : { + "ET1" : { + "focus" : true + } + } + } + } + } } } \ No newline at end of file