using js modules

This commit is contained in:
Devaev Maxim
2019-07-13 06:38:55 +03:00
parent ad97aecaf4
commit 98468bfa30
20 changed files with 104 additions and 70 deletions

View File

@@ -20,7 +20,11 @@
*****************************************************************************/
function Atx() {
import {tools, $} from "../tools.js";
import {wm} from "../wm.js";
export function Atx() {
var self = this;
/************************************************************************/

View File

@@ -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;
/************************************************************************/

View File

@@ -20,7 +20,11 @@
*****************************************************************************/
function Keyboard() {
import {tools, $} from "../tools.js";
import {Keypad} from "../keypad.js";
export function Keyboard() {
var self = this;
/************************************************************************/

View File

@@ -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")));

View File

@@ -20,7 +20,11 @@
*****************************************************************************/
function Mouse() {
import {tools, $} from "../tools.js";
import {Keypad} from "../keypad.js";
export function Mouse() {
var self = this;
/************************************************************************/

View File

@@ -20,7 +20,11 @@
*****************************************************************************/
function Msd() {
import {tools, $} from "../tools.js";
import {wm} from "../wm.js";
export function Msd() {
var self = this;
/************************************************************************/

View File

@@ -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;
/************************************************************************/

View File

@@ -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();