2013-07-18 22:56:05 +00:00
|
|
|
var blessed = require('../');
|
2013-07-12 12:48:55 +00:00
|
|
|
|
|
|
|
var screen = blessed.screen({
|
2013-07-23 22:06:01 +00:00
|
|
|
tput: true,
|
2013-07-23 22:57:04 +00:00
|
|
|
smartCSR: true,
|
2013-07-28 19:29:07 +00:00
|
|
|
dump: __dirname + '/logs/file.log'
|
2013-07-12 12:48:55 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
var fm = blessed.filemanager({
|
|
|
|
parent: screen,
|
2015-04-04 06:43:24 +00:00
|
|
|
border: 'line',
|
|
|
|
style: {
|
|
|
|
selected: {
|
|
|
|
bg: 'blue'
|
|
|
|
}
|
2013-07-12 12:48:55 +00:00
|
|
|
},
|
|
|
|
height: 'half',
|
|
|
|
width: 'half',
|
|
|
|
top: 'center',
|
|
|
|
left: 'center',
|
2013-08-27 15:22:19 +00:00
|
|
|
label: ' {blue-fg}%path{/blue-fg} ',
|
2013-07-12 12:48:55 +00:00
|
|
|
cwd: process.env.HOME,
|
|
|
|
keys: true,
|
|
|
|
vi: true,
|
|
|
|
scrollbar: {
|
|
|
|
bg: 'white',
|
|
|
|
ch: ' '
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
var box = blessed.box({
|
|
|
|
parent: screen,
|
2015-04-04 06:43:24 +00:00
|
|
|
style: {
|
|
|
|
bg: 'green'
|
2013-07-12 12:48:55 +00:00
|
|
|
},
|
2015-04-04 06:43:24 +00:00
|
|
|
border: 'line',
|
2013-07-12 12:48:55 +00:00
|
|
|
height: 'half',
|
|
|
|
width: 'half',
|
|
|
|
top: 'center',
|
|
|
|
left: 'center',
|
|
|
|
hidden: true
|
|
|
|
});
|
|
|
|
|
|
|
|
fm.refresh();
|
|
|
|
|
|
|
|
screen.render();
|
|
|
|
|
|
|
|
screen.key('q', function() {
|
|
|
|
process.exit(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
screen.key(['s', 'p'], function() {
|
|
|
|
fm.hide();
|
|
|
|
screen.render();
|
|
|
|
setTimeout(function() {
|
|
|
|
fm.pick(function(err, file) {
|
|
|
|
box.show();
|
|
|
|
box.setContent(err ? err + '' : file);
|
|
|
|
screen.render();
|
|
|
|
setTimeout(function() {
|
|
|
|
box.hide();
|
|
|
|
fm.reset(function() {
|
|
|
|
fm.show();
|
|
|
|
screen.render();
|
|
|
|
});
|
|
|
|
}, 2000);
|
|
|
|
});
|
|
|
|
}, 2000);
|
|
|
|
});
|