mirror of
https://github.com/ajayyy/SponsorBlock.git
synced 2025-12-09 21:17:20 +03:00
Add option to show categories you don't have permission to submit
This commit is contained in:
@@ -246,6 +246,12 @@
|
|||||||
"whatRefetchWhenNotFound": {
|
"whatRefetchWhenNotFound": {
|
||||||
"message": "If the video is new, and there are no segments found, it will keep refetching every few minutes while you watch."
|
"message": "If the video is new, and there are no segments found, it will keep refetching every few minutes while you watch."
|
||||||
},
|
},
|
||||||
|
"enableShowCategoryWithoutPermission": {
|
||||||
|
"message": "Show categories in submission menu even without submission permission"
|
||||||
|
},
|
||||||
|
"whatShowCategoryWithoutPermission": {
|
||||||
|
"message": "Some categories require permission to submit due to minimum reputation requirements"
|
||||||
|
},
|
||||||
"showNotice": {
|
"showNotice": {
|
||||||
"message": "Show Notice Again"
|
"message": "Show Notice Again"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -141,6 +141,20 @@
|
|||||||
<div class="small-description">__MSG_whatRefetchWhenNotFound__</div>
|
<div class="small-description">__MSG_whatRefetchWhenNotFound__</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div data-type="toggle" data-sync="showCategoryWithoutPermission">
|
||||||
|
<div class="switch-container">
|
||||||
|
<label class="switch">
|
||||||
|
<input id="showCategoryWithoutPermission" type="checkbox" checked>
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
<label class="switch-label" for="showCategoryWithoutPermission">
|
||||||
|
__MSG_enableShowCategoryWithoutPermission__
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="small-description">__MSG_whatShowCategoryWithoutPermission__</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="interface" class="option-group hidden">
|
<div id="interface" class="option-group hidden">
|
||||||
|
|||||||
@@ -404,8 +404,10 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
|
|||||||
for (const category of (this.props.categoryList ?? CompileConfig.categoryList)) {
|
for (const category of (this.props.categoryList ?? CompileConfig.categoryList)) {
|
||||||
// If permission not loaded, treat it like we have permission except chapter
|
// If permission not loaded, treat it like we have permission except chapter
|
||||||
const defaultBlockCategories = ["chapter"];
|
const defaultBlockCategories = ["chapter"];
|
||||||
const permission = Config.config.permissions[category as Category] && (category !== "chapter" || noRefreshFetchingChaptersAllowed());
|
const permission = (Config.config.showCategoryWithoutPermission
|
||||||
if ((defaultBlockCategories.includes(category) || permission !== undefined) && !permission) continue;
|
|| Config.config.permissions[category as Category]) && (category !== "chapter" || noRefreshFetchingChaptersAllowed());
|
||||||
|
if ((defaultBlockCategories.includes(category)
|
||||||
|
|| (permission !== undefined && !Config.config.showCategoryWithoutPermission)) && !permission) continue;
|
||||||
|
|
||||||
elements.push(
|
elements.push(
|
||||||
<option value={category}
|
<option value={category}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ interface SBConfig {
|
|||||||
darkMode: boolean,
|
darkMode: boolean,
|
||||||
showCategoryGuidelines: boolean,
|
showCategoryGuidelines: boolean,
|
||||||
chaptersAvailable: boolean,
|
chaptersAvailable: boolean,
|
||||||
|
showCategoryWithoutPermission: boolean,
|
||||||
|
|
||||||
// Used to cache calculated text color info
|
// Used to cache calculated text color info
|
||||||
categoryPillColors: {
|
categoryPillColors: {
|
||||||
@@ -195,6 +196,7 @@ const Config: SBObject = {
|
|||||||
darkMode: true,
|
darkMode: true,
|
||||||
showCategoryGuidelines: true,
|
showCategoryGuidelines: true,
|
||||||
chaptersAvailable: true,
|
chaptersAvailable: true,
|
||||||
|
showCategoryWithoutPermission: false,
|
||||||
|
|
||||||
categoryPillColors: {},
|
categoryPillColors: {},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user