mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-06 11:37:02 +03:00
Added "read the guidelines button.
This commit is contained in:
@@ -611,7 +611,11 @@
|
||||
"multipleSegments": {
|
||||
"message": "Multiple Segments"
|
||||
},
|
||||
"categoryGuidelines": {
|
||||
"message": "Category Guidelines"
|
||||
"guidelines": {
|
||||
"message": "Guidelines"
|
||||
},
|
||||
"readTheGuidelines": {
|
||||
"message": "Read The Guidelines!!",
|
||||
"description": "Show the first time they submit or if they are \"high risk\""
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)}>
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user