diff options
author | Ajay Ramachandran <[email protected]> | 2022-11-29 16:03:35 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2022-11-29 16:03:35 -0500 |
commit | 53713cd2e7f9b24ef05594fda3eef8ba25aea7bf (patch) | |
tree | 1f093d0786fd8162a96b46883b2e9aac97d6f10f | |
parent | 5925d45f74e1eedac4cb68ac7f111f16112116c4 (diff) | |
parent | a1e00b44d52f042bada2e3fb4f2a50a321e126a8 (diff) | |
download | SponsorBlock-53713cd2e7f9b24ef05594fda3eef8ba25aea7bf.tar.gz SponsorBlock-53713cd2e7f9b24ef05594fda3eef8ba25aea7bf.zip |
Merge pull request #1578 from caneleex/patch/disable-scrolling
Add option to disable scrolling to edit
-rw-r--r-- | public/_locales/en/messages.json | 3 | ||||
-rw-r--r-- | public/options/options.html | 12 | ||||
-rw-r--r-- | src/components/SponsorTimeEditComponent.tsx | 1 | ||||
-rw-r--r-- | src/config.ts | 2 |
4 files changed, 18 insertions, 0 deletions
diff --git a/public/_locales/en/messages.json b/public/_locales/en/messages.json index 7a5dd69b..21b7a048 100644 --- a/public/_locales/en/messages.json +++ b/public/_locales/en/messages.json @@ -1249,5 +1249,8 @@ }, "segmentFetchFailureWarning": { "message": "Warning: The server hasn't responded with segments yet. There might actually be segments on this video already submitted but you just haven't recieved them due to issues with the server." + }, + "allowScrollingToEdit": { + "message": "Allow Scrolling To Edit Times" } } diff --git a/public/options/options.html b/public/options/options.html index 91112941..8128e284 100644 --- a/public/options/options.html +++ b/public/options/options.html @@ -277,6 +277,18 @@ </label> </div> </div> + + <div data-type="toggle" data-sync="allowScrollingToEdit"> + <div class="switch-container"> + <label class="switch"> + <input id="allowScrollingToEdit" type="checkbox" checked> + <span class="slider round"></span> + </label> + <label class="switch-label" for="allowScrollingToEdit"> + __MSG_allowScrollingToEdit__ + </label> + </div> + </div> <div data-type="toggle" data-sync="audioNotificationOnSkip"> <div class="switch-container"> diff --git a/src/components/SponsorTimeEditComponent.tsx b/src/components/SponsorTimeEditComponent.tsx index 84b69cbf..01bee538 100644 --- a/src/components/SponsorTimeEditComponent.tsx +++ b/src/components/SponsorTimeEditComponent.tsx @@ -320,6 +320,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo } changeTimesWhenScrolling(index: number, e: React.WheelEvent, sponsorTime: SponsorTime): void { + if (!Config.config.allowScrollingToEdit) return; let step = 0; // shift + ctrl = 1 // ctrl = 0.1 diff --git a/src/config.ts b/src/config.ts index ba3caf85..bb4d5854 100644 --- a/src/config.ts +++ b/src/config.ts @@ -69,6 +69,7 @@ interface SBConfig { showSegmentNameInChapterBar: boolean; useVirtualTime: boolean; showSegmentFailedToFetchWarning: boolean; + allowScrollingToEdit: boolean; // Used to cache calculated text color info categoryPillColors: { @@ -204,6 +205,7 @@ const Config: SBObject = { showSegmentNameInChapterBar: true, useVirtualTime: true, showSegmentFailedToFetchWarning: true, + allowScrollingToEdit: true, categoryPillColors: {}, |