Use let and const instead of var in vnc_lite
The rest of noVNC has been converted already. This allows us to remove the extra scope that was created for the VNC connection.
This commit is contained in:
parent
6517c498b9
commit
25551b6b40
|
@ -72,7 +72,7 @@
|
||||||
<script>
|
<script>
|
||||||
window.addEventListener("load", function() {
|
window.addEventListener("load", function() {
|
||||||
if (window._noVNC_has_module_support) return;
|
if (window._noVNC_has_module_support) return;
|
||||||
var loader = document.createElement("script");
|
const loader = document.createElement("script");
|
||||||
loader.src = "vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
|
loader.src = "vendor/browser-es-module-loader/dist/browser-es-module-loader.js";
|
||||||
document.head.appendChild(loader);
|
document.head.appendChild(loader);
|
||||||
});
|
});
|
||||||
|
@ -83,8 +83,8 @@
|
||||||
// RFB holds the API to connect and communicate with a VNC server
|
// RFB holds the API to connect and communicate with a VNC server
|
||||||
import RFB from './core/rfb.js';
|
import RFB from './core/rfb.js';
|
||||||
|
|
||||||
var rfb;
|
let rfb;
|
||||||
var desktopName;
|
let desktopName;
|
||||||
|
|
||||||
// When this function is called we have received
|
// When this function is called we have received
|
||||||
// a desktop name from the server
|
// a desktop name from the server
|
||||||
|
@ -96,7 +96,7 @@
|
||||||
// credentials to authenticate
|
// credentials to authenticate
|
||||||
function credentials(e) {
|
function credentials(e) {
|
||||||
// Let's create a password input
|
// Let's create a password input
|
||||||
var form = document.createElement('form');
|
const form = document.createElement('form');
|
||||||
form.innerHTML = '<label></label>';
|
form.innerHTML = '<label></label>';
|
||||||
form.innerHTML += '<input type=password size=10 id="password_input">';
|
form.innerHTML += '<input type=password size=10 id="password_input">';
|
||||||
form.onsubmit = setPassword;
|
form.onsubmit = setPassword;
|
||||||
|
@ -168,20 +168,19 @@
|
||||||
|
|
||||||
// Read parameters specified in the URL query string
|
// Read parameters specified in the URL query string
|
||||||
// By default, use the host and port of server that served this file
|
// By default, use the host and port of server that served this file
|
||||||
var host = readQueryVariable('host', window.location.hostname);
|
const host = readQueryVariable('host', window.location.hostname);
|
||||||
var port = readQueryVariable('port', window.location.port);
|
let port = readQueryVariable('port', window.location.port);
|
||||||
var password = readQueryVariable('password', '');
|
const password = readQueryVariable('password', '');
|
||||||
var path = readQueryVariable('path', 'websockify');
|
const path = readQueryVariable('path', 'websockify');
|
||||||
|
|
||||||
// | | | | | |
|
// | | | | | |
|
||||||
// | | | Connect | | |
|
// | | | Connect | | |
|
||||||
// v v v v v v
|
// v v v v v v
|
||||||
(function() {
|
|
||||||
|
|
||||||
status("Connecting");
|
status("Connecting");
|
||||||
|
|
||||||
// Build the websocket URL used to connect
|
// Build the websocket URL used to connect
|
||||||
var url;
|
let url;
|
||||||
if (window.location.protocol === "https:") {
|
if (window.location.protocol === "https:") {
|
||||||
url = 'wss';
|
url = 'wss';
|
||||||
} else {
|
} else {
|
||||||
|
@ -206,7 +205,6 @@
|
||||||
// Set parameters that can be changed on an active connection
|
// Set parameters that can be changed on an active connection
|
||||||
rfb.viewOnly = readQueryVariable('view_only', false);
|
rfb.viewOnly = readQueryVariable('view_only', false);
|
||||||
rfb.scaleViewport = readQueryVariable('scale', false);
|
rfb.scaleViewport = readQueryVariable('scale', false);
|
||||||
})();
|
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue