Add option to disable thumbnail icons

This commit is contained in:
Ajay
2023-03-18 02:05:14 -04:00
parent e15e33b048
commit 488f5efa2f
6 changed files with 27 additions and 2 deletions

View File

@@ -797,6 +797,10 @@
"message": "Show an icon when a video is entirely an advertisement", "message": "Show an icon when a video is entirely an advertisement",
"description": "Referring to the category pill that is now shown on videos that are entirely sponsor or entirely selfpromo" "description": "Referring to the category pill that is now shown on videos that are entirely sponsor or entirely selfpromo"
}, },
"fullVideoLabelsOnThumbnails": {
"message": "Show labels on video thumbnails as well",
"description": "Referring to the category pill that is shown on videos that are entirely sponsor or entirely selfpromo on recommended videos, in searches or on the homepage."
},
"previewColor": { "previewColor": {
"message": "Unsubmitted Color", "message": "Unsubmitted Color",
"description": "Referring to submissions that have not been sent to the server yet." "description": "Referring to submissions that have not been sent to the server yet."

View File

@@ -696,4 +696,9 @@ svg {
.upsellButton { .upsellButton {
cursor: pointer; cursor: pointer;
vertical-align: middle; vertical-align: middle;
}
.no-bottom-border {
border: none !important;
padding: 20px 0px 0px 0px !important;
} }

View File

@@ -78,7 +78,7 @@
</div> </div>
</div> </div>
<div data-type="toggle" data-sync="fullVideoSegments"> <div data-type="toggle" data-sync="fullVideoSegments" class="no-bottom-border">
<div class="switch-container"> <div class="switch-container">
<label class="switch"> <label class="switch">
<input id="fullVideoSegments" type="checkbox" checked> <input id="fullVideoSegments" type="checkbox" checked>
@@ -90,6 +90,19 @@
</div> </div>
</div> </div>
<div data-type="toggle" data-sync="fullVideoLabelsOnThumbnails"
data-dependent-on="fullVideoSegments">
<div class="switch-container">
<label class="switch">
<input id="fullVideoLabelsOnThumbnails" type="checkbox" checked>
<span class="slider round"></span>
</label>
<label class="switch-label" for="fullVideoLabelsOnThumbnails">
__MSG_fullVideoLabelsOnThumbnails__
</label>
</div>
</div>
<div data-type="number-change" data-sync="minDuration"> <div data-type="number-change" data-sync="minDuration">
<label class="number-container"> <label class="number-container">
<span class="optionLabel">__MSG_minDuration__</span> <span class="optionLabel">__MSG_minDuration__</span>

View File

@@ -27,6 +27,7 @@ interface SBConfig {
disableSkipping: boolean; disableSkipping: boolean;
muteSegments: boolean; muteSegments: boolean;
fullVideoSegments: boolean; fullVideoSegments: boolean;
fullVideoLabelsOnThumbnails: boolean;
manualSkipOnFullVideo: boolean; manualSkipOnFullVideo: boolean;
trackViewCount: boolean; trackViewCount: boolean;
trackViewCountInPrivate: boolean; trackViewCountInPrivate: boolean;
@@ -258,6 +259,7 @@ const syncDefaults = {
disableSkipping: false, disableSkipping: false,
muteSegments: true, muteSegments: true,
fullVideoSegments: true, fullVideoSegments: true,
fullVideoLabelsOnThumbnails: true,
manualSkipOnFullVideo: false, manualSkipOnFullVideo: false,
trackViewCount: true, trackViewCount: true,
trackViewCountInPrivate: true, trackViewCountInPrivate: true,

View File

@@ -345,6 +345,7 @@ function contentConfigUpdateListener(changes: StorageChangesObject) {
setCategoryColorCSSVariables(); setCategoryColorCSSVariables();
break; break;
case "fullVideoSegments": case "fullVideoSegments":
case "fullVideoLabelsOnThumbnails":
updateAll(); updateAll();
break; break;
} }

View File

@@ -9,7 +9,7 @@ export async function labelThumbnails(thumbnails: HTMLImageElement[]): Promise<v
} }
export async function labelThumbnail(thumbnail: HTMLImageElement): Promise<HTMLElement | null> { export async function labelThumbnail(thumbnail: HTMLImageElement): Promise<HTMLElement | null> {
if (!Config.config?.fullVideoSegments) { if (!Config.config?.fullVideoSegments || !Config.config?.fullVideoLabelsOnThumbnails) {
hideThumbnailLabel(thumbnail); hideThumbnailLabel(thumbnail);
return null; return null;
} }