diff --git a/config.json.example b/config.json.example index ffc482a511..f69160651b 100644 --- a/config.json.example +++ b/config.json.example @@ -12,5 +12,17 @@ "preview": ["skip"], "music_offtopic": ["skip"], "poi_highlight": ["skip"] + }, + "wikiLinks": { + "sponsor": "https://wiki.sponsor.ajay.app/w/Sponsor", + "selfpromo": "https://wiki.sponsor.ajay.app/w/Unpaid/Self_Promotion", + "interaction": "https://wiki.sponsor.ajay.app/w/Interaction_Reminder_(Subscribe)", + "intro": "https://wiki.sponsor.ajay.app/w/Intermission/Intro_Animation", + "outro": "https://wiki.sponsor.ajay.app/w/Endcards/Credits", + "preview": "https://wiki.sponsor.ajay.app/w/Preview/Recap", + "music_offtopic": "https://wiki.sponsor.ajay.app/w/Music:_Non-Music_Section", + "poi_highlight": "https://wiki.sponsor.ajay.app/w/Highlight", + "guidelines": "https://wiki.sponsor.ajay.app/w/Guidelines", + "mute": "https://wiki.sponsor.ajay.app/w/Mute_Segment" } } diff --git a/manifest/manifest.json b/manifest/manifest.json index c9350235fb..3c49bebf30 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -37,6 +37,7 @@ "icons/upvote.png", "icons/downvote.png", "icons/thumbs_down.svg", + "icons/thumbs_down_locked.svg", "icons/thumbs_up.svg", "icons/help.svg", "icons/report.png", diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 35a27cf294..3d5758323a 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -700,7 +700,7 @@ "message": "Incorrect/Wrong Timing" }, "incorrectCategory": { - "message": "Wrong Category" + "message": "Change Category" }, "nonMusicCategoryOnMusic": { "message": "This video is categorized as music. Are you sure this has a sponsor? If this is actually a \"Non-Music segment\", open up the extension options and enable this category. Then, you can submit this segment as \"Non-Music\" instead of sponsor. Please read the guidelines if you are confused." @@ -810,6 +810,21 @@ }, "LearnMore": { "message": "Learn More" + }, + "CopyDownvoteButtonInfo": { + "message": "Downvotes and creates a local copy for you to resubmit" + }, + "OpenCategoryWikiPage": { + "message": "Open this category's wiki page." + }, + "CopyAndDownvote": { + "message": "Copy and downvote" + }, + "ContinueVoting": { + "message": "Continue Voting" + }, + "ChangeCategoryTooltip": { + "message": "This will instantly apply to your segments" }, "SponsorTimeEditScrollNewFeature": { "message": "Use your mousewheel while hovering over the edit box to quickly adjust the time. Combinations of the ctrl or shift key can be used to fine tune the changes." diff --git a/public/content.css b/public/content.css index 2bd1b11334..4751d293b5 100644 --- a/public/content.css +++ b/public/content.css @@ -217,7 +217,7 @@ /* if two are very close to eachother */ .secondSkipNotice { - bottom: 250px; + bottom: 290px; } .noticeLeftIcon { @@ -254,12 +254,16 @@ .sponsorTimesVoteButtonsContainer { float: left; - + vertical-align:middle; padding: 2px 5px; margin-right: 4px; } +.sponsorTimesVoteButtonsContainer div{ + display: inline-block; +} + .sponsorSkipNoticeRightSection { right: 0; position: absolute; @@ -330,7 +334,8 @@ } .voteButton { - height: 17px; + height: 24px; + width: 24px; cursor: pointer; } .voteButton:hover { @@ -556,6 +561,10 @@ input::-webkit-inner-spin-button { border-color: rgba(28, 28, 28, 0.7) transparent transparent transparent; } +.sponsorBlockLockedColor { + color: #ffc83d; +} + .sponsorBlockRectangleTooltip { position: absolute; border-radius: 5px; @@ -565,3 +574,4 @@ input::-webkit-inner-spin-button { white-space: normal; line-height: 1.5em; } + diff --git a/public/icons/thumbs_down_locked.svg b/public/icons/thumbs_down_locked.svg new file mode 100644 index 0000000000..57672e2df0 --- /dev/null +++ b/public/icons/thumbs_down_locked.svg @@ -0,0 +1,58 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 4a5152700f..6d3c378bab 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -4,14 +4,22 @@ import Config from "../config" import { Category, ContentContainer, CategoryActionType, SponsorHideType, SponsorTime, NoticeVisbilityMode, ActionType } from "../types"; import NoticeComponent from "./NoticeComponent"; import NoticeTextSelectionComponent from "./NoticeTextSectionComponent"; +import SubmissionNotice from "../render/SubmissionNotice"; +import Utils from "../utils"; +const utils = new Utils(); import { getCategoryActionType, getSkippingText } from "../utils/categoryUtils"; +import ThumbsUpSvg from "../svg-icons/thumbs_up_svg"; +import ThumbsDownSvg from "../svg-icons/thumbs_down_svg"; +import PencilSvg from "../svg-icons/pencil_svg"; + export enum SkipNoticeAction { None, Upvote, Downvote, CategoryVote, + CopyDownvote, Unskip } @@ -43,7 +51,7 @@ export interface SkipNoticeState { skipButtonCallback?: (index: number) => void; showSkipButton?: boolean; - downvoting?: boolean; + editing?: boolean; choosingCategory?: boolean; thanksForVotingText?: string; //null until the voting buttons should be hidden @@ -52,6 +60,10 @@ export interface SkipNoticeState { showKeybindHint?: boolean; smaller?: boolean; + + voted?: SkipNoticeAction[]; + copied?: SkipNoticeAction[]; + } class SkipNoticeComponent extends React.Component { @@ -69,6 +81,10 @@ class SkipNoticeComponent extends React.Component; categoryOptionRef: React.RefObject; + selectedColor: string; + unselectedColor: string; + lockedColor: string; + // Used to update on config change configListener: () => void; @@ -94,12 +110,16 @@ class SkipNoticeComponent extends React.Component a.segment[0] - b.segment[0]); } - //this is the suffix added at the end of every id + // This is the suffix added at the end of every id for (const segment of this.segments) { this.idSuffix += segment.UUID; } this.idSuffix += this.amountOfPreviousNotices; + this.selectedColor = Config.config.colorPalette.red; + this.unselectedColor = Config.config.colorPalette.white; + this.lockedColor = Config.config.colorPalette.locked; + // Setup state this.state = { noticeTitle, @@ -115,7 +135,7 @@ class SkipNoticeComponent extends React.Component this.unskip(index), showSkipButton: true, - downvoting: false, + editing: false, choosingCategory: false, thanksForVotingText: null, @@ -123,7 +143,11 @@ class SkipNoticeComponent extends React.Component {/* Vote Button Container */} - {!this.state.thanksForVotingText ? + {!this.state.thanksForVotingText ? {/* Upvote Button */} - this.prepAction(SkipNoticeAction.Upvote)}> - - +
this.prepAction(SkipNoticeAction.Upvote)}> + +
{/* Report Button */} - this.adjustDownvotingState(true)}> - - - +
this.prepAction(SkipNoticeAction.Downvote)}> + +
+ + {/* Copy and Downvote Button */} +
this.openEditingOptions()}> + +
: @@ -216,7 +249,22 @@ class SkipNoticeComponent extends React.Component - {this.state.thanksForVotingText} + + {/* Submitted string */} + + {this.state.thanksForVotingText} + + + {/* Continue Voting Button */} + } @@ -229,45 +277,46 @@ class SkipNoticeComponent extends React.Component } ), - /* Downvote Options Row */ - (this.state.downvoting && - - + - {/* Normal downvote */} + {/* Copy Segment */} {/* Category vote */} - ), /* Category Chooser Row */ - (this.state.choosingCategory && + (this.state.choosingCategory && !this.state.thanksForVotingText && {/* Category Selector */}