-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
27 lines (22 loc) · 723 Bytes
/
test.js
File metadata and controls
27 lines (22 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var ncurses = require('ncurses');
var UI = require('./ui').UI;
var ui = new UI();
ui.prompt = '[] ';
var myNick = false;
var colorPair = 1;
ncurses.colorPair(colorPair, 13, 0);
var flutters = ncurses.colorPair(colorPair++);
var onMessage = function (line) {
var args = line.split(' ');
var cmd = args[0].toLowerCase();
if (cmd === '/nick') {
myNick = args[1];
ui.prompt = '[' + myNick + '] ';
} else {
}
};
ui.onMessage(onMessage);
ui.paint();
ui.addMessage('<cyzon> \x1b' + ncurses.attrs.UNDERLINE + ';underlined\x1b0; not underlined');
ui.addMessage('<cyzon> \x1b' + ncurses.attrs.BOLD + ';bold \x1b0; not bold');
ui.addMessage('<cyzon> \x1b' + flutters + ';yay \x1b0; not yay');