mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-08 04:04:04 +08:00
update files
This commit is contained in:
parent
ec262a50e0
commit
d079b9bf16
@ -90,7 +90,7 @@ function Terminal(options){
|
||||
|
||||
// misc
|
||||
this.element = null;
|
||||
this.children = null;
|
||||
this.children = [];
|
||||
this.refreshStart = null;
|
||||
this.refreshEnd = null;
|
||||
this.savedX = null;
|
||||
@ -126,8 +126,8 @@ require('./lib/colors')(Terminal);
|
||||
require('./lib/options')(Terminal);
|
||||
|
||||
require('./lib/open')(Terminal);
|
||||
require('./lib/destroy')(Terminal);
|
||||
require('./lib/refresh')(Terminal);
|
||||
require('./lib/close')(Terminal);
|
||||
|
||||
require('./lib/write')(Terminal);
|
||||
|
||||
@ -149,11 +149,11 @@ require('./lib/focused')(Terminal);
|
||||
require('./lib/scrollDisp')(Terminal);
|
||||
|
||||
require('./lib/resize')(Terminal);
|
||||
|
||||
require('./lib/esc/index.js')(Terminal);
|
||||
require('./lib/esc/reset.js')(Terminal);
|
||||
require('./lib/esc/tabSet.js')(Terminal);
|
||||
|
||||
require('./lib/charsets.js')(Terminal);
|
||||
require('./lib/csi/charAttributes')(Terminal);
|
||||
require('./lib/csi/insert-delete')(Terminal);
|
||||
require('./lib/csi/position')(Terminal);
|
||||
@ -163,5 +163,3 @@ require('./lib/csi/tabClear')(Terminal);
|
||||
require('./lib/csi/softReset')(Terminal);
|
||||
require('./lib/csi/scroll')(Terminal);
|
||||
require('./lib/csi/device')(Terminal);
|
||||
|
||||
require('./lib/charsets.js')(Terminal);
|
||||
|
26
static/js/terminal/lib/close.js
Normal file
26
static/js/terminal/lib/close.js
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/24.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function (Terminal){
|
||||
Terminal.prototype.close = function (){
|
||||
this.lines = [];
|
||||
this.children = [];
|
||||
this.readable = false;
|
||||
this.writable = false;
|
||||
this.handler = function (){};
|
||||
this.write = function (){};
|
||||
|
||||
if (this.element) {
|
||||
var parent = this.element.parentNode;
|
||||
|
||||
if (parent) {
|
||||
parent.removeChild(this.element);
|
||||
}
|
||||
|
||||
this.element = null;
|
||||
}
|
||||
};
|
||||
};
|
@ -1,18 +0,0 @@
|
||||
/**
|
||||
* Created by nuintun on 2015/11/24.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function (Terminal){
|
||||
Terminal.prototype.destroy = function (){
|
||||
this.readable = false;
|
||||
this.writable = false;
|
||||
this.handler = function (){};
|
||||
this.write = function (){};
|
||||
|
||||
if (this.element.parentNode) {
|
||||
this.element.parentNode.removeChild(this.element);
|
||||
}
|
||||
};
|
||||
};
|
@ -7,10 +7,23 @@
|
||||
module.exports = function (Terminal){
|
||||
// ESC c Full Reset (RIS).
|
||||
Terminal.prototype.reset = function (){
|
||||
this.options.rows = this.rows;
|
||||
this.options.cols = this.cols;
|
||||
var parent;
|
||||
|
||||
if (this.element) {
|
||||
parent = this.element.parentNode;
|
||||
|
||||
if (parent) {
|
||||
parent.removeChild(this.element);
|
||||
}
|
||||
}
|
||||
|
||||
Terminal.call(this, this.options);
|
||||
|
||||
this.open();
|
||||
this.refresh(0, this.rows - 1);
|
||||
|
||||
if (parent) {
|
||||
parent.appendChild(this.element);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user