mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-29 10:58:22 +03:00
Compare commits
26 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
39cfdc7b6c | ||
|
|
a8701b02a1 | ||
|
|
3f1ad528c3 | ||
|
|
ae685baeef | ||
|
|
d2ee67f3cf | ||
|
|
d440a4d52a | ||
|
|
7566b71ccd | ||
|
|
109b7ed5bc | ||
|
|
3eb853154f | ||
|
|
ee3ce8aa46 | ||
|
|
1557af5d2a | ||
|
|
465e7065ca | ||
|
|
a3f8419c49 | ||
|
|
dde443ccec | ||
|
|
01b1380b78 | ||
|
|
c51b18465e | ||
|
|
ad9888cf52 | ||
|
|
7856791f90 | ||
|
|
273ee63ec7 | ||
|
|
be36583aee | ||
|
|
433bbbf904 | ||
|
|
6c2ee76198 | ||
|
|
42f59898f3 | ||
|
|
8ab126f502 | ||
|
|
4954abf9e3 | ||
|
|
30a21d5ff5 |
@@ -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"]
|
||||||
@@ -9,5 +9,8 @@
|
|||||||
},
|
},
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"scripting"
|
"scripting"
|
||||||
]
|
],
|
||||||
|
"browser_action": {
|
||||||
|
"default_area": "navbar"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "__MSG_fullName__",
|
"name": "__MSG_fullName__",
|
||||||
"short_name": "SponsorBlock",
|
"short_name": "SponsorBlock",
|
||||||
"version": "5.4.19",
|
"version": "5.4.22",
|
||||||
"default_locale": "en",
|
"default_locale": "en",
|
||||||
"description": "__MSG_Description__",
|
"description": "__MSG_Description__",
|
||||||
"homepage_url": "https://sponsor.ajay.app",
|
"homepage_url": "https://sponsor.ajay.app",
|
||||||
@@ -17,9 +17,7 @@
|
|||||||
],
|
],
|
||||||
"css": [
|
"css": [
|
||||||
"content.css",
|
"content.css",
|
||||||
"shared.css",
|
"shared.css"
|
||||||
"./libs/Source+Sans+Pro.css",
|
|
||||||
"popup.css"
|
|
||||||
]
|
]
|
||||||
}],
|
}],
|
||||||
"web_accessible_resources": [
|
"web_accessible_resources": [
|
||||||
|
|||||||
Submodule maze-utils updated: 4f7384e03f...a984d11483
Submodule public/_locales updated: 0a46f4ec38...8024493171
@@ -49,7 +49,13 @@ div:hover > #previewbar.sbNotInvidious {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.previewbar.requiredSegment {
|
.previewbar.requiredSegment {
|
||||||
transform: scaleY(3)
|
transform: scaleY(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
.previewbar.selectedSegment {
|
||||||
|
opacity: 1 !important;
|
||||||
|
z-index: 100;
|
||||||
|
transform: scaleY(1.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Make sure settings are upfront */
|
/* Make sure settings are upfront */
|
||||||
@@ -243,11 +249,6 @@ div:hover > .sponsorBlockChapterBar {
|
|||||||
border-collapse: unset;
|
border-collapse: unset;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sponsorSkipNoticeParent {
|
|
||||||
min-width: 350px;
|
|
||||||
max-width: 50%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sponsorSkipNotice {
|
.sponsorSkipNotice {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -570,8 +571,8 @@ div:hover > .sponsorBlockChapterBar {
|
|||||||
.sponsorTimeEditButton {
|
.sponsorTimeEditButton {
|
||||||
text-decoration: underline;
|
text-decoration: underline;
|
||||||
|
|
||||||
margin-left: 20px;
|
margin-left: 13px;
|
||||||
margin-right: 20px;
|
margin-right: 13px;
|
||||||
|
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -195,7 +195,7 @@
|
|||||||
<a href="https://github.com/ajayyy/SponsorBlock" target="_blank" rel="noopener">GitHub</a>
|
<a href="https://github.com/ajayyy/SponsorBlock" target="_blank" rel="noopener">GitHub</a>
|
||||||
<a href="https://discord.gg/SponsorBlock" target="_blank" rel="noopener">Discord</a>
|
<a href="https://discord.gg/SponsorBlock" target="_blank" rel="noopener">Discord</a>
|
||||||
<a href="https://matrix.to/#/#sponsor:ajay.app?via=ajay.app&via=matrix.org&via=mozilla.org" target="_blank" rel="noopener">Matrix</a>
|
<a href="https://matrix.to/#/#sponsor:ajay.app?via=ajay.app&via=matrix.org&via=mozilla.org" target="_blank" rel="noopener">Matrix</a>
|
||||||
<a href="https://sponsor.ajay.app/donate" target="_blank" rel="noopener" id="sbDonate">$</a>
|
<a href="https://sponsor.ajay.app/donate" target="_blank" rel="noopener" id="sbDonate">__MSG_Donate__</a>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<button id="showNoticeAgain" style="display: none">__MSG_showNotice__</button>
|
<button id="showNoticeAgain" style="display: none">__MSG_showNotice__</button>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sponsorSkipNoticeParent {
|
.sponsorSkipNoticeParent {
|
||||||
min-width: 350px;
|
min-width: 375px;
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,14 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
style={timeDisplayStyle}
|
style={timeDisplayStyle}
|
||||||
className="sponsorTimeDisplay">
|
className="sponsorTimeDisplay">
|
||||||
|
|
||||||
|
{sponsorTime.actionType !== ActionType.Poi ? (
|
||||||
|
<span id={"startButton" + this.idSuffix}
|
||||||
|
className="sponsorNowButton"
|
||||||
|
onClick={() => this.setTimeTo(0, 0)}>
|
||||||
|
{chrome.i18n.getMessage("bracketStart")}
|
||||||
|
</span>
|
||||||
|
): ""}
|
||||||
|
|
||||||
<span id={"nowButton0" + this.idSuffix}
|
<span id={"nowButton0" + this.idSuffix}
|
||||||
className="sponsorNowButton"
|
className="sponsorNowButton"
|
||||||
onClick={() => this.setTimeToNow(0)}>
|
onClick={() => this.setTimeToNow(0)}>
|
||||||
@@ -155,6 +163,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
type="text"
|
type="text"
|
||||||
style={{color: "inherit", backgroundColor: "inherit"}}
|
style={{color: "inherit", backgroundColor: "inherit"}}
|
||||||
value={this.state.sponsorTimeEdits[1]}
|
value={this.state.sponsorTimeEdits[1]}
|
||||||
|
onKeyDown={(e) => e.stopPropagation()}
|
||||||
|
onKeyUp={(e) => e.stopPropagation()}
|
||||||
onChange={(e) => this.handleOnChange(1, e, sponsorTime, e.target.value)}
|
onChange={(e) => this.handleOnChange(1, e, sponsorTime, e.target.value)}
|
||||||
onWheel={(e) => this.changeTimesWhenScrolling(1, e, sponsorTime)}>
|
onWheel={(e) => this.changeTimesWhenScrolling(1, e, sponsorTime)}>
|
||||||
</input>
|
</input>
|
||||||
@@ -240,6 +250,8 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
ref={this.descriptionOptionRef}
|
ref={this.descriptionOptionRef}
|
||||||
type="text"
|
type="text"
|
||||||
value={this.state.description}
|
value={this.state.description}
|
||||||
|
onKeyDown={(e) => e.stopPropagation()}
|
||||||
|
onKeyUp={(e) => e.stopPropagation()}
|
||||||
onContextMenu={(e) => e.stopPropagation()}
|
onContextMenu={(e) => e.stopPropagation()}
|
||||||
onChange={(e) => this.descriptionUpdate(e.target.value)}
|
onChange={(e) => this.descriptionUpdate(e.target.value)}
|
||||||
onFocus={() => this.setState({chapterNameSelectorOpen: true})}>
|
onFocus={() => this.setState({chapterNameSelectorOpen: true})}>
|
||||||
@@ -284,11 +296,10 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
</span>
|
</span>
|
||||||
): ""}
|
): ""}
|
||||||
|
|
||||||
{(!isNaN(segment[1]) && ![ActionType.Poi, ActionType.Full].includes(sponsorTime.actionType))
|
{(!isNaN(segment[1]) && ![ActionType.Poi, ActionType.Full].includes(sponsorTime.actionType)) ? (
|
||||||
&& sponsorTime.actionType === ActionType.Chapter ? (
|
|
||||||
<span id={"sponsorTimePreviewButton" + this.idSuffix}
|
<span id={"sponsorTimePreviewButton" + this.idSuffix}
|
||||||
className="sponsorTimeEditButton"
|
className="sponsorTimeEditButton"
|
||||||
onClick={(e) => this.previewTime(e.ctrlKey, e.shiftKey)}>
|
onClick={(e) => this.previewTime(e.ctrlKey, e.shiftKey, true)}>
|
||||||
{chrome.i18n.getMessage("End")}
|
{chrome.i18n.getMessage("End")}
|
||||||
</span>
|
</span>
|
||||||
): ""}
|
): ""}
|
||||||
@@ -626,7 +637,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
: CompileConfig.categorySupport[category]?.[0] ?? ActionType.Skip
|
: CompileConfig.categorySupport[category]?.[0] ?? ActionType.Skip
|
||||||
}
|
}
|
||||||
|
|
||||||
previewTime(ctrlPressed = false, shiftPressed = false): void {
|
previewTime(ctrlPressed = false, shiftPressed = false, skipToEndTime = false): void {
|
||||||
const sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting;
|
const sponsorTimes = this.props.contentContainer().sponsorTimesSubmitting;
|
||||||
const index = this.props.index;
|
const index = this.props.index;
|
||||||
let seekTime = 2;
|
let seekTime = 2;
|
||||||
@@ -635,13 +646,11 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
|
|
||||||
const startTime = sponsorTimes[index].segment[0];
|
const startTime = sponsorTimes[index].segment[0];
|
||||||
const endTime = sponsorTimes[index].segment[1];
|
const endTime = sponsorTimes[index].segment[1];
|
||||||
const isChapter = sponsorTimes[index].actionType === ActionType.Chapter;
|
|
||||||
|
|
||||||
// If segment starts at 0:00, start playback at the end of the segment
|
// If segment starts at 0:00, start playback at the end of the segment
|
||||||
const skipToEndTime = startTime === 0 || isChapter;
|
const skipTime = (startTime === 0 || skipToEndTime) ? endTime : (startTime - (seekTime * this.props.contentContainer().v.playbackRate));
|
||||||
const skipTime = skipToEndTime ? endTime : (startTime - (seekTime * this.props.contentContainer().v.playbackRate));
|
|
||||||
|
|
||||||
this.props.contentContainer().previewTime(skipTime, !isChapter);
|
this.props.contentContainer().previewTime(skipTime, !skipToEndTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
inspectTime(): void {
|
inspectTime(): void {
|
||||||
|
|||||||
@@ -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 },
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ const skipNotices: SkipNotice[] = [];
|
|||||||
let activeSkipKeybindElement: ToggleSkippable = null;
|
let activeSkipKeybindElement: ToggleSkippable = null;
|
||||||
let retryFetchTimeout: NodeJS.Timeout = null;
|
let retryFetchTimeout: NodeJS.Timeout = null;
|
||||||
let shownSegmentFailedToFetchWarning = false;
|
let shownSegmentFailedToFetchWarning = false;
|
||||||
|
let selectedSegment: SegmentUUID | null = null;
|
||||||
|
|
||||||
// JSON video info
|
// JSON video info
|
||||||
let videoInfo: VideoInfo = null;
|
let videoInfo: VideoInfo = null;
|
||||||
@@ -300,6 +301,10 @@ function messageListener(request: Message, sender: unknown, sendResponse: (respo
|
|||||||
case "reskip":
|
case "reskip":
|
||||||
reskipSponsorTime(sponsorTimes.find((segment) => segment.UUID === request.UUID), true);
|
reskipSponsorTime(sponsorTimes.find((segment) => segment.UUID === request.UUID), true);
|
||||||
break;
|
break;
|
||||||
|
case "selectSegment":
|
||||||
|
selectedSegment = request.UUID;
|
||||||
|
updatePreviewBar();
|
||||||
|
break;
|
||||||
case "submitVote":
|
case "submitVote":
|
||||||
vote(request.type, request.UUID).then((response) => sendResponse(response));
|
vote(request.type, request.UUID).then((response) => sendResponse(response));
|
||||||
return true;
|
return true;
|
||||||
@@ -1369,7 +1374,8 @@ function updatePreviewBar(): void {
|
|||||||
showLarger: segment.actionType === ActionType.Poi,
|
showLarger: segment.actionType === ActionType.Poi,
|
||||||
description: segment.description,
|
description: segment.description,
|
||||||
source: segment.source,
|
source: segment.source,
|
||||||
requiredSegment: requiredSegment && (segment.UUID === requiredSegment || segment.UUID.startsWith(requiredSegment))
|
requiredSegment: requiredSegment && (segment.UUID === requiredSegment || segment.UUID.startsWith(requiredSegment)),
|
||||||
|
selectedSegment: selectedSegment && segment.UUID === selectedSegment
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -2121,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))
|
||||||
@@ -2311,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));
|
||||||
@@ -2426,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();
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export interface PreviewBarSegment {
|
|||||||
description: string;
|
description: string;
|
||||||
source: SponsorSourceType;
|
source: SponsorSourceType;
|
||||||
requiredSegment?: boolean;
|
requiredSegment?: boolean;
|
||||||
|
selectedSegment?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ChapterGroup extends SegmentContainer {
|
interface ChapterGroup extends SegmentContainer {
|
||||||
@@ -332,6 +333,7 @@ class PreviewBar {
|
|||||||
const bar = document.createElement('li');
|
const bar = document.createElement('li');
|
||||||
bar.classList.add('previewbar');
|
bar.classList.add('previewbar');
|
||||||
if (barSegment.requiredSegment) bar.classList.add("requiredSegment");
|
if (barSegment.requiredSegment) bar.classList.add("requiredSegment");
|
||||||
|
if (barSegment.selectedSegment) bar.classList.add("selectedSegment");
|
||||||
bar.innerHTML = showLarger ? ' ' : ' ';
|
bar.innerHTML = showLarger ? ' ' : ' ';
|
||||||
|
|
||||||
const fullCategoryName = (unsubmitted ? 'preview-' : '') + category;
|
const fullCategoryName = (unsubmitted ? 'preview-' : '') + category;
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ interface IsInfoFoundMessage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface SkipMessage {
|
interface SkipMessage {
|
||||||
message: "unskip" | "reskip";
|
message: "unskip" | "reskip" | "selectSegment";
|
||||||
UUID: SegmentUUID;
|
UUID: SegmentUUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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("*");
|
||||||
|
|||||||
11
src/popup.ts
11
src/popup.ts
@@ -687,6 +687,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
: chrome.i18n.getMessage("skipSegment");
|
: chrome.i18n.getMessage("skipSegment");
|
||||||
skipButton.addEventListener("click", () => skipSegment(actionType, UUID, skipButton));
|
skipButton.addEventListener("click", () => skipSegment(actionType, UUID, skipButton));
|
||||||
votingButtons.addEventListener("dblclick", () => skipSegment(actionType, UUID));
|
votingButtons.addEventListener("dblclick", () => skipSegment(actionType, UUID));
|
||||||
|
votingButtons.addEventListener("dblclick", () => skipSegment(actionType, UUID));
|
||||||
|
votingButtons.addEventListener("mouseenter", () => selectSegment(UUID));
|
||||||
|
|
||||||
//add thumbs up, thumbs down and uuid copy buttons to the container
|
//add thumbs up, thumbs down and uuid copy buttons to the container
|
||||||
voteButtonsContainer.appendChild(upvoteButton);
|
voteButtonsContainer.appendChild(upvoteButton);
|
||||||
@@ -718,6 +720,8 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
|
|
||||||
container.appendChild(votingButtons);
|
container.appendChild(votingButtons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
container.addEventListener("mouseleave", () => selectSegment(null));
|
||||||
}
|
}
|
||||||
|
|
||||||
function submitTimes() {
|
function submitTimes() {
|
||||||
@@ -968,6 +972,13 @@ async function runThePopup(messageListener?: MessageListener): Promise<void> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function selectSegment(UUID: SegmentUUID | null): void {
|
||||||
|
sendTabMessage({
|
||||||
|
message: "selectSegment",
|
||||||
|
UUID: UUID
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Should skipping be disabled (visuals stay)
|
* Should skipping be disabled (visuals stay)
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -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