mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-07 20:17:05 +03:00
Added "read the guidelines button.
This commit is contained in:
@@ -611,7 +611,11 @@
|
|||||||
"multipleSegments": {
|
"multipleSegments": {
|
||||||
"message": "Multiple Segments"
|
"message": "Multiple Segments"
|
||||||
},
|
},
|
||||||
"categoryGuidelines": {
|
"guidelines": {
|
||||||
"message": "Category Guidelines"
|
"message": "Guidelines"
|
||||||
|
},
|
||||||
|
"readTheGuidelines": {
|
||||||
|
"message": "Read The Guidelines!!",
|
||||||
|
"description": "Show the first time they submit or if they are \"high risk\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,6 +93,13 @@ class SubmissionNoticeComponent extends React.Component<SubmissionNoticeProps, S
|
|||||||
<td className="sponsorSkipNoticeRightSection"
|
<td className="sponsorSkipNoticeRightSection"
|
||||||
style={{position: "relative"}}>
|
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 */}
|
{/* Submit Button */}
|
||||||
<button className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeRightButton"
|
<button className="sponsorSkipObject sponsorSkipNoticeButton sponsorSkipNoticeRightButton"
|
||||||
onClick={this.submit.bind(this)}>
|
onClick={this.submit.bind(this)}>
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ interface SBConfig {
|
|||||||
minutesSaved: number,
|
minutesSaved: number,
|
||||||
skipCount: number,
|
skipCount: number,
|
||||||
sponsorTimesContributed: number,
|
sponsorTimesContributed: number,
|
||||||
|
submissionCountSinceCategories: number, // New count used to show the "Read The Guidelines!!" message
|
||||||
disableSkipping: boolean,
|
disableSkipping: boolean,
|
||||||
trackViewCount: boolean,
|
trackViewCount: boolean,
|
||||||
dontShowNotice: boolean,
|
dontShowNotice: boolean,
|
||||||
@@ -129,6 +130,7 @@ var Config: SBObject = {
|
|||||||
minutesSaved: 0,
|
minutesSaved: 0,
|
||||||
skipCount: 0,
|
skipCount: 0,
|
||||||
sponsorTimesContributed: 0,
|
sponsorTimesContributed: 0,
|
||||||
|
submissionCountSinceCategories: 0,
|
||||||
disableSkipping: false,
|
disableSkipping: false,
|
||||||
trackViewCount: true,
|
trackViewCount: true,
|
||||||
dontShowNotice: false,
|
dontShowNotice: false,
|
||||||
|
|||||||
@@ -1476,6 +1476,10 @@ async function sendSubmitMessage(){
|
|||||||
// Increase contribution count
|
// Increase contribution count
|
||||||
Config.config.sponsorTimesContributed = Config.config.sponsorTimesContributed + sponsorTimesSubmitting.length;
|
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
|
// Empty the submitting times
|
||||||
sponsorTimesSubmitting = [];
|
sponsorTimesSubmitting = [];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user