mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 13:07:05 +03:00
hide when buttons disabled and hide chapter prefix
This commit is contained in:
@@ -68,6 +68,7 @@ export class SkipButtonControlBar {
|
|||||||
if (this.segment) {
|
if (this.segment) {
|
||||||
this.chapterText?.classList?.add("hidden");
|
this.chapterText?.classList?.add("hidden");
|
||||||
this.container.classList.remove("hidden");
|
this.container.classList.remove("hidden");
|
||||||
|
this.textContainer?.classList?.remove("hidden");
|
||||||
this.textContainer.innerText = getSkippingText([this.segment], false) + (this.showKeybindHint ? " (" + Config.config.skipKeybind + ")" : "");
|
this.textContainer.innerText = getSkippingText([this.segment], false) + (this.showKeybindHint ? " (" + Config.config.skipKeybind + ")" : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -84,22 +85,36 @@ export class SkipButtonControlBar {
|
|||||||
|
|
||||||
startTimer(): void {
|
startTimer(): void {
|
||||||
this.stopTimer();
|
this.stopTimer();
|
||||||
this.timeout = setTimeout(() => this.innerTextVanish(), Math.max(Config.config.skipNoticeDuration, this.duration) * 1000);
|
this.timeout = setTimeout(() => this.disableText(), Math.max(Config.config.skipNoticeDuration, this.duration) * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
disable(): void {
|
disable(): void {
|
||||||
this.container.classList.add("hidden");
|
this.container.classList.add("hidden");
|
||||||
|
this.textContainer?.classList?.remove("hidden");
|
||||||
|
|
||||||
this.chapterText?.classList?.remove("hidden");
|
this.chapterText?.classList?.remove("hidden");
|
||||||
|
this.getChapterPrefix()?.classList?.remove("hidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleSkip(): void {
|
toggleSkip(): void {
|
||||||
this.skip(this.segment);
|
this.skip(this.segment);
|
||||||
this.innerTextVanish();
|
this.disableText();
|
||||||
}
|
}
|
||||||
|
|
||||||
innerTextVanish(): void {
|
disableText(): void {
|
||||||
this.textContainer.innerText = "";
|
if (Config.config.hideVideoPlayerControls) {
|
||||||
|
this.disable();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.textContainer?.classList?.add("hidden");
|
||||||
this.chapterText?.classList?.remove("hidden");
|
this.chapterText?.classList?.remove("hidden");
|
||||||
|
|
||||||
|
this.getChapterPrefix()?.classList?.add("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
|
private getChapterPrefix(): HTMLElement {
|
||||||
|
return document.querySelector(".ytp-chapter-title-prefix");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user