diff options
author | Maxim Devaev <[email protected]> | 2022-11-18 04:42:40 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-11-18 04:42:40 +0300 |
commit | b78a9dd8e1fbb1422552b501abafde052ec1a8eb (patch) | |
tree | cee87c328bf55de2286299c0997921c06f7ad9fa /web/share/js/tools.js | |
parent | 0f4e7361856446a029e950233f532226614cf665 (diff) |
web: ui config
Diffstat (limited to 'web/share/js/tools.js')
-rw-r--r-- | web/share/js/tools.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/web/share/js/tools.js b/web/share/js/tools.js index f2805fc3..789c4b12 100644 --- a/web/share/js/tools.js +++ b/web/share/js/tools.js @@ -346,6 +346,16 @@ export var tools = new function() { }; }; + self.config = new function() { + return { + "get": function(key, default_value) { + let value = window.getComputedStyle(document.documentElement).getPropertyValue(`--config-ui--${key}`); + return (value || default_value); + }, + "getBool": (key, default_value) => !!parseInt(self.config.get(key, (default_value ? "1" : "0"))), + }; + }; + self.browser = browser; }; |