mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-02-11 05:45:01 +09:00
ソフトワードミュートのミュート文字列表示を切り替え可能に
This commit is contained in:
parent
6b1cc0c0f2
commit
4e4cd6a7d9
4
locales/index.d.ts
vendored
4
locales/index.d.ts
vendored
@ -2758,6 +2758,10 @@ export interface Locale extends ILocale {
|
|||||||
* ハードワードミュート
|
* ハードワードミュート
|
||||||
*/
|
*/
|
||||||
"hardWordMute": string;
|
"hardWordMute": string;
|
||||||
|
/**
|
||||||
|
* ミュートされたワードを表示
|
||||||
|
*/
|
||||||
|
"showMutedWord": string;
|
||||||
/**
|
/**
|
||||||
* 正規表現エラー
|
* 正規表現エラー
|
||||||
*/
|
*/
|
||||||
|
@ -685,6 +685,7 @@ smtpSecureInfo: "STARTTLS使用時はオフにします。"
|
|||||||
testEmail: "配信テスト"
|
testEmail: "配信テスト"
|
||||||
wordMute: "ワードミュート"
|
wordMute: "ワードミュート"
|
||||||
hardWordMute: "ハードワードミュート"
|
hardWordMute: "ハードワードミュート"
|
||||||
|
showMutedWord: "ミュートされたワードを表示"
|
||||||
regexpError: "正規表現エラー"
|
regexpError: "正規表現エラー"
|
||||||
regexpErrorDescription: "{tab}ワードミュートの{line}行目の正規表現にエラーが発生しました:"
|
regexpErrorDescription: "{tab}ワードミュートの{line}行目の正規表現にエラーが発生しました:"
|
||||||
instanceMute: "サーバーミュート"
|
instanceMute: "サーバーミュート"
|
||||||
|
@ -150,6 +150,13 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</MkA>
|
</MkA>
|
||||||
</template>
|
</template>
|
||||||
</I18n>
|
</I18n>
|
||||||
|
<I18n v-else-if="showSoftWordMutedWord !== true" :src="i18n.ts.userSaysSomething" tag="small">
|
||||||
|
<template #name>
|
||||||
|
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
|
||||||
|
<MkUserName :user="appearNote.user"/>
|
||||||
|
</MkA>
|
||||||
|
</template>
|
||||||
|
</I18n>
|
||||||
<I18n v-else :src="i18n.ts.userSaysSomethingAbout" tag="small">
|
<I18n v-else :src="i18n.ts.userSaysSomethingAbout" tag="small">
|
||||||
<template #name>
|
<template #name>
|
||||||
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
|
<MkA v-user-preview="appearNote.userId" :to="userPage(appearNote.user)">
|
||||||
@ -276,6 +283,7 @@ const collapsed = ref(appearNote.value.cw == null && isLong);
|
|||||||
const isDeleted = ref(false);
|
const isDeleted = ref(false);
|
||||||
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
|
const muted = ref(checkMute(appearNote.value, $i?.mutedWords));
|
||||||
const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords, true));
|
const hardMuted = ref(props.withHardMute && checkMute(appearNote.value, $i?.hardMutedWords, true));
|
||||||
|
const showSoftWordMutedWord = computed(() => defaultStore.state.showSoftWordMutedWord);
|
||||||
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
|
const translation = ref<Misskey.entities.NotesTranslateResponse | null>(null);
|
||||||
const translating = ref(false);
|
const translating = ref(false);
|
||||||
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance);
|
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.value.user.instance);
|
||||||
|
@ -9,9 +9,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
<template #icon><i class="ti ti-message-off"></i></template>
|
<template #icon><i class="ti ti-message-off"></i></template>
|
||||||
<template #label>{{ i18n.ts.wordMute }}</template>
|
<template #label>{{ i18n.ts.wordMute }}</template>
|
||||||
|
|
||||||
<XWordMute :muted="$i.mutedWords" @save="saveMutedWords"/>
|
<div class="_gaps_s">
|
||||||
</MkFolder>
|
<MkSwitch v-model="showSoftWordMutedWord">{{ i18n.ts.showMutedWord }}</MkSwitch>
|
||||||
|
|
||||||
|
<XWordMute :muted="$i.mutedWords" @save="saveMutedWords"/>
|
||||||
|
</div>
|
||||||
|
</MkFolder>
|
||||||
<MkFolder>
|
<MkFolder>
|
||||||
<template #icon><i class="ti ti-message-off"></i></template>
|
<template #icon><i class="ti ti-message-off"></i></template>
|
||||||
<template #label>{{ i18n.ts.hardWordMute }}</template>
|
<template #label>{{ i18n.ts.hardWordMute }}</template>
|
||||||
@ -126,7 +129,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed, watch } from 'vue';
|
||||||
import XInstanceMute from './mute-block.instance-mute.vue';
|
import XInstanceMute from './mute-block.instance-mute.vue';
|
||||||
import XWordMute from './mute-block.word-mute.vue';
|
import XWordMute from './mute-block.word-mute.vue';
|
||||||
import MkPagination from '@/components/MkPagination.vue';
|
import MkPagination from '@/components/MkPagination.vue';
|
||||||
@ -139,6 +142,9 @@ import { misskeyApi } from '@/scripts/misskey-api.js';
|
|||||||
import { infoImageUrl } from '@/instance.js';
|
import { infoImageUrl } from '@/instance.js';
|
||||||
import { signinRequired } from '@/account.js';
|
import { signinRequired } from '@/account.js';
|
||||||
import MkFolder from '@/components/MkFolder.vue';
|
import MkFolder from '@/components/MkFolder.vue';
|
||||||
|
import MkSwitch from '@/components/MkSwitch.vue';
|
||||||
|
import { defaultStore } from '@/store';
|
||||||
|
import { unisonReload } from '@/scripts/unison-reload.js';
|
||||||
|
|
||||||
const $i = signinRequired();
|
const $i = signinRequired();
|
||||||
|
|
||||||
@ -161,6 +167,24 @@ const expandedRenoteMuteItems = ref([]);
|
|||||||
const expandedMuteItems = ref([]);
|
const expandedMuteItems = ref([]);
|
||||||
const expandedBlockItems = ref([]);
|
const expandedBlockItems = ref([]);
|
||||||
|
|
||||||
|
const showSoftWordMutedWord = computed(defaultStore.makeGetterSetter('showSoftWordMutedWord'));
|
||||||
|
|
||||||
|
async function reloadAsk() {
|
||||||
|
const { canceled } = await os.confirm({
|
||||||
|
type: 'info',
|
||||||
|
text: i18n.ts.reloadToApplySetting,
|
||||||
|
});
|
||||||
|
if (canceled) return;
|
||||||
|
|
||||||
|
unisonReload();
|
||||||
|
}
|
||||||
|
|
||||||
|
watch([
|
||||||
|
showSoftWordMutedWord,
|
||||||
|
], async () => {
|
||||||
|
await reloadAsk();
|
||||||
|
});
|
||||||
|
|
||||||
async function unrenoteMute(user, ev) {
|
async function unrenoteMute(user, ev) {
|
||||||
os.popupMenu([{
|
os.popupMenu([{
|
||||||
text: i18n.ts.renoteUnmute,
|
text: i18n.ts.renoteUnmute,
|
||||||
|
@ -503,6 +503,11 @@ export const defaultStore = markRaw(new Storage('base', {
|
|||||||
where: 'device',
|
where: 'device',
|
||||||
default: { type: 'syuilo/bubble2', volume: 1 } as SoundStore,
|
default: { type: 'syuilo/bubble2', volume: 1 } as SoundStore,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
showSoftWordMutedWord: {
|
||||||
|
where: 'device',
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
Loading…
Reference in New Issue
Block a user