From 6c2d8900f53cca2f5e0980f8ac038566080986a9 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Tue, 27 Nov 2018 17:44:02 +0300 Subject: refactoring --- web/index.html | 18 ------------------ web/js/bb.js | 24 ++++++++++++++++++++++-- web/js/index/main.js | 6 ++++-- web/js/kvm/main.js | 2 +- web/kvm/index.html | 18 ------------------ 5 files changed, 27 insertions(+), 41 deletions(-) (limited to 'web') 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 @@ - -
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 = ` + + `; + 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 @@ - -