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