summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-11-14 06:08:07 +0300
committerDevaev Maxim <[email protected]>2018-11-14 06:08:07 +0300
commitc5544349d2bc5981ed843a7f71c8326364da4a3e (patch)
tree1e1a75fe7052a073a893b80fab0d8718e407acfb
parentff2ac423b2ad5d49401b76dc3dfb287bcf60ab83 (diff)
refactoring
-rw-r--r--eslintrc.yaml1
-rw-r--r--web/index.html3
-rw-r--r--web/js/bb.js13
-rw-r--r--web/js/kvm/main.js9
4 files changed, 17 insertions, 9 deletions
diff --git a/eslintrc.yaml b/eslintrc.yaml
index 4ba71dda..8c3d07f9 100644
--- a/eslintrc.yaml
+++ b/eslintrc.yaml
@@ -9,6 +9,7 @@ globals:
Ui: true
ui: true
tools: true
+ check_browser: true
"$": true
"$$": true
diff --git a/web/index.html b/web/index.html
index 20f25451..d8de279f 100644
--- a/web/index.html
+++ b/web/index.html
@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <title>Pi-KVM</title>
+ <title>Pi-KVM / Session</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
@@ -27,6 +27,7 @@
<link rel="stylesheet" href="css/kvm/keyboard.css">
<link rel="stylesheet" href="css/kvm/about.css">
+ <script src="js/bb.js"></script>
<script src="js/tools.js"></script>
<script src="js/ui.js"></script>
<script src="js/kvm/stream.js"></script>
diff --git a/web/js/bb.js b/web/js/bb.js
new file mode 100644
index 00000000..8d8590db
--- /dev/null
+++ b/web/js/bb.js
@@ -0,0 +1,13 @@
+function check_browser() {
+ if (
+ !window.navigator
+ || window.navigator.userAgent.indexOf("MSIE ") > 0
+ || window.navigator.userAgent.indexOf("Trident/") > 0
+ || window.navigator.userAgent.indexOf("Edge/") > 0
+ ) {
+ $("bad-browser-modal").style.visibility = "visible";
+ return false;
+ } else {
+ return true;
+ }
+}
diff --git a/web/js/kvm/main.js b/web/js/kvm/main.js
index 3cb65402..4565ce3c 100644
--- a/web/js/kvm/main.js
+++ b/web/js/kvm/main.js
@@ -1,14 +1,7 @@
var ui;
function main() {
- if (
- !window.navigator
- || window.navigator.userAgent.indexOf("MSIE ") > 0
- || window.navigator.userAgent.indexOf("Trident/") > 0
- || window.navigator.userAgent.indexOf("Edge/") > 0
- ) {
- $("bad-browser-modal").style.visibility = "visible";
- } else {
+ if (check_browser()) {
ui = new Ui();
tools.setOnClick($("show-about-button"), () => ui.showWindow($("about-window")));