summaryrefslogtreecommitdiff
path: root/web/share/js/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'web/share/js/kvm')
-rw-r--r--web/share/js/kvm/atx.js6
-rw-r--r--web/share/js/kvm/hid.js9
-rw-r--r--web/share/js/kvm/keyboard.js6
-rw-r--r--web/share/js/kvm/main.js11
-rw-r--r--web/share/js/kvm/mouse.js6
-rw-r--r--web/share/js/kvm/msd.js6
-rw-r--r--web/share/js/kvm/session.js11
-rw-r--r--web/share/js/kvm/stream.js8
8 files changed, 52 insertions, 11 deletions
diff --git a/web/share/js/kvm/atx.js b/web/share/js/kvm/atx.js
index b718b99c..e95998f1 100644
--- a/web/share/js/kvm/atx.js
+++ b/web/share/js/kvm/atx.js
@@ -20,7 +20,11 @@
*****************************************************************************/
-function Atx() {
+import {tools, $} from "../tools.js";
+import {wm} from "../wm.js";
+
+
+export function Atx() {
var self = this;
/************************************************************************/
diff --git a/web/share/js/kvm/hid.js b/web/share/js/kvm/hid.js
index 345b28eb..0e0adbea 100644
--- a/web/share/js/kvm/hid.js
+++ b/web/share/js/kvm/hid.js
@@ -20,7 +20,14 @@
*****************************************************************************/
-function Hid() {
+import {tools, $, $$$} from "../tools.js";
+import {wm} from "../wm.js";
+
+import {Keyboard} from "./keyboard.js";
+import {Mouse} from "./mouse.js";
+
+
+export function Hid() {
var self = this;
/************************************************************************/
diff --git a/web/share/js/kvm/keyboard.js b/web/share/js/kvm/keyboard.js
index 1a4563af..d573d924 100644
--- a/web/share/js/kvm/keyboard.js
+++ b/web/share/js/kvm/keyboard.js
@@ -20,7 +20,11 @@
*****************************************************************************/
-function Keyboard() {
+import {tools, $} from "../tools.js";
+import {Keypad} from "../keypad.js";
+
+
+export function Keyboard() {
var self = this;
/************************************************************************/
diff --git a/web/share/js/kvm/main.js b/web/share/js/kvm/main.js
index dcbb1eeb..3059457b 100644
--- a/web/share/js/kvm/main.js
+++ b/web/share/js/kvm/main.js
@@ -20,9 +20,14 @@
*****************************************************************************/
-var wm;
+import {tools, $} from "../tools.js";
+import {checkBrowser} from "../bb.js";
+import {wm, initWindowManager} from "../wm.js";
-function main() {
+import {Session} from "./session.js";
+
+
+export function main() {
if (checkBrowser()) {
window.onbeforeunload = function(event) {
let text = "Are you sure you want to close Pi-KVM session?";
@@ -30,7 +35,7 @@ function main() {
return text;
};
- wm = new WindowManager();
+ initWindowManager();
tools.setOnClick($("show-about-button"), () => wm.showWindow($("about-window")));
tools.setOnClick($("show-keyboard-button"), () => wm.showWindow($("keyboard-window")));
diff --git a/web/share/js/kvm/mouse.js b/web/share/js/kvm/mouse.js
index c2d961e6..5ec79444 100644
--- a/web/share/js/kvm/mouse.js
+++ b/web/share/js/kvm/mouse.js
@@ -20,7 +20,11 @@
*****************************************************************************/
-function Mouse() {
+import {tools, $} from "../tools.js";
+import {Keypad} from "../keypad.js";
+
+
+export function Mouse() {
var self = this;
/************************************************************************/
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js
index 68cb3fb7..3b414376 100644
--- a/web/share/js/kvm/msd.js
+++ b/web/share/js/kvm/msd.js
@@ -20,7 +20,11 @@
*****************************************************************************/
-function Msd() {
+import {tools, $} from "../tools.js";
+import {wm} from "../wm.js";
+
+
+export function Msd() {
var self = this;
/************************************************************************/
diff --git a/web/share/js/kvm/session.js b/web/share/js/kvm/session.js
index b01fbe34..d76e75ae 100644
--- a/web/share/js/kvm/session.js
+++ b/web/share/js/kvm/session.js
@@ -20,7 +20,16 @@
*****************************************************************************/
-function Session() {
+import {tools, $} from "../tools.js";
+import {wm} from "../wm.js";
+
+import {Hid} from "./hid.js";
+import {Atx} from "./atx.js";
+import {Msd} from "./msd.js";
+import {Streamer} from "./stream.js";
+
+
+export function Session() {
// var self = this;
/************************************************************************/
diff --git a/web/share/js/kvm/stream.js b/web/share/js/kvm/stream.js
index a73d0d2d..8a664454 100644
--- a/web/share/js/kvm/stream.js
+++ b/web/share/js/kvm/stream.js
@@ -20,7 +20,11 @@
*****************************************************************************/
-function Streamer() {
+import {tools, $} from "../tools.js";
+import {wm} from "../wm.js";
+
+
+export function Streamer() {
var self = this;
/************************************************************************/
@@ -103,7 +107,7 @@ function Streamer() {
__client_id = stream_client.slice(stream_client.indexOf("/") + 1);
}
- if (stream.clients_stat.hasOwnProperty(__client_id)) {
+ if (Object.prototype.hasOwnProperty.call(stream.clients_stat, __client_id)) {
__client_fps = stream.clients_stat[__client_id].fps;
} else {
__clearState();