mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-18 13:38:25 +03:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e4c9afecbd | ||
|
|
79e855a038 | ||
|
|
09a3a4e6d4 | ||
|
|
e271f2cbcc | ||
|
|
1cc4c18665 | ||
|
|
e650b7183a | ||
|
|
4eb097b422 | ||
|
|
04a9f82bdc | ||
|
|
39cfdc7b6c | ||
|
|
a8701b02a1 | ||
|
|
3f1ad528c3 | ||
|
|
ae685baeef | ||
|
|
d2ee67f3cf | ||
|
|
d440a4d52a | ||
|
|
7566b71ccd | ||
|
|
109b7ed5bc | ||
|
|
3eb853154f | ||
|
|
ee3ce8aa46 | ||
|
|
1557af5d2a | ||
|
|
465e7065ca | ||
|
|
a3f8419c49 | ||
|
|
dde443ccec | ||
|
|
01b1380b78 | ||
|
|
c51b18465e |
@@ -1 +1 @@
|
|||||||
["www.youtubekids.com","inv.bp.projectsegfau.lt","inv.citw.lgbt","inv.in.projectsegfau.lt","inv.makerlab.tech","inv.pistasjis.net","inv.tux.pizza","inv.zzls.xyz","invidious.0011.lt","invidious.io.lol","invidious.lunar.icu","invidious.no-logs.com","invidious.projectsegfau.lt","invidious.protokolla.fi","invidious.slipfox.xyz","invidious.tiekoetter.com","iv.ggtyler.dev","iv.melmac.space","iv.nboeck.de","onion.tube","vid.priv.au","vid.puffyan.us","yewtu.be","yt.artemislena.eu","yt.oelrichsgarcia.de"]
|
["www.youtubekids.com","anontube.lvkaszus.pl","inv.bp.projectsegfau.lt","inv.makerlab.tech","inv.pistasjis.net","inv.tux.pizza","inv.zzls.xyz","invidious.asir.dev","invidious.flokinet.to","invidious.io.lol","invidious.lunar.icu","invidious.no-logs.com","invidious.privacydev.net","invidious.private.coffee","invidious.protokolla.fi","invidious.slipfox.xyz","invidious.tiekoetter.com","iv.ggtyler.dev","iv.melmac.space","iv.nboeck.de","onion.tube","vid.priv.au","vid.puffyan.us","yewtu.be","yt.artemislena.eu","yt.drgnz.club","yt.oelrichsgarcia.de"]
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
"browser_specific_settings": {
|
"browser_specific_settings": {
|
||||||
"gecko": {
|
"gecko": {
|
||||||
"id": "sponsorBlocker@ajay.app"
|
"id": "sponsorBlocker@ajay.app"
|
||||||
|
},
|
||||||
|
"gecko_android": {
|
||||||
|
"strict_min_version": "79.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"background": {
|
"background": {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.4.20",
|
"version": "5.4.24",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
|
|||||||
Submodule maze-utils updated: 043437980b...92d368b051
Submodule public/_locales updated: 2135449c37...81f5afdd15
@@ -7,7 +7,7 @@
|
|||||||
--sb-dark-red-outline: rgb(130,0,0,0.9);
|
--sb-dark-red-outline: rgb(130,0,0,0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.sbhidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ div:hover > .sponsorBlockChapterBar {
|
|||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
.playerButton.hidden:not(.autoHiding) {
|
.playerButton.sbhidden:not(.autoHiding) {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,13 +169,13 @@ div:hover > .sponsorBlockChapterBar {
|
|||||||
overflow: visible !important;
|
overflow: visible !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoHiding:not(.hidden) {
|
.autoHiding:not(.sbhidden) {
|
||||||
transform: translateX(0%) scale(1);
|
transform: translateX(0%) scale(1);
|
||||||
/* opacity is from YouTube page */
|
/* opacity is from YouTube page */
|
||||||
transition: transform 0.2s, width 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
transition: transform 0.2s, width 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoHiding.hidden {
|
.autoHiding.sbhidden {
|
||||||
transform: translateX(100%) scale(0);
|
transform: translateX(100%) scale(0);
|
||||||
/* opacity is from YouTube page */
|
/* opacity is from YouTube page */
|
||||||
transition: transform 0.2s, width 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
transition: transform 0.2s, width 0.2s, opacity .1s cubic-bezier(0.4,0.0,1,1) !important;
|
||||||
@@ -183,7 +183,7 @@ div:hover > .sponsorBlockChapterBar {
|
|||||||
width: 0px !important;
|
width: 0px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.autoHiding.hidden.autoHideLeft {
|
.autoHiding.sbhidden.autoHideLeft {
|
||||||
transform: translateX(-100%) scale(0);
|
transform: translateX(-100%) scale(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,7 +272,7 @@ div:hover > .sponsorBlockChapterBar {
|
|||||||
max-width: calc(100% - 50px);
|
max-width: calc(100% - 50px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sponsorSkipNotice .hidden {
|
.sponsorSkipNotice .sbhidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -691,7 +691,7 @@ input::-webkit-inner-spin-button {
|
|||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.skipButtonControlBarContainer.hidden {
|
.skipButtonControlBarContainer.sbhidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -257,7 +257,7 @@ input[type='number'] {
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden, .sbhidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="deArrowPromotion" class="promotion-container" class="hidden">
|
<div id="deArrowPromotion" class="promotion-container hidden">
|
||||||
<a class="dearrow-link"
|
<a class="dearrow-link"
|
||||||
href="https://dearrow.ajay.app"
|
href="https://dearrow.ajay.app"
|
||||||
target="_blank"
|
target="_blank"
|
||||||
@@ -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_skip_to_category__:</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>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ body {
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden {
|
.hidden, .sbhidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
#sponsorBlockPopupBody .hidden {
|
#sponsorBlockPopupBody .hidden, #sponsorBlockPopupBody .sbhidden {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -260,19 +260,6 @@
|
|||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Buttons that appear under a segment on click
|
|
||||||
*/
|
|
||||||
.voteButton {
|
|
||||||
height: 20px;
|
|
||||||
padding: 0 5px;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.voteButton:hover {
|
|
||||||
opacity: 0.8;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "Voted!" text that appears after voting on a segment
|
* "Voted!" text that appears after voting on a segment
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
max-width: calc(100% - 50px);
|
max-width: calc(100% - 50px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.sponsorSkipNotice .hidden {
|
.sponsorSkipNotice .sbhidden {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,4 +216,17 @@
|
|||||||
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Buttons that appear under a segment on click
|
||||||
|
*/
|
||||||
|
.voteButton {
|
||||||
|
height: 20px;
|
||||||
|
padding: 0 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.voteButton:hover {
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
@@ -44,7 +44,7 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
|||||||
<>
|
<>
|
||||||
{/* Upvote Button */}
|
{/* Upvote Button */}
|
||||||
<button id={"sponsorTimesDownvoteButtonsContainerUpvoteChapter"}
|
<button id={"sponsorTimesDownvoteButtonsContainerUpvoteChapter"}
|
||||||
className={"playerButton sbPlayerUpvote ytp-button " + (!this.state.show ? "hidden" : "")}
|
className={"playerButton sbPlayerUpvote ytp-button " + (!this.state.show ? "sbhidden" : "")}
|
||||||
draggable="false"
|
draggable="false"
|
||||||
title={chrome.i18n.getMessage("upvoteButtonInfo")}
|
title={chrome.i18n.getMessage("upvoteButtonInfo")}
|
||||||
onClick={(e) => this.vote(e, 1)}>
|
onClick={(e) => this.vote(e, 1)}>
|
||||||
@@ -55,7 +55,7 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
|
|||||||
|
|
||||||
{/* Downvote Button */}
|
{/* Downvote Button */}
|
||||||
<button id={"sponsorTimesDownvoteButtonsContainerDownvoteChapter"}
|
<button id={"sponsorTimesDownvoteButtonsContainerDownvoteChapter"}
|
||||||
className={"playerButton sbPlayerDownvote ytp-button " + (!this.state.show ? "hidden" : "")}
|
className={"playerButton sbPlayerDownvote ytp-button " + (!this.state.show ? "sbhidden" : "")}
|
||||||
draggable="false"
|
draggable="false"
|
||||||
title={chrome.i18n.getMessage("reportButtonInfo")}
|
title={chrome.i18n.getMessage("reportButtonInfo")}
|
||||||
onClick={(e) => {
|
onClick={(e) => {
|
||||||
|
|||||||
@@ -196,21 +196,21 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
|
|||||||
<span
|
<span
|
||||||
id={"skipNoticeTimerText" + this.idSuffix}
|
id={"skipNoticeTimerText" + this.idSuffix}
|
||||||
key="skipNoticeTimerText"
|
key="skipNoticeTimerText"
|
||||||
className={this.state.countdownMode !== CountdownMode.Timer ? "hidden" : ""} >
|
className={this.state.countdownMode !== CountdownMode.Timer ? "sbhidden" : ""} >
|
||||||
{chrome.i18n.getMessage("NoticeTimeAfterSkip").replace("{seconds}", this.state.countdownTime.toString())}
|
{chrome.i18n.getMessage("NoticeTimeAfterSkip").replace("{seconds}", this.state.countdownTime.toString())}
|
||||||
</span>
|
</span>
|
||||||
),(
|
),(
|
||||||
<img
|
<img
|
||||||
id={"skipNoticeTimerPaused" + this.idSuffix}
|
id={"skipNoticeTimerPaused" + this.idSuffix}
|
||||||
key="skipNoticeTimerPaused"
|
key="skipNoticeTimerPaused"
|
||||||
className={this.state.countdownMode !== CountdownMode.Paused ? "hidden" : ""}
|
className={this.state.countdownMode !== CountdownMode.Paused ? "sbhidden" : ""}
|
||||||
src={chrome.runtime.getURL("icons/pause.svg")}
|
src={chrome.runtime.getURL("icons/pause.svg")}
|
||||||
alt={chrome.i18n.getMessage("paused")} />
|
alt={chrome.i18n.getMessage("paused")} />
|
||||||
),(
|
),(
|
||||||
<img
|
<img
|
||||||
id={"skipNoticeTimerStopped" + this.idSuffix}
|
id={"skipNoticeTimerStopped" + this.idSuffix}
|
||||||
key="skipNoticeTimerStopped"
|
key="skipNoticeTimerStopped"
|
||||||
className={this.state.countdownMode !== CountdownMode.Stopped ? "hidden" : ""}
|
className={this.state.countdownMode !== CountdownMode.Stopped ? "sbhidden" : ""}
|
||||||
src={chrome.runtime.getURL("icons/stop.svg")}
|
src={chrome.runtime.getURL("icons/stop.svg")}
|
||||||
alt={chrome.i18n.getMessage("manualPaused")} />
|
alt={chrome.i18n.getMessage("manualPaused")} />
|
||||||
)];
|
)];
|
||||||
|
|||||||
@@ -128,11 +128,13 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
style={timeDisplayStyle}
|
style={timeDisplayStyle}
|
||||||
className="sponsorTimeDisplay">
|
className="sponsorTimeDisplay">
|
||||||
|
|
||||||
<span id={"startButton" + this.idSuffix}
|
{sponsorTime.actionType !== ActionType.Poi ? (
|
||||||
className="sponsorNowButton"
|
<span id={"startButton" + this.idSuffix}
|
||||||
onClick={() => this.setTimeTo(0, 0)}>
|
className="sponsorNowButton"
|
||||||
{chrome.i18n.getMessage("bracketStart")}
|
onClick={() => this.setTimeTo(0, 0)}>
|
||||||
</span>
|
{chrome.i18n.getMessage("bracketStart")}
|
||||||
|
</span>
|
||||||
|
): ""}
|
||||||
|
|
||||||
<span id={"nowButton0" + this.idSuffix}
|
<span id={"nowButton0" + this.idSuffix}
|
||||||
className="sponsorNowButton"
|
className="sponsorNowButton"
|
||||||
|
|||||||
@@ -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 },
|
||||||
|
|||||||
@@ -2127,7 +2127,7 @@ async function vote(type: number, UUID: SegmentUUID, category?: Category, skipNo
|
|||||||
//success (treat rate limits as a success)
|
//success (treat rate limits as a success)
|
||||||
skipNotice.afterVote.bind(skipNotice)(utils.getSponsorTimeFromUUID(sponsorTimes, UUID), type, category);
|
skipNotice.afterVote.bind(skipNotice)(utils.getSponsorTimeFromUUID(sponsorTimes, UUID), type, category);
|
||||||
} else if (response.successType == -1) {
|
} else if (response.successType == -1) {
|
||||||
if (response.statusCode === 403 && response.responseText.startsWith("Vote rejected due to a warning from a moderator.")) {
|
if (response.statusCode === 403 && response.responseText.startsWith("Vote rejected due to a tip from a moderator.")) {
|
||||||
openWarningDialog(skipNoticeContentContainer);
|
openWarningDialog(skipNoticeContentContainer);
|
||||||
} else {
|
} else {
|
||||||
skipNotice.setNoticeInfoMessage.bind(skipNotice)(getErrorMessage(response.statusCode, response.responseText))
|
skipNotice.setNoticeInfoMessage.bind(skipNotice)(getErrorMessage(response.statusCode, response.responseText))
|
||||||
@@ -2317,7 +2317,7 @@ async function sendSubmitMessage() {
|
|||||||
playerButtons.submit.button.style.animation = "unset";
|
playerButtons.submit.button.style.animation = "unset";
|
||||||
playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker.svg");
|
playerButtons.submit.image.src = chrome.extension.getURL("icons/PlayerUploadFailedIconSponsorBlocker.svg");
|
||||||
|
|
||||||
if (response.status === 403 && response.responseText.startsWith("Submission rejected due to a warning from a moderator.")) {
|
if (response.status === 403 && response.responseText.startsWith("Submission rejected due to a tip from a moderator.")) {
|
||||||
openWarningDialog(skipNoticeContentContainer);
|
openWarningDialog(skipNoticeContentContainer);
|
||||||
} else {
|
} else {
|
||||||
alert(getErrorMessage(response.status, response.responseText));
|
alert(getErrorMessage(response.status, response.responseText));
|
||||||
@@ -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();
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export class SkipButtonControlBar {
|
|||||||
|
|
||||||
this.container = document.createElement("div");
|
this.container = document.createElement("div");
|
||||||
this.container.classList.add("skipButtonControlBarContainer");
|
this.container.classList.add("skipButtonControlBarContainer");
|
||||||
this.container.classList.add("hidden");
|
this.container.classList.add("sbhidden");
|
||||||
if (this.onMobileYouTube) this.container.classList.add("mobile");
|
if (this.onMobileYouTube) this.container.classList.add("mobile");
|
||||||
|
|
||||||
this.skipIcon = document.createElement("img");
|
this.skipIcon = document.createElement("img");
|
||||||
@@ -103,7 +103,7 @@ export class SkipButtonControlBar {
|
|||||||
|
|
||||||
this.refreshText();
|
this.refreshText();
|
||||||
this.container?.classList?.remove("textDisabled");
|
this.container?.classList?.remove("textDisabled");
|
||||||
this.textContainer?.classList?.remove("hidden");
|
this.textContainer?.classList?.remove("sbhidden");
|
||||||
AnimationUtils.disableAutoHideAnimation(this.skipIcon);
|
AnimationUtils.disableAutoHideAnimation(this.skipIcon);
|
||||||
|
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
@@ -111,8 +111,8 @@ export class SkipButtonControlBar {
|
|||||||
|
|
||||||
refreshText(): void {
|
refreshText(): void {
|
||||||
if (this.segment) {
|
if (this.segment) {
|
||||||
this.chapterText?.classList?.add("hidden");
|
this.chapterText?.classList?.add("sbhidden");
|
||||||
this.container.classList.remove("hidden");
|
this.container.classList.remove("sbhidden");
|
||||||
this.textContainer.innerText = this.getTitle();
|
this.textContainer.innerText = this.getTitle();
|
||||||
this.skipIcon.setAttribute("title", this.getTitle());
|
this.skipIcon.setAttribute("title", this.getTitle());
|
||||||
}
|
}
|
||||||
@@ -134,10 +134,10 @@ export class SkipButtonControlBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
disable(): void {
|
disable(): void {
|
||||||
this.container.classList.add("hidden");
|
this.container.classList.add("sbhidden");
|
||||||
|
|
||||||
this.chapterText?.classList?.remove("hidden");
|
this.chapterText?.classList?.remove("sbhidden");
|
||||||
this.getChapterPrefix()?.classList?.remove("hidden");
|
this.getChapterPrefix()?.classList?.remove("sbhidden");
|
||||||
|
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
}
|
}
|
||||||
@@ -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 {
|
||||||
@@ -158,10 +160,10 @@ export class SkipButtonControlBar {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.container.classList.add("textDisabled");
|
this.container.classList.add("textDisabled");
|
||||||
this.textContainer?.classList?.add("hidden");
|
this.textContainer?.classList?.add("sbhidden");
|
||||||
this.chapterText?.classList?.remove("hidden");
|
this.chapterText?.classList?.remove("sbhidden");
|
||||||
|
|
||||||
this.getChapterPrefix()?.classList?.add("hidden");
|
this.getChapterPrefix()?.classList?.add("sbhidden");
|
||||||
|
|
||||||
AnimationUtils.enableAutoHideAnimation(this.skipIcon);
|
AnimationUtils.enableAutoHideAnimation(this.skipIcon);
|
||||||
if (this.onMobileYouTube) {
|
if (this.onMobileYouTube) {
|
||||||
@@ -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 {
|
||||||
|
|||||||
@@ -85,6 +85,9 @@ async function init() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const skipToHighlightKeybind = document.querySelector(`[data-sync="skipToHighlightKeybind"] .optionLabel`) as HTMLElement;
|
||||||
|
skipToHighlightKeybind.innerText = `${chrome.i18n.getMessage("skip_to_category").replace("{0}", chrome.i18n.getMessage("category_poi_highlight")).replace("?", "")}:`;
|
||||||
|
|
||||||
// Set all of the toggle options to the correct option
|
// Set all of the toggle options to the correct option
|
||||||
const optionsContainer = document.getElementById("options");
|
const optionsContainer = document.getElementById("options");
|
||||||
const optionsElements = optionsContainer.querySelectorAll("*");
|
const optionsElements = optionsContainer.querySelectorAll("*");
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ function applyLoadingAnimation(element: HTMLElement, time: number, callback?: ()
|
|||||||
|
|
||||||
function setupCustomHideAnimation(element: Element, container: Element, enabled = true, rightSlide = true): { hide: () => void; show: () => void } {
|
function setupCustomHideAnimation(element: Element, container: Element, enabled = true, rightSlide = true): { hide: () => void; show: () => void } {
|
||||||
if (enabled) element.classList.add("autoHiding");
|
if (enabled) element.classList.add("autoHiding");
|
||||||
element.classList.add("hidden");
|
element.classList.add("sbhidden");
|
||||||
element.classList.add("animationDone");
|
element.classList.add("animationDone");
|
||||||
if (!rightSlide) element.classList.add("autoHideLeft");
|
if (!rightSlide) element.classList.add("autoHideLeft");
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ function setupCustomHideAnimation(element: Element, container: Element, enabled
|
|||||||
hide: () => {
|
hide: () => {
|
||||||
mouseEntered = false;
|
mouseEntered = false;
|
||||||
if (element.classList.contains("autoHiding")) {
|
if (element.classList.contains("autoHiding")) {
|
||||||
element.classList.add("hidden");
|
element.classList.add("sbhidden");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
show: () => {
|
show: () => {
|
||||||
@@ -46,7 +46,7 @@ function setupCustomHideAnimation(element: Element, container: Element, enabled
|
|||||||
|
|
||||||
// Wait for next event loop
|
// Wait for next event loop
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
if (mouseEntered) element.classList.remove("hidden")
|
if (mouseEntered) element.classList.remove("sbhidden")
|
||||||
}, 10);
|
}, 10);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -61,12 +61,12 @@ function setupAutoHideAnimation(element: Element, container: Element, enabled =
|
|||||||
|
|
||||||
function enableAutoHideAnimation(element: Element): void {
|
function enableAutoHideAnimation(element: Element): void {
|
||||||
element.classList.add("autoHiding");
|
element.classList.add("autoHiding");
|
||||||
element.classList.add("hidden");
|
element.classList.add("sbhidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
function disableAutoHideAnimation(element: Element): void {
|
function disableAutoHideAnimation(element: Element): void {
|
||||||
element.classList.remove("autoHiding");
|
element.classList.remove("autoHiding");
|
||||||
element.classList.remove("hidden");
|
element.classList.remove("sbhidden");
|
||||||
}
|
}
|
||||||
|
|
||||||
export const AnimationUtils = {
|
export const AnimationUtils = {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export async function openWarningDialog(contentContainer: ContentContainer): Pro
|
|||||||
|
|
||||||
let notice: GenericNotice = null;
|
let notice: GenericNotice = null;
|
||||||
const options: NoticeOptions = {
|
const options: NoticeOptions = {
|
||||||
title: chrome.i18n.getMessage("warningTitle"),
|
title: chrome.i18n.getMessage("deArrowMessageRecieved"),
|
||||||
textBoxes: [{
|
textBoxes: [{
|
||||||
text: chrome.i18n.getMessage("warningChatInfo"),
|
text: chrome.i18n.getMessage("warningChatInfo"),
|
||||||
icon: null
|
icon: null
|
||||||
|
|||||||
Reference in New Issue
Block a user