mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-22 20:34:26 +00:00
8803721f3d
* Move to TypeScript from legacy JavaScript * Add support of xterm.js * Hterm is still available for backward compatibility
23 lines
871 B
JavaScript
23 lines
871 B
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var hterm_1 = require("./hterm");
|
|
var xterm_1 = require("./xterm");
|
|
var webtty_1 = require("./webtty");
|
|
var websocket_1 = require("./websocket");
|
|
var elem = document.getElementById("terminal");
|
|
if (elem !== null) {
|
|
var term_1 = new xterm_1.TermXterm(elem);
|
|
var httpsEnabled = window.location.protocol == "https:";
|
|
var url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.hostname + ":8080/ws";
|
|
var args = window.location.search;
|
|
var factory = new websocket_1.ConnectionFactory(url, webtty_1.protocols);
|
|
var wt = new webtty_1.WebTTY(term_1, factory, args, "");
|
|
var closer_1 = wt.open();
|
|
new hterm_1.TermHterm(elem);
|
|
window.addEventListener("unload", function () {
|
|
closer_1();
|
|
term_1.close();
|
|
});
|
|
}
|
|
;
|
|
//# sourceMappingURL=main.js.map
|