Merge branch 'develop'

This commit is contained in:
sim1222 2022-09-12 01:39:40 +09:00
commit 94c362cbb6
9 changed files with 48 additions and 11 deletions

View File

@ -107,6 +107,7 @@ clickToShow: "クリックして表示"
sensitive: "閲覧注意"
add: "追加"
reaction: "リアクション"
reactWithRenote: "ついでにRenoteする"
reactionSetting: "ピッカーに表示するリアクション"
reactionSettingDescription2: "ドラッグして並び替え、クリックして削除、+を押して追加します。"
rememberNoteVisibility: "公開範囲を記憶する"

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "12.119.0-simkey-v2",
"version": "12.119.0-simkey-v3",
"codename": "indigo",
"repository": {
"type": "git",

View File

@ -74,6 +74,7 @@
<button class="_button tab" :class="{ active: tab === 'unicode' }" @click="tab = 'unicode'"><i class="fas fa-leaf fa-fw"></i></button>
<button class="_button tab" :class="{ active: tab === 'tags' }" @click="tab = 'tags'"><i class="fas fa-hashtag fa-fw"></i></button>
</div>
<MkSwitch v-if="props.asReactionPicker" v-model="withRenote" class="withRenote">{{ i18n.ts.reactWithRenote }}</MkSwitch>
</div>
</template>
@ -90,6 +91,7 @@ import { deviceKind } from '@/scripts/device-kind';
import { emojiCategories, instance } from '@/instance';
import { i18n } from '@/i18n';
import { defaultStore } from '@/store';
import MkSwitch from '@/components/form/switch.vue';
const props = withDefaults(defineProps<{
showPinned?: boolean;
@ -101,10 +103,11 @@ const props = withDefaults(defineProps<{
});
const emit = defineEmits<{
(ev: 'chosen', v: string): void;
(ev: 'chosen', v: { reaction: string, withRenote: boolean } | string): void;
}>();
const search = ref<HTMLInputElement>();
const withRenote = ref<boolean>(true);
const emojis = ref<HTMLDivElement>();
const {
@ -278,6 +281,7 @@ function focus() {
function reset() {
if (emojis.value) emojis.value.scrollTop = 0;
q.value = '';
withRenote.value = false; // Renotefalse
}
function getKey(emoji: string | Misskey.entities.CustomEmoji | UnicodeEmojiDef): string {
@ -294,7 +298,7 @@ function chosen(emoji: any, ev?: MouseEvent) {
}
const key = getKey(emoji);
emit('chosen', key);
emit('chosen', (props.asReactionPicker) ? { reaction: key, withRenote: withRenote.value } : key);
// 使
if (!pinned.value.includes(key)) {
@ -452,6 +456,10 @@ defineExpose({
}
}
> .withRenote {
padding: 12px;
}
> .tabs {
display: flex;
display: none;

View File

@ -51,8 +51,8 @@ const emit = defineEmits<{
const modal = ref<InstanceType<typeof MkModal>>();
const picker = ref<InstanceType<typeof MkEmojiPicker>>();
function chosen(emoji: any) {
emit('done', emoji);
function chosen(results: { reaction: string, withRenote: boolean }) {
emit('done', results);
modal.value?.close();
}

View File

@ -207,11 +207,17 @@ function reply(viaKeyboard = false): void {
function react(viaKeyboard = false): void {
pleaseLogin();
blur();
reactionPicker.show(reactButton.value, reaction => {
reactionPicker.show(reactButton.value, results => {
os.api('notes/reactions/create', {
noteId: appearNote.id,
reaction: reaction,
reaction: results.reaction,
});
if (results.withRenote) {
os.api('notes/create', {
renoteId: appearNote.id,
isRenote: true,
});
}
}, () => {
focus();
});

View File

@ -6,7 +6,6 @@
<p><img :src="previewUrl" class="img" :alt="emojiName" /></p>
</FormSection>
<FormButton primary class="_formBlock" @click="uploadEmoji">{{ $ts.emojiApproval }}</FormButton>
<!-- <FormButton primary class="_formBlock" @click="preview">{{ $ts.emojiGenerate }}</FormButton> -->
<FormSection>
<template #label>{{ $ts.settings }}</template>
<FormInput v-model="emojiName" class="_formBlock">

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,

View File

@ -4,7 +4,7 @@ import { popup } from '@/os';
class ReactionPicker {
private src: Ref<HTMLElement | null> = ref(null);
private manualShowing = ref(false);
private onChosen?: (reaction: string) => void;
private onChosen?: ({ reaction: string, withRenote: boolean }) => void;
private onClosed?: () => void;
constructor() {
@ -17,8 +17,8 @@ class ReactionPicker {
asReactionPicker: true,
manualShowing: this.manualShowing
}, {
done: reaction => {
this.onChosen!(reaction);
done: results => {
this.onChosen!({ reaction: results.reaction, withRenote: results.withRenote });
},
close: () => {
this.manualShowing.value = false;