diff options
author | Phie <phie@phie.ovh> | 2018-11-25 02:40:15 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2018-11-25 02:40:15 +0300 |
commit | e54baff9e26aacec79e511d1d46baa80829a6dff (patch) | |
tree | 09cece6f3dcc8b3e85f850b8631a1b2d1ba6db0b /utils | |
parent | 8fbaf0153eb0b1028ea01487c75cb2705008483c (diff) |
dark theme for electron
Diffstat (limited to 'utils')
-rw-r--r-- | utils/utils.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/utils/utils.js b/utils/utils.js index 5a41fff..20d6580 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -11,8 +11,20 @@ Utils.caseInsensitiveSrt = function (a, b) { return a.toLowerCase().localeCompare(b.toLowerCase()); } -Utils.srt = function(desc) { +Utils.srt = function (desc) { return function (a, b) { return desc ? ~~(a < b) : ~~(a > b); } +} +Utils.applyCss = function (url) { + var head = document.getElementsByTagName('head')[0]; + var link = document.createElement('link'); + link.rel = 'stylesheet'; + link.type = 'text/css'; + link.href = url; + head.appendChild(link); +} +Utils.removeCss = function (url) { + $('link[href="' + url + '"]').attr('disabled', 'true'); + $('link[href="' + url + '"]').remove(); }
\ No newline at end of file |