mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-16 08:27:03 +03:00
Formatting fixes and add locales
This commit is contained in:
Submodule public/_locales updated: 0285b87951...89f31bcf2d
@@ -58,12 +58,10 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const segmentsWithNesting: segmentWithNesting[] = []
|
const segmentsWithNesting: segmentWithNesting[] = [];
|
||||||
let nbTrailingNonChapters = 0
|
let nbTrailingNonChapters = 0;
|
||||||
function nestChapters(segments: segmentWithNesting[], seg: SponsorTime, topLevel?:boolean){
|
function nestChapters(segments: segmentWithNesting[], seg: SponsorTime, topLevel?: boolean) {
|
||||||
if (seg.actionType === ActionType.Chapter
|
if (seg.actionType === ActionType.Chapter && segments.length) {
|
||||||
&& segments.length)
|
|
||||||
{
|
|
||||||
// trailing non-chapters can only exist at top level
|
// trailing non-chapters can only exist at top level
|
||||||
const lastElement = segments[segments.length - (topLevel ? nbTrailingNonChapters + 1 : 1)]
|
const lastElement = segments[segments.length - (topLevel ? nbTrailingNonChapters + 1 : 1)]
|
||||||
|
|
||||||
@@ -75,18 +73,22 @@ export const SegmentListComponent = (props: SegmentListComponentProps) => {
|
|||||||
} else {
|
} else {
|
||||||
lastElement.innerChapters = [seg];
|
lastElement.innerChapters = [seg];
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (topLevel) {
|
||||||
|
nbTrailingNonChapters = 0;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if (topLevel){nbTrailingNonChapters = 0}
|
|
||||||
segments.push(seg);
|
segments.push(seg);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (seg.actionType !== ActionType.Chapter){nbTrailingNonChapters++}
|
if (seg.actionType !== ActionType.Chapter) {
|
||||||
|
nbTrailingNonChapters++;
|
||||||
|
}
|
||||||
|
|
||||||
segments.push(seg);
|
segments.push(seg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
props.segments.forEach((seg) => {nestChapters(segmentsWithNesting, {...seg}, true)})
|
props.segments.forEach((seg) => nestChapters(segmentsWithNesting, {...seg}, true));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div id="issueReporterContainer">
|
<div id="issueReporterContainer">
|
||||||
@@ -160,7 +162,6 @@ function SegmentListItem({ segment, videoID, currentTime, isVip, loopedChapter,
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={"segmentWrapper " + (!tabFilter(segment) ? "hidden" : "")}>
|
<div className={"segmentWrapper " + (!tabFilter(segment) ? "hidden" : "")}>
|
||||||
{
|
|
||||||
<details data-uuid={segment.UUID}
|
<details data-uuid={segment.UUID}
|
||||||
onDoubleClick={() => skipSegment({
|
onDoubleClick={() => skipSegment({
|
||||||
segment,
|
segment,
|
||||||
@@ -250,7 +251,6 @@ function SegmentListItem({ segment, videoID, currentTime, isVip, loopedChapter,
|
|||||||
stopAnimation();
|
stopAnimation();
|
||||||
}
|
}
|
||||||
|
|
||||||
stopAnimation();
|
|
||||||
}}/>
|
}}/>
|
||||||
{
|
{
|
||||||
segment.actionType === ActionType.Chapter &&
|
segment.actionType === ActionType.Chapter &&
|
||||||
@@ -325,7 +325,7 @@ function SegmentListItem({ segment, videoID, currentTime, isVip, loopedChapter,
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
}
|
|
||||||
{
|
{
|
||||||
segment.innerChapters
|
segment.innerChapters
|
||||||
&& <InnerChapterList
|
&& <InnerChapterList
|
||||||
|
|||||||
Reference in New Issue
Block a user