mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-10 21:47:06 +03:00
Submodule maze-utils updated: 2eb140ad32...a984d11483
Submodule public/_locales updated: d1edc0e7e3...f85b7b926e
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user