feat: pakuru

This commit is contained in:
こけっち 2022-09-12 01:23:19 +09:00
parent 9f6e6ac3c8
commit c56f8fd953
No known key found for this signature in database
GPG Key ID: 21460619C5FC4DD1
2 changed files with 23 additions and 0 deletions

View File

@ -837,6 +837,8 @@ emojiColor: "カラーコード"
colorPicker: "カラーピッカー"
emojiApproval: "絵文字を登録"
deckOld: "旧デッキ"
pakuruConfirm: "パクりますか?"
pakuru: "パクる"
_emailUnavailable:

View File

@ -26,6 +26,22 @@ export function getNoteMenu(props: {
const appearNote = isRenote ? props.note.renote as misskey.entities.Note : props.note;
function pakuru(): void {
os.confirm({
type: 'question',
text: i18n.ts.pakuruConfirm,
}).then(({ canceled }) => {
if (canceled) return;
const postData = {
text: appearNote.text,
cw: appearNote.cw ? appearNote.cw || '' : undefined,
localOnly: appearNote.localOnly,
visibility: appearNote.visibility,
}
os.api('notes/create', postData, undefined);
});
}
function del(): void {
os.confirm({
type: 'warning',
@ -205,6 +221,11 @@ export function getNoteMenu(props: {
action: unclip,
}, null] : []
),
{
icon: 'fas fa-copy',
text: i18n.ts.pakuru,
action: pakuru,
},
{
icon: 'fas fa-copy',
text: i18n.ts.copyContent,