diff --git a/manifest/manifest.json b/manifest/manifest.json index 59dc3272..f4d92bbe 100644 --- a/manifest/manifest.json +++ b/manifest/manifest.json @@ -1,7 +1,7 @@ { "name": "__MSG_fullName__", "short_name": "__MSG_Name__", - "version": "1.2.30", + "version": "1.2.31", "default_locale": "en", "description": "__MSG_Description__", "content_scripts": [{ @@ -32,6 +32,7 @@ "icons/downvote.png", "icons/thumbs_down.svg", "icons/thumbs_up.svg", + "icons/help.svg", "icons/report.png", "icons/close.png", "icons/beep.ogg", diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 30e9be2e..43999660 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -483,24 +483,54 @@ "category_sponsor": { "message": "Sponsor" }, + "category_sponsor_description": { + "message": "Paid promotion, paid referrals and direct advertisements. Not for self-promotion or free shoutouts to causes/creators/websites/products they like." + }, "category_intro": { "message": "Intro Animation" }, + "category_intro_description": { + "message": "Intro animations that are recurring in the series or provide no direct value. This should not be used on music videos." + }, + "category_intro_short": { + "message": "Intro" + }, "category_outro": { "message": "Endcards/Credits" }, + "category_outro_description": { + "message": "Credits or when the YouTube endcards appear. Not for spoken conclusions. This should not include useful content. This should not be used on music videos." + }, "category_interaction": { "message": "Interaction Reminder (Subscribe)" }, + "category_interaction_description": { + "message": "When there is a short reminder to like, subscribe or follow them in the middle of content. If it is long or about something specific, it should be under self promotion instead." + }, + "category_interaction_short": { + "message": "Interaction Reminder" + }, "category_selfpromo": { "message": "Unpaid/Self Promotion" }, + "category_selfpromo_description": { + "message": "Similar to \"sponsor\" except for unpaid or self promotion. This includes sections about merchandise, donations, or information about who they collaborated with." + }, "category_music_offtopic": { "message": "Music: Non-Music Section" }, + "category_music_offtopic_description": { + "message": "Only for use in music videos. This includes introductions or outros in music videos." + }, + "category_music_offtopic_short": { + "message": "Non-Music" + }, "category_livestream_messages": { "message": "Livestream: Donation/Message Readings" }, + "category_livestream_messages_short": { + "message": "Message Reading" + }, "disable": { "message": "Disable" }, @@ -510,6 +540,23 @@ "showOverlay": { "message": "Show In Seek Bar" }, + "colorFormatIncorrect": { + "message": "Your color is formatted incorrectly. It should be a 3 or 6 digit hex code with a number sign at the beginning." + }, + "previewColor": { + "message": "Preview Color", + "description": "Referring to submissions that have not been sent to the server yet." + }, + "seekBarColor": { + "message": "Seek Bar Color" + }, + "category": { + "message": "Category" + }, + "skipOption": { + "message": "Skip Option", + "description": "Used on the options page to describe the ways to skip the segment (auto skip, manual, etc.)" + }, "enableTestingServer": { "message": "Enable Beta Testing Server" }, @@ -563,5 +610,24 @@ }, "multipleSegments": { "message": "Multiple Segments" + }, + "guidelines": { + "message": "Guidelines" + }, + "readTheGuidelines": { + "message": "Read The Guidelines!!", + "description": "Show the first time they submit or if they are \"high risk\"" + }, + "categoryUpdate1": { + "message": "Categories are here!" + }, + "categoryUpdate2": { + "message": "Open the options to skip intros, outros, merch, etc." + }, + "unsubmittedWarning": { + "message": "Unsubmitted Segments Notification" + }, + "unsubmittedWarningDescription": { + "message": "Send a notification when you leave a video with segments that are not uploaded" } } diff --git a/public/content.css b/public/content.css index 66838a9f..95009d26 100644 --- a/public/content.css +++ b/public/content.css @@ -394,4 +394,22 @@ input::-webkit-inner-spin-button { color: white; border-width: 3px; padding: 3px; +} + +.helpButton { + +} + +.helpButton { + height: 25px; + cursor: pointer; + padding: 5px; + + margin: auto; + top: 0; + bottom: 0; + position: absolute; +} +.helpButton:hover { + filter: brightness(80%); } \ No newline at end of file diff --git a/public/help/index_en.html b/public/help/index_en.html index 163e26e5..605ed501 100644 --- a/public/help/index_en.html +++ b/public/help/index_en.html @@ -30,15 +30,15 @@ Come contribute, make some suggestions and help out in the Discord: https://discord.gg/QnmVMpU

-
- Enable optional features -
+

Please review the options below

- Some features, such as support for non third-party YouTube sites, are disabled by default and can be enabled in the options. These can be enabled or disabled at any time. + Many features are disabled by default. If you want to skip Intros, outros, use Invidious, please enable the specific options. These can be enabled or disabled at any time. You can also hide/show all UI elements added to the YouTube page.

+ +

How skipping works

diff --git a/public/icons/help.svg b/public/icons/help.svg new file mode 100644 index 00000000..571216ba --- /dev/null +++ b/public/icons/help.svg @@ -0,0 +1,58 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/public/options/options.css b/public/options/options.css index 36db654e..8ad87e3d 100644 --- a/public/options/options.css +++ b/public/options/options.css @@ -346,4 +346,8 @@ svg { font-size: 14px; padding: 5px; border-radius: 5px; +} + +.categoryColorTextBox { + width: 60px; } \ No newline at end of file diff --git a/src/background.ts b/src/background.ts index 0c11ab06..28a1051e 100644 --- a/src/background.ts +++ b/src/background.ts @@ -62,12 +62,14 @@ chrome.runtime.onMessage.addListener(function (request, sender, callback) { //this allows the callback to be called later return true; case "alertPrevious": - chrome.notifications.create("stillThere" + Math.random(), { - type: "basic", - title: chrome.i18n.getMessage("wantToSubmit") + " " + request.previousVideoID + "?", - message: chrome.i18n.getMessage("leftTimes"), - iconUrl: "./icons/LogoSponsorBlocker256px.png" - }); + if (Config.config.unsubmittedWarning) { + chrome.notifications.create("stillThere" + Math.random(), { + type: "basic", + title: chrome.i18n.getMessage("wantToSubmit") + " " + request.previousVideoID + "?", + message: chrome.i18n.getMessage("leftTimes"), + iconUrl: "./icons/LogoSponsorBlocker256px.png" + }); + } case "registerContentScript": registerFirefoxContentScript(request); return false; diff --git a/src/components/CategoryChooserComponent.tsx b/src/components/CategoryChooserComponent.tsx index 3ec272fa..1aa401c1 100644 --- a/src/components/CategoryChooserComponent.tsx +++ b/src/components/CategoryChooserComponent.tsx @@ -28,6 +28,26 @@ class CategoryChooserComponent extends React.Component + {/* Headers */} + + + {chrome.i18n.getMessage("category")} + + + + {chrome.i18n.getMessage("skipOption")} + + + + {chrome.i18n.getMessage("seekBarColor")} + + + + {chrome.i18n.getMessage("previewColor")} + + + {this.getCategorySkipOptions()} @@ -40,7 +60,6 @@ class CategoryChooserComponent extends React.Component ); diff --git a/src/components/CategorySkipOptionsComponent.tsx b/src/components/CategorySkipOptionsComponent.tsx index 58301d7b..0a44b172 100644 --- a/src/components/CategorySkipOptionsComponent.tsx +++ b/src/components/CategorySkipOptionsComponent.tsx @@ -2,14 +2,19 @@ import * as React from "react"; import Config from "../config" import { CategorySkipOption } from "../types"; +import Utils from "../utils"; + +const utils = new Utils(); export interface CategorySkipOptionsProps { category: string; - defaultColor: string; + defaultColor?: string; + defaultPreviewColor?: string; } export interface CategorySkipOptionsState { color: string; + previewColor: string; } class CategorySkipOptionsComponent extends React.Component { @@ -19,7 +24,8 @@ class CategorySkipOptionsComponent extends React.Component - - {chrome.i18n.getMessage("category_" + this.props.category)} - + <> + + + {chrome.i18n.getMessage("category_" + this.props.category)} + - - - + + + + + + this.setColorState(event, false)} + value={this.state.color} /> + - {/* TODO: Add colour chooser */} - + + this.setColorState(event, true)} + value={this.state.previewColor} /> + + + +

this.save()}> + {chrome.i18n.getMessage("save")} +
+ + + + + + + + {chrome.i18n.getMessage("category_" + this.props.category + "_description")} + + + + ); } @@ -112,7 +155,7 @@ class CategorySkipOptionsComponent extends React.Component, preview: boolean) { + if (preview) { + this.setState({ + previewColor: event.target.value + }); + } else { + this.setState({ + color: event.target.value + }); + } + } + + // Save text box data + save() { + // Validate colors + let checkVar = [this.state.color, this.state.previewColor] + for (const color of checkVar) { + if (color[0] !== "#" || (color.length !== 7 && color.length !== 4) || !utils.isHex(color.slice(1))) { + alert(chrome.i18n.getMessage("colorFormatIncorrect") + " " + color.slice(1) + " " + utils.isHex(color.slice(1)) + " " + utils.isHex("abcd123")); + return; + } + } + + // Save colors + Config.config.barTypes[this.props.category].color = this.state.color; + Config.config.barTypes["preview-" + this.props.category].color = this.state.previewColor; + // Make listener get called + Config.config.barTypes = Config.config.barTypes; + } } export default CategorySkipOptionsComponent; \ No newline at end of file diff --git a/src/components/NoticeTextSectionComponent.tsx b/src/components/NoticeTextSectionComponent.tsx index 839d7448..faed5704 100644 --- a/src/components/NoticeTextSectionComponent.tsx +++ b/src/components/NoticeTextSectionComponent.tsx @@ -2,7 +2,8 @@ import * as React from "react"; export interface NoticeTextSelectionProps { text: string, - idSuffix: string + idSuffix: string, + onClick?: (event: React.MouseEvent) => any } export interface NoticeTextSelectionState { @@ -16,8 +17,16 @@ class NoticeTextSelectionComponent extends React.Component {this.props.text}

diff --git a/src/components/SkipNoticeComponent.tsx b/src/components/SkipNoticeComponent.tsx index 7e6c4751..022490d0 100644 --- a/src/components/SkipNoticeComponent.tsx +++ b/src/components/SkipNoticeComponent.tsx @@ -31,6 +31,7 @@ export interface SkipNoticeState { noticeTitle: string; messages: string[]; + messageOnClick: (event: React.MouseEvent) => any; countdownTime: number; maxCountdownTime: () => number; @@ -73,7 +74,8 @@ class SkipNoticeComponent extends React.Component 1 ? "multipleSegments" : "category_" + this.segments[0].category); + let categoryName = chrome.i18n.getMessage(this.segments.length > 1 ? "multipleSegments" + : "category_" + this.segments[0].category + "_short") || chrome.i18n.getMessage("category_" + this.segments[0].category); let noticeTitle = categoryName + " " + chrome.i18n.getMessage("skipped"); if (!this.autoSkip) { noticeTitle = chrome.i18n.getMessage("skip") + " " + categoryName + "?"; @@ -104,6 +106,7 @@ class SkipNoticeComponent extends React.Component 4, @@ -131,6 +134,13 @@ class SkipNoticeComponent extends React.Component chrome.runtime.sendMessage({"message": "openConfig"}) + , chrome.i18n.getMessage("categoryUpdate1"), chrome.i18n.getMessage("categoryUpdate2")); + + Config.config.categoryUpdateShowCount = Config.config.categoryUpdateShowCount + 1 + } } render() { @@ -324,6 +334,7 @@ class SkipNoticeComponent extends React.Component ) @@ -504,6 +515,13 @@ class SkipNoticeComponent extends React.Component any, ...messages: string[]) { + this.setState({ + messages, + messageOnClick: (event) => onClick(event) + }); + } + setNoticeInfoMessage(...messages: string[]) { this.setState({ messages diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 73e9b422..52c1da0c 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -182,14 +182,23 @@ class SponsorTimeEditComponent extends React.Component + - + chrome.runtime.sendMessage({"message": "openConfig"})}> + + +
diff --git a/src/components/SubmissionNoticeComponent.tsx b/src/components/SubmissionNoticeComponent.tsx index a380fd73..a545c340 100644 --- a/src/components/SubmissionNoticeComponent.tsx +++ b/src/components/SubmissionNoticeComponent.tsx @@ -86,13 +86,20 @@ class SubmissionNoticeComponent extends React.Component - + {/* Last Row */} + {/* Guidelines button */} + + {/* Submit Button */}