This commit is contained in:
NoriDev 2023-11-14 17:46:01 +09:00
parent 6df1fe4cfa
commit 3d5cde2192
2 changed files with 13 additions and 3 deletions

View file

@ -121,6 +121,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
</div>
<div v-if="viewTextSource">
<hr style="margin: 10px 0;">
<pre style="margin: initial;"><small>{{ appearNote.text }}</small></pre>
</div>
<div v-if="appearNote.files.length > 0">
<MkMediaList v-if="appearNote.disableRightClick" :mediaList="appearNote.files" @contextmenu.prevent/>
<MkMediaList v-else :mediaList="appearNote.files"/>
@ -353,6 +357,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 noNyaize = ref(false);
const parsed = appearNote.text ? mfm.parse(appearNote.text) : null;
const urls = parsed ? extractUrlFromMfm(parsed) : null;
@ -565,13 +570,13 @@ function onContextmenu(ev: MouseEvent): void {
ev.preventDefault();
react();
} else {
const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, noNyaize, menuButton, isDeleted });
const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, viewTextSource, noNyaize, menuButton, isDeleted });
os.contextMenu(menu, ev).then(focus).finally(cleanup);
}
}
function menu(viaKeyboard = false): void {
const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, noNyaize, menuButton, isDeleted });
const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, viewTextSource, noNyaize, menuButton, isDeleted });
os.popupMenu(menu, menuButton.value, {
viaKeyboard,
}).then(focus).finally(cleanup);

View file

@ -35,6 +35,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
</div>
<div v-if="viewTextSource">
<hr style="margin: 10px 0;">
<pre style="margin: initial;"><small>{{ appearNote.text }}</small></pre>
</div>
<div v-show="showContent">
<div v-if="note.files.length > 0">
<MkMediaList v-if="note.disableRightClick" :mediaList="note.files" @contextmenu.prevent/>
@ -165,6 +169,7 @@ const showContent = ref(true);
const translation = ref<any>(null);
const translating = ref(false);
const viewTextSource = ref(false);
const noNyaize = ref(false);
const parsed = props.note.text ? mfm.parse(props.note.text) : null;
@ -370,7 +375,7 @@ function menu(viaKeyboard = false): void {
return;
}
const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, noNyaize, menuButton, isDeleted, currentClip: currentClip?.value });
const { menu, cleanup } = getNoteMenu({ note: note, translating, translation, viewTextSource, noNyaize, menuButton, isDeleted, currentClip: currentClip?.value });
os.popupMenu(menu, menuButton.value, {
viaKeyboard,
}).then(focus).finally(cleanup);