Use bootstrap components for up- and downloads

This commit is contained in:
Søren L. Hansen 2022-04-09 10:10:03 +00:00
parent 736ad294e7
commit 7f05f2fe17
22 changed files with 6840 additions and 1717 deletions

View file

@ -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();