URLプレビューのサムネイルを隠す機能を追加 (MisskeyIO#214)
This commit is contained in:
@@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
<div v-else>
|
||||
<component :is="self ? 'MkA' : 'a'" :class="[$style.link, { [$style.compact]: compact }]" :[attr]="self ? url.substring(local.length) : url" rel="nofollow noopener" :target="target" :title="url">
|
||||
<div v-if="thumbnail" :class="$style.thumbnail" :style="`background-image: url('${thumbnail}')`">
|
||||
<div v-if="thumbnail" :class="[$style.thumbnail, { [$style.thumbnailBlur]: sensitive }]" :style="`background-image: url('${thumbnail}')`">
|
||||
</div>
|
||||
<article :class="$style.body">
|
||||
<header :class="$style.header">
|
||||
@@ -118,6 +118,7 @@ let description = $ref<string | null>(null);
|
||||
let thumbnail = $ref<string | null>(null);
|
||||
let icon = $ref<string | null>(null);
|
||||
let sitename = $ref<string | null>(null);
|
||||
let sensitive = $ref<boolean | undefined>(undefined);
|
||||
let player = $ref({
|
||||
url: null,
|
||||
width: null,
|
||||
@@ -170,6 +171,7 @@ window.fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${versatileLa
|
||||
icon = info.icon;
|
||||
sitename = info.sitename;
|
||||
player = info.player;
|
||||
sensitive = info.sensitive;
|
||||
});
|
||||
|
||||
function adjustTweetHeight(message: any) {
|
||||
@@ -319,6 +321,10 @@ onUnmounted(() => {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.thumbnailBlur {
|
||||
filter: blur(8px);
|
||||
}
|
||||
|
||||
@container (max-width: 400px) {
|
||||
.link {
|
||||
font-size: 12px;
|
||||
|
@@ -34,6 +34,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<template #label>{{ i18n.ts.sensitiveWords }}</template>
|
||||
<template #caption>{{ i18n.ts.sensitiveWordsDescription }}<br>{{ i18n.ts.sensitiveWordsDescription2 }}</template>
|
||||
</MkTextarea>
|
||||
|
||||
<MkTextarea v-model="urlPreviewDenyList">
|
||||
<template #label>{{ i18n.ts.urlPreviewDenyList }}</template>
|
||||
<template #caption>{{ i18n.ts.urlPreviewDenyListDescription }}</template>
|
||||
</MkTextarea>
|
||||
</div>
|
||||
</FormSuspense>
|
||||
</MkSpacer>
|
||||
@@ -69,6 +74,7 @@ let emailRequiredForSignup: boolean = $ref(false);
|
||||
let sensitiveWords: string = $ref('');
|
||||
let preservedUsernames: string = $ref('');
|
||||
let tosUrl: string | null = $ref(null);
|
||||
let urlPreviewDenyList: string = $ref('');
|
||||
|
||||
async function init() {
|
||||
const meta = await os.api('admin/meta');
|
||||
@@ -77,6 +83,7 @@ async function init() {
|
||||
sensitiveWords = meta.sensitiveWords.join('\n');
|
||||
preservedUsernames = meta.preservedUsernames.join('\n');
|
||||
tosUrl = meta.tosUrl;
|
||||
urlPreviewDenyList = meta.urlPreviewDenyList.join('\n');
|
||||
}
|
||||
|
||||
function save() {
|
||||
@@ -86,6 +93,7 @@ function save() {
|
||||
tosUrl,
|
||||
sensitiveWords: sensitiveWords.split('\n'),
|
||||
preservedUsernames: preservedUsernames.split('\n'),
|
||||
urlPreviewDenyList: urlPreviewDenyList.split('\n'),
|
||||
}).then(() => {
|
||||
fetchInstance();
|
||||
});
|
||||
|
Reference in New Issue
Block a user