mirror of
https://github.com/Astatin3/Polyboard.git
synced 2026-06-09 00:28:07 -06:00
33 lines
992 B
HTML
33 lines
992 B
HTML
<link rel="stylesheet" href="https://unpkg.com/xterm@4.11.0/css/xterm.css"/>
|
|
<script src="https://unpkg.com/xterm@4.11.0/lib/xterm.js"></script>
|
|
<script src="https://unpkg.com/xterm-addon-fit@0.5.0/lib/xterm-addon-fit.js"></script>
|
|
<script src="https://unpkg.com/xterm-addon-web-links@0.4.0/lib/xterm-addon-web-links.js"></script>
|
|
<script src="https://unpkg.com/xterm-addon-search@0.8.0/lib/xterm-addon-search.js"></script>
|
|
|
|
<h4>This is an example chat module</h4>
|
|
<div id="term"></div>
|
|
<script>
|
|
|
|
window.main = ()=>{
|
|
const term = new Terminal({
|
|
cursorBlink: true,
|
|
macOptionIsMeta: true,
|
|
scrollback: true,
|
|
});
|
|
|
|
const fit = new FitAddon.FitAddon()
|
|
term.loadAddon(fit)
|
|
term.loadAddon(new WebLinksAddon.WebLinksAddon())
|
|
term.loadAddon(new SearchAddon.SearchAddon())
|
|
|
|
term.open(utils.getEl("term"))
|
|
fit.fit()
|
|
|
|
term.onData((data) => {
|
|
term.write(data);
|
|
})
|
|
|
|
function resize(){fit.fit()}
|
|
window.onresize = resize
|
|
}
|
|
</script> |