aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2020-06-05 21:38:38 -0400
committerAjay Ramachandran <[email protected]>2020-06-05 21:38:38 -0400
commit89cc6ed18496f580207a99283486a572fe98a5d4 (patch)
tree327c2dfb4755a7c2514c5d5ad89a62069f2e6dd9 /src
parent730d9660192e5d9813f8946238984bcf4c28de40 (diff)
downloadSponsorBlock-89cc6ed18496f580207a99283486a572fe98a5d4.tar.gz
SponsorBlock-89cc6ed18496f580207a99283486a572fe98a5d4.zip
Added "read the guidelines button.
Diffstat (limited to 'src')
-rw-r--r--src/components/SubmissionNoticeComponent.tsx9
-rw-r--r--src/config.ts2
-rw-r--r--src/content.ts4
3 files changed, 14 insertions, 1 deletions
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<SubmissionNoticeProps, S
{this.getSponsorTimeMessages()}
</td>
</tr>
-
+
{/* Last Row */}
<tr id={"sponsorSkipNoticeSecondRow" + this.state.idSuffix}>
<td className="sponsorSkipNoticeRightSection"
style={{position: "relative"}}>
+ {/* Guidelines button */}
+ <button className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeRightButton"
+ onClick={() => window.open("https://github.com/ajayyy/SponsorBlock/wiki/Guidelines")}>
+
+ {chrome.i18n.getMessage(Config.config.submissionCountSinceCategories > 3 ? "guidelines" : "readTheGuidelines")}
+ </button>
+
{/* Submit Button */}
<button className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeRightButton"
onClick={this.submit.bind(this)}>
diff --git a/src/config.ts b/src/config.ts
index ce7efc91..2e82d4f1 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -14,6 +14,7 @@ interface SBConfig {
minutesSaved: number,
skipCount: number,
sponsorTimesContributed: number,
+ submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
disableSkipping: boolean,
trackViewCount: boolean,
dontShowNotice: boolean,
@@ -129,6 +130,7 @@ var Config: SBObject = {
minutesSaved: 0,
skipCount: 0,
sponsorTimesContributed: 0,
+ submissionCountSinceCategories: 0,
disableSkipping: false,
trackViewCount: true,
dontShowNotice: false,
diff --git a/src/content.ts b/src/content.ts
index 737aab23..c2642333 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -1476,6 +1476,10 @@ async function sendSubmitMessage(){
// Increase contribution count
Config.config.sponsorTimesContributed = Config.config.sponsorTimesContributed + sponsorTimesSubmitting.length;
+ // New count just used to see if a warning "Read The Guidelines!!" message needs to be shown
+ // One per time submitting
+ Config.config.submissionCountSinceCategories = Config.config.submissionCountSinceCategories + 1;
+
// Empty the submitting times
sponsorTimesSubmitting = [];