replace confusing "always show ads" setting with "hide ads"
This commit is contained in:
parent
57450fd8b8
commit
b6b87b320e
6 changed files with 16 additions and 6 deletions
4
locales/index.d.ts
vendored
4
locales/index.d.ts
vendored
|
|
@ -13403,6 +13403,10 @@ export interface Locale extends ILocale {
|
||||||
* Custom font size
|
* Custom font size
|
||||||
*/
|
*/
|
||||||
"customFontSize": string;
|
"customFontSize": string;
|
||||||
|
/**
|
||||||
|
* Hide ads
|
||||||
|
*/
|
||||||
|
"hideAds": string;
|
||||||
}
|
}
|
||||||
declare const locales: {
|
declare const locales: {
|
||||||
[lang: string]: Locale;
|
[lang: string]: Locale;
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
|
|
||||||
const renderChildren = () => {
|
const renderChildren = () => {
|
||||||
const shouldHideAds = (!prefer.s.forceShowAds && $i && $i.policies.canHideAds) ?? false;
|
const shouldHideAds = prefer.s.hideAds && $i != null && $i.policies.canHideAds;
|
||||||
|
|
||||||
const children = renderChildrenImpl(shouldHideAds);
|
const children = renderChildrenImpl(shouldHideAds);
|
||||||
if (isDebuggerEnabled(6864)) {
|
if (isDebuggerEnabled(6864)) {
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ const chosen = ref(choseAd());
|
||||||
|
|
||||||
const self = computed(() => chosen.value?.url.startsWith(local));
|
const self = computed(() => chosen.value?.url.startsWith(local));
|
||||||
|
|
||||||
const shouldHide = ref(!prefer.s.forceShowAds && $i && $i.policies.canHideAds && (props.specify == null));
|
const shouldHide = computed(() => prefer.s.hideAds && $i != null && $i.policies.canHideAds && (props.specify == null));
|
||||||
|
|
||||||
function reduceFrequency(): void {
|
function reduceFrequency(): void {
|
||||||
if (chosen.value == null) return;
|
if (chosen.value == null) return;
|
||||||
|
|
|
||||||
|
|
@ -913,10 +913,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
</SearchMarker>
|
</SearchMarker>
|
||||||
|
|
||||||
<SearchMarker :keywords="['ad', 'show']">
|
<SearchMarker v-if="$i.policies.canHideAds" :keywords="['ad', 'hide']">
|
||||||
<MkPreferenceContainer k="forceShowAds">
|
<MkPreferenceContainer k="hideAds">
|
||||||
<MkSwitch v-model="forceShowAds">
|
<MkSwitch v-model="hideAds">
|
||||||
<template #label><SearchLabel>{{ i18n.ts.forceShowAds }}</SearchLabel></template>
|
<template #label><SearchLabel>{{ i18n.ts.hideAds }}</SearchLabel></template>
|
||||||
</MkSwitch>
|
</MkSwitch>
|
||||||
</MkPreferenceContainer>
|
</MkPreferenceContainer>
|
||||||
</SearchMarker>
|
</SearchMarker>
|
||||||
|
|
@ -1096,6 +1096,7 @@ const trustedDomains = prefer.model(
|
||||||
(domainsList) => domainsList.join('\n'),
|
(domainsList) => domainsList.join('\n'),
|
||||||
(domainsString) => domainsString.split('\n').map( d => d.trim() ).filter( x => x.length > 0),
|
(domainsString) => domainsString.split('\n').map( d => d.trim() ).filter( x => x.length > 0),
|
||||||
);
|
);
|
||||||
|
const hideAds = prefer.model('hideAds');
|
||||||
|
|
||||||
watch([
|
watch([
|
||||||
hemisphere,
|
hemisphere,
|
||||||
|
|
|
||||||
|
|
@ -480,6 +480,9 @@ export const PREF_DEF = {
|
||||||
warnMissingAltText: {
|
warnMissingAltText: {
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
hideAds: {
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region hybrid options
|
//#region hybrid options
|
||||||
|
|
|
||||||
|
|
@ -661,3 +661,5 @@ clearCachedFilesOptions:
|
||||||
keepFilesInUseDescription: "this option requires more complicated database queries, you may need to increase the value of db.extra.statement_timeout in the configuration file"
|
keepFilesInUseDescription: "this option requires more complicated database queries, you may need to increase the value of db.extra.statement_timeout in the configuration file"
|
||||||
|
|
||||||
customFontSize: "Custom font size"
|
customFontSize: "Custom font size"
|
||||||
|
|
||||||
|
hideAds: "Hide ads"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue