2020-10-17 11:12:00 +00:00
|
|
|
<template>
|
2020-11-25 12:31:34 +00:00
|
|
|
<FormBase>
|
2020-12-29 02:47:36 +00:00
|
|
|
<FormSwitch v-model:value="titlebar">{{ $ts.showTitlebar }}</FormSwitch>
|
2020-12-26 01:47:36 +00:00
|
|
|
<FormSwitch v-model:value="showFixedPostForm">{{ $ts.showFixedPostForm }}</FormSwitch>
|
2020-11-25 12:31:34 +00:00
|
|
|
|
|
|
|
<FormSelect v-model:value="lang">
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.uiLanguage }}</template>
|
2020-11-25 12:31:34 +00:00
|
|
|
<option v-for="x in langs" :value="x[0]" :key="x[0]">{{ x[1] }}</option>
|
|
|
|
<template #caption>
|
2020-12-26 01:47:36 +00:00
|
|
|
<I18n :src="$ts.i18nInfo" tag="span">
|
2020-11-25 12:31:34 +00:00
|
|
|
<template #link>
|
|
|
|
<MkLink url="https://crowdin.com/project/misskey">Crowdin</MkLink>
|
|
|
|
</template>
|
2020-12-26 01:01:32 +00:00
|
|
|
</I18n>
|
2020-11-25 12:31:34 +00:00
|
|
|
</template>
|
|
|
|
</FormSelect>
|
|
|
|
|
|
|
|
<FormGroup>
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.behavior }}</template>
|
|
|
|
<FormSwitch v-model:value="imageNewTab">{{ $ts.openImageInNewTab }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="enableInfiniteScroll">{{ $ts.enableInfiniteScroll }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="disablePagesScript">{{ $ts.disablePagesScript }}</FormSwitch>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormSelect v-model:value="serverDisconnectedBehavior">
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.whenServerDisconnected }}</template>
|
|
|
|
<option value="reload">{{ $ts._serverDisconnectedBehavior.reload }}</option>
|
|
|
|
<option value="dialog">{{ $ts._serverDisconnectedBehavior.dialog }}</option>
|
|
|
|
<option value="quiet">{{ $ts._serverDisconnectedBehavior.quiet }}</option>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormSelect>
|
|
|
|
|
|
|
|
<FormGroup>
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.appearance }}</template>
|
|
|
|
<FormSwitch v-model:value="disableAnimatedMfm">{{ $ts.disableAnimatedMfm }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="reduceAnimation">{{ $ts.reduceUiAnimation }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="useBlurEffectForModal">{{ $ts.useBlurEffectForModal }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="showGapBetweenNotesInTimeline">{{ $ts.showGapBetweenNotesInTimeline }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="loadRawImages">{{ $ts.loadRawImages }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="disableShowingAnimatedImages">{{ $ts.disableShowingAnimatedImages }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="useSystemFont">{{ $ts.useSystemFont }}</FormSwitch>
|
|
|
|
<FormSwitch v-model:value="useOsNativeEmojis">{{ $ts.useOsNativeEmojis }}
|
2020-12-19 01:55:52 +00:00
|
|
|
<div><Mfm text="🍮🍦🍭🍩🍰🍫🍬🥞🍪" :key="useOsNativeEmojis"/></div>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormSwitch>
|
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormRadios v-model="fontSize">
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #desc>{{ $ts.fontSize }}</template>
|
2020-11-25 12:31:34 +00:00
|
|
|
<option value="small"><span style="font-size: 14px;">Aa</span></option>
|
|
|
|
<option :value="null"><span style="font-size: 16px;">Aa</span></option>
|
|
|
|
<option value="large"><span style="font-size: 18px;">Aa</span></option>
|
|
|
|
<option value="veryLarge"><span style="font-size: 20px;">Aa</span></option>
|
|
|
|
</FormRadios>
|
|
|
|
|
|
|
|
<FormSelect v-model:value="instanceTicker">
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.instanceTicker }}</template>
|
|
|
|
<option value="none">{{ $ts._instanceTicker.none }}</option>
|
|
|
|
<option value="remote">{{ $ts._instanceTicker.remote }}</option>
|
|
|
|
<option value="always">{{ $ts._instanceTicker.always }}</option>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormSelect>
|
|
|
|
|
|
|
|
<FormSelect v-model:value="nsfw">
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.nsfw }}</template>
|
|
|
|
<option value="respect">{{ $ts._nsfw.respect }}</option>
|
|
|
|
<option value="ignore">{{ $ts._nsfw.ignore }}</option>
|
|
|
|
<option value="force">{{ $ts._nsfw.force }}</option>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormSelect>
|
|
|
|
|
|
|
|
<FormGroup>
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.defaultNavigationBehaviour }}</template>
|
|
|
|
<FormSwitch v-model:value="defaultSideView">{{ $ts.openInSideView }}</FormSwitch>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormSelect v-model:value="chatOpenBehavior">
|
2020-12-26 01:47:36 +00:00
|
|
|
<template #label>{{ $ts.chatOpenBehavior }}</template>
|
|
|
|
<option value="page">{{ $ts.showInPage }}</option>
|
|
|
|
<option value="window">{{ $ts.openInWindow }}</option>
|
|
|
|
<option value="popout">{{ $ts.popout }}</option>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormSelect>
|
|
|
|
|
2020-12-26 01:47:36 +00:00
|
|
|
<FormLink to="/settings/deck">{{ $ts.deck }}</FormLink>
|
2020-11-25 12:31:34 +00:00
|
|
|
</FormBase>
|
2020-10-17 11:12:00 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
|
|
|
import { faImage, faCog, faColumns, faCogs } from '@fortawesome/free-solid-svg-icons';
|
2020-11-25 12:31:34 +00:00
|
|
|
import FormSwitch from '@/components/form/switch.vue';
|
|
|
|
import FormSelect from '@/components/form/select.vue';
|
|
|
|
import FormRadios from '@/components/form/radios.vue';
|
|
|
|
import FormBase from '@/components/form/base.vue';
|
|
|
|
import FormGroup from '@/components/form/group.vue';
|
|
|
|
import FormLink from '@/components/form/link.vue';
|
|
|
|
import FormButton from '@/components/form/button.vue';
|
|
|
|
import MkLink from '@/components/link.vue';
|
2020-10-17 11:12:00 +00:00
|
|
|
import { langs } from '@/config';
|
2020-12-19 01:55:52 +00:00
|
|
|
import { defaultStore } from '@/store';
|
|
|
|
import { ColdDeviceStorage } from '@/store';
|
2020-12-28 08:18:13 +00:00
|
|
|
import * as os from '@/os';
|
2020-10-17 11:12:00 +00:00
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
2020-11-25 12:31:34 +00:00
|
|
|
MkLink,
|
|
|
|
FormSwitch,
|
|
|
|
FormSelect,
|
|
|
|
FormRadios,
|
|
|
|
FormBase,
|
|
|
|
FormGroup,
|
|
|
|
FormLink,
|
|
|
|
FormButton,
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
INFO: {
|
2020-12-26 01:47:36 +00:00
|
|
|
title: this.$ts.general,
|
2020-11-03 11:36:12 +00:00
|
|
|
icon: faCogs
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
langs,
|
|
|
|
lang: localStorage.getItem('lang'),
|
|
|
|
fontSize: localStorage.getItem('fontSize'),
|
2020-11-28 04:05:57 +00:00
|
|
|
useSystemFont: localStorage.getItem('useSystemFont') != null,
|
2020-10-17 11:12:00 +00:00
|
|
|
faImage, faCog, faColumns
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
2020-12-19 01:55:52 +00:00
|
|
|
serverDisconnectedBehavior: defaultStore.makeGetterSetter('serverDisconnectedBehavior'),
|
|
|
|
reduceAnimation: defaultStore.makeGetterSetter('animation', v => !v, v => !v),
|
|
|
|
useBlurEffectForModal: defaultStore.makeGetterSetter('useBlurEffectForModal'),
|
|
|
|
showGapBetweenNotesInTimeline: defaultStore.makeGetterSetter('showGapBetweenNotesInTimeline'),
|
|
|
|
disableAnimatedMfm: defaultStore.makeGetterSetter('animatedMfm', v => !v, v => !v),
|
|
|
|
useOsNativeEmojis: defaultStore.makeGetterSetter('useOsNativeEmojis'),
|
|
|
|
disableShowingAnimatedImages: defaultStore.makeGetterSetter('disableShowingAnimatedImages'),
|
|
|
|
loadRawImages: defaultStore.makeGetterSetter('loadRawImages'),
|
2020-12-29 02:47:36 +00:00
|
|
|
titlebar: defaultStore.makeGetterSetter('titlebar'),
|
2020-12-19 01:55:52 +00:00
|
|
|
imageNewTab: defaultStore.makeGetterSetter('imageNewTab'),
|
|
|
|
nsfw: defaultStore.makeGetterSetter('nsfw'),
|
|
|
|
disablePagesScript: defaultStore.makeGetterSetter('disablePagesScript'),
|
|
|
|
showFixedPostForm: defaultStore.makeGetterSetter('showFixedPostForm'),
|
|
|
|
defaultSideView: defaultStore.makeGetterSetter('defaultSideView'),
|
|
|
|
chatOpenBehavior: ColdDeviceStorage.makeGetterSetter('chatOpenBehavior'),
|
|
|
|
instanceTicker: defaultStore.makeGetterSetter('instanceTicker'),
|
|
|
|
enableInfiniteScroll: defaultStore.makeGetterSetter('enableInfiniteScroll'),
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
lang() {
|
|
|
|
localStorage.setItem('lang', this.lang);
|
2020-12-26 06:27:39 +00:00
|
|
|
localStorage.removeItem('locale');
|
2020-12-28 08:18:13 +00:00
|
|
|
this.reloadAsk();
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
fontSize() {
|
|
|
|
if (this.fontSize == null) {
|
|
|
|
localStorage.removeItem('fontSize');
|
|
|
|
} else {
|
|
|
|
localStorage.setItem('fontSize', this.fontSize);
|
|
|
|
}
|
2020-12-28 08:18:13 +00:00
|
|
|
this.reloadAsk();
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
|
2020-11-28 04:05:57 +00:00
|
|
|
useSystemFont() {
|
|
|
|
if (this.useSystemFont) {
|
|
|
|
localStorage.setItem('useSystemFont', 't');
|
|
|
|
} else {
|
|
|
|
localStorage.removeItem('useSystemFont');
|
|
|
|
}
|
2020-12-28 08:18:13 +00:00
|
|
|
this.reloadAsk();
|
2020-11-28 04:05:57 +00:00
|
|
|
},
|
|
|
|
|
2020-10-17 11:12:00 +00:00
|
|
|
enableInfiniteScroll() {
|
2020-12-28 08:18:13 +00:00
|
|
|
this.reloadAsk();
|
|
|
|
},
|
|
|
|
|
|
|
|
showGapBetweenNotesInTimeline() {
|
|
|
|
this.reloadAsk();
|
2020-10-17 11:12:00 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
this.$emit('info', this.INFO);
|
|
|
|
},
|
2020-12-28 08:18:13 +00:00
|
|
|
|
|
|
|
methods: {
|
|
|
|
async reloadAsk() {
|
|
|
|
const { canceled } = await os.dialog({
|
|
|
|
type: 'info',
|
|
|
|
text: this.$ts.reloadToApplySetting,
|
|
|
|
showCancelButton: true
|
|
|
|
});
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
location.reload();
|
|
|
|
}
|
|
|
|
}
|
2020-10-17 11:12:00 +00:00
|
|
|
});
|
|
|
|
</script>
|