aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-client/assets/index.js
blob: 94a074426f7fd2d44d7668d9dfc13496af6a7288 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { initConnectionHandlers } from './connection.js';
import { initAuthentication } from './auth.js';
import { initTerminal } from './terminal.js';
import { setupInputHandlers } from './input.js';
import { initWebSockets } from './websockets.js';

document.addEventListener("DOMContentLoaded", async (event) => {
    initConnectionHandlers();

    const webClientId = await initAuthentication();

    const { term, fitAddon } = initTerminal();
    const sessionName = location.pathname.split("/").pop();

    let sendAnsiKey = (ansiKey) => {};

    setupInputHandlers(term, fitAddon, sendAnsiKey);

    document.title = sessionName;
    const websockets = initWebSockets(webClientId, sessionName, term, fitAddon, sendAnsiKey);

    sendAnsiKey = websockets.sendAnsiKey;

    setupInputHandlers(term, fitAddon, sendAnsiKey);
});