summaryrefslogtreecommitdiff
path: root/kvmd/web/js/tools.js
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2018-08-07 19:09:47 +0300
committerDevaev Maxim <[email protected]>2018-08-07 19:09:47 +0300
commita844e9d152b67e0f2aa344992f02397144394a6d (patch)
treed745599bece9eae126f636d2aba5f568f31714d8 /kvmd/web/js/tools.js
parent20f7e2cde675fe7c3bddbf62328ebe9a11d96e13 (diff)
web linting
Diffstat (limited to 'kvmd/web/js/tools.js')
-rw-r--r--kvmd/web/js/tools.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/kvmd/web/js/tools.js b/kvmd/web/js/tools.js
index f5748d87..ea68b96a 100644
--- a/kvmd/web/js/tools.js
+++ b/kvmd/web/js/tools.js
@@ -1,23 +1,23 @@
var tools = new function() {
+ var __debug = (new URL(window.location.href)).searchParams.get("debug");
+
this.makeRequest = function(method, url, callback, timeout=null) {
var http = new XMLHttpRequest();
- http.open(method, url, true)
+ http.open(method, url, true);
http.onreadystatechange = callback;
- http.timeout = timeout ? timeout : 5000;
+ http.timeout = (timeout ? timeout : 5000);
http.send();
return http;
};
- var __debug = (new URL(window.location.href)).searchParams.get("debug");
-
this.debug = function(...args) {
if (__debug) {
- console.log("LOG/DEBUG", ...args);
+ console.log("LOG/DEBUG", ...args); // eslint-disable-line no-console
}
};
- this.info = (...args) => console.log("LOG/INFO", ...args);
- this.error = (...args) => console.error("LOG/ERROR", ...args);
+ this.info = (...args) => console.log("LOG/INFO", ...args); // eslint-disable-line no-console
+ this.error = (...args) => console.error("LOG/ERROR", ...args); // eslint-disable-line no-console
};
-var $ = function(id) { return document.getElementById(id); };
+var $ = (id) => document.getElementById(id);