Rename TermXterm and TermHterm to Xterm and Hterm

This commit is contained in:
Iwasaki Yudai 2017-08-22 15:59:24 +09:00
parent 70aaf33082
commit 27b6436196
7 changed files with 41 additions and 41 deletions

64
js/dist/bundle.js vendored
View File

@ -2479,8 +2479,8 @@ exports.getRawByteCoords = getRawByteCoords;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var bare = __webpack_require__(14); var bare = __webpack_require__(14);
var TermHterm = (function () { var Hterm = (function () {
function TermHterm(elem) { function Hterm(elem) {
this.elem = elem; this.elem = elem;
bare.hterm.defaultStorage = new bare.lib.Storage.Memory(); bare.hterm.defaultStorage = new bare.lib.Storage.Memory();
this.term = new bare.hterm.Terminal(); this.term = new bare.hterm.Terminal();
@ -2490,17 +2490,17 @@ var TermHterm = (function () {
this.term.installKeyboard(); this.term.installKeyboard();
} }
; ;
TermHterm.prototype.info = function () { Hterm.prototype.info = function () {
return { columns: this.columns, rows: this.rows }; return { columns: this.columns, rows: this.rows };
}; };
; ;
TermHterm.prototype.output = function (data) { Hterm.prototype.output = function (data) {
if (this.term.io != null) { if (this.term.io != null) {
this.term.io.writeUTF16(data); this.term.io.writeUTF16(data);
} }
}; };
; ;
TermHterm.prototype.showMessage = function (message, timeout) { Hterm.prototype.showMessage = function (message, timeout) {
this.message = message; this.message = message;
if (timeout > 0) { if (timeout > 0) {
this.term.io.showOverlay(message, timeout); this.term.io.showOverlay(message, timeout);
@ -2510,22 +2510,22 @@ var TermHterm = (function () {
} }
}; };
; ;
TermHterm.prototype.removeMessage = function () { Hterm.prototype.removeMessage = function () {
// there is no hideOverlay(), so show the same message with 0 sec // there is no hideOverlay(), so show the same message with 0 sec
this.term.io.showOverlay(this.message, 0); this.term.io.showOverlay(this.message, 0);
}; };
TermHterm.prototype.setWindowTitle = function (title) { Hterm.prototype.setWindowTitle = function (title) {
this.term.setWindowTitle(title); this.term.setWindowTitle(title);
}; };
; ;
TermHterm.prototype.setPreferences = function (value) { Hterm.prototype.setPreferences = function (value) {
var _this = this; var _this = this;
Object.keys(value).forEach(function (key) { Object.keys(value).forEach(function (key) {
_this.term.getPrefs().set(key, value[key]); _this.term.getPrefs().set(key, value[key]);
}); });
}; };
; ;
TermHterm.prototype.onInput = function (callback) { Hterm.prototype.onInput = function (callback) {
this.io.onVTKeystroke = function (data) { this.io.onVTKeystroke = function (data) {
callback(data); callback(data);
}; };
@ -2534,7 +2534,7 @@ var TermHterm = (function () {
}; };
}; };
; ;
TermHterm.prototype.onResize = function (callback) { Hterm.prototype.onResize = function (callback) {
var _this = this; var _this = this;
this.io.onTerminalResize = function (columns, rows) { this.io.onTerminalResize = function (columns, rows) {
_this.columns = columns; _this.columns = columns;
@ -2543,22 +2543,22 @@ var TermHterm = (function () {
}; };
}; };
; ;
TermHterm.prototype.deactivate = function () { Hterm.prototype.deactivate = function () {
this.io.onVTKeystroke = null; this.io.onVTKeystroke = null;
this.io.sendString = null; this.io.sendString = null;
this.io.onTerminalResize = null; this.io.onTerminalResize = null;
this.term.uninstallKeyboard(); this.term.uninstallKeyboard();
}; };
TermHterm.prototype.reset = function () { Hterm.prototype.reset = function () {
this.removeMessage(); this.removeMessage();
this.term.installKeyboard(); this.term.installKeyboard();
}; };
TermHterm.prototype.close = function () { Hterm.prototype.close = function () {
this.term.uninstallKeyboard(); this.term.uninstallKeyboard();
}; };
return TermHterm; return Hterm;
}()); }());
exports.TermHterm = TermHterm; exports.Hterm = Hterm;
/***/ }), /***/ }),
@ -2741,8 +2741,8 @@ exports.WebTTY = WebTTY;
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
var bare = __webpack_require__(0); var bare = __webpack_require__(0);
bare.loadAddon("fit"); bare.loadAddon("fit");
var TermXterm = (function () { var Xterm = (function () {
function TermXterm(elem) { function Xterm(elem) {
var _this = this; var _this = this;
this.elem = elem; this.elem = elem;
this.term = new bare(); this.term = new bare();
@ -2761,15 +2761,15 @@ var TermXterm = (function () {
this.term.open(elem, true); this.term.open(elem, true);
} }
; ;
TermXterm.prototype.info = function () { Xterm.prototype.info = function () {
return { columns: this.term.cols, rows: this.term.rows }; return { columns: this.term.cols, rows: this.term.rows };
}; };
; ;
TermXterm.prototype.output = function (data) { Xterm.prototype.output = function (data) {
this.term.write(data); this.term.write(data);
}; };
; ;
TermXterm.prototype.showMessage = function (message, timeout) { Xterm.prototype.showMessage = function (message, timeout) {
var _this = this; var _this = this;
this.message.textContent = message; this.message.textContent = message;
this.elem.appendChild(this.message); this.elem.appendChild(this.message);
@ -2783,46 +2783,46 @@ var TermXterm = (function () {
} }
}; };
; ;
TermXterm.prototype.removeMessage = function () { Xterm.prototype.removeMessage = function () {
if (this.message.parentNode == this.elem) { if (this.message.parentNode == this.elem) {
this.elem.removeChild(this.message); this.elem.removeChild(this.message);
} }
}; };
TermXterm.prototype.setWindowTitle = function (title) { Xterm.prototype.setWindowTitle = function (title) {
document.title = title; document.title = title;
}; };
; ;
TermXterm.prototype.setPreferences = function (value) { Xterm.prototype.setPreferences = function (value) {
}; };
; ;
TermXterm.prototype.onInput = function (callback) { Xterm.prototype.onInput = function (callback) {
this.term.on("data", function (data) { this.term.on("data", function (data) {
callback(data); callback(data);
}); });
}; };
; ;
TermXterm.prototype.onResize = function (callback) { Xterm.prototype.onResize = function (callback) {
this.term.on("resize", function (data) { this.term.on("resize", function (data) {
callback(data.cols, data.rows); callback(data.cols, data.rows);
}); });
}; };
; ;
TermXterm.prototype.deactivate = function () { Xterm.prototype.deactivate = function () {
this.term.off("data"); this.term.off("data");
this.term.off("resize"); this.term.off("resize");
this.term.blur(); this.term.blur();
}; };
TermXterm.prototype.reset = function () { Xterm.prototype.reset = function () {
this.removeMessage(); this.removeMessage();
this.term.clear(); this.term.clear();
}; };
TermXterm.prototype.close = function () { Xterm.prototype.close = function () {
window.removeEventListener("resize", this.resizeListener); window.removeEventListener("resize", this.resizeListener);
this.term.destroy(); this.term.destroy();
}; };
return TermXterm; return Xterm;
}()); }());
exports.TermXterm = TermXterm; exports.Xterm = Xterm;
/***/ }), /***/ }),
@ -20831,10 +20831,10 @@ var elem = document.getElementById("terminal");
if (elem !== null) { if (elem !== null) {
var term; var term;
if (gotty_term == "hterm") { if (gotty_term == "hterm") {
term = new hterm_1.TermHterm(elem); term = new hterm_1.Hterm(elem);
} }
else { else {
term = new xterm_1.TermXterm(elem); term = new xterm_1.Xterm(elem);
} }
var httpsEnabled = window.location.protocol == "https:"; var httpsEnabled = window.location.protocol == "https:";
var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws'; var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';

File diff suppressed because one or more lines are too long

2
js/dist/hterm.d.ts vendored
View File

@ -1,5 +1,5 @@
import * as bare from "libapps"; import * as bare from "libapps";
export declare class TermHterm { export declare class Hterm {
elem: HTMLElement; elem: HTMLElement;
term: bare.Terminal; term: bare.Terminal;
io: bare.IO; io: bare.IO;

2
js/dist/xterm.d.ts vendored
View File

@ -1,5 +1,5 @@
import * as bare from "xterm"; import * as bare from "xterm";
export declare class TermXterm { export declare class Xterm {
elem: HTMLElement; elem: HTMLElement;
message: HTMLElement; message: HTMLElement;
messageTimeout: number; messageTimeout: number;

View File

@ -1,6 +1,6 @@
import * as bare from "libapps"; import * as bare from "libapps";
export class TermHterm { export class Hterm {
elem: HTMLElement; elem: HTMLElement;
term: bare.Terminal; term: bare.Terminal;

View File

@ -1,5 +1,5 @@
import { TermHterm } from "./hterm"; import { Hterm } from "./hterm";
import { TermXterm } from "./xterm"; import { Xterm } from "./xterm";
import { Terminal, WebTTY, protocols } from "./webtty"; import { Terminal, WebTTY, protocols } from "./webtty";
import { ConnectionFactory } from "./websocket"; import { ConnectionFactory } from "./websocket";
@ -12,9 +12,9 @@ const elem = document.getElementById("terminal")
if (elem !== null) { if (elem !== null) {
var term: Terminal; var term: Terminal;
if (gotty_term == "hterm") { if (gotty_term == "hterm") {
term = new TermHterm(elem); term = new Hterm(elem);
} else { } else {
term = new TermXterm(elem); term = new Xterm(elem);
} }
const httpsEnabled = window.location.protocol == "https:"; const httpsEnabled = window.location.protocol == "https:";
const url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws'; const url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';

View File

@ -2,7 +2,7 @@ import * as bare from "xterm";
bare.loadAddon("fit"); bare.loadAddon("fit");
export class TermXterm { export class Xterm {
elem: HTMLElement; elem: HTMLElement;
message: HTMLElement; message: HTMLElement;