From fd024f01e1c8ca102fd28e9417784b5fad9cab14 Mon Sep 17 00:00:00 2001 From: nuintun Date: Wed, 25 Nov 2015 11:12:57 +0800 Subject: [PATCH] update files --- static/js/terminal/index.js | 4 ++-- static/js/terminal/lib/colors.js | 10 +++++----- static/js/terminal/lib/open.js | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/static/js/terminal/index.js b/static/js/terminal/index.js index a16d3b1..ef31edd 100644 --- a/static/js/terminal/index.js +++ b/static/js/terminal/index.js @@ -22,8 +22,6 @@ function Terminal(options){ if (!(this instanceof Terminal)) return new Terminal(options); iterator(Terminal.defaults, function (key, value){ - console.log(key); - if (options.hasOwnProperty(options)) { this[key] = options[key]; } else { @@ -49,6 +47,8 @@ function Terminal(options){ this.cols = options.cols || Terminal.geometry[0]; this.rows = options.rows || Terminal.geometry[1]; + this.bgColor = options.bgColor || Terminal.defaultColors.bgColor; + this.fgColor = options.bgColor || Terminal.defaultColors.fgColor; this.ybase = 0; this.ydisp = 0; diff --git a/static/js/terminal/lib/colors.js b/static/js/terminal/lib/colors.js index a3ab04b..b28d314 100644 --- a/static/js/terminal/lib/colors.js +++ b/static/js/terminal/lib/colors.js @@ -12,7 +12,7 @@ module.exports = function (Terminal){ // bright: '#555753', '#ef2929', '#8ae234', '#fce94f', '#729fcf', '#ad7fa8', '#34e2e2', '#eeeeec' ]; - + // Colors 16-255 // Much thanks to TooTallNate for writing this. Terminal.colors = (function (){ @@ -50,10 +50,10 @@ module.exports = function (Terminal){ // Default BG/FG Terminal.defaultColors = { - bg: '#000000', - fg: '#f0f0f0' + bgColor: '#000000', + fgColor: '#f0f0f0' }; - Terminal.colors[256] = Terminal.defaultColors.bg; - Terminal.colors[257] = Terminal.defaultColors.fg; + Terminal.colors[256] = Terminal.defaultColors.bgColor; + Terminal.colors[257] = Terminal.defaultColors.fgColor; }; diff --git a/static/js/terminal/lib/open.js b/static/js/terminal/lib/open.js index 3578724..540ccd5 100644 --- a/static/js/terminal/lib/open.js +++ b/static/js/terminal/lib/open.js @@ -51,7 +51,7 @@ module.exports = function (Terminal){ } // sync default bg/fg colors - this.element.style.backgroundColor = Terminal.defaultColors.bg; - this.element.style.color = Terminal.defaultColors.fg; + this.element.style.backgroundColor = this.bgColor; + this.element.style.color = this.fgColor; }; };