From da35e889f2d4d14395f0d4e2e857bd66f7e1a98a Mon Sep 17 00:00:00 2001 From: Ajay Date: Sat, 24 Sep 2022 22:29:07 -0400 Subject: [PATCH] Add option to disable segment names beside timestamp in video player --- public/_locales/en/messages.json | 3 +++ public/options/options.css | 4 ++-- .../options/CategorySkipOptionsComponent.tsx | 17 ++++++++++++++--- .../options/ToggleOptionComponent.tsx | 2 +- src/config.ts | 2 ++ src/js-components/previewBar.ts | 3 ++- 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 70d93913..52c07049 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -35,6 +35,9 @@ "message": "Render segments as chapters", "description": "Refers to drawing segments on the YouTube seek bar as split up chapters, similar to the existing chapter system" }, + "showSegmentNameInChapterBar": { + "message": "Show Current Segment Beside Video Time" + }, "upvoteButtonInfo": { "message": "Upvote this submission" }, diff --git a/public/options/options.css b/public/options/options.css index 588d6127..00035cd0 100644 --- a/public/options/options.css +++ b/public/options/options.css @@ -317,12 +317,12 @@ input[type='number'] { color: grey; } -.disabled .slider { +.sb-toggle-option.disabled .slider { cursor: default; } /* To hide everything except upsell button */ -.disabled td:not(.skipOption), .disabled td.skipOption > :not(.upsellButton) { +.disabled td:not(.skipOption, .categoryExtraOptions), .disabled td.skipOption > :not(.upsellButton) { opacity: 0.3; } diff --git a/src/components/options/CategorySkipOptionsComponent.tsx b/src/components/options/CategorySkipOptionsComponent.tsx index e1180e4b..a7aa55d9 100644 --- a/src/components/options/CategorySkipOptionsComponent.tsx +++ b/src/components/options/CategorySkipOptionsComponent.tsx @@ -5,7 +5,7 @@ import * as CompileConfig from "../../../config.json"; import { Category, CategorySkipOption } from "../../types"; import { getCategorySuffix } from "../../utils/categoryUtils"; -import ToggleOptionComponent, { ToggleOptionProps } from "./ToggleOptionComponent"; +import ToggleOptionComponent from "./ToggleOptionComponent"; import { fetchingChaptersAllowed } from "../../utils/licenseKey"; import LockSvg from "../../svg-icons/lock_svg"; @@ -21,6 +21,12 @@ export interface CategorySkipOptionsState { hideChapter: boolean; } +export interface ToggleOption { + configKey: string; + label: string; + dontDisable?: boolean; +} + class CategorySkipOptionsComponent extends React.Component { setBarColorTimeout: NodeJS.Timeout; @@ -237,7 +243,7 @@ class CategorySkipOptionsComponent extends React.Component @@ -248,12 +254,17 @@ class CategorySkipOptionsComponent extends React.Component +