aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/config.ts2
-rw-r--r--src/content.ts11
-rw-r--r--src/js-components/skipButtonControlBar.ts8
3 files changed, 17 insertions, 4 deletions
diff --git a/src/config.ts b/src/config.ts
index 61b32937..4dab0dab 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -86,6 +86,7 @@ interface SBConfig {
};
skipKeybind: Keybind;
+ skipToHighlightKeybind: Keybind;
startSponsorKeybind: Keybind;
submitKeybind: Keybind;
nextChapterKeybind: Keybind;
@@ -328,6 +329,7 @@ const syncDefaults = {
* TODO: Find a way to skip having to update these checks. Maybe storing keybinds in a Map?
*/
skipKeybind: { key: "Enter" },
+ skipToHighlightKeybind: { key: "Enter", ctrl: true },
startSponsorKeybind: { key: ";" },
submitKeybind: { key: "'" },
nextChapterKeybind: { key: "ArrowRight", ctrl: true },
diff --git a/src/content.ts b/src/content.ts
index 7b1c757b..6de4a9e5 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -2432,14 +2432,23 @@ function hotkeyListener(e: KeyboardEvent): void {
};
const skipKey = Config.config.skipKeybind;
+ const skipToHighlightKey = Config.config.skipToHighlightKeybind;
const startSponsorKey = Config.config.startSponsorKeybind;
const submitKey = Config.config.submitKeybind;
const nextChapterKey = Config.config.nextChapterKeybind;
const previousChapterKey = Config.config.previousChapterKeybind;
if (keybindEquals(key, skipKey)) {
- if (activeSkipKeybindElement)
+ if (activeSkipKeybindElement) {
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
+ }
+
+ return;
+ } else if (keybindEquals(key, skipToHighlightKey)) {
+ if (skipButtonControlBar) {
+ skipButtonControlBar.toggleSkip.call(skipButtonControlBar);
+ }
+
return;
} else if (keybindEquals(key, startSponsorKey)) {
startOrEndTimingNewSegment();
diff --git a/src/js-components/skipButtonControlBar.ts b/src/js-components/skipButtonControlBar.ts
index f8b2439f..2a93c49c 100644
--- a/src/js-components/skipButtonControlBar.ts
+++ b/src/js-components/skipButtonControlBar.ts
@@ -147,8 +147,10 @@ export class SkipButtonControlBar {
}
toggleSkip(): void {
- this.skip(this.segment);
- this.disableText();
+ if (this.segment && this.enabled) {
+ this.skip(this.segment);
+ this.disableText();
+ }
}
disableText(): void {
@@ -182,7 +184,7 @@ export class SkipButtonControlBar {
}
private getTitle(): string {
- return getSkippingText([this.segment], false) + (this.showKeybindHint ? " (" + keybindToString(Config.config.skipKeybind) + ")" : "");
+ return getSkippingText([this.segment], false) + (this.showKeybindHint ? " (" + keybindToString(Config.config.skipToHighlightKeybind) + ")" : "");
}
private getChapterPrefix(): HTMLElement {