diff options
author | Ajay Ramachandran <[email protected]> | 2023-09-05 01:28:15 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-09-05 01:28:15 -0400 |
commit | bc2db0cf2c13f6e8aac75227694babdf3693d45d (patch) | |
tree | 664d67988b1fe96abc67e9842dd2252aaaa3b9bc /src/utils/configUtils.ts | |
parent | edaed61612597d55af691963fa99b74ab0813e8e (diff) | |
parent | 843ef37dcd5e5e15f5ace6d36e5c84908048f0ea (diff) | |
download | SponsorBlock-bc2db0cf2c13f6e8aac75227694babdf3693d45d.tar.gz SponsorBlock-bc2db0cf2c13f6e8aac75227694babdf3693d45d.zip |
Merge branch 'master' into EthanBnntt-patch-1
Diffstat (limited to 'src/utils/configUtils.ts')
-rw-r--r-- | src/utils/configUtils.ts | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/utils/configUtils.ts b/src/utils/configUtils.ts index db957caa..8aec5208 100644 --- a/src/utils/configUtils.ts +++ b/src/utils/configUtils.ts @@ -1,48 +1,5 @@ import Config from "../config"; -import { Keybind } from "../types"; export function showDonationLink(): boolean { return navigator.vendor !== "Apple Computer, Inc." && Config.config.showDonationLink; -} - -export function isSafari(): boolean { - return navigator.vendor === "Apple Computer, Inc."; -} - -export function keybindEquals(first: Keybind, second: Keybind): boolean { - if (first == null || second == null || - Boolean(first.alt) != Boolean(second.alt) || Boolean(first.ctrl) != Boolean(second.ctrl) || Boolean(first.shift) != Boolean(second.shift) || - first.key == null && first.code == null || second.key == null && second.code == null) - return false; - if (first.code != null && second.code != null) - return first.code === second.code; - if (first.key != null && second.key != null) - return first.key.toUpperCase() === second.key.toUpperCase(); - return false; -} - -export function formatKey(key: string): string { - if (key == null) - return ""; - else if (key == " ") - return "Space"; - else if (key.length == 1) - return key.toUpperCase(); - else - return key; -} - -export function keybindToString(keybind: Keybind): string { - if (keybind == null || keybind.key == null) - return ""; - - let ret = ""; - if (keybind.ctrl) - ret += "Ctrl+"; - if (keybind.alt) - ret += "Alt+"; - if (keybind.shift) - ret += "Shift+"; - - return ret += formatKey(keybind.key); }
\ No newline at end of file |