This commit is contained in:
NoriDev 2023-09-12 17:11:32 +09:00
parent 0a9071f1e2
commit 0f1d0b3fa6
2 changed files with 58 additions and 58 deletions

View file

@ -35,13 +35,13 @@ SPDX-License-Identifier: AGPL-3.0-only
<i v-else-if="note.reactionAcceptance === 'likeOnly'" v-tooltip="i18n.ts.likeOnly" class="ti ti-heart"></i>
</span>
<span v-if="note.localOnly" style="margin-right: 0.5em;"><i v-tooltip="i18n.ts._visibility['disableFederation']" class="ti ti-rocket-off"></i></span>
<span :class="$style.renoteTime">
<button ref="renoteTime" class="_button">
<span :class="$style.renoteTime">
<button ref="renoteTime" class="_button">
<i class="ti ti-dots" :class="$style.renoteMenu" @click="showRenoteMenu()"></i>
</button>
<MkTime v-if="defaultStore.state.enableAbsoluteTime" :time="note.createdAt" mode="absolute"/>
<MkTime v-else :time="note.createdAt" mode="relative"/>
</span>
<MkTime v-if="defaultStore.state.enableAbsoluteTime" :time="note.createdAt" mode="absolute"/>
<MkTime v-else :time="note.createdAt" mode="relative"/>
</span>
</div>
</div>
<MkNoteSub v-for="note in conversation" :key="note.id" :class="$style.replyToMore" :note="note"/>
@ -147,12 +147,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<button v-if="appearNote.myReaction == null" ref="heartReactButton" v-tooltip="i18n.ts.like" :class="$style.noteFooterButton" class="_button" @mousedown="heartReact()">
<i class="ti ti-heart"></i>
</button>
<button v-if="appearNote.reactionAcceptance !== 'likeOnly'" ref="reactButton" v-tooltip="i18n.ts.reaction" :class="$style.noteFooterButton" class="_button" @mousedown="react()">
<i v-if="appearNote.myReaction == null" class="ti ti-mood-plus"></i>
<i v-else class="ti ti-mood-edit"></i>
</button>
<button v-if="appearNote.myReaction != null && appearNote.reactionAcceptance == 'likeOnly'" ref="reactButton" :class="[$style.noteFooterButton, $style.reacted]" class="_button" @click="undoReact(appearNote)">
<i class="ti ti-heart-minus"></i>
<button v-if="appearNote.reactionAcceptance !== 'likeOnly'" ref="reactButton" v-tooltip="i18n.ts.reaction" :class="$style.noteFooterButton" class="_button" @mousedown="react()">
<i v-if="appearNote.myReaction == null" class="ti ti-mood-plus"></i>
<i v-else class="ti ti-mood-edit"></i>
</button>
<button v-if="appearNote.myReaction != null && appearNote.reactionAcceptance == 'likeOnly'" ref="reactButton" :class="[$style.noteFooterButton, $style.reacted]" class="_button" @click="undoReact(appearNote)">
<i class="ti ti-heart-minus"></i>
</button>
<button v-if="canRenote" v-tooltip="i18n.ts.quote" class="_button" :class="$style.noteFooterButton" @mousedown="quote()"><i class="ti ti-quote"></i></button>
<button v-if="defaultStore.state.showClipButtonInNoteFooter" ref="clipButton" v-tooltip="i18n.ts.clip" class="_button" :class="$style.noteFooterButton" @mousedown="clip()">
@ -297,7 +297,7 @@ async function renote() {
const { canceled } = await os.confirm({
type: 'info',
text: i18n.ts.renoteConfirm,
caption: i18n.ts.renoteConfirmDescription,
caption: i18n.ts.renoteConfirmDescription,
});
if (canceled) return;
}
@ -486,26 +486,26 @@ async function clip() {
}
function showRenoteMenu(viaKeyboard = false): void {
if (isMyRenote) {
pleaseLogin();
os.popupMenu([{
text: i18n.ts.unrenote,
icon: 'ti ti-trash',
danger: true,
action: () => {
os.api('notes/delete', {
noteId: note.id,
});
isDeleted.value = true;
},
}], renoteTime.value, {
viaKeyboard: viaKeyboard,
});
} else {
os.popupMenu([getAbuseNoteMenu(note, i18n.ts.reportAbuseRenote)], renoteTime.value, {
viaKeyboard: viaKeyboard,
});
}
if (isMyRenote) {
pleaseLogin();
os.popupMenu([{
text: i18n.ts.unrenote,
icon: 'ti ti-trash',
danger: true,
action: () => {
os.api('notes/delete', {
noteId: note.id,
});
isDeleted.value = true;
},
}], renoteTime.value, {
viaKeyboard: viaKeyboard,
});
} else {
os.popupMenu([getAbuseNoteMenu(note, i18n.ts.reportAbuseRenote)], renoteTime.value, {
viaKeyboard: viaKeyboard,
});
}
}
function focus() {

View file

@ -46,10 +46,10 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
</div>
<div v-else-if="!thin_ && !canBack && !(actions && actions.length > 0)" :class="$style.buttonsRight"/>
<div v-if="metadata && metadata.avatar && showFollowButton" :class="$style.followButton">
<MkFollowButton v-if="narrow" :user="metadata.avatar" :transparent="false" :full="false"/>
<MkFollowButton v-else :user="metadata.avatar" :transparent="false" :full="true"/>
</div>
<div v-if="metadata && metadata.avatar && showFollowButton" :class="$style.followButton">
<MkFollowButton v-if="narrow" :user="metadata.avatar" :transparent="false" :full="false"/>
<MkFollowButton v-else :user="metadata.avatar" :transparent="false" :full="true"/>
</div>
</div>
</template>
@ -137,18 +137,18 @@ const preventDrag = (ev: TouchEvent) => {
};
const top = (ev: MouseEvent) => {
const pos = getScrollPosition(el as HTMLElement);
if (el && pos !== 0) {
scrollToTop(el as HTMLElement, { behavior: 'smooth' });
} else if (pos === 0) {
os.popupMenu([{
text: i18n.ts.reload,
icon: 'ti ti-refresh',
action: () => {
location.reload();
},
}], ev.currentTarget ?? ev.target);
}
const pos = getScrollPosition(el as HTMLElement);
if (el && pos !== 0) {
scrollToTop(el as HTMLElement, { behavior: 'smooth' });
} else if (pos === 0) {
os.popupMenu([{
text: i18n.ts.reload,
icon: 'ti ti-refresh',
action: () => {
location.reload();
},
}], ev.currentTarget ?? ev.target);
}
};
function openAccountMenu(ev: MouseEvent) {
@ -180,11 +180,11 @@ function goBack() {
}
const calcBg = () => {
const rawBg = 'var(--bg)';
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
if (narrow) tinyBg.setAlpha(1);
else tinyBg.setAlpha(0.85);
bg.value = tinyBg.toRgbString();
const rawBg = 'var(--bg)';
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
if (narrow) tinyBg.setAlpha(1);
else tinyBg.setAlpha(0.85);
bg.value = tinyBg.toRgbString();
};
let ro: ResizeObserver | null;
@ -216,12 +216,12 @@ onMounted(() => {
ro.observe(el.parentElement as HTMLElement);
}
calcBg();
globalEvents.on('themeChanged', calcBg);
calcBg();
globalEvents.on('themeChanged', calcBg);
eventBus.on('showFollowButton', (showFollowButton_receive) => {
showFollowButton = showFollowButton_receive;
});
eventBus.on('showFollowButton', (showFollowButton_receive) => {
showFollowButton = showFollowButton_receive;
});
});
onUnmounted(() => {