merge: remove Twitter preview
This commit is contained in:
commit
5a6b183175
21 changed files with 2 additions and 53 deletions
|
@ -19,6 +19,7 @@ For older Misskey versions, see [CHANGELOG-OLD.md](./CHANGELOG-OLD.md).
|
|||
### Removed
|
||||
- Okteto config and Helm chart
|
||||
- Client: acrylic styling
|
||||
- Client: Twitter embeds, the standard URL preview is used instead.
|
||||
|
||||
### Fixed
|
||||
- Server: Blocking remote accounts
|
||||
|
|
|
@ -531,7 +531,6 @@ poll: "استطلاع رأي"
|
|||
useCw: "إخفاء المحتوى"
|
||||
enablePlayer: "افتح مشغل الفيديو"
|
||||
disablePlayer: "أغلق مشغل الفيديو"
|
||||
expandTweet: "وسّع التغريدة"
|
||||
themeEditor: "مصمم القوالب"
|
||||
description: "الوصف"
|
||||
describeFile: "أضف تعليقًا توضيحيًا"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "জরিপ"
|
|||
useCw: "কন্টেন্ট লুকান"
|
||||
enablePlayer: "ভিডিও প্লেয়ার খুলুন"
|
||||
disablePlayer: "ভিডিও প্লেয়ার বন্ধ করুন"
|
||||
expandTweet: "টুইট বিস্তারিত করুন"
|
||||
themeEditor: "থিম সম্পাদক"
|
||||
description: "বর্ণনা"
|
||||
describeFile: "ক্যাপশন যোগ করুন"
|
||||
|
|
|
@ -550,7 +550,6 @@ poll: "Umfrage"
|
|||
useCw: "Inhaltswarnung verwenden"
|
||||
enablePlayer: "Video-Player öffnen"
|
||||
disablePlayer: "Video-Player schließen"
|
||||
expandTweet: "Tweet ausklappen"
|
||||
themeEditor: "Farbschema-Editor"
|
||||
description: "Beschreibung"
|
||||
describeFile: "Beschreibung hinzufügen"
|
||||
|
|
|
@ -550,7 +550,6 @@ poll: "Poll"
|
|||
useCw: "Hide content"
|
||||
enablePlayer: "Open video player"
|
||||
disablePlayer: "Close video player"
|
||||
expandTweet: "Expand tweet"
|
||||
themeEditor: "Theme editor"
|
||||
description: "Description"
|
||||
describeFile: "Add caption"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Encuesta"
|
|||
useCw: "Esconder contenidos"
|
||||
enablePlayer: "Abrir reproductor"
|
||||
disablePlayer: "Cerrar reproductor"
|
||||
expandTweet: "Expandir tweet"
|
||||
themeEditor: "Editor de temas"
|
||||
description: "Descripción"
|
||||
describeFile: "Añade una descripción"
|
||||
|
|
|
@ -546,7 +546,6 @@ poll: "Sondage"
|
|||
useCw: "Masquer le contenu"
|
||||
enablePlayer: "Ouvrir dans le lecteur vidéo"
|
||||
disablePlayer: "Fermer le lecteur vidéo"
|
||||
expandTweet: "Étendre le tweet"
|
||||
themeEditor: "Éditeur de thèmes"
|
||||
description: "Description"
|
||||
describeFile: "Ajouter une description d'image"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Angket"
|
|||
useCw: "Sembunyikan konten"
|
||||
enablePlayer: "Buka pemutar video"
|
||||
disablePlayer: "Tutup pemutar video"
|
||||
expandTweet: "Perluas utas"
|
||||
themeEditor: "Penyunting tema"
|
||||
description: "Deskripsi"
|
||||
describeFile: "Tambahkan keterangan"
|
||||
|
|
|
@ -545,7 +545,6 @@ poll: "Sondaggio"
|
|||
useCw: "Nascondere media"
|
||||
enablePlayer: "Apri in lettore video"
|
||||
disablePlayer: "Chiudi lettore video"
|
||||
expandTweet: "Espandi tweet"
|
||||
themeEditor: "Editor di temi"
|
||||
description: "Descrizione"
|
||||
describeFile: "Aggiungi una descrizione d'immagine"
|
||||
|
|
|
@ -550,7 +550,6 @@ poll: "アンケート"
|
|||
useCw: "内容を隠す"
|
||||
enablePlayer: "プレイヤーを開く"
|
||||
disablePlayer: "プレイヤーを閉じる"
|
||||
expandTweet: "ツイートを展開する"
|
||||
themeEditor: "テーマエディター"
|
||||
description: "説明"
|
||||
describeFile: "キャプションを付ける"
|
||||
|
|
|
@ -524,7 +524,6 @@ addedRelays: "追加済みのリレー"
|
|||
poll: "アンケート"
|
||||
enablePlayer: "プレイヤーを開く"
|
||||
disablePlayer: "プレイヤーを閉じる"
|
||||
expandTweet: "ツイートを展開する"
|
||||
themeEditor: "テーマエディター"
|
||||
description: "説明"
|
||||
author: "作者"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "투표"
|
|||
useCw: "내용 숨기기"
|
||||
enablePlayer: "플레이어 열기"
|
||||
disablePlayer: "플레이어 닫기"
|
||||
expandTweet: "트윗 확장하기"
|
||||
themeEditor: "테마 에디터"
|
||||
description: "설명"
|
||||
describeFile: "캡션 추가"
|
||||
|
|
|
@ -536,7 +536,6 @@ poll: "Ankieta"
|
|||
useCw: "Ukryj zawartość"
|
||||
enablePlayer: "Otwórz odtwarzacz wideo"
|
||||
disablePlayer: "Zamknij odtwarzacz wideo"
|
||||
expandTweet: "Rozwiń tweet"
|
||||
themeEditor: "Edytor motywu"
|
||||
description: "Opis"
|
||||
describeFile: "dodaj podpis"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Sondaj"
|
|||
useCw: "Ascunde conținutul"
|
||||
enablePlayer: "Deschide player-ul video"
|
||||
disablePlayer: "Închide player-ul video"
|
||||
expandTweet: "Expandează tweet"
|
||||
themeEditor: "Editor de teme"
|
||||
description: "Descriere"
|
||||
describeFile: "Adaugă titrări"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Опрос"
|
|||
useCw: "Скрывать содержимое под предупреждением"
|
||||
enablePlayer: "Включить проигрыватель"
|
||||
disablePlayer: "Выключить проигрыватель"
|
||||
expandTweet: "Развернуть твит"
|
||||
themeEditor: "Редактор темы оформления"
|
||||
description: "Описание"
|
||||
describeFile: "Добавить подпись"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Hlasovanie"
|
|||
useCw: "Skryť obsah"
|
||||
enablePlayer: "Otvoriť video prehrávač"
|
||||
disablePlayer: "Zavrieť video prehrávač"
|
||||
expandTweet: "Rozšíriť tweet"
|
||||
themeEditor: "Editor tém"
|
||||
description: "Popis"
|
||||
describeFile: "Pridať nadpis"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Опитування"
|
|||
useCw: "Приховати вміст"
|
||||
enablePlayer: "Відкрити відеоплеєр"
|
||||
disablePlayer: "Закрити відеоплеєр"
|
||||
expandTweet: "Розгорнути твіт"
|
||||
themeEditor: "Редактор тем"
|
||||
description: "Опис"
|
||||
describeFile: "Додати підпис"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "Bình chọn"
|
|||
useCw: "Ẩn nội dung"
|
||||
enablePlayer: "Mở trình phát video"
|
||||
disablePlayer: "Đóng trình phát video"
|
||||
expandTweet: "Mở rộng tweet"
|
||||
themeEditor: "Công cụ thiết kế theme"
|
||||
description: "Mô tả"
|
||||
describeFile: "Thêm mô tả"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "调查问卷"
|
|||
useCw: "隐藏内容"
|
||||
enablePlayer: "打开播放器"
|
||||
disablePlayer: "关闭播放器"
|
||||
expandTweet: "展开帖子"
|
||||
themeEditor: "主题编辑器"
|
||||
description: "描述"
|
||||
describeFile: "添加标题"
|
||||
|
|
|
@ -549,7 +549,6 @@ poll: "投票"
|
|||
useCw: "隱藏內容"
|
||||
enablePlayer: "打開播放器"
|
||||
disablePlayer: "關閉播放器"
|
||||
expandTweet: "展開推文"
|
||||
themeEditor: "主題編輯器"
|
||||
description: "描述"
|
||||
describeFile: "添加標題 "
|
||||
|
|
|
@ -3,9 +3,6 @@
|
|||
<button class="disablePlayer" :title="i18n.ts.disablePlayer" @click="playerEnabled = false"><i class="fas fa-times"></i></button>
|
||||
<iframe :src="player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')" :width="player.width || '100%'" :heigth="player.height || 250" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen/>
|
||||
</div>
|
||||
<div v-else-if="tweetId && tweetExpanded" ref="twitter" class="twitter">
|
||||
<iframe ref="tweet" scrolling="no" frameborder="no" :style="{ position: 'relative', width: '100%', height: `${tweetHeight}px` }" :src="`https://platform.twitter.com/embed/index.html?embedId=${embedId}&hideCard=false&hideThread=false&lang=en&theme=${$store.state.darkMode ? 'dark' : 'light'}&id=${tweetId}`"></iframe>
|
||||
</div>
|
||||
<div v-else v-size="{ max: [400, 350] }" class="mk-url-preview">
|
||||
<transition :name="$store.state.animation ? 'zoom' : ''" mode="out-in">
|
||||
<component :is="self ? 'MkA' : 'a'" v-if="!fetching" :class="{ compact }" :[attr]="self ? url.substr(local.length) : url" rel="nofollow noopener" :target="target" :title="url">
|
||||
|
@ -24,16 +21,10 @@
|
|||
</article>
|
||||
</component>
|
||||
</transition>
|
||||
<div v-if="tweetId" class="expandTweet">
|
||||
<a @click="tweetExpanded = true">
|
||||
<i class="fab fa-twitter"></i> {{ i18n.ts.expandTweet }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onUnmounted } from 'vue';
|
||||
import { url as local, lang } from '@/config';
|
||||
import { i18n } from '@/i18n';
|
||||
|
||||
|
@ -61,23 +52,14 @@ let player = $ref({
|
|||
height: null,
|
||||
});
|
||||
let playerEnabled = $ref(false);
|
||||
let tweetId = $ref<string | null>(null);
|
||||
let tweetExpanded = $ref(props.detail);
|
||||
const embedId = `embed${Math.random().toString().replace(/\D/,'')}`;
|
||||
let tweetHeight = $ref(150);
|
||||
|
||||
const requestUrl = new URL(props.url);
|
||||
|
||||
if (requestUrl.hostname === 'twitter.com') {
|
||||
const m = requestUrl.pathname.match(/^\/.+\/status(?:es)?\/(\d+)/);
|
||||
if (m) tweetId = m[1];
|
||||
}
|
||||
|
||||
if (requestUrl.hostname === 'music.youtube.com' && requestUrl.pathname.match('^/(?:watch|channel)')) {
|
||||
requestUrl.hostname = 'www.youtube.com';
|
||||
}
|
||||
|
||||
const requestLang = (lang || 'ja-JP').replace('ja-KS', 'ja-JP');
|
||||
const requestLang = lang || 'en-US';
|
||||
|
||||
requestUrl.hash = '';
|
||||
|
||||
|
@ -93,21 +75,6 @@ fetch(`/url?url=${encodeURIComponent(requestUrl.href)}&lang=${requestLang}`).the
|
|||
player = info.player;
|
||||
});
|
||||
});
|
||||
|
||||
function adjustTweetHeight(message: any) {
|
||||
if (message.origin !== 'https://platform.twitter.com') return;
|
||||
const embed = message.data?.['twttr.embed'];
|
||||
if (embed?.method !== 'twttr.private.resize') return;
|
||||
if (embed?.id !== embedId) return;
|
||||
const height = embed?.params[0]?.height;
|
||||
if (height) tweetHeight = height;
|
||||
}
|
||||
|
||||
(window as any).addEventListener('message', adjustTweetHeight);
|
||||
|
||||
onUnmounted(() => {
|
||||
(window as any).removeEventListener('message', adjustTweetHeight);
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in a new issue