add MkPreferenceContainer for our settings

This commit is contained in:
dakkar 2025-04-07 17:12:47 +01:00
parent c5aee8c92b
commit be3366d6db

View file

@ -141,21 +141,27 @@ SPDX-License-Identifier: AGPL-3.0-only
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['collapse', 'repl']"> <SearchMarker :keywords="['collapse', 'repl']">
<MkSwitch v-model="collapseNotesRepliedTo"> <MkPreferenceContainer k="collapseNotesRepliedTo">
<template #label><SearchLabel>{{ i18n.ts.collapseNotesRepliedTo }}</SearchLabel></template> <MkSwitch v-model="collapseNotesRepliedTo">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.collapseNotesRepliedTo }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['collapse', 'uncollapse', 'un-collapse', 'cw', 'content', 'warning']"> <SearchMarker :keywords="['collapse', 'uncollapse', 'un-collapse', 'cw', 'content', 'warning']">
<MkSwitch v-model="uncollapseCW"> <MkPreferenceContainer k="uncollapseCW">
<template #label><SearchLabel>{{ i18n.ts.uncollapseCW }}</SearchLabel></template> <MkSwitch v-model="uncollapseCW">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.uncollapseCW }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['expand', 'long']"> <SearchMarker :keywords="['expand', 'long']">
<MkSwitch v-model="expandLongNote"> <MkPreferenceContainer k="expandLongNote">
<template #label><SearchLabel>{{ i18n.ts.expandLongNote }}</SearchLabel></template> <MkSwitch v-model="expandLongNote">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.expandLongNote }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['note', 'timeline', 'gap']"> <SearchMarker :keywords="['note', 'timeline', 'gap']">
@ -184,40 +190,48 @@ SPDX-License-Identifier: AGPL-3.0-only
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['show', 'ticker', 'replies']"> <SearchMarker :keywords="['show', 'ticker', 'replies']">
<MkSwitch v-model="showTickerOnReplies"> <MkPreferenceContainer k="showTickerOnReplies">
<template #label>{{ i18n.ts.showTickerOnReplies }}</template> <MkSwitch v-model="showTickerOnReplies">
</MkSwitch> <template #label>{{ i18n.ts.showTickerOnReplies }}</template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['cat', 'speak']"> <SearchMarker :keywords="['cat', 'speak']">
<MkSwitch v-model="disableCatSpeak"> <MkPreferenceContainer k="disableCatSpeak">
<template #label><SearchLabel>{{ i18n.ts.disableCatSpeak }}</SearchLabel></template> <MkSwitch v-model="disableCatSpeak">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.disableCatSpeak }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['search', 'engine']"> <SearchMarker :keywords="['search', 'engine']">
<MkSelect v-model="searchEngine" placeholder="Other"> <MkPreferenceContainer k="searchEngine">
<template #label><SearchLabel>{{ i18n.ts.searchEngine }}</SearchLabel></template> <MkSelect v-model="searchEngine" placeholder="Other">
<option <template #label><SearchLabel>{{ i18n.ts.searchEngine }}</SearchLabel></template>
v-for="[key, value] in Object.entries(searchEngineMap)" :key="key" :value="key" <option
> v-for="[key, value] in Object.entries(searchEngineMap)" :key="key" :value="key"
{{ value }} >
</option> {{ value }}
<!-- If the user is on Other and enters a domain add this one so that the dropdown doesnt go blank --> </option>
<option v-if="useCustomSearchEngine" :value="searchEngine"> <!-- If the user is on Other and enters a domain add this one so that the dropdown doesnt go blank -->
{{ i18n.ts.searchEngineOther }} <option v-if="useCustomSearchEngine" :value="searchEngine">
</option> {{ i18n.ts.searchEngineOther }}
<!-- If one of the other options is selected show this as a blank other --> </option>
<option v-if="!useCustomSearchEngine" value="">{{ i18n.ts.searchEngineOther }}</option> <!-- If one of the other options is selected show this as a blank other -->
</MkSelect> <option v-if="!useCustomSearchEngine" value="">{{ i18n.ts.searchEngineOther }}</option>
</MkSelect>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['design', 'appear']"> <SearchMarker :keywords="['design', 'appear']">
<MkRadios v-model="noteDesign"> <MkPreferenceContainer k="noteDesign">
<template #label><SearchLabel>Note Design</SearchLabel></template> <MkRadios v-model="noteDesign">
<option value="sharkey"><i class="sk-icons sk-shark sk-icons-lg" style="top: 2px;position: relative;"></i> Sharkey</option> <template #label><SearchLabel>Note Design</SearchLabel></template>
<option value="misskey"><i class="sk-icons sk-misskey sk-icons-lg" style="top: 2px;position: relative;"></i> Misskey</option> <option value="sharkey"><i class="sk-icons sk-shark sk-icons-lg" style="top: 2px;position: relative;"></i> Sharkey</option>
</MkRadios> <option value="misskey"><i class="sk-icons sk-misskey sk-icons-lg" style="top: 2px;position: relative;"></i> Misskey</option>
</MkRadios>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
</div> </div>
@ -328,10 +342,12 @@ SPDX-License-Identifier: AGPL-3.0-only
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['number', 'replies']"> <SearchMarker :keywords="['number', 'replies']">
<MkRange v-model="numberOfReplies" :min="2" :max="20" :step="1" easing> <MkPreferenceContainer k="numberOfReplies">
<template #label><SearchLabel>{{ i18n.ts.numberOfReplies }}</SearchLabel></template> <MkRange v-model="numberOfReplies" :min="2" :max="20" :step="1" easing>
<template #caption>{{ i18n.ts.numberOfRepliesDescription }}</template> <template #label><SearchLabel>{{ i18n.ts.numberOfReplies }}</SearchLabel></template>
</MkRange> <template #caption>{{ i18n.ts.numberOfRepliesDescription }}</template>
</MkRange>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
</div> </div>
</div> </div>
@ -415,22 +431,26 @@ SPDX-License-Identifier: AGPL-3.0-only
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['click']"> <SearchMarker :keywords="['click']">
<MkSwitch v-model="notificationClickable"> <MkPreferenceContainer k="notificationClickable">
<template #label><SearchLabel>{{ i18n.ts.allowClickingNotifications }}</SearchLabel></template> <MkSwitch v-model="notificationClickable">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.allowClickingNotifications }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['favicon', 'dot']"> <SearchMarker :keywords="['favicon', 'dot']">
<MkSwitch v-model="enableFaviconNotificationDot"> <MkPreferenceContainer k="enableFaviconNotificationDot">
<template #label><SearchLabel>{{ i18n.ts.enableFaviconNotificationDot }}</SearchLabel></template> <MkSwitch v-model="enableFaviconNotificationDot">
<template #caption> <template #label><SearchLabel>{{ i18n.ts.enableFaviconNotificationDot }}</SearchLabel></template>
<I18n :src="i18n.ts.notificationDotNotWorkingAdvice" tag="span"> <template #caption>
<template #link> <I18n :src="i18n.ts.notificationDotNotWorkingAdvice" tag="span">
<template #link>
<MkLink url="https://docs.joinsharkey.org/docs/install/faqs/#ive-enabled-the-notification-dot-but-it-doesnt-show">{{ i18n.ts._mfm.link }}</MkLink> <MkLink url="https://docs.joinsharkey.org/docs/install/faqs/#ive-enabled-the-notification-dot-but-it-doesnt-show">{{ i18n.ts._mfm.link }}</MkLink>
</template> </template>
</I18n> </I18n>
</template> </template>
</MkSwitch> </MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<MkButton @click="testNotificationDot">{{ i18n.ts.verifyNotificationDotWorkingButton }}</MkButton> <MkButton @click="testNotificationDot">{{ i18n.ts.verifyNotificationDotWorkingButton }}</MkButton>
@ -705,23 +725,29 @@ SPDX-License-Identifier: AGPL-3.0-only
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['corner', 'radius']"> <SearchMarker :keywords="['corner', 'radius']">
<MkRadios v-model="cornerRadius"> <MkPreferenceContainer k="cornerRadius">
<template #label><SearchLabel>{{ i18n.ts.cornerRadius }}</SearchLabel></template> <MkRadios v-model="cornerRadius">
<option :value="null"><i class="sk-icons sk-shark sk-icons-lg" style="top: 2px;position: relative;"></i> Sharkey</option> <template #label><SearchLabel>{{ i18n.ts.cornerRadius }}</SearchLabel></template>
<option value="misskey"><i class="sk-icons sk-misskey sk-icons-lg" style="top: 2px;position: relative;"></i> Misskey</option> <option :value="null"><i class="sk-icons sk-shark sk-icons-lg" style="top: 2px;position: relative;"></i> Sharkey</option>
</MkRadios> <option value="misskey"><i class="sk-icons sk-misskey sk-icons-lg" style="top: 2px;position: relative;"></i> Misskey</option>
</MkRadios>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['warn', 'missing', 'alt', 'text']"> <SearchMarker :keywords="['warn', 'missing', 'alt', 'text']">
<MkSwitch v-model="warnMissingAltText"> <MkPreferenceContainer k="warnMissingAltText">
<template #label><SearchLabel>{{ i18n.ts.warnForMissingAltText }}</SearchLabel></template> <MkSwitch v-model="warnMissingAltText">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.warnForMissingAltText }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['warn', 'external', 'url']"> <SearchMarker :keywords="['warn', 'external', 'url']">
<MkSwitch v-model="warnExternalUrl"> <MkPreferenceContainer k="warnExternalUrl">
<template #label><SearchLabel>{{ i18n.ts.warnExternalUrl }}</SearchLabel></template> <MkSwitch v-model="warnExternalUrl">
</MkSwitch> <template #label><SearchLabel>{{ i18n.ts.warnExternalUrl }}</SearchLabel></template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['image', 'photo', 'picture', 'media', 'thumbnail', 'new', 'tab']"> <SearchMarker :keywords="['image', 'photo', 'picture', 'media', 'thumbnail', 'new', 'tab']">
@ -765,18 +791,22 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #label>{{ i18n.ts.boostSettings }}</template> <template #label>{{ i18n.ts.boostSettings }}</template>
<div class="_gaps_m"> <div class="_gaps_m">
<SearchMarker :keywords="['boost', 'show', 'visib', 'selector']"> <SearchMarker :keywords="['boost', 'show', 'visib', 'selector']">
<MkSwitch v-model="showVisibilitySelectorOnBoost"> <MkPreferenceContainer k="showVisibilitySelectorOnBoost">
<template #label><SearchLabel>{{ i18n.ts.showVisibilitySelectorOnBoost }}</SearchLabel></template> <MkSwitch v-model="showVisibilitySelectorOnBoost">
<template #caption>{{ i18n.ts.showVisibilitySelectorOnBoostDescription }}</template> <template #label><SearchLabel>{{ i18n.ts.showVisibilitySelectorOnBoost }}</SearchLabel></template>
</MkSwitch> <template #caption>{{ i18n.ts.showVisibilitySelectorOnBoostDescription }}</template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['boost', 'visib']"> <SearchMarker :keywords="['boost', 'visib']">
<MkSelect v-model="visibilityOnBoost"> <MkPreferenceContainer k="visibilityOnBoost">
<template #label><SearchLabel>{{ i18n.ts.visibilityOnBoost }}</SearchLabel></template> <MkSelect v-model="visibilityOnBoost">
<option value="public">{{ i18n.ts._visibility['public'] }}</option> <template #label><SearchLabel>{{ i18n.ts.visibilityOnBoost }}</SearchLabel></template>
<option value="home">{{ i18n.ts._visibility['home'] }}</option> <option value="public">{{ i18n.ts._visibility['public'] }}</option>
<option value="followers">{{ i18n.ts._visibility['followers'] }}</option> <option value="home">{{ i18n.ts._visibility['home'] }}</option>
</MkSelect> <option value="followers">{{ i18n.ts._visibility['followers'] }}</option>
</MkSelect>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
</div> </div>
</MkFolder> </MkFolder>
@ -790,9 +820,11 @@ SPDX-License-Identifier: AGPL-3.0-only
</SearchMarker> </SearchMarker>
<SearchMarker :keywords="['oneko', 'cat']"> <SearchMarker :keywords="['oneko', 'cat']">
<MkSwitch v-model="oneko"> <MkPreferenceContainer k="oneko">
<template #label>{{ i18n.ts.oneko }}</template> <MkSwitch v-model="oneko">
</MkSwitch> <template #label>{{ i18n.ts.oneko }}</template>
</MkSwitch>
</MkPreferenceContainer>
</SearchMarker> </SearchMarker>
<SearchMarker> <SearchMarker>