Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed May 31, 2024
1 parent 8c1d4f2 commit 975d084
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import RFB from "@novnc/novnc/core/rfb";
import { setupTooltip } from "./tooltip.js";

const maxRetryCount = 5;
const retryInterval = 3; // seconds
const retryInterval = 3; // seconds

// When this function is called we have successfully connected to a server
function connectedToServer() {
Expand Down Expand Up @@ -57,31 +57,31 @@ function connect() {
websockifyUrl.toString(),
{},
);

// Add listeners to important events from the RFB module
rfb.addEventListener("connect", connectedToServer);
rfb.addEventListener("disconnect", disconnectedFromServer);

// Scale our viewport so the user doesn't have to scroll
rfb.scaleViewport = true;

// Use a CSS variable to set background color
rfb.background = "var(--jupyter-medium-dark-grey)";

// Clipboard
function clipboardReceive(e) {
document.getElementById("clipboard-text").value = e.detail.text;
}
rfb.addEventListener("clipboard", clipboardReceive);

function clipboardSend() {
const text = document.getElementById("clipboard-text").value;
rfb.clipboardPasteFrom(text);
}
document
.getElementById("clipboard-text")
.addEventListener("change", clipboardSend);

setupTooltip(
document.getElementById("clipboard-button"),
document.getElementById("clipboard-container"),
Expand Down

0 comments on commit 975d084

Please sign in to comment.