From 2b21fcd164a753ce82d8b581933ca5a1efe204bd Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 18 Jul 2015 14:40:51 -0700 Subject: [PATCH] rename `itype` to `type`. --- README.md | 4 ++-- lib/widgets/image.js | 8 ++++---- test/widget-image.js | 2 +- test/widget-png.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 29f9f25..4496e33 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ var icon = blessed.image({ parent: box, top: 0, left: 0, - itype: 'overlay', + type: 'overlay', width: 'shrink', height: 'shrink', file: __dirname + '/my-program-icon.png', @@ -1403,7 +1403,7 @@ using `w3mimgdisplay` (using a [OverlayImage element](#overlayimage-from-box)). - Inherits all from Box. - __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 more information/options. (__default__: `ansi`). diff --git a/lib/widgets/image.js b/lib/widgets/image.js index 04d66e7..c2e56d4 100644 --- a/lib/widgets/image.js +++ b/lib/widgets/image.js @@ -25,11 +25,11 @@ function Image(options) { } options = options || {}; - options.itype = options.itype || 'ansi'; + options.type = options.itype || options.type || 'ansi'; Box.call(this, options); - if (options.itype === 'ansi' && this.type !== 'ansiimage') { + if (options.type === 'ansi' && this.type !== 'ansiimage') { var ANSIImage = require('./ansiimage'); Object.getOwnPropertyNames(ANSIImage.prototype).forEach(function(key) { if (key === 'type') return; @@ -40,7 +40,7 @@ function Image(options) { return this; } - if (options.itype === 'overlay' && this.type !== 'overlayimage') { + if (options.type === 'overlay' && this.type !== 'overlayimage') { var OverlayImage = require('./overlayimage'); Object.getOwnPropertyNames(OverlayImage.prototype).forEach(function(key) { if (key === 'type') return; @@ -51,7 +51,7 @@ function Image(options) { 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; diff --git a/test/widget-image.js b/test/widget-image.js index 4064288..32ad03d 100644 --- a/test/widget-image.js +++ b/test/widget-image.js @@ -16,7 +16,7 @@ var file = process.argv[2] || __dirname + '/test-image.png'; var image = blessed.image({ parent: screen, - itype: 'overlay', + type: 'overlay', left: 'center', top: 'center', width: 'shrink', diff --git a/test/widget-png.js b/test/widget-png.js index 700c505..902b2f4 100644 --- a/test/widget-png.js +++ b/test/widget-png.js @@ -83,7 +83,7 @@ var png = blessed.image({ left: 0, file: file, draggable: true, - itype: 'ansi', + type: 'ansi', scale: argv.scale, ascii: argv.ascii, optimization: argv.optimization,