From 434dc188509efd03354def9cb2865867676e6bfd Mon Sep 17 00:00:00 2001 From: nuintun Date: Thu, 26 Nov 2015 23:16:58 +0800 Subject: [PATCH] update files --- static/js/components/app-main/index.js | 4 ++-- static/js/terminal/lib/refresh.js | 23 +++++++++++++++-------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/static/js/components/app-main/index.js b/static/js/components/app-main/index.js index 15a56a6..7da6b35 100644 --- a/static/js/components/app-main/index.js +++ b/static/js/components/app-main/index.js @@ -70,10 +70,10 @@ function createXTerm(name, xtermNode){ clearTimeout(timer); timer = setTimeout(function (){ - xtermNode.innerHTML = screen; + //xtermNode.innerHTML = screen; scroll(xterm, xtermNode); - }, 0); + }, 10); } } }); diff --git a/static/js/terminal/lib/refresh.js b/static/js/terminal/lib/refresh.js index 4bd2241..3661b9c 100644 --- a/static/js/terminal/lib/refresh.js +++ b/static/js/terminal/lib/refresh.js @@ -5,6 +5,21 @@ 'use strict'; module.exports = function (Terminal){ + /** + * screen + * @param foreground + * @param background + * @param content + * @returns {string} + */ + function screen(foreground, background, content){ + var intro = '
'; + var outro = '
'; + + return intro + content + outro; + } + // Rendering Engine // In the screen buffer, each character // is stored as a an array with a character @@ -16,14 +31,6 @@ module.exports = function (Terminal){ // Next 14 bits: a mask for misc. // flags: 1=bold, 2=underline, 4=blink, 8=inverse, 16=invisible - function screen(foreground, background, content){ - var intro = '
'; - var outro = '
'; - - return intro + content + outro; - } - /** * refresh * @param start