added proper server connection dialog
This commit is contained in:
parent
d3c35e7b8c
commit
6ced824e1c
4 changed files with 134 additions and 2 deletions
|
@ -10,6 +10,7 @@ var client;
|
|||
var my_colour = false;
|
||||
var pre_buffer_chars = 0;
|
||||
var server_url = "";
|
||||
var enable_input = true;
|
||||
|
||||
const DATA_TYPES = {
|
||||
ping: 0,
|
||||
|
@ -223,11 +224,22 @@ function new_caret() {
|
|||
content.appendChild(new_caret);
|
||||
}
|
||||
|
||||
/**
|
||||
* sets whether or not the terminal should accept user input
|
||||
* (handy for not interfering with dialogs)
|
||||
* @param {value} boolean
|
||||
*/
|
||||
export function set_enable_input(value) {
|
||||
enable_input = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* the input handler for the document.
|
||||
* automatically scrolls to the bottom of the page on valid key presses.
|
||||
*/
|
||||
function handle_input(event) {
|
||||
if (!enable_input) return;
|
||||
|
||||
if (event.key == "'") {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue