summaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-11-27 17:44:02 +0300
committerDevaev Maxim <[email protected]>2018-11-27 17:44:02 +0300
commit6c2d8900f53cca2f5e0980f8ac038566080986a9 (patch)
treee4cc9e231e20c011b4a7666ac6ca5b6457ff5d70 /web
parent2cea16a978f475aa2b12d49d7ac2eccfd5c6892f (diff)
refactoring
Diffstat (limited to 'web')
-rw-r--r--web/index.html18
-rw-r--r--web/js/bb.js24
-rw-r--r--web/js/index/main.js6
-rw-r--r--web/js/kvm/main.js2
-rw-r--r--web/kvm/index.html18
5 files changed, 27 insertions, 41 deletions
diff --git a/web/index.html b/web/index.html
index ed0447eb..2dbc6044 100644
--- a/web/index.html
+++ b/web/index.html
@@ -25,24 +25,6 @@
</head>
<body>
- <div id="bad-browser-modal" class="modal">
- <div class="modal-window">
- <div class="modal-content">
- Hello. You are using an incompatible or legacy browser.<br>
- Please use one of the following browsers:
- <hr>
- <ul>
- <li><a target="_blank" href="https://google.com/chrome">Google Chrome</a> <sup><i>recommended</i></sup></li>
- <li><a target="_blank" href="https://chromium.org/Home">Chromium</a> <sup><i>recommended</i></sup></li>
- <li><a target="_blank" href="https://mozilla.org/firefox">Mozilla Firefox</a></li>
- <li><a target="_blank" href="https://apple.com/safari">Apple Safari</a></li>
- <li><a target="_blank" href="https://opera.com">Opera</a></li>
- <li><a target="_blank" href="https://vivaldi.com">Vivaldi</a></li>
- </ul>
- </div>
- </div>
- </div>
-
<div id="start-box">
<div id="start">
<table>
diff --git a/web/js/bb.js b/web/js/bb.js
index 8d8590db..565a3ab4 100644
--- a/web/js/bb.js
+++ b/web/js/bb.js
@@ -1,11 +1,31 @@
-function check_browser() {
+function checkBrowser() {
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";
+ var el_modal = document.createElement("div");
+ el_modal.className = "modal";
+ el_modal.style.visibility = "visible";
+ el_modal.innerHTML = `
+ <div class="modal-window">
+ <div class="modal-content">
+ Hello. You are using an incompatible or legacy browser.<br>
+ Please use one of the following browsers:
+ <hr>
+ <ul>
+ <li><a target="_blank" href="https://google.com/chrome">Google Chrome</a> <sup><i>recommended</i></sup></li>
+ <li><a target="_blank" href="https://chromium.org/Home">Chromium</a> <sup><i>recommended</i></sup></li>
+ <li><a target="_blank" href="https://mozilla.org/firefox">Mozilla Firefox</a></li>
+ <li><a target="_blank" href="https://apple.com/safari">Apple Safari</a></li>
+ <li><a target="_blank" href="https://opera.com">Opera</a></li>
+ <li><a target="_blank" href="https://vivaldi.com">Vivaldi</a></li>
+ </ul>
+ </div>
+ </div>
+ `;
+ document.body.appendChild(el_modal);
return false;
} else {
return true;
diff --git a/web/js/index/main.js b/web/js/index/main.js
index ba82ed2f..ea38245a 100644
--- a/web/js/index/main.js
+++ b/web/js/index/main.js
@@ -1,6 +1,8 @@
function main() {
- __setAppText();
- __loadKvmdInfo();
+ if (checkBrowser()) {
+ __setAppText();
+ __loadKvmdInfo();
+ }
}
function __setAppText() {
diff --git a/web/js/kvm/main.js b/web/js/kvm/main.js
index 9a000615..fe6b595c 100644
--- a/web/js/kvm/main.js
+++ b/web/js/kvm/main.js
@@ -1,7 +1,7 @@
var ui;
function main() {
- if (check_browser()) {
+ if (checkBrowser()) {
ui = new Ui();
tools.setOnClick($("show-about-button"), () => ui.showWindow($("about-window")));
diff --git a/web/kvm/index.html b/web/kvm/index.html
index 43d2a997..bae173cd 100644
--- a/web/kvm/index.html
+++ b/web/kvm/index.html
@@ -43,24 +43,6 @@
</head>
<body class="body-no-select">
- <div id="bad-browser-modal" class="modal">
- <div class="modal-window">
- <div class="modal-content">
- Hello. You are using an incompatible or legacy browser.<br>
- Please use one of the following browsers:
- <hr>
- <ul>
- <li><a target="_blank" href="https://google.com/chrome">Google Chrome</a> <sup><i>recommended</i></sup></li>
- <li><a target="_blank" href="https://chromium.org/Home">Chromium</a> <sup><i>recommended</i></sup></li>
- <li><a target="_blank" href="https://mozilla.org/firefox">Mozilla Firefox</a></li>
- <li><a target="_blank" href="https://apple.com/safari">Apple Safari</a></li>
- <li><a target="_blank" href="https://opera.com">Opera</a></li>
- <li><a target="_blank" href="https://vivaldi.com">Vivaldi</a></li>
- </ul>
- </div>
- </div>
- </div>
-
<ul id="menu">
<li class="menu-left-items">
<a id="menu-logo" href="#">