enhance(frontend): クリップボタンをノートアクションに追加できるように

This commit is contained in:
syuilo
2023-03-24 16:54:37 +09:00
parent e438091113
commit 5f52b13325
13 changed files with 199 additions and 62 deletions

View File

@@ -26,6 +26,7 @@ import { i18n } from '@/i18n';
import { definePageMetadata } from '@/scripts/page-metadata';
import { useRouter } from '@/router';
import MkButton from '@/components/MkButton.vue';
import { rolesCache } from '@/cache';
const router = useRouter();
@@ -61,6 +62,7 @@ if (props.id) {
}
async function save() {
rolesCache.delete();
if (role) {
os.apiWithDialog('admin/roles/update', {
roleId: role.id,

View File

@@ -30,6 +30,7 @@ import * as os from '@/os';
import { definePageMetadata } from '@/scripts/page-metadata';
import { url } from '@/config';
import MkButton from '@/components/MkButton.vue';
import { clipsCache } from '@/cache';
const props = defineProps<{
clipId: string,
@@ -108,6 +109,8 @@ const headerActions = $computed(() => clip && isOwned ? [{
clipId: clip.id,
...result,
});
clipsCache.delete();
},
}, ...(clip.isPublic ? [{
icon: 'ti ti-share',
@@ -133,6 +136,8 @@ const headerActions = $computed(() => clip && isOwned ? [{
await os.apiWithDialog('clips/delete', {
clipId: clip.id,
});
clipsCache.delete();
},
}] : null);

View File

@@ -65,6 +65,8 @@ async function create() {
os.apiWithDialog('clips/create', result);
clipsCache.delete();
pagingComponent.reload();
}

View File

@@ -47,6 +47,7 @@
<div class="_gaps_m">
<div class="_gaps_s">
<MkSwitch v-model="showNoteActionsOnlyHover">{{ i18n.ts.showNoteActionsOnlyHover }}</MkSwitch>
<MkSwitch v-model="showClipButtonInNoteFooter">{{ i18n.ts.showClipButtonInNoteFooter }}</MkSwitch>
<MkSwitch v-model="collapseRenotes">{{ i18n.ts.collapseRenotes }}</MkSwitch>
<MkSwitch v-model="advancedMfm">{{ i18n.ts.enableAdvancedMfm }}</MkSwitch>
<MkSwitch v-if="advancedMfm" v-model="animatedMfm">{{ i18n.ts.enableAnimatedMfm }}</MkSwitch>
@@ -143,6 +144,7 @@ async function reloadAsk() {
const overridedDeviceKind = computed(defaultStore.makeGetterSetter('overridedDeviceKind'));
const serverDisconnectedBehavior = computed(defaultStore.makeGetterSetter('serverDisconnectedBehavior'));
const showNoteActionsOnlyHover = computed(defaultStore.makeGetterSetter('showNoteActionsOnlyHover'));
const showClipButtonInNoteFooter = computed(defaultStore.makeGetterSetter('showClipButtonInNoteFooter'));
const collapseRenotes = computed(defaultStore.makeGetterSetter('collapseRenotes'));
const reduceAnimation = computed(defaultStore.makeGetterSetter('animation', v => !v, v => !v));
const useBlurEffectForModal = computed(defaultStore.makeGetterSetter('useBlurEffectForModal'));