mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2024-11-12 18:04:20 +01:00
parent
1557af5d2a
commit
ee3ce8aa46
6 changed files with 24 additions and 6 deletions
|
@ -1 +1 @@
|
||||||
Subproject commit 2eb140ad3200e58aa6b2a8e73bc8ca951a4cefb4
|
Subproject commit a984d114839441953d5d4ecf5005cac9f19caaa7
|
|
@ -1 +1 @@
|
||||||
Subproject commit d1edc0e7e3533fd47a2c4d7aae79770c3a0b82fc
|
Subproject commit f85b7b926e33a41a47c91a5ae1d5e1415fc1ef6c
|
|
@ -414,6 +414,11 @@
|
||||||
<div class="inline"></div>
|
<div class="inline"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-type="keybind-change" data-sync="skipToHighlightKeybind">
|
||||||
|
<label class="optionLabel">__MSG_setSkipToHighlightShortcut__:</label>
|
||||||
|
<div class="inline"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div data-type="keybind-change" data-sync="startSponsorKeybind">
|
<div data-type="keybind-change" data-sync="startSponsorKeybind">
|
||||||
<label class="optionLabel">__MSG_setStartSponsorShortcut__:</label>
|
<label class="optionLabel">__MSG_setStartSponsorShortcut__:</label>
|
||||||
<div class="inline"></div>
|
<div class="inline"></div>
|
||||||
|
|
|
@ -86,6 +86,7 @@ interface SBConfig {
|
||||||
};
|
};
|
||||||
|
|
||||||
skipKeybind: Keybind;
|
skipKeybind: Keybind;
|
||||||
|
skipToHighlightKeybind: Keybind;
|
||||||
startSponsorKeybind: Keybind;
|
startSponsorKeybind: Keybind;
|
||||||
submitKeybind: Keybind;
|
submitKeybind: Keybind;
|
||||||
nextChapterKeybind: 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?
|
* TODO: Find a way to skip having to update these checks. Maybe storing keybinds in a Map?
|
||||||
*/
|
*/
|
||||||
skipKeybind: { key: "Enter" },
|
skipKeybind: { key: "Enter" },
|
||||||
|
skipToHighlightKeybind: { key: "Enter", ctrl: true },
|
||||||
startSponsorKeybind: { key: ";" },
|
startSponsorKeybind: { key: ";" },
|
||||||
submitKeybind: { key: "'" },
|
submitKeybind: { key: "'" },
|
||||||
nextChapterKeybind: { key: "ArrowRight", ctrl: true },
|
nextChapterKeybind: { key: "ArrowRight", ctrl: true },
|
||||||
|
|
|
@ -2432,14 +2432,23 @@ function hotkeyListener(e: KeyboardEvent): void {
|
||||||
};
|
};
|
||||||
|
|
||||||
const skipKey = Config.config.skipKeybind;
|
const skipKey = Config.config.skipKeybind;
|
||||||
|
const skipToHighlightKey = Config.config.skipToHighlightKeybind;
|
||||||
const startSponsorKey = Config.config.startSponsorKeybind;
|
const startSponsorKey = Config.config.startSponsorKeybind;
|
||||||
const submitKey = Config.config.submitKeybind;
|
const submitKey = Config.config.submitKeybind;
|
||||||
const nextChapterKey = Config.config.nextChapterKeybind;
|
const nextChapterKey = Config.config.nextChapterKeybind;
|
||||||
const previousChapterKey = Config.config.previousChapterKeybind;
|
const previousChapterKey = Config.config.previousChapterKeybind;
|
||||||
|
|
||||||
if (keybindEquals(key, skipKey)) {
|
if (keybindEquals(key, skipKey)) {
|
||||||
if (activeSkipKeybindElement)
|
if (activeSkipKeybindElement) {
|
||||||
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
|
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
} else if (keybindEquals(key, skipToHighlightKey)) {
|
||||||
|
if (skipButtonControlBar) {
|
||||||
|
skipButtonControlBar.toggleSkip.call(skipButtonControlBar);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (keybindEquals(key, startSponsorKey)) {
|
} else if (keybindEquals(key, startSponsorKey)) {
|
||||||
startOrEndTimingNewSegment();
|
startOrEndTimingNewSegment();
|
||||||
|
|
|
@ -147,8 +147,10 @@ export class SkipButtonControlBar {
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSkip(): void {
|
toggleSkip(): void {
|
||||||
this.skip(this.segment);
|
if (this.segment && this.enabled) {
|
||||||
this.disableText();
|
this.skip(this.segment);
|
||||||
|
this.disableText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
disableText(): void {
|
disableText(): void {
|
||||||
|
@ -182,7 +184,7 @@ export class SkipButtonControlBar {
|
||||||
}
|
}
|
||||||
|
|
||||||
private getTitle(): string {
|
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 {
|
private getChapterPrefix(): HTMLElement {
|
||||||
|
|
Loading…
Reference in a new issue