2013-07-28 19:29:07 +00:00
|
|
|
var blessed = require('../')
|
|
|
|
, screen;
|
2013-07-04 05:10:01 +00:00
|
|
|
|
2013-07-28 19:29:07 +00:00
|
|
|
screen = blessed.screen({
|
2015-04-16 23:16:55 +00:00
|
|
|
dump: __dirname + '/logs/textarea.log',
|
2015-07-22 02:23:57 +00:00
|
|
|
fullUnicode: true,
|
|
|
|
warnings: true
|
2013-07-28 19:29:07 +00:00
|
|
|
});
|
2013-07-04 05:10:01 +00:00
|
|
|
|
|
|
|
var box = blessed.textarea({
|
|
|
|
parent: screen,
|
|
|
|
// Possibly support:
|
|
|
|
// align: 'center',
|
2015-04-04 06:43:24 +00:00
|
|
|
style: {
|
|
|
|
bg: 'blue'
|
|
|
|
},
|
2013-07-04 05:10:01 +00:00
|
|
|
height: 'half',
|
|
|
|
width: 'half',
|
|
|
|
top: 'center',
|
2015-05-01 06:44:46 +00:00
|
|
|
left: 'center',
|
|
|
|
tags: true
|
2013-07-04 05:10:01 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
screen.render();
|
|
|
|
|
|
|
|
screen.key('q', function() {
|
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
screen.key('i', function() {
|
|
|
|
box.readInput(function() {});
|
|
|
|
});
|
|
|
|
|
|
|
|
screen.key('e', function() {
|
|
|
|
box.readEditor(function() {});
|
|
|
|
});
|