From 5b406d507d829a70054bb6d1248817d9c3605765 Mon Sep 17 00:00:00 2001 From: NoriDev Date: Tue, 14 Nov 2023 16:49:12 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=85=B8=ED=8A=B8=EC=9D=98=20=ED=85=8D?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=86=8C=EC=8A=A4=EB=A5=BC=20=EB=B3=BC=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG_CHERRYPICK.md | 1 + locales/en-US.yml | 1 + locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + locales/ko-KR.yml | 1 + packages/frontend/src/components/MkNote.vue | 9 +++++++-- packages/frontend/src/scripts/get-note-menu.ts | 11 +++++++++++ 7 files changed, 23 insertions(+), 2 deletions(-) diff --git a/CHANGELOG_CHERRYPICK.md b/CHANGELOG_CHERRYPICK.md index de903a34a6..27399f99e3 100644 --- a/CHANGELOG_CHERRYPICK.md +++ b/CHANGELOG_CHERRYPICK.md @@ -39,6 +39,7 @@ Misskey의 전체 변경 사항을 확인하려면, [CHANGELOG.md#2023xx](CHANGE - Feat: 본문 미리보기의 프로필을 표시하지 않도록 설정할 수 있음 - Feat: 이모티콘 피커의 카테고리를 다중 계층 폴더로 분류할 수 있음 (misskey-dev/misskey#12132) - Feat: 열람 주의로 설정된 미디어를 두 번 탭 하여 표시하도록 할 수 있음 #392 +- Feat: 노트의 텍스트 소스를 볼 수 있음 - Enhance: 스와이프하여 타임라인을 다시 불러올 수 있음 (misskey-dev/misskey#12113) - PC의 경우 오른쪽 상단의 버튼을 통해서도 다시 불러올 수 있습니다 - Enhance: 타임라인 자동 업데이트를 비활성화할 수 있음 (misskey-dev/misskey#12113) diff --git a/locales/en-US.yml b/locales/en-US.yml index 257f3e6869..7e9d6849e3 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1,5 +1,6 @@ --- _lang_: "English" +viewTextSource: "View text source" disableNoteEditConfirm: "Really continue editing the note?" disableNoteEditConfirmWarn: "Only software that supports note editing(Mastodon, CherryPick, FireFish, etc.) will be able to see the edits and history.\nSoftware that doesn't support note editing will only show what was in the note before you edited it, so if you want it to reflect your edits across all federated servers, rewrite the note with \"delete and edit\"." disableNoteEditOk: "Edit a note" diff --git a/locales/index.d.ts b/locales/index.d.ts index b9fa6cb253..2a04c7e926 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -3,6 +3,7 @@ // Do not edit this file directly. export interface Locale { "_lang_": string; + "viewTextSource": string; "disableNoteEditConfirm": string; "disableNoteEditConfirmWarn": string; "disableNoteEditOk": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 5adb0cfd03..7cc8de33de 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1,5 +1,6 @@ _lang_: "日本語" +viewTextSource: "テキストのソースを表示する" disableNoteEditConfirm: "ノート編集を続行しますか?" disableNoteEditConfirmWarn: "ノート編集に対応しているソフトウェア(Mastodon、CherryPick、FireFishなど)でのみ、編集された内容と履歴を見ることができます。\nノート編集に対応していないソフトウェアでは、ノートを編集する前の内容が表示されるので、すべての連合サーバーで修正した内容を反映させたい場合は、「削除して編集」でノートを書き直してください。" disableNoteEditOk: "ノートを編集する" diff --git a/locales/ko-KR.yml b/locales/ko-KR.yml index 481f5d77cd..ba3059bd3b 100644 --- a/locales/ko-KR.yml +++ b/locales/ko-KR.yml @@ -1,5 +1,6 @@ --- _lang_: "한국어" +viewTextSource: "텍스트 소스 보기" disableNoteEditConfirm: "노트 편집을 계속 진행할까요?" disableNoteEditConfirmWarn: "노트 편집을 대응하는 소프트웨어(Mastodon, CherryPick, FireFish 등)에서만 편집된 내용과 이력을 볼 수 있어요.\n노트 편집이 지원되지 않는 소프트웨어에서는 노트를 편집하기 전의 내용으로 표시되므로, 모든 연합된 서버에서 수정된 내용을 반영하고 싶은 경우, '삭제 후 편집'으로 노트를 재작성해 주세요." disableNoteEditOk: "노트 편집하기" diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 4bf889b9ca..9bd7c04047 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -101,6 +101,10 @@ SPDX-License-Identifier: AGPL-3.0-only +
+
+
{{ appearNote.text }}
+
@@ -288,6 +292,7 @@ const isDeleted = ref(false); const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false); const translation = ref(null); const translating = ref(false); +const viewTextSource = ref(false); const canRenote = computed(() => ['public', 'home'].includes(appearNote.visibility) || (appearNote.visibility === 'followers' && appearNote.userId === $i.id)); let renoteCollapsed = $ref(defaultStore.state.collapseRenotes && isRenote && (($i && ($i.id === note.userId || $i.id === appearNote.userId)) || (appearNote.myReaction != null))); @@ -526,7 +531,7 @@ function onContextmenu(ev: MouseEvent): void { ev.preventDefault(); react(); } else { - const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, menuButton, isDeleted, currentClip: currentClip?.value }); + const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, viewTextSource, menuButton, isDeleted, currentClip: currentClip?.value }); os.contextMenu(menu, ev).then(focus).finally(cleanup); } } @@ -536,7 +541,7 @@ function menu(viaKeyboard = false): void { return; } - const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, menuButton, isDeleted, currentClip: currentClip?.value }); + const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, viewTextSource, menuButton, isDeleted, currentClip: currentClip?.value }); os.popupMenu(menu, menuButton.value, { viaKeyboard, }).then(focus).finally(cleanup); diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 81daba86d2..3a639d0e74 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -125,6 +125,7 @@ export function getNoteMenu(props: { menuButton: Ref; translation: Ref; translating: Ref; + viewTextSource: Ref; isDeleted: Ref; currentClip?: Misskey.entities.Clip; }) { @@ -311,6 +312,10 @@ export function getNoteMenu(props: { props.translation.value = res; } + function showViewTextSource(): void { + props.viewTextSource.value = true; + } + let menu: MenuItem[]; if ($i) { const statePromise = os.api('notes/state', { @@ -370,6 +375,12 @@ export function getNoteMenu(props: { action: translate, } : undefined, null, + { + icon: 'ti ti-file-text', + text: i18n.ts.viewTextSource, + action: showViewTextSource, + }, + null, statePromise.then(state => state.isFavorited ? { icon: 'ti ti-star-off', text: i18n.ts.unfavorite,