mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-11 14:07:13 +03:00
Added end button to submission notice
This commit is contained in:
@@ -531,5 +531,8 @@
|
|||||||
},
|
},
|
||||||
"moreCategories": {
|
"moreCategories": {
|
||||||
"message": "More Categories"
|
"message": "More Categories"
|
||||||
|
},
|
||||||
|
"bracketEnd": {
|
||||||
|
"message": "(End)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,12 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
onClick={() => this.setTimeToNow(1)}>
|
onClick={() => this.setTimeToNow(1)}>
|
||||||
{chrome.i18n.getMessage("bracketNow")}
|
{chrome.i18n.getMessage("bracketNow")}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<span id={"endButton" + this.idSuffix}
|
||||||
|
className="sponsorNowButton"
|
||||||
|
onClick={() => this.setTimeToEnd()}>
|
||||||
|
{chrome.i18n.getMessage("bracketEnd")}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@@ -230,10 +236,18 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
}
|
}
|
||||||
|
|
||||||
setTimeToNow(index: number) {
|
setTimeToNow(index: number) {
|
||||||
|
this.setTimeTo(index, this.props.contentContainer().v.currentTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeToEnd() {
|
||||||
|
this.setTimeTo(1, this.props.contentContainer().v.duration);
|
||||||
|
}
|
||||||
|
|
||||||
|
setTimeTo(index: number, time: number) {
|
||||||
let sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
|
let sponsorTime = this.props.contentContainer().sponsorTimesSubmitting[this.props.index];
|
||||||
|
|
||||||
sponsorTime.segment[index] =
|
sponsorTime.segment[index] =
|
||||||
this.props.contentContainer().v.currentTime;
|
time;
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
sponsorTimeEdits: this.getFormattedSponsorTimesEdits(sponsorTime)
|
sponsorTimeEdits: this.getFormattedSponsorTimesEdits(sponsorTime)
|
||||||
|
|||||||
Reference in New Issue
Block a user