mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 14:44:40 +02:00
+ Start work on MenuView & friends
* connect.js no longer a module. Part of initial connection always * Cleaner & expandable BBS init * Better theme handling
This commit is contained in:
parent
14a321de2f
commit
c3aa4c44e2
8 changed files with 96 additions and 64 deletions
31
core/menu_view.js
Normal file
31
core/menu_view.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
/* jslint node: true */
|
||||
'use strict';
|
||||
|
||||
var View = require('./view.js').View;
|
||||
var ansi = require('./ansi_term.js');
|
||||
var util = require('util');
|
||||
var assert = require('assert');
|
||||
|
||||
exports.MenuView = MenuView;
|
||||
|
||||
function MenuView(client, options) {
|
||||
View.call(this, client, options);
|
||||
|
||||
this.items = [];
|
||||
if(this.options.items) {
|
||||
this.options.items.forEach(function onItem(itemText) {
|
||||
this.items.push({
|
||||
text : itemText,
|
||||
focused : false,
|
||||
selected : false,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
this.itemSpacing = this.options.itemSpacing || 1;
|
||||
this.focusPrefix = this.options.focusPrefix || '';
|
||||
this.focusSuffix = this.options.focusSuffix || '';
|
||||
}
|
||||
|
||||
util.inherits(MenuView, View);
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue