From ce9a27bebc5dabf9edfe3cea532df9763f0480e8 Mon Sep 17 00:00:00 2001 From: Zacchary Dempsey-Plante Date: Sat, 2 Apr 2022 21:41:48 -0400 Subject: [PATCH] Implement channel-specific categories. --- public/_locales/en/messages.json | 12 ++ public/options/options.css | 6 +- public/popup.html | 2 +- src/components/CategoryChooserComponent.tsx | 122 +++++++++++-- .../CategorySkipOptionsComponent.tsx | 124 ++++++++----- src/config.ts | 18 +- src/content.ts | 76 +++++--- src/messageTypes.ts | 9 +- src/options.ts | 9 +- src/popup.ts | 165 ++++++++++-------- src/types.ts | 10 +- src/utils.ts | 30 +++- 12 files changed, 403 insertions(+), 180 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 1d3e9f1580..f939a247f4 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -200,6 +200,9 @@ "showDeleteButton": { "message": "Show Delete Button On YouTube Player" }, + "removeChannelSettingsButton": { + "message": "Remove Channel-Specific Settings" + }, "enableViewTracking": { "message": "Enable Skip Count Tracking" }, @@ -621,6 +624,9 @@ "category_livestream_messages_short": { "message": "Message Reading" }, + "inherit": { + "message": "Inherit" + }, "autoSkip": { "message": "Auto Skip" }, @@ -737,9 +743,15 @@ "whatForceChannelCheck": { "message": "By default, it will skip segments right away before it even knows what the channel is. By default, some segments at the start of the video might be skipped on whitelisted channels. Enabling this option will prevent this but making all skipping have a slight delay as getting the channelID can take some time. This delay might be unnoticeable if you have fast internet." }, + "channelSettingsPopup": { + "message": "Ctrl-click to open the channel-specific settings for this channel." + }, "forceChannelCheckPopup": { "message": "Consider Enabling \"Force Channel Check Before Skipping\"" }, + "forceChannelCheckRequired": { + "message": "\"Force Channel Check Before Skipping\" is required for channel-specific category selections to work properly." + }, "downvoteDescription": { "message": "Incorrect/Wrong Timing" }, diff --git a/public/options/options.css b/public/options/options.css index a2a829a14b..b0d0adbef2 100644 --- a/public/options/options.css +++ b/public/options/options.css @@ -558,6 +558,10 @@ svg { /* React styles */ +.categoryTableHeader { + height: 3em; /* So the height doesn't change when switching to/from global channel settings (which have two-line headers) */ +} + .categoryTableElement { font-size: 16px; } @@ -670,4 +674,4 @@ svg { #options > div { max-width: 100%; } -} \ No newline at end of file +} diff --git a/public/popup.html b/public/popup.html index 78001e86a1..21f3e24921 100644 --- a/public/popup.html +++ b/public/popup.html @@ -30,7 +30,7 @@
-