update files

This commit is contained in:
nuintun 2015-11-25 00:19:23 +08:00
parent a77c63998e
commit 12a617fce5
6 changed files with 40 additions and 5 deletions

View File

@ -494,3 +494,7 @@ header [class*=" icon-"] {
height: calc(100% - 32px);
background: url(../images/no-data.png) center no-repeat;
}
.ui-terminal-cursor {
color: #181818;
background-color: #fff;
}

View File

@ -118,7 +118,7 @@ module.exports = Vue.component('app-main', {
'',
' \u001b[31mreturn\u001b[39m \u001b[37mhypernal\u001b[39m\u001b[90m;\u001b[39m',
'\u001b[33m}\u001b[39m\u001b[90m;\u001b[39m',
new Date().toISOString()
new Date().toISOString() + '\r\n'
].join('\r\n');
if (!runtime) {
@ -126,8 +126,8 @@ module.exports = Vue.component('app-main', {
xterm.open();
xtermNode.appendChild(xterm.element);
xterm.showCursor();
xterm.startBlink();
xterm.focus();
//xterm.startBlink();
console.log(xterm);

View File

@ -97,6 +97,7 @@ require('./lib/range')(Terminal);
require('./lib/util')(Terminal);
require('./lib/cursor')(Terminal);
require('./lib/focused')(Terminal);
require('./lib/scrollDisp')(Terminal);

View File

@ -0,0 +1,30 @@
/**
* Created by nuintun on 2015/11/25.
*/
'use strict';
module.exports = function (Terminal){
Terminal.focus = null;
Terminal.prototype.focus = function (){
if (Terminal.focus === this) return;
if (Terminal.focus) {
Terminal.focus.blur();
}
this.showCursor();
Terminal.focus = this;
};
Terminal.prototype.blur = function (){
if (Terminal.focus !== this) return;
this.cursorState = 0;
this.refresh(this.y, this.y);
Terminal.focus = null;
};
};

View File

@ -33,7 +33,7 @@ module.exports = function (Terminal){
var div;
this.element = document.createElement('div');
this.element.className = 'terminal';
this.element.className = 'ui-terminal';
this.children = [];
for (; i < this.rows; i++) {

View File

@ -58,7 +58,7 @@ module.exports = function (Terminal){
if (data !== this.defAttr) {
if (data === -1) {
out += '<span class="reverse-video">';
out += '<span class="ui-terminal-reverse ui-terminal-cursor">';
} else {
out += '<span style="';
bgColor = data & 0x1ff;