2013-06-01 02:09:07 +00:00
|
|
|
/**
|
2013-07-24 19:40:05 +00:00
|
|
|
* widget.js - high-level interface for blessed
|
2015-02-01 15:22:39 +00:00
|
|
|
* Copyright (c) 2013-2015, Christopher Jeffrey and contributors (MIT License).
|
2013-07-24 19:40:05 +00:00
|
|
|
* https://github.com/chjj/blessed
|
2013-06-01 02:09:07 +00:00
|
|
|
*/
|
|
|
|
|
2015-05-06 06:20:28 +00:00
|
|
|
var widget = exports;
|
|
|
|
|
|
|
|
widget.classes = [
|
|
|
|
'Node',
|
|
|
|
'Screen',
|
|
|
|
'Element',
|
|
|
|
'Box',
|
|
|
|
'Text',
|
|
|
|
'Line',
|
|
|
|
'ScrollableBox',
|
|
|
|
'ScrollableText',
|
2015-07-11 23:15:30 +00:00
|
|
|
'BigText',
|
2015-05-06 06:20:28 +00:00
|
|
|
'List',
|
|
|
|
'Form',
|
|
|
|
'Input',
|
|
|
|
'Textarea',
|
|
|
|
'Textbox',
|
|
|
|
'Button',
|
|
|
|
'ProgressBar',
|
|
|
|
'FileManager',
|
|
|
|
'Checkbox',
|
|
|
|
'RadioSet',
|
|
|
|
'RadioButton',
|
|
|
|
'Prompt',
|
|
|
|
'Question',
|
|
|
|
'Message',
|
|
|
|
'Loading',
|
|
|
|
'Listbar',
|
|
|
|
'Log',
|
|
|
|
'Table',
|
|
|
|
'ListTable',
|
|
|
|
'Terminal',
|
2015-05-06 19:32:19 +00:00
|
|
|
'Image',
|
2015-07-12 12:19:00 +00:00
|
|
|
'ANSIImage',
|
|
|
|
'OverlayImage',
|
2015-07-11 22:08:01 +00:00
|
|
|
'Video',
|
|
|
|
'Layout'
|
2015-05-06 06:20:28 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
widget.classes.forEach(function(name) {
|
|
|
|
var file = name.toLowerCase();
|
|
|
|
widget[name] = widget[file] = require('./widgets/' + file);
|
|
|
|
});
|
2015-07-17 10:11:21 +00:00
|
|
|
|
|
|
|
widget.aliases = {
|
|
|
|
'ListBar': 'Listbar',
|
|
|
|
'PNG': 'ANSIImage'
|
|
|
|
};
|
|
|
|
|
|
|
|
Object.keys(widget.aliases).forEach(function(key) {
|
|
|
|
var name = widget.aliases[key];
|
|
|
|
widget[key] = widget[name];
|
|
|
|
widget[key.toLowerCase()] = widget[name];
|
|
|
|
});
|