mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-12-15 09:15:44 +01:00
chore: lint fixes
This commit is contained in:
parent
adf3190859
commit
5fb3f8a116
7 changed files with 41 additions and 40 deletions
|
@ -39,8 +39,8 @@ export default defineComponent({
|
||||||
|
|
||||||
inject: {
|
inject: {
|
||||||
sideViewHook: {
|
sideViewHook: {
|
||||||
default: null
|
default: null,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
provide() {
|
provide() {
|
||||||
|
@ -94,31 +94,31 @@ export default defineComponent({
|
||||||
}, {
|
}, {
|
||||||
icon: 'fas fa-expand-alt',
|
icon: 'fas fa-expand-alt',
|
||||||
text: this.$ts.showInPage,
|
text: this.$ts.showInPage,
|
||||||
action: this.expand
|
action: this.expand,
|
||||||
}, this.sideViewHook ? {
|
}, this.sideViewHook ? {
|
||||||
icon: 'fas fa-columns',
|
icon: 'fas fa-columns',
|
||||||
text: this.$ts.openInSideView,
|
text: this.$ts.openInSideView,
|
||||||
action: () => {
|
action: () => {
|
||||||
this.sideViewHook(this.path);
|
this.sideViewHook(this.path);
|
||||||
this.$refs.window.close();
|
this.$refs.window.close();
|
||||||
}
|
},
|
||||||
} : undefined, {
|
} : undefined, {
|
||||||
icon: 'fas fa-external-link-alt',
|
icon: 'fas fa-external-link-alt',
|
||||||
text: this.$ts.popout,
|
text: this.$ts.popout,
|
||||||
action: this.popout
|
action: this.popout,
|
||||||
}, null, {
|
}, null, {
|
||||||
icon: 'fas fa-external-link-alt',
|
icon: 'fas fa-external-link-alt',
|
||||||
text: this.$ts.openInNewTab,
|
text: this.$ts.openInNewTab,
|
||||||
action: () => {
|
action: () => {
|
||||||
window.open(this.url, '_blank');
|
window.open(this.url, '_blank');
|
||||||
this.$refs.window.close();
|
this.$refs.window.close();
|
||||||
}
|
},
|
||||||
}, {
|
}, {
|
||||||
icon: 'fas fa-link',
|
icon: 'fas fa-link',
|
||||||
text: this.$ts.copyLink,
|
text: this.$ts.copyLink,
|
||||||
action: () => {
|
action: () => {
|
||||||
copyToClipboard(this.url);
|
copyToClipboard(this.url);
|
||||||
}
|
},
|
||||||
}];
|
}];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -155,7 +155,7 @@ export default defineComponent({
|
||||||
|
|
||||||
onContextmenu(ev: MouseEvent) {
|
onContextmenu(ev: MouseEvent) {
|
||||||
os.contextMenu(this.contextmenu, ev);
|
os.contextMenu(this.contextmenu, ev);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -222,7 +222,7 @@ function react(viaKeyboard = false): void {
|
||||||
reactionPicker.show(reactButton.value, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
os.api('notes/reactions/create', {
|
os.api('notes/reactions/create', {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
reaction: reaction
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
}, () => {
|
}, () => {
|
||||||
focus();
|
focus();
|
||||||
|
@ -233,7 +233,7 @@ function undoReact(note): void {
|
||||||
const oldReaction = note.myReaction;
|
const oldReaction = note.myReaction;
|
||||||
if (!oldReaction) return;
|
if (!oldReaction) return;
|
||||||
os.api('notes/reactions/delete', {
|
os.api('notes/reactions/delete', {
|
||||||
noteId: note.id
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ function onContextmenu(ev: MouseEvent): void {
|
||||||
|
|
||||||
function menu(viaKeyboard = false): void {
|
function menu(viaKeyboard = false): void {
|
||||||
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, {
|
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, {
|
||||||
viaKeyboard
|
viaKeyboard,
|
||||||
}).then(focus);
|
}).then(focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,12 +269,12 @@ function showRenoteMenu(viaKeyboard = false): void {
|
||||||
danger: true,
|
danger: true,
|
||||||
action: () => {
|
action: () => {
|
||||||
os.api('notes/delete', {
|
os.api('notes/delete', {
|
||||||
noteId: note.id
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
}
|
},
|
||||||
}], renoteTime.value, {
|
}], renoteTime.value, {
|
||||||
viaKeyboard: viaKeyboard
|
viaKeyboard: viaKeyboard,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,14 +288,14 @@ function blur() {
|
||||||
|
|
||||||
os.api('notes/children', {
|
os.api('notes/children', {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
limit: 30
|
limit: 30,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
replies.value = res;
|
replies.value = res;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (appearNote.replyId) {
|
if (appearNote.replyId) {
|
||||||
os.api('notes/conversation', {
|
os.api('notes/conversation', {
|
||||||
noteId: appearNote.replyId
|
noteId: appearNote.replyId,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
conversation.value = res.reverse();
|
conversation.value = res.reverse();
|
||||||
});
|
});
|
||||||
|
|
|
@ -210,7 +210,7 @@ function react(viaKeyboard = false): void {
|
||||||
reactionPicker.show(reactButton.value, reaction => {
|
reactionPicker.show(reactButton.value, reaction => {
|
||||||
os.api('notes/reactions/create', {
|
os.api('notes/reactions/create', {
|
||||||
noteId: appearNote.id,
|
noteId: appearNote.id,
|
||||||
reaction: reaction
|
reaction: reaction,
|
||||||
});
|
});
|
||||||
}, () => {
|
}, () => {
|
||||||
focus();
|
focus();
|
||||||
|
@ -221,7 +221,7 @@ function undoReact(note): void {
|
||||||
const oldReaction = note.myReaction;
|
const oldReaction = note.myReaction;
|
||||||
if (!oldReaction) return;
|
if (!oldReaction) return;
|
||||||
os.api('notes/reactions/delete', {
|
os.api('notes/reactions/delete', {
|
||||||
noteId: note.id
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -245,7 +245,7 @@ function onContextmenu(ev: MouseEvent): void {
|
||||||
|
|
||||||
function menu(viaKeyboard = false): void {
|
function menu(viaKeyboard = false): void {
|
||||||
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, {
|
os.popupMenu(getNoteMenu({ note: note, translating, translation, menuButton }), menuButton.value, {
|
||||||
viaKeyboard
|
viaKeyboard,
|
||||||
}).then(focus);
|
}).then(focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,12 +257,12 @@ function showRenoteMenu(viaKeyboard = false): void {
|
||||||
danger: true,
|
danger: true,
|
||||||
action: () => {
|
action: () => {
|
||||||
os.api('notes/delete', {
|
os.api('notes/delete', {
|
||||||
noteId: note.id
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
}
|
},
|
||||||
}], renoteTime.value, {
|
}], renoteTime.value, {
|
||||||
viaKeyboard: viaKeyboard
|
viaKeyboard: viaKeyboard,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ function focusAfter() {
|
||||||
|
|
||||||
function readPromo() {
|
function readPromo() {
|
||||||
os.api('promo/read', {
|
os.api('promo/read', {
|
||||||
noteId: appearNote.id
|
noteId: appearNote.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<XModalWindow ref="dialog"
|
<XModalWindow
|
||||||
|
ref="dialog"
|
||||||
:width="400"
|
:width="400"
|
||||||
:height="450"
|
:height="450"
|
||||||
:with-ok-button="true"
|
:with-ok-button="true"
|
||||||
|
@ -28,18 +29,18 @@
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, PropType } from 'vue';
|
import { defineComponent, PropType } from 'vue';
|
||||||
import XModalWindow from '@/components/ui/modal-window.vue';
|
import { notificationTypes } from 'misskey-js';
|
||||||
import MkSwitch from './form/switch.vue';
|
import MkSwitch from './form/switch.vue';
|
||||||
import MkInfo from './ui/info.vue';
|
import MkInfo from './ui/info.vue';
|
||||||
import MkButton from './ui/button.vue';
|
import MkButton from './ui/button.vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
import XModalWindow from '@/components/ui/modal-window.vue';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
XModalWindow,
|
XModalWindow,
|
||||||
MkSwitch,
|
MkSwitch,
|
||||||
MkInfo,
|
MkInfo,
|
||||||
MkButton
|
MkButton,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
@ -53,7 +54,7 @@ export default defineComponent({
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
required: false,
|
required: false,
|
||||||
default: true,
|
default: true,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ['done', 'closed'],
|
emits: ['done', 'closed'],
|
||||||
|
@ -93,7 +94,7 @@ export default defineComponent({
|
||||||
for (const type in this.typesMap) {
|
for (const type in this.typesMap) {
|
||||||
this.typesMap[type as typeof notificationTypes[number]] = true;
|
this.typesMap[type as typeof notificationTypes[number]] = true;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -16,7 +16,8 @@
|
||||||
<i v-else-if="notification.type === 'pollVote'" class="fas fa-poll-h"></i>
|
<i v-else-if="notification.type === 'pollVote'" class="fas fa-poll-h"></i>
|
||||||
<i v-else-if="notification.type === 'pollEnded'" class="fas fa-poll-h"></i>
|
<i v-else-if="notification.type === 'pollEnded'" class="fas fa-poll-h"></i>
|
||||||
<!-- notification.reaction が null になることはまずないが、ここでoptional chaining使うと一部ブラウザで刺さるので念の為 -->
|
<!-- notification.reaction が null になることはまずないが、ここでoptional chaining使うと一部ブラウザで刺さるので念の為 -->
|
||||||
<XReactionIcon v-else-if="notification.type === 'reaction'"
|
<XReactionIcon
|
||||||
|
v-else-if="notification.type === 'reaction'"
|
||||||
ref="reactionRef"
|
ref="reactionRef"
|
||||||
:reaction="notification.reaction ? notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : notification.reaction"
|
:reaction="notification.reaction ? notification.reaction.replace(/^:(\w+):$/, ':$1@.:') : notification.reaction"
|
||||||
:custom-emojis="notification.note.emojis"
|
:custom-emojis="notification.note.emojis"
|
||||||
|
@ -74,10 +75,10 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, onMounted, onUnmounted, watch } from 'vue';
|
import { defineComponent, ref, onMounted, onUnmounted, watch } from 'vue';
|
||||||
import * as misskey from 'misskey-js';
|
import * as misskey from 'misskey-js';
|
||||||
import { getNoteSummary } from '@/scripts/get-note-summary';
|
|
||||||
import XReactionIcon from './reaction-icon.vue';
|
import XReactionIcon from './reaction-icon.vue';
|
||||||
import MkFollowButton from './follow-button.vue';
|
import MkFollowButton from './follow-button.vue';
|
||||||
import XReactionTooltip from './reaction-tooltip.vue';
|
import XReactionTooltip from './reaction-tooltip.vue';
|
||||||
|
import { getNoteSummary } from '@/scripts/get-note-summary';
|
||||||
import { notePage } from '@/filters/note';
|
import { notePage } from '@/filters/note';
|
||||||
import { userPage } from '@/filters/user';
|
import { userPage } from '@/filters/user';
|
||||||
import { i18n } from '@/i18n';
|
import { i18n } from '@/i18n';
|
||||||
|
@ -87,7 +88,7 @@ import { useTooltip } from '@/scripts/use-tooltip';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: {
|
components: {
|
||||||
XReactionIcon, MkFollowButton
|
XReactionIcon, MkFollowButton,
|
||||||
},
|
},
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
|
@ -116,7 +117,7 @@ export default defineComponent({
|
||||||
const readObserver = new IntersectionObserver((entries, observer) => {
|
const readObserver = new IntersectionObserver((entries, observer) => {
|
||||||
if (!entries.some(entry => entry.isIntersecting)) return;
|
if (!entries.some(entry => entry.isIntersecting)) return;
|
||||||
stream.send('readNotification', {
|
stream.send('readNotification', {
|
||||||
id: props.notification.id
|
id: props.notification.id,
|
||||||
});
|
});
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,8 +19,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineComponent, markRaw, onUnmounted, onMounted, computed, ref } from 'vue';
|
import { defineComponent, markRaw, onUnmounted, onMounted, computed, ref } from 'vue';
|
||||||
import { notificationTypes } from 'misskey-js';
|
import { notificationTypes } from 'misskey-js';
|
||||||
import MkPagination from '@/components/ui/pagination.vue';
|
import MkPagination, { Paging } from '@/components/ui/pagination.vue';
|
||||||
import { Paging } from '@/components/ui/pagination.vue';
|
|
||||||
import XNotification from '@/components/notification.vue';
|
import XNotification from '@/components/notification.vue';
|
||||||
import XList from '@/components/date-separated-list.vue';
|
import XList from '@/components/date-separated-list.vue';
|
||||||
import XNote from '@/components/note.vue';
|
import XNote from '@/components/note.vue';
|
||||||
|
@ -49,14 +48,14 @@ const onNotification = (notification) => {
|
||||||
const isMuted = props.includeTypes ? !props.includeTypes.includes(notification.type) : $i.mutingNotificationTypes.includes(notification.type);
|
const isMuted = props.includeTypes ? !props.includeTypes.includes(notification.type) : $i.mutingNotificationTypes.includes(notification.type);
|
||||||
if (isMuted || document.visibilityState === 'visible') {
|
if (isMuted || document.visibilityState === 'visible') {
|
||||||
stream.send('readNotification', {
|
stream.send('readNotification', {
|
||||||
id: notification.id
|
id: notification.id,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isMuted) {
|
if (!isMuted) {
|
||||||
pagingComponent.value.prepend({
|
pagingComponent.value.prepend({
|
||||||
...notification,
|
...notification,
|
||||||
isRead: document.visibilityState === 'visible'
|
isRead: document.visibilityState === 'visible',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
type: Number,
|
type: Number,
|
||||||
required: true
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ export default defineComponent({
|
||||||
isZero,
|
isZero,
|
||||||
number,
|
number,
|
||||||
};
|
};
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue