summaryrefslogtreecommitdiff
path: root/web/js
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/js
parent2cea16a978f475aa2b12d49d7ac2eccfd5c6892f (diff)
refactoring
Diffstat (limited to 'web/js')
-rw-r--r--web/js/bb.js24
-rw-r--r--web/js/index/main.js6
-rw-r--r--web/js/kvm/main.js2
3 files changed, 27 insertions, 5 deletions
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")));