From 930bc113fe8276cdb7d24432e9ee4551b20d95ca Mon Sep 17 00:00:00 2001 From: Ajay Date: Mon, 21 Feb 2022 11:17:58 -0500 Subject: [PATCH] Add sort segments button --- manifest/manifest.json | 1 + public/content.css | 5 +++++ public/icons/sort.svg | 1 + src/components/SubmissionNoticeComponent.tsx | 19 ++++++++++++++++++- 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 public/icons/sort.svg diff --git a/manifest/manifest.json b/manifest/manifest.json index 740e292c..4eafb170 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -51,6 +51,7 @@ "icons/heart.svg", "icons/visible.svg", "icons/not_visible.svg", + "icons/sort.svg", "icons/PlayerInfoIconSponsorBlocker.svg", "icons/PlayerDeleteIconSponsorBlocker.svg", "popup.html", diff --git a/public/content.css b/public/content.css index ce4e2f8f..64e0c56e 100644 --- a/public/content.css +++ b/public/content.css @@ -291,6 +291,11 @@ div:hover > .sponsorBlockChapterBar { transition: background-color 0.4s; } +.sponsorSkipNoticeFirstRow .sponsorSkipNoticeButton.sponsorSkipSmallButton { + height: 1.3em; + padding: 0; +} + .sponsorTimesVoteButtonsContainer { float: left; vertical-align:middle; diff --git a/public/icons/sort.svg b/public/icons/sort.svg new file mode 100644 index 00000000..29c6d16f --- /dev/null +++ b/public/icons/sort.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index 82aa0cca..08b60dd5 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -68,12 +68,19 @@ class SubmissionNoticeComponent extends React.Component this.sortSegments()} + src={chrome.extension.getURL("icons/sort.svg")}> + ; return ( + zIndex={5000} + firstColumn={sortButton}> {/* Text Boxes */} {this.getMessageBoxes()} @@ -190,6 +197,16 @@ class SubmissionNoticeComponent extends React.Component a.segment[0] - b.segment[0]); + + Config.config.unsubmittedSegments[this.props.contentContainer().sponsorVideoID] = sponsorTimesSubmitting; + Config.forceSyncUpdate("unsubmittedSegments"); + + this.forceUpdate(); + } } export default SubmissionNoticeComponent;