rename `itype` to `type`.
This commit is contained in:
parent
72ddc05fd1
commit
2b21fcd164
|
@ -99,7 +99,7 @@ var icon = blessed.image({
|
||||||
parent: box,
|
parent: box,
|
||||||
top: 0,
|
top: 0,
|
||||||
left: 0,
|
left: 0,
|
||||||
itype: 'overlay',
|
type: 'overlay',
|
||||||
width: 'shrink',
|
width: 'shrink',
|
||||||
height: 'shrink',
|
height: 'shrink',
|
||||||
file: __dirname + '/my-program-icon.png',
|
file: __dirname + '/my-program-icon.png',
|
||||||
|
@ -1403,7 +1403,7 @@ using `w3mimgdisplay` (using a [OverlayImage element](#overlayimage-from-box)).
|
||||||
|
|
||||||
- Inherits all from Box.
|
- Inherits all from Box.
|
||||||
- __file__ - Path to image.
|
- __file__ - Path to image.
|
||||||
- __itype__ - `ansi` or `overlay`. Whether to render the file as ANSI art or
|
- __type__ - `ansi` or `overlay`. Whether to render the file as ANSI art or
|
||||||
using `w3m` to overlay. See the [ANSIImage element](#ansiimage-from-box) for
|
using `w3m` to overlay. See the [ANSIImage element](#ansiimage-from-box) for
|
||||||
more information/options. (__default__: `ansi`).
|
more information/options. (__default__: `ansi`).
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,11 @@ function Image(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
options = options || {};
|
options = options || {};
|
||||||
options.itype = options.itype || 'ansi';
|
options.type = options.itype || options.type || 'ansi';
|
||||||
|
|
||||||
Box.call(this, options);
|
Box.call(this, options);
|
||||||
|
|
||||||
if (options.itype === 'ansi' && this.type !== 'ansiimage') {
|
if (options.type === 'ansi' && this.type !== 'ansiimage') {
|
||||||
var ANSIImage = require('./ansiimage');
|
var ANSIImage = require('./ansiimage');
|
||||||
Object.getOwnPropertyNames(ANSIImage.prototype).forEach(function(key) {
|
Object.getOwnPropertyNames(ANSIImage.prototype).forEach(function(key) {
|
||||||
if (key === 'type') return;
|
if (key === 'type') return;
|
||||||
|
@ -40,7 +40,7 @@ function Image(options) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.itype === 'overlay' && this.type !== 'overlayimage') {
|
if (options.type === 'overlay' && this.type !== 'overlayimage') {
|
||||||
var OverlayImage = require('./overlayimage');
|
var OverlayImage = require('./overlayimage');
|
||||||
Object.getOwnPropertyNames(OverlayImage.prototype).forEach(function(key) {
|
Object.getOwnPropertyNames(OverlayImage.prototype).forEach(function(key) {
|
||||||
if (key === 'type') return;
|
if (key === 'type') return;
|
||||||
|
@ -51,7 +51,7 @@ function Image(options) {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error('`itype` must either be `ansi` or `overlay`.');
|
throw new Error('`type` must either be `ansi` or `overlay`.');
|
||||||
}
|
}
|
||||||
|
|
||||||
Image.prototype.__proto__ = Box.prototype;
|
Image.prototype.__proto__ = Box.prototype;
|
||||||
|
|
|
@ -16,7 +16,7 @@ var file = process.argv[2] || __dirname + '/test-image.png';
|
||||||
|
|
||||||
var image = blessed.image({
|
var image = blessed.image({
|
||||||
parent: screen,
|
parent: screen,
|
||||||
itype: 'overlay',
|
type: 'overlay',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
top: 'center',
|
top: 'center',
|
||||||
width: 'shrink',
|
width: 'shrink',
|
||||||
|
|
|
@ -83,7 +83,7 @@ var png = blessed.image({
|
||||||
left: 0,
|
left: 0,
|
||||||
file: file,
|
file: file,
|
||||||
draggable: true,
|
draggable: true,
|
||||||
itype: 'ansi',
|
type: 'ansi',
|
||||||
scale: argv.scale,
|
scale: argv.scale,
|
||||||
ascii: argv.ascii,
|
ascii: argv.ascii,
|
||||||
optimization: argv.optimization,
|
optimization: argv.optimization,
|
||||||
|
|
Loading…
Reference in New Issue