neo-blessed/lib/widget.js

61 lines
1.0 KiB
JavaScript
Raw Normal View History

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