Compare commits

...

19 Commits

Author SHA1 Message Date
Ajay
e650b7183a bump version 2023-10-08 16:44:12 -04:00
Ajay
4eb097b422 update translations 2023-10-08 16:44:07 -04:00
Ajay
04a9f82bdc Rename hidden css class to sbhidden to fix compatibility with Piped
Fixes #1865
2023-10-08 16:38:40 -04:00
Ajay
39cfdc7b6c bump version 2023-10-01 13:57:51 -04:00
Ajay
a8701b02a1 update translations 2023-10-01 13:57:41 -04:00
Ajay
3f1ad528c3 Merge branch 'master' of https://github.com/ajayyy/SponsorBlock 2023-10-01 13:56:44 -04:00
Ajay
ae685baeef Fix tip ui broken for submissions 2023-10-01 13:56:34 -04:00
Ajay Ramachandran
d2ee67f3cf Merge pull request #1867 from ajayyy/ci/update_invidious_list
Update Invidious List
2023-09-30 20:57:53 -04:00
github-actions[bot]
d440a4d52a Update Invidious List 2023-10-01 00:21:32 +00:00
Ajay
7566b71ccd Properly hide dearrow button 2023-09-30 17:00:10 -04:00
Ajay
109b7ed5bc Don't show start button for highlight 2023-09-24 21:13:43 -04:00
Ajay
3eb853154f Remove unnecessary translation string 2023-09-24 19:01:41 -04:00
Ajay
ee3ce8aa46 Add seperate keybind for skip to highlight
Fixes #1187
2023-09-23 15:40:11 -04:00
Ajay
1557af5d2a update translations 2023-09-23 14:27:29 -04:00
Ajay
465e7065ca Update warning title 2023-09-23 13:46:12 -04:00
Ajay
a3f8419c49 update translations 2023-09-23 12:20:05 -04:00
Ajay
dde443ccec bump version 2023-09-23 12:18:32 -04:00
Ajay
01b1380b78 Update sponsorblock ui to tip 2023-09-23 12:17:46 -04:00
Ajay
c51b18465e Fix slightly different tv url format that appears on Firefox 2023-09-18 14:17:46 -04:00
19 changed files with 71 additions and 48 deletions

View File

@@ -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"]

View File

@@ -1,7 +1,7 @@
{
"name": "__MSG_fullName__",
"short_name": "SponsorBlock",
"version": "5.4.20",
"version": "5.4.23",
"default_locale": "en",
"description": "__MSG_Description__",
"homepage_url": "https://sponsor.ajay.app",

View File

@@ -7,7 +7,7 @@
--sb-dark-red-outline: rgb(130,0,0,0.9);
}
.hidden {
.sbhidden {
display: none;
}
@@ -151,7 +151,7 @@ div:hover > .sponsorBlockChapterBar {
vertical-align: top;
}
.playerButton.hidden:not(.autoHiding) {
.playerButton.sbhidden:not(.autoHiding) {
display: none !important;
}
@@ -169,13 +169,13 @@ div:hover > .sponsorBlockChapterBar {
overflow: visible !important;
}
.autoHiding:not(.hidden) {
.autoHiding:not(.sbhidden) {
transform: translateX(0%) scale(1);
/* opacity is from YouTube page */
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);
/* opacity is from YouTube page */
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;
}
.autoHiding.hidden.autoHideLeft {
.autoHiding.sbhidden.autoHideLeft {
transform: translateX(-100%) scale(0);
}
@@ -272,7 +272,7 @@ div:hover > .sponsorBlockChapterBar {
max-width: calc(100% - 50px);
}
.sponsorSkipNotice .hidden {
.sponsorSkipNotice .sbhidden {
display: none;
}
@@ -691,7 +691,7 @@ input::-webkit-inner-spin-button {
color: white;
}
.skipButtonControlBarContainer.hidden {
.skipButtonControlBarContainer.sbhidden {
display: none !important;
}

View File

@@ -257,7 +257,7 @@ input[type='number'] {
opacity: 0;
}
.hidden {
.hidden, .sbhidden {
display: none !important;
}

View File

@@ -65,7 +65,7 @@
</div>
<div id="deArrowPromotion" class="promotion-container" class="hidden">
<div id="deArrowPromotion" class="promotion-container hidden">
<a class="dearrow-link"
href="https://dearrow.ajay.app"
target="_blank"
@@ -414,6 +414,11 @@
<div class="inline"></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">
<label class="optionLabel">__MSG_setStartSponsorShortcut__:</label>
<div class="inline"></div>

View File

@@ -19,7 +19,7 @@ body {
font-weight: bold;
}
.hidden {
.hidden, .sbhidden {
display: none !important;
}

View File

@@ -27,7 +27,7 @@
position: relative;
}
#sponsorBlockPopupBody .hidden {
#sponsorBlockPopupBody .hidden, #sponsorBlockPopupBody .sbhidden {
display: none !important;
}

View File

@@ -36,7 +36,7 @@
max-width: calc(100% - 50px);
}
.sponsorSkipNotice .hidden {
.sponsorSkipNotice .sbhidden {
display: none;
}

View File

@@ -44,7 +44,7 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
<>
{/* Upvote Button */}
<button id={"sponsorTimesDownvoteButtonsContainerUpvoteChapter"}
className={"playerButton sbPlayerUpvote ytp-button " + (!this.state.show ? "hidden" : "")}
className={"playerButton sbPlayerUpvote ytp-button " + (!this.state.show ? "sbhidden" : "")}
draggable="false"
title={chrome.i18n.getMessage("upvoteButtonInfo")}
onClick={(e) => this.vote(e, 1)}>
@@ -55,7 +55,7 @@ class ChapterVoteComponent extends React.Component<ChapterVoteProps, ChapterVote
{/* Downvote Button */}
<button id={"sponsorTimesDownvoteButtonsContainerDownvoteChapter"}
className={"playerButton sbPlayerDownvote ytp-button " + (!this.state.show ? "hidden" : "")}
className={"playerButton sbPlayerDownvote ytp-button " + (!this.state.show ? "sbhidden" : "")}
draggable="false"
title={chrome.i18n.getMessage("reportButtonInfo")}
onClick={(e) => {

View File

@@ -196,21 +196,21 @@ class NoticeComponent extends React.Component<NoticeProps, NoticeState> {
<span
id={"skipNoticeTimerText" + this.idSuffix}
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())}
</span>
),(
<img
id={"skipNoticeTimerPaused" + this.idSuffix}
key="skipNoticeTimerPaused"
className={this.state.countdownMode !== CountdownMode.Paused ? "hidden" : ""}
className={this.state.countdownMode !== CountdownMode.Paused ? "sbhidden" : ""}
src={chrome.runtime.getURL("icons/pause.svg")}
alt={chrome.i18n.getMessage("paused")} />
),(
<img
id={"skipNoticeTimerStopped" + this.idSuffix}
key="skipNoticeTimerStopped"
className={this.state.countdownMode !== CountdownMode.Stopped ? "hidden" : ""}
className={this.state.countdownMode !== CountdownMode.Stopped ? "sbhidden" : ""}
src={chrome.runtime.getURL("icons/stop.svg")}
alt={chrome.i18n.getMessage("manualPaused")} />
)];

View File

@@ -128,11 +128,13 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
style={timeDisplayStyle}
className="sponsorTimeDisplay">
<span id={"startButton" + this.idSuffix}
className="sponsorNowButton"
onClick={() => this.setTimeTo(0, 0)}>
{chrome.i18n.getMessage("bracketStart")}
</span>
{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}
className="sponsorNowButton"

View File

@@ -86,6 +86,7 @@ interface SBConfig {
};
skipKeybind: Keybind;
skipToHighlightKeybind: Keybind;
startSponsorKeybind: Keybind;
submitKeybind: 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?
*/
skipKeybind: { key: "Enter" },
skipToHighlightKeybind: { key: "Enter", ctrl: true },
startSponsorKeybind: { key: ";" },
submitKeybind: { key: "'" },
nextChapterKeybind: { key: "ArrowRight", ctrl: true },

View File

@@ -2127,7 +2127,7 @@ async function vote(type: number, UUID: SegmentUUID, category?: Category, skipNo
//success (treat rate limits as a success)
skipNotice.afterVote.bind(skipNotice)(utils.getSponsorTimeFromUUID(sponsorTimes, UUID), type, category);
} 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);
} else {
skipNotice.setNoticeInfoMessage.bind(skipNotice)(getErrorMessage(response.statusCode, response.responseText))
@@ -2317,7 +2317,7 @@ async function sendSubmitMessage() {
playerButtons.submit.button.style.animation = "unset";
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);
} else {
alert(getErrorMessage(response.status, response.responseText));
@@ -2432,14 +2432,23 @@ function hotkeyListener(e: KeyboardEvent): void {
};
const skipKey = Config.config.skipKeybind;
const skipToHighlightKey = Config.config.skipToHighlightKeybind;
const startSponsorKey = Config.config.startSponsorKeybind;
const submitKey = Config.config.submitKeybind;
const nextChapterKey = Config.config.nextChapterKeybind;
const previousChapterKey = Config.config.previousChapterKeybind;
if (keybindEquals(key, skipKey)) {
if (activeSkipKeybindElement)
if (activeSkipKeybindElement) {
activeSkipKeybindElement.toggleSkip.call(activeSkipKeybindElement);
}
return;
} else if (keybindEquals(key, skipToHighlightKey)) {
if (skipButtonControlBar) {
skipButtonControlBar.toggleSkip.call(skipButtonControlBar);
}
return;
} else if (keybindEquals(key, startSponsorKey)) {
startOrEndTimingNewSegment();

View File

@@ -41,7 +41,7 @@ export class SkipButtonControlBar {
this.container = document.createElement("div");
this.container.classList.add("skipButtonControlBarContainer");
this.container.classList.add("hidden");
this.container.classList.add("sbhidden");
if (this.onMobileYouTube) this.container.classList.add("mobile");
this.skipIcon = document.createElement("img");
@@ -103,7 +103,7 @@ export class SkipButtonControlBar {
this.refreshText();
this.container?.classList?.remove("textDisabled");
this.textContainer?.classList?.remove("hidden");
this.textContainer?.classList?.remove("sbhidden");
AnimationUtils.disableAutoHideAnimation(this.skipIcon);
this.startTimer();
@@ -111,8 +111,8 @@ export class SkipButtonControlBar {
refreshText(): void {
if (this.segment) {
this.chapterText?.classList?.add("hidden");
this.container.classList.remove("hidden");
this.chapterText?.classList?.add("sbhidden");
this.container.classList.remove("sbhidden");
this.textContainer.innerText = this.getTitle();
this.skipIcon.setAttribute("title", this.getTitle());
}
@@ -134,10 +134,10 @@ export class SkipButtonControlBar {
}
disable(): void {
this.container.classList.add("hidden");
this.container.classList.add("sbhidden");
this.chapterText?.classList?.remove("hidden");
this.getChapterPrefix()?.classList?.remove("hidden");
this.chapterText?.classList?.remove("sbhidden");
this.getChapterPrefix()?.classList?.remove("sbhidden");
this.enabled = false;
}
@@ -147,8 +147,10 @@ export class SkipButtonControlBar {
}
toggleSkip(): void {
this.skip(this.segment);
this.disableText();
if (this.segment && this.enabled) {
this.skip(this.segment);
this.disableText();
}
}
disableText(): void {
@@ -158,10 +160,10 @@ export class SkipButtonControlBar {
}
this.container.classList.add("textDisabled");
this.textContainer?.classList?.add("hidden");
this.chapterText?.classList?.remove("hidden");
this.textContainer?.classList?.add("sbhidden");
this.chapterText?.classList?.remove("sbhidden");
this.getChapterPrefix()?.classList?.add("hidden");
this.getChapterPrefix()?.classList?.add("sbhidden");
AnimationUtils.enableAutoHideAnimation(this.skipIcon);
if (this.onMobileYouTube) {
@@ -182,7 +184,7 @@ export class SkipButtonControlBar {
}
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 {

View File

@@ -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
const optionsContainer = document.getElementById("options");
const optionsElements = optionsContainer.querySelectorAll("*");

View File

@@ -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 } {
if (enabled) element.classList.add("autoHiding");
element.classList.add("hidden");
element.classList.add("sbhidden");
element.classList.add("animationDone");
if (!rightSlide) element.classList.add("autoHideLeft");
@@ -37,7 +37,7 @@ function setupCustomHideAnimation(element: Element, container: Element, enabled
hide: () => {
mouseEntered = false;
if (element.classList.contains("autoHiding")) {
element.classList.add("hidden");
element.classList.add("sbhidden");
}
},
show: () => {
@@ -46,7 +46,7 @@ function setupCustomHideAnimation(element: Element, container: Element, enabled
// Wait for next event loop
setTimeout(() => {
if (mouseEntered) element.classList.remove("hidden")
if (mouseEntered) element.classList.remove("sbhidden")
}, 10);
}
};
@@ -61,12 +61,12 @@ function setupAutoHideAnimation(element: Element, container: Element, enabled =
function enableAutoHideAnimation(element: Element): void {
element.classList.add("autoHiding");
element.classList.add("hidden");
element.classList.add("sbhidden");
}
function disableAutoHideAnimation(element: Element): void {
element.classList.remove("autoHiding");
element.classList.remove("hidden");
element.classList.remove("sbhidden");
}
export const AnimationUtils = {

View File

@@ -26,7 +26,7 @@ export async function openWarningDialog(contentContainer: ContentContainer): Pro
let notice: GenericNotice = null;
const options: NoticeOptions = {
title: chrome.i18n.getMessage("warningTitle"),
title: chrome.i18n.getMessage("deArrowMessageRecieved"),
textBoxes: [{
text: chrome.i18n.getMessage("warningChatInfo"),
icon: null