mirror of
https://github.com/yudai/gotty.git
synced 2026-02-21 07:24:07 +01:00
Use bootstrap components for up- and downloads
This commit is contained in:
parent
736ad294e7
commit
7f05f2fe17
22 changed files with 6840 additions and 1717 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Xterm } from "./xterm";
|
||||
import { OurXterm } from "./xterm";
|
||||
import { Terminal, WebTTY, protocols } from "./webtty";
|
||||
import { ConnectionFactory } from "./websocket";
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ const elem = document.getElementById("terminal")
|
|||
|
||||
if (elem !== null) {
|
||||
var term: Terminal;
|
||||
term = new Xterm(elem);
|
||||
term = new OurXterm(elem);
|
||||
|
||||
const httpsEnabled = window.location.protocol == "https:";
|
||||
const url = (httpsEnabled ? 'wss://' : 'ws://') + window.location.host + window.location.pathname + 'ws';
|
||||
|
|
@ -19,6 +19,9 @@ if (elem !== null) {
|
|||
const wt = new WebTTY(term, factory, args, gotty_auth_token);
|
||||
const closer = wt.open();
|
||||
|
||||
// According to https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event
|
||||
// this event is unreliable and in some cases (Firefox is mentioned), having an
|
||||
// "unload" event handler can have unwanted side effects. Consider commenting it out.
|
||||
window.addEventListener("unload", () => {
|
||||
closer();
|
||||
term.close();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue