feat (client): add a toggleable setting to show no alt warning
This commit is contained in:
parent
40293a73c0
commit
68fa43d97c
9 changed files with 39 additions and 8 deletions
|
@ -9,6 +9,7 @@ Critical security updates are indicated by the :warning: icon.
|
||||||
- Show unlisted posts from following users in antennas (similar to [Fedibird](https://github.com/fedibird/mastodon/tree/fedibird) and [kmyblue](https://github.com/kmycode/mastodon), unlisted posts from people you don't follow won't be shown)
|
- Show unlisted posts from following users in antennas (similar to [Fedibird](https://github.com/fedibird/mastodon/tree/fedibird) and [kmyblue](https://github.com/kmycode/mastodon), unlisted posts from people you don't follow won't be shown)
|
||||||
- Add ability to publish the Local and Global timelines on `/timeline` page
|
- Add ability to publish the Local and Global timelines on `/timeline` page
|
||||||
- Add langage annotation to post contents (!10687)
|
- Add langage annotation to post contents (!10687)
|
||||||
|
- Add a toggleable setting to show a warning when you attempt to post files without alt text
|
||||||
- Fix bugs
|
- Fix bugs
|
||||||
- Update documents
|
- Update documents
|
||||||
|
|
||||||
|
|
|
@ -1215,6 +1215,8 @@ searchCwAndAlt: "Include content warnings and file descriptions"
|
||||||
publishTimelines: "Publish timelines for visitors"
|
publishTimelines: "Publish timelines for visitors"
|
||||||
publishTimelinesDescription: "If enabled, the Local and Global timeline will be shown
|
publishTimelinesDescription: "If enabled, the Local and Global timeline will be shown
|
||||||
on {url} even when signed out."
|
on {url} even when signed out."
|
||||||
|
noAltTextWarning: "Some attached file(s) have no description. Did you forget to write?"
|
||||||
|
showNoAltTextWarning: "Show a warning if you attempt to post files without a description"
|
||||||
|
|
||||||
_emojiModPerm:
|
_emojiModPerm:
|
||||||
unauthorized: "None"
|
unauthorized: "None"
|
||||||
|
|
|
@ -76,7 +76,7 @@ lists: "リスト"
|
||||||
noLists: "リストはありません"
|
noLists: "リストはありません"
|
||||||
note: "投稿"
|
note: "投稿"
|
||||||
notes: "投稿"
|
notes: "投稿"
|
||||||
toPost: "投稿"
|
toPost: "投稿する"
|
||||||
following: "フォロー"
|
following: "フォロー"
|
||||||
followers: "フォロワー"
|
followers: "フォロワー"
|
||||||
followsYou: "フォローされています"
|
followsYou: "フォローされています"
|
||||||
|
@ -1021,6 +1021,8 @@ searchPostsWithFiles: "添付ファイルのある投稿のみ"
|
||||||
searchCwAndAlt: "閲覧注意の注釈と添付ファイルの代替テキストも検索する"
|
searchCwAndAlt: "閲覧注意の注釈と添付ファイルの代替テキストも検索する"
|
||||||
publishTimelines: "非ログインユーザーにもタイムラインを公開する"
|
publishTimelines: "非ログインユーザーにもタイムラインを公開する"
|
||||||
publishTimelinesDescription: "有効にすると、{url} でローカルタイムラインとグローバルタイムラインが公開されます。"
|
publishTimelinesDescription: "有効にすると、{url} でローカルタイムラインとグローバルタイムラインが公開されます。"
|
||||||
|
noAltTextWarning: "説明が書かれていない添付ファイルがあります。書き忘れてはいませんか?"
|
||||||
|
showNoAltTextWarning: "説明が書かれていない添付ファイルを投稿しようとした場合に警告する"
|
||||||
|
|
||||||
_sensitiveMediaDetection:
|
_sensitiveMediaDetection:
|
||||||
description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。"
|
description: "機械学習を使って自動でセンシティブなメディアを検出し、モデレーションに役立てられます。サーバーの負荷が少し増えます。"
|
||||||
|
|
|
@ -73,7 +73,7 @@ lists: "清單"
|
||||||
noLists: "你沒有任何清單"
|
noLists: "你沒有任何清單"
|
||||||
note: "貼文"
|
note: "貼文"
|
||||||
notes: "貼文"
|
notes: "貼文"
|
||||||
toPost: "貼文"
|
toPost: "發貼文"
|
||||||
following: "追隨中"
|
following: "追隨中"
|
||||||
followers: "追隨者"
|
followers: "追隨者"
|
||||||
followsYou: "追隨你的人"
|
followsYou: "追隨你的人"
|
||||||
|
|
|
@ -144,16 +144,17 @@
|
||||||
:disabled="okButtonDisabled"
|
:disabled="okButtonDisabled"
|
||||||
@click="ok"
|
@click="ok"
|
||||||
>{{
|
>{{
|
||||||
showCancelButton || input || select
|
okText ??
|
||||||
|
(showCancelButton || input || select
|
||||||
? i18n.ts.ok
|
? i18n.ts.ok
|
||||||
: i18n.ts.gotIt
|
: i18n.ts.gotIt)
|
||||||
}}</MkButton
|
}}</MkButton
|
||||||
>
|
>
|
||||||
<MkButton
|
<MkButton
|
||||||
v-if="showCancelButton || input || select"
|
v-if="showCancelButton || input || select"
|
||||||
inline
|
inline
|
||||||
@click="cancel"
|
@click="cancel"
|
||||||
>{{ i18n.ts.cancel }}</MkButton
|
>{{ cancelText ?? i18n.ts.cancel }}</MkButton
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
|
@ -194,13 +195,11 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
|
import { computed, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
|
||||||
import { acct } from "firefish-js";
|
|
||||||
import MkModal from "@/components/MkModal.vue";
|
import MkModal from "@/components/MkModal.vue";
|
||||||
import MkButton from "@/components/MkButton.vue";
|
import MkButton from "@/components/MkButton.vue";
|
||||||
import MkInput from "@/components/form/input.vue";
|
import MkInput from "@/components/form/input.vue";
|
||||||
import MkTextarea from "@/components/form/textarea.vue";
|
import MkTextarea from "@/components/form/textarea.vue";
|
||||||
import MkSelect from "@/components/form/select.vue";
|
import MkSelect from "@/components/form/select.vue";
|
||||||
import * as os from "@/os";
|
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import iconClass from "@/scripts/icon";
|
import iconClass from "@/scripts/icon";
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@ const showBigPostButton = defaultStore.state.showBigPostButton;
|
||||||
|
|
||||||
const posting = ref(false);
|
const posting = ref(false);
|
||||||
const text = ref(props.initialText ?? "");
|
const text = ref(props.initialText ?? "");
|
||||||
const files = ref(props.initialFiles ?? []);
|
const files = ref(props.initialFiles ?? ([] as entities.DriveFile[]));
|
||||||
const poll = ref<{
|
const poll = ref<{
|
||||||
choices: string[];
|
choices: string[];
|
||||||
multiple: boolean;
|
multiple: boolean;
|
||||||
|
@ -1020,6 +1020,22 @@ function deleteDraft() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function post() {
|
async function post() {
|
||||||
|
if (
|
||||||
|
defaultStore.state.showNoAltTextWarning &&
|
||||||
|
files.value.some((f) => f.comment == null || f.comment.length === 0)
|
||||||
|
) {
|
||||||
|
// "canceled" means "post anyway"
|
||||||
|
const { canceled } = await os.confirm({
|
||||||
|
type: "warning",
|
||||||
|
text: i18n.ts.noAltTextWarning,
|
||||||
|
okText: i18n.ts.goBack,
|
||||||
|
cancelText: i18n.ts.toPost,
|
||||||
|
isPlaintext: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!canceled) return;
|
||||||
|
}
|
||||||
|
|
||||||
const processedText = preprocess(text.value);
|
const processedText = preprocess(text.value);
|
||||||
|
|
||||||
let postData = {
|
let postData = {
|
||||||
|
|
|
@ -121,6 +121,9 @@
|
||||||
<FormSwitch v-model="openServerInfo" class="_formBlock">{{
|
<FormSwitch v-model="openServerInfo" class="_formBlock">{{
|
||||||
i18n.ts.openServerInfo
|
i18n.ts.openServerInfo
|
||||||
}}</FormSwitch>
|
}}</FormSwitch>
|
||||||
|
<FormSwitch v-model="showNoAltTextWarning" class="_formBlock">{{
|
||||||
|
i18n.ts.showNoAltTextWarning
|
||||||
|
}}</FormSwitch>
|
||||||
|
|
||||||
<FormSelect v-model="serverDisconnectedBehavior" class="_formBlock">
|
<FormSelect v-model="serverDisconnectedBehavior" class="_formBlock">
|
||||||
<template #label>{{ i18n.ts.whenServerDisconnected }}</template>
|
<template #label>{{ i18n.ts.whenServerDisconnected }}</template>
|
||||||
|
@ -524,6 +527,9 @@ const enablePullToRefresh = computed(
|
||||||
const pullToRefreshThreshold = computed(
|
const pullToRefreshThreshold = computed(
|
||||||
defaultStore.makeGetterSetter("pullToRefreshThreshold"),
|
defaultStore.makeGetterSetter("pullToRefreshThreshold"),
|
||||||
);
|
);
|
||||||
|
const showNoAltTextWarning = computed(
|
||||||
|
defaultStore.makeGetterSetter("showNoAltTextWarning"),
|
||||||
|
);
|
||||||
|
|
||||||
// This feature (along with injectPromo) is currently disabled
|
// This feature (along with injectPromo) is currently disabled
|
||||||
// function onChangeInjectFeaturedNote(v) {
|
// function onChangeInjectFeaturedNote(v) {
|
||||||
|
|
|
@ -124,6 +124,7 @@ const defaultStoreSaveKeys: (keyof (typeof defaultStore)["state"])[] = [
|
||||||
"enableTimelineStreaming",
|
"enableTimelineStreaming",
|
||||||
"enablePullToRefresh",
|
"enablePullToRefresh",
|
||||||
"pullToRefreshThreshold",
|
"pullToRefreshThreshold",
|
||||||
|
"showNoAltTextWarning",
|
||||||
];
|
];
|
||||||
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
const coldDeviceStorageSaveKeys: (keyof typeof ColdDeviceStorage.default)[] = [
|
||||||
"lightTheme",
|
"lightTheme",
|
||||||
|
|
|
@ -428,6 +428,10 @@ export const defaultStore = markRaw(
|
||||||
where: "device",
|
where: "device",
|
||||||
default: 150,
|
default: 150,
|
||||||
},
|
},
|
||||||
|
showNoAltTextWarning: {
|
||||||
|
where: "account",
|
||||||
|
default: true,
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue