mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 20:55:30 +02:00
+ Concept of PluginModule and inherited classes such as ServerModule, MenuModule, ...
* Client now tracks current menu module. Auto detach events, etc.
This commit is contained in:
parent
d3e35d286a
commit
f7462bbbdd
11 changed files with 226 additions and 60 deletions
29
core/menu_module.js
Normal file
29
core/menu_module.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
var PluginModule = require('./plugin_module.js').PluginModule;
|
||||
|
||||
exports.MenuModule = MenuModule;
|
||||
|
||||
function MenuModule() {
|
||||
PluginModule.call(this);
|
||||
|
||||
this.viewControllers = [];
|
||||
}
|
||||
|
||||
require('util').inherits(MenuModule, PluginModule);
|
||||
|
||||
MenuModule.prototype.enter = function(client) {
|
||||
|
||||
};
|
||||
|
||||
MenuModule.prototype.leave = function() {
|
||||
this.viewControllers.forEach(function onVC(vc) {
|
||||
vc.detachClientEvents();
|
||||
});
|
||||
};
|
||||
|
||||
MenuModule.prototype.addViewController = function(vc) {
|
||||
this.viewControllers.push(vc);
|
||||
return vc; // allow var vc = this.addViewController(new ViewController(...));
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue