aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAjay Ramachandran <[email protected]>2021-08-17 18:37:59 -0400
committerAjay Ramachandran <[email protected]>2021-08-17 18:37:59 -0400
commit42beaf698c0e99ba0e8e3522e2ee46238eb5fe56 (patch)
treeaccb8d19cf9e0cdc7ea3bc0443369ed00941d93c
parent4e99754b8c651a84ec6087498e991aba65f2ebfe (diff)
downloadSponsorBlock-42beaf698c0e99ba0e8e3522e2ee46238eb5fe56.tar.gz
SponsorBlock-42beaf698c0e99ba0e8e3522e2ee46238eb5fe56.zip
Make highlight larger on preview bar
-rw-r--r--src/content.ts3
-rw-r--r--src/js-components/previewBar.ts5
2 files changed, 5 insertions, 3 deletions
diff --git a/src/content.ts b/src/content.ts
index df1fcb18..3039e730 100644
--- a/src/content.ts
+++ b/src/content.ts
@@ -827,7 +827,6 @@ function updatePreviewBar(): void {
if (video === null) return;
const previewBarSegments: PreviewBarSegment[] = [];
-
if (sponsorTimes) {
sponsorTimes.forEach((segment) => {
if (segment.hidden !== SponsorHideType.Visible) return;
@@ -836,6 +835,7 @@ function updatePreviewBar(): void {
segment: segment.segment as [number, number],
category: segment.category,
unsubmitted: false,
+ showLarger: utils.getCategoryActionType(segment.category) === CategoryActionType.POI
});
});
}
@@ -845,6 +845,7 @@ function updatePreviewBar(): void {
segment: segment.segment as [number, number],
category: segment.category,
unsubmitted: true,
+ showLarger: utils.getCategoryActionType(segment.category) === CategoryActionType.POI
});
});
diff --git a/src/js-components/previewBar.ts b/src/js-components/previewBar.ts
index fd7476a1..c71c3c81 100644
--- a/src/js-components/previewBar.ts
+++ b/src/js-components/previewBar.ts
@@ -15,6 +15,7 @@ export interface PreviewBarSegment {
segment: [number, number];
category: string;
unsubmitted: boolean;
+ showLarger: boolean;
}
class PreviewBar {
@@ -182,10 +183,10 @@ class PreviewBar {
});
}
- createBar({category, unsubmitted, segment}: PreviewBarSegment): HTMLLIElement {
+ createBar({category, unsubmitted, segment, showLarger}: PreviewBarSegment): HTMLLIElement {
const bar = document.createElement('li');
bar.classList.add('previewbar');
- bar.innerHTML = '&nbsp;';
+ bar.innerHTML = showLarger ? '&nbsp;&nbsp;' : '&nbsp;';
const fullCategoryName = (unsubmitted ? 'preview-' : '') + category;
bar.setAttribute('sponsorblock-category', fullCategoryName);