2020-01-29 12:37:25 -07:00
|
|
|
|
<template>
|
|
|
|
|
<div
|
|
|
|
|
class="note _panel"
|
2020-07-26 22:34:20 -06:00
|
|
|
|
v-if="!muted"
|
2020-07-26 17:46:21 -06:00
|
|
|
|
v-show="!isDeleted"
|
2020-02-05 17:09:24 -07:00
|
|
|
|
:tabindex="!isDeleted ? '-1' : null"
|
2020-01-29 12:37:25 -07:00
|
|
|
|
:class="{ renote: isRenote }"
|
|
|
|
|
v-hotkey="keymap"
|
|
|
|
|
v-size="[{ max: 500 }, { max: 450 }, { max: 350 }, { max: 300 }]"
|
|
|
|
|
>
|
2020-05-10 02:37:11 -06:00
|
|
|
|
<x-sub v-for="note in conversation" class="reply-to-more" :key="note.id" :note="note"/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<x-sub :note="appearNote.reply" class="reply-to" v-if="appearNote.reply"/>
|
2020-02-18 02:14:38 -07:00
|
|
|
|
<div class="info" v-if="pinned"><fa :icon="faThumbtack"/> {{ $t('pinnedNote') }}</div>
|
2020-02-18 03:05:11 -07:00
|
|
|
|
<div class="info" v-if="appearNote._prId_"><fa :icon="faBullhorn"/> {{ $t('promotion') }}<button class="_textButton hide" @click="readPromo()">{{ $t('hideThisNote') }} <fa :icon="faTimes"/></button></div>
|
|
|
|
|
<div class="info" v-if="appearNote._featuredId_"><fa :icon="faBolt"/> {{ $t('featured') }}</div>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<div class="renote" v-if="isRenote">
|
|
|
|
|
<mk-avatar class="avatar" :user="note.user"/>
|
|
|
|
|
<fa :icon="faRetweet"/>
|
|
|
|
|
<i18n path="renotedBy" tag="span">
|
|
|
|
|
<router-link class="name" :to="note.user | userPage" v-user-preview="note.userId" place="user">
|
|
|
|
|
<mk-user-name :user="note.user"/>
|
|
|
|
|
</router-link>
|
|
|
|
|
</i18n>
|
|
|
|
|
<div class="info">
|
2020-05-15 05:39:11 -06:00
|
|
|
|
<button class="_button time" @click="showRenoteMenu()" ref="renoteTime">
|
2020-05-15 21:15:59 -06:00
|
|
|
|
<fa class="dropdownIcon" v-if="isMyRenote" :icon="faEllipsisH"/>
|
2020-05-15 05:39:11 -06:00
|
|
|
|
<mk-time :time="note.createdAt"/>
|
|
|
|
|
</button>
|
2020-05-10 00:36:42 -06:00
|
|
|
|
<span class="visibility" v-if="note.visibility !== 'public'">
|
|
|
|
|
<fa v-if="note.visibility === 'home'" :icon="faHome"/>
|
|
|
|
|
<fa v-if="note.visibility === 'followers'" :icon="faUnlock"/>
|
|
|
|
|
<fa v-if="note.visibility === 'specified'" :icon="faEnvelope"/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
</span>
|
2020-05-16 07:06:39 -06:00
|
|
|
|
<span class="localOnly" v-if="note.localOnly"><fa :icon="faBiohazard"/></span>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<article class="article">
|
2020-07-24 10:47:01 -06:00
|
|
|
|
<mk-avatar class="avatar" :user="appearNote.user" v-once/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<div class="main">
|
|
|
|
|
<x-note-header class="header" :note="appearNote" :mini="true"/>
|
2020-07-26 17:46:21 -06:00
|
|
|
|
<div class="body" ref="noteBody">
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<p v-if="appearNote.cw != null" class="cw">
|
2020-07-27 08:25:37 -06:00
|
|
|
|
<mfm v-if="appearNote.cw != ''" class="text" :text="appearNote.cw" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" v-once/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<x-cw-button v-model="showContent" :note="appearNote"/>
|
|
|
|
|
</p>
|
|
|
|
|
<div class="content" v-show="appearNote.cw == null || showContent">
|
|
|
|
|
<div class="text">
|
|
|
|
|
<span v-if="appearNote.isHidden" style="opacity: 0.5">({{ $t('private') }})</span>
|
|
|
|
|
<router-link class="reply" v-if="appearNote.replyId" :to="`/notes/${appearNote.replyId}`"><fa :icon="faReply"/></router-link>
|
2020-07-27 08:25:37 -06:00
|
|
|
|
<mfm v-if="appearNote.text" :text="appearNote.text" :author="appearNote.user" :i="$store.state.i" :custom-emojis="appearNote.emojis" v-once/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<a class="rp" v-if="appearNote.renote != null">RN:</a>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="files" v-if="appearNote.files.length > 0">
|
2020-04-15 10:04:21 -06:00
|
|
|
|
<x-media-list :media-list="appearNote.files" :parent-element="noteBody"/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
</div>
|
2020-05-10 02:06:20 -06:00
|
|
|
|
<x-poll v-if="appearNote.poll" :note="appearNote" ref="pollViewer" class="poll"/>
|
2020-07-03 08:12:50 -06:00
|
|
|
|
<mk-url-preview v-for="url in urls" :url="url" :key="url" :compact="true" :detail="detail" class="url-preview"/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<div class="renote" v-if="appearNote.renote"><x-note-preview :note="appearNote.renote"/></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2020-07-26 17:46:21 -06:00
|
|
|
|
<footer class="footer">
|
2020-07-27 08:25:37 -06:00
|
|
|
|
<x-reactions-viewer :note="appearNote" ref="reactionsViewer"/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<button @click="reply()" class="button _button">
|
|
|
|
|
<template v-if="appearNote.reply"><fa :icon="faReplyAll"/></template>
|
|
|
|
|
<template v-else><fa :icon="faReply"/></template>
|
|
|
|
|
<p class="count" v-if="appearNote.repliesCount > 0">{{ appearNote.repliesCount }}</p>
|
|
|
|
|
</button>
|
2020-02-16 05:10:52 -07:00
|
|
|
|
<button v-if="canRenote" @click="renote()" class="button _button" ref="renoteButton">
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<fa :icon="faRetweet"/><p class="count" v-if="appearNote.renoteCount > 0">{{ appearNote.renoteCount }}</p>
|
|
|
|
|
</button>
|
|
|
|
|
<button v-else class="button _button">
|
|
|
|
|
<fa :icon="faBan"/>
|
|
|
|
|
</button>
|
2020-07-27 08:25:37 -06:00
|
|
|
|
<button v-if="!isMyNote && appearNote.myReaction == null" class="button _button" @click="react()" ref="reactButton">
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<fa :icon="faPlus"/>
|
|
|
|
|
</button>
|
2020-07-27 08:25:37 -06:00
|
|
|
|
<button v-if="!isMyNote && appearNote.myReaction != null" class="button _button reacted" @click="undoReact(appearNote)" ref="reactButton">
|
2020-01-29 12:37:25 -07:00
|
|
|
|
<fa :icon="faMinus"/>
|
|
|
|
|
</button>
|
|
|
|
|
<button class="button _button" @click="menu()" ref="menuButton">
|
|
|
|
|
<fa :icon="faEllipsisH"/>
|
|
|
|
|
</button>
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
|
|
|
|
</article>
|
2020-05-10 01:22:39 -06:00
|
|
|
|
<x-sub v-for="note in replies" :key="note.id" :note="note" class="reply" :detail="true"/>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
</div>
|
2020-07-26 22:34:20 -06:00
|
|
|
|
<div v-else class="_panel muted" @click="muted = false">
|
|
|
|
|
<i18n path="userSaysSomething" tag="small">
|
|
|
|
|
<router-link class="name" :to="appearNote.user | userPage" v-user-preview="appearNote.userId" place="name">
|
|
|
|
|
<mk-user-name :user="appearNote.user"/>
|
|
|
|
|
</router-link>
|
|
|
|
|
</i18n>
|
|
|
|
|
</div>
|
2020-01-29 12:37:25 -07:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
import Vue from 'vue';
|
2020-07-11 09:38:55 -06:00
|
|
|
|
import { faBolt, faTimes, faBullhorn, faStar, faLink, faExternalLinkSquareAlt, faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan, faQuoteRight, faInfoCircle, faBiohazard, faPlug } from '@fortawesome/free-solid-svg-icons';
|
2020-03-21 03:58:05 -06:00
|
|
|
|
import { faCopy, faTrashAlt, faEdit, faEye, faEyeSlash } from '@fortawesome/free-regular-svg-icons';
|
2020-01-29 12:37:25 -07:00
|
|
|
|
import { parse } from '../../mfm/parse';
|
|
|
|
|
import { sum, unique } from '../../prelude/array';
|
|
|
|
|
import XSub from './note.sub.vue';
|
|
|
|
|
import XNoteHeader from './note-header.vue';
|
|
|
|
|
import XNotePreview from './note-preview.vue';
|
|
|
|
|
import XReactionsViewer from './reactions-viewer.vue';
|
|
|
|
|
import XMediaList from './media-list.vue';
|
|
|
|
|
import XCwButton from './cw-button.vue';
|
|
|
|
|
import XPoll from './poll.vue';
|
2020-03-21 23:38:33 -06:00
|
|
|
|
import MkUrlPreview from './url-preview.vue';
|
2020-01-29 12:37:25 -07:00
|
|
|
|
import MkReactionPicker from './reaction-picker.vue';
|
|
|
|
|
import pleaseLogin from '../scripts/please-login';
|
2020-02-08 07:52:40 -07:00
|
|
|
|
import { focusPrev, focusNext } from '../scripts/focus';
|
|
|
|
|
import { url } from '../config';
|
|
|
|
|
import copyToClipboard from '../scripts/copy-to-clipboard';
|
2020-07-26 22:34:20 -06:00
|
|
|
|
import { checkWordMute } from '../scripts/check-word-mute';
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
|
|
|
|
export default Vue.extend({
|
2020-07-27 08:25:37 -06:00
|
|
|
|
model: {
|
|
|
|
|
prop: 'note',
|
|
|
|
|
event: 'updated'
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
components: {
|
|
|
|
|
XSub,
|
|
|
|
|
XNoteHeader,
|
|
|
|
|
XNotePreview,
|
|
|
|
|
XReactionsViewer,
|
|
|
|
|
XMediaList,
|
|
|
|
|
XCwButton,
|
|
|
|
|
XPoll,
|
2020-03-21 23:38:33 -06:00
|
|
|
|
MkUrlPreview,
|
2020-01-29 12:37:25 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
props: {
|
|
|
|
|
note: {
|
|
|
|
|
type: Object,
|
|
|
|
|
required: true
|
|
|
|
|
},
|
|
|
|
|
detail: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: false,
|
|
|
|
|
default: false
|
|
|
|
|
},
|
|
|
|
|
pinned: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
required: false,
|
|
|
|
|
default: false
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
connection: null,
|
|
|
|
|
conversation: [],
|
|
|
|
|
replies: [],
|
|
|
|
|
showContent: false,
|
2020-07-26 17:46:21 -06:00
|
|
|
|
isDeleted: false,
|
2020-07-26 22:34:20 -06:00
|
|
|
|
muted: false,
|
2020-04-15 10:04:21 -06:00
|
|
|
|
noteBody: this.$refs.noteBody,
|
2020-07-11 09:38:55 -06:00
|
|
|
|
faEdit, faBolt, faTimes, faBullhorn, faPlus, faMinus, faRetweet, faReply, faReplyAll, faEllipsisH, faHome, faUnlock, faEnvelope, faThumbtack, faBan, faBiohazard, faPlug
|
2020-01-29 12:37:25 -07:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
computed: {
|
|
|
|
|
keymap(): any {
|
|
|
|
|
return {
|
|
|
|
|
'r': () => this.reply(true),
|
|
|
|
|
'e|a|plus': () => this.react(true),
|
|
|
|
|
'q': () => this.renote(true),
|
|
|
|
|
'f|b': this.favorite,
|
|
|
|
|
'delete|ctrl+d': this.del,
|
|
|
|
|
'ctrl+q': this.renoteDirectly,
|
|
|
|
|
'up|k|shift+tab': this.focusBefore,
|
|
|
|
|
'down|j|tab': this.focusAfter,
|
|
|
|
|
'esc': this.blur,
|
|
|
|
|
'm|o': () => this.menu(true),
|
|
|
|
|
's': this.toggleShowContent,
|
|
|
|
|
'1': () => this.reactDirectly(this.$store.state.settings.reactions[0]),
|
|
|
|
|
'2': () => this.reactDirectly(this.$store.state.settings.reactions[1]),
|
|
|
|
|
'3': () => this.reactDirectly(this.$store.state.settings.reactions[2]),
|
|
|
|
|
'4': () => this.reactDirectly(this.$store.state.settings.reactions[3]),
|
|
|
|
|
'5': () => this.reactDirectly(this.$store.state.settings.reactions[4]),
|
|
|
|
|
'6': () => this.reactDirectly(this.$store.state.settings.reactions[5]),
|
|
|
|
|
'7': () => this.reactDirectly(this.$store.state.settings.reactions[6]),
|
|
|
|
|
'8': () => this.reactDirectly(this.$store.state.settings.reactions[7]),
|
|
|
|
|
'9': () => this.reactDirectly(this.$store.state.settings.reactions[8]),
|
|
|
|
|
'0': () => this.reactDirectly(this.$store.state.settings.reactions[9]),
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isRenote(): boolean {
|
|
|
|
|
return (this.note.renote &&
|
|
|
|
|
this.note.text == null &&
|
|
|
|
|
this.note.fileIds.length == 0 &&
|
|
|
|
|
this.note.poll == null);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
appearNote(): any {
|
|
|
|
|
return this.isRenote ? this.note.renote : this.note;
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
isMyNote(): boolean {
|
|
|
|
|
return this.$store.getters.isSignedIn && (this.$store.state.i.id === this.appearNote.userId);
|
|
|
|
|
},
|
|
|
|
|
|
2020-05-15 21:15:59 -06:00
|
|
|
|
isMyRenote(): boolean {
|
|
|
|
|
return this.$store.getters.isSignedIn && (this.$store.state.i.id === this.note.userId);
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-16 05:10:52 -07:00
|
|
|
|
canRenote(): boolean {
|
|
|
|
|
return ['public', 'home'].includes(this.appearNote.visibility) || this.isMyNote;
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
reactionsCount(): number {
|
2020-07-27 08:25:37 -06:00
|
|
|
|
return this.appearNote.reactions
|
|
|
|
|
? sum(Object.values(this.appearNote.reactions))
|
|
|
|
|
: 0;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
urls(): string[] {
|
|
|
|
|
if (this.appearNote.text) {
|
|
|
|
|
const ast = parse(this.appearNote.text);
|
|
|
|
|
// TODO: 再帰的にURL要素がないか調べる
|
|
|
|
|
const urls = unique(ast
|
|
|
|
|
.filter(t => ((t.node.type == 'url' || t.node.type == 'link') && t.node.props.url && !t.node.props.silent))
|
|
|
|
|
.map(t => t.node.props.url));
|
|
|
|
|
|
|
|
|
|
// unique without hash
|
|
|
|
|
// [ http://a/#1, http://a/#2, http://b/#3 ] => [ http://a/#1, http://b/#3 ]
|
|
|
|
|
const removeHash = x => x.replace(/#[^#]*$/, '');
|
|
|
|
|
|
|
|
|
|
return urls.reduce((array, url) => {
|
|
|
|
|
const removed = removeHash(url);
|
|
|
|
|
if (!array.map(x => removeHash(x)).includes(removed)) array.push(url);
|
|
|
|
|
return array;
|
|
|
|
|
}, []);
|
|
|
|
|
} else {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2020-07-26 22:34:20 -06:00
|
|
|
|
async created() {
|
2020-01-29 12:37:25 -07:00
|
|
|
|
if (this.$store.getters.isSignedIn) {
|
|
|
|
|
this.connection = this.$root.stream;
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-26 22:34:20 -06:00
|
|
|
|
this.muted = await checkWordMute(this.appearNote, this.$store.state.i, this.$store.state.settings.mutedWords);
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
if (this.detail) {
|
|
|
|
|
this.$root.api('notes/children', {
|
|
|
|
|
noteId: this.appearNote.id,
|
|
|
|
|
limit: 30
|
|
|
|
|
}).then(replies => {
|
|
|
|
|
this.replies = replies;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (this.appearNote.replyId) {
|
|
|
|
|
this.$root.api('notes/conversation', {
|
|
|
|
|
noteId: this.appearNote.replyId
|
|
|
|
|
}).then(conversation => {
|
|
|
|
|
this.conversation = conversation.reverse();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
mounted() {
|
|
|
|
|
this.capture(true);
|
|
|
|
|
|
|
|
|
|
if (this.$store.getters.isSignedIn) {
|
|
|
|
|
this.connection.on('_connected_', this.onStreamConnected);
|
|
|
|
|
}
|
2020-04-15 10:04:21 -06:00
|
|
|
|
|
2020-07-26 17:46:21 -06:00
|
|
|
|
this.noteBody = this.$refs.noteBody;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
beforeDestroy() {
|
|
|
|
|
this.decapture(true);
|
|
|
|
|
|
|
|
|
|
if (this.$store.getters.isSignedIn) {
|
|
|
|
|
this.connection.off('_connected_', this.onStreamConnected);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
2020-07-27 08:25:37 -06:00
|
|
|
|
updateAppearNote(v) {
|
|
|
|
|
this.$emit('updated', Object.freeze(this.isRenote ? {
|
|
|
|
|
...this.note,
|
|
|
|
|
renote: {
|
|
|
|
|
...this.note.renote,
|
|
|
|
|
...v
|
|
|
|
|
}
|
|
|
|
|
} : {
|
|
|
|
|
...this.note,
|
|
|
|
|
...v
|
|
|
|
|
}));
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-18 02:14:38 -07:00
|
|
|
|
readPromo() {
|
|
|
|
|
(this as any).$root.api('promo/read', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
});
|
2020-07-26 17:46:21 -06:00
|
|
|
|
this.isDeleted = true;
|
2020-02-18 02:14:38 -07:00
|
|
|
|
},
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
capture(withHandler = false) {
|
|
|
|
|
if (this.$store.getters.isSignedIn) {
|
2020-02-08 11:49:18 -07:00
|
|
|
|
this.connection.send(document.body.contains(this.$el) ? 'sn' : 's', { id: this.appearNote.id });
|
|
|
|
|
if (withHandler) this.connection.on('noteUpdated', this.onStreamNoteUpdated);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
decapture(withHandler = false) {
|
|
|
|
|
if (this.$store.getters.isSignedIn) {
|
|
|
|
|
this.connection.send('un', {
|
|
|
|
|
id: this.appearNote.id
|
|
|
|
|
});
|
|
|
|
|
if (withHandler) this.connection.off('noteUpdated', this.onStreamNoteUpdated);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onStreamConnected() {
|
|
|
|
|
this.capture();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onStreamNoteUpdated(data) {
|
|
|
|
|
const { type, id, body } = data;
|
|
|
|
|
|
|
|
|
|
if (id !== this.appearNote.id) return;
|
|
|
|
|
|
|
|
|
|
switch (type) {
|
|
|
|
|
case 'reacted': {
|
|
|
|
|
const reaction = body.reaction;
|
|
|
|
|
|
2020-07-27 08:25:37 -06:00
|
|
|
|
// DeepではなくShallowコピーであることに注意。n.reactions[reaction] = hogeとかしないように(親からもらったデータをミューテートすることになるので)
|
|
|
|
|
let n = {
|
|
|
|
|
...this.appearNote,
|
|
|
|
|
};
|
|
|
|
|
|
2020-04-13 09:42:59 -06:00
|
|
|
|
if (body.emoji) {
|
2020-07-27 08:25:37 -06:00
|
|
|
|
const emojis = this.appearNote.emojis || [];
|
|
|
|
|
if (!emojis.includes(body.emoji)) {
|
|
|
|
|
n.emojis = [...emojis, body.emoji];
|
2020-04-13 09:42:59 -06:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-27 08:25:37 -06:00
|
|
|
|
// TODO: reactionsプロパティがない場合ってあったっけ? なければ || {} は消せる
|
|
|
|
|
const currentCount = (this.appearNote.reactions || {})[reaction] || 0;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
|
|
|
|
// Increment the count
|
2020-07-27 08:25:37 -06:00
|
|
|
|
n.reactions = {
|
|
|
|
|
...this.appearNote.reactions,
|
|
|
|
|
[reaction]: currentCount + 1
|
|
|
|
|
};
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
2020-07-26 17:46:21 -06:00
|
|
|
|
if (body.userId === this.$store.state.i.id) {
|
2020-07-27 08:25:37 -06:00
|
|
|
|
n.myReaction = reaction;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
2020-07-27 08:25:37 -06:00
|
|
|
|
|
|
|
|
|
this.updateAppearNote(n);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'unreacted': {
|
|
|
|
|
const reaction = body.reaction;
|
|
|
|
|
|
2020-07-27 08:25:37 -06:00
|
|
|
|
// DeepではなくShallowコピーであることに注意。n.reactions[reaction] = hogeとかしないように(親からもらったデータをミューテートすることになるので)
|
|
|
|
|
let n = {
|
|
|
|
|
...this.appearNote,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// TODO: reactionsプロパティがない場合ってあったっけ? なければ || {} は消せる
|
|
|
|
|
const currentCount = (this.appearNote.reactions || {})[reaction] || 0;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
|
|
|
|
// Decrement the count
|
2020-07-27 08:25:37 -06:00
|
|
|
|
n.reactions = {
|
|
|
|
|
...this.appearNote.reactions,
|
|
|
|
|
[reaction]: Math.max(0, currentCount - 1)
|
|
|
|
|
};
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
2020-07-26 17:46:21 -06:00
|
|
|
|
if (body.userId === this.$store.state.i.id) {
|
2020-07-27 08:25:37 -06:00
|
|
|
|
n.myReaction = null;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
2020-07-27 08:25:37 -06:00
|
|
|
|
|
|
|
|
|
this.updateAppearNote(n);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'pollVoted': {
|
|
|
|
|
const choice = body.choice;
|
2020-07-27 08:25:37 -06:00
|
|
|
|
|
|
|
|
|
// DeepではなくShallowコピーであることに注意。n.reactions[reaction] = hogeとかしないように(親からもらったデータをミューテートすることになるので)
|
|
|
|
|
let n = {
|
|
|
|
|
...this.appearNote,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
n.poll = {
|
|
|
|
|
...this.appearNote.poll,
|
|
|
|
|
choices: {
|
|
|
|
|
...this.appearNote.poll.choices,
|
|
|
|
|
[choice]: {
|
|
|
|
|
...this.appearNote.poll.choices[choice],
|
|
|
|
|
votes: this.appearNote.poll.choices[choice].votes + 1,
|
|
|
|
|
...(body.userId === this.$store.state.i.id ? {
|
|
|
|
|
isVoted: true
|
|
|
|
|
} : {})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.updateAppearNote(n);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case 'deleted': {
|
2020-07-26 17:46:21 -06:00
|
|
|
|
this.isDeleted = true;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
reply(viaKeyboard = false) {
|
|
|
|
|
pleaseLogin(this.$root);
|
|
|
|
|
this.$root.post({
|
|
|
|
|
reply: this.appearNote,
|
|
|
|
|
animation: !viaKeyboard,
|
|
|
|
|
}, () => {
|
|
|
|
|
this.focus();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-08 07:52:40 -07:00
|
|
|
|
renote(viaKeyboard = false) {
|
2020-01-29 12:37:25 -07:00
|
|
|
|
pleaseLogin(this.$root);
|
|
|
|
|
this.blur();
|
2020-02-08 01:36:23 -07:00
|
|
|
|
this.$root.menu({
|
|
|
|
|
items: [{
|
|
|
|
|
text: this.$t('renote'),
|
|
|
|
|
icon: faRetweet,
|
|
|
|
|
action: () => {
|
|
|
|
|
(this as any).$root.api('notes/create', {
|
|
|
|
|
renoteId: this.appearNote.id
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
text: this.$t('quote'),
|
|
|
|
|
icon: faQuoteRight,
|
|
|
|
|
action: () => {
|
|
|
|
|
this.$root.post({
|
|
|
|
|
renote: this.appearNote,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]
|
2020-01-29 12:37:25 -07:00
|
|
|
|
source: this.$refs.renoteButton,
|
2020-02-08 07:52:40 -07:00
|
|
|
|
viaKeyboard
|
2020-02-22 10:34:54 -07:00
|
|
|
|
});
|
2020-01-29 12:37:25 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
renoteDirectly() {
|
|
|
|
|
(this as any).$root.api('notes/create', {
|
|
|
|
|
renoteId: this.appearNote.id
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
react(viaKeyboard = false) {
|
|
|
|
|
pleaseLogin(this.$root);
|
|
|
|
|
this.blur();
|
|
|
|
|
const picker = this.$root.new(MkReactionPicker, {
|
|
|
|
|
source: this.$refs.reactButton,
|
|
|
|
|
showFocus: viaKeyboard,
|
|
|
|
|
});
|
|
|
|
|
picker.$once('chosen', reaction => {
|
|
|
|
|
this.$root.api('notes/reactions/create', {
|
|
|
|
|
noteId: this.appearNote.id,
|
|
|
|
|
reaction: reaction
|
|
|
|
|
}).then(() => {
|
|
|
|
|
picker.close();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
picker.$once('closed', this.focus);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
reactDirectly(reaction) {
|
|
|
|
|
this.$root.api('notes/reactions/create', {
|
|
|
|
|
noteId: this.appearNote.id,
|
|
|
|
|
reaction: reaction
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-07-27 08:25:37 -06:00
|
|
|
|
undoReact(note) {
|
|
|
|
|
const oldReaction = note.myReaction;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
if (!oldReaction) return;
|
|
|
|
|
this.$root.api('notes/reactions/delete', {
|
2020-07-27 08:25:37 -06:00
|
|
|
|
noteId: note.id
|
2020-01-29 12:37:25 -07:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
favorite() {
|
|
|
|
|
pleaseLogin(this.$root);
|
|
|
|
|
this.$root.api('notes/favorites/create', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
del() {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
text: this.$t('noteDeleteConfirm'),
|
|
|
|
|
showCancelButton: true
|
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
|
|
this.$root.api('notes/delete', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-03-21 03:58:05 -06:00
|
|
|
|
delEdit() {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'warning',
|
|
|
|
|
text: this.$t('deleteAndEditConfirm'),
|
|
|
|
|
showCancelButton: true
|
|
|
|
|
}).then(({ canceled }) => {
|
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
|
|
this.$root.api('notes/delete', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
this.$root.post({ initialNote: this.appearNote, renote: this.appearNote.renote, reply: this.appearNote.reply });
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-08 07:52:40 -07:00
|
|
|
|
toggleFavorite(favorite: boolean) {
|
|
|
|
|
this.$root.api(favorite ? 'notes/favorites/create' : 'notes/favorites/delete', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
toggleWatch(watch: boolean) {
|
|
|
|
|
this.$root.api(watch ? 'notes/watching/create' : 'notes/watching/delete', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
2020-01-29 12:37:25 -07:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-08 07:52:40 -07:00
|
|
|
|
async menu(viaKeyboard = false) {
|
|
|
|
|
let menu;
|
|
|
|
|
if (this.$store.getters.isSignedIn) {
|
|
|
|
|
const state = await this.$root.api('notes/state', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
});
|
|
|
|
|
menu = [{
|
2020-02-21 14:57:54 -07:00
|
|
|
|
type: 'link',
|
|
|
|
|
icon: faInfoCircle,
|
|
|
|
|
text: this.$t('details'),
|
|
|
|
|
to: '/notes/' + this.appearNote.id
|
|
|
|
|
}, null, {
|
2020-02-08 07:52:40 -07:00
|
|
|
|
icon: faCopy,
|
|
|
|
|
text: this.$t('copyContent'),
|
|
|
|
|
action: this.copyContent
|
|
|
|
|
}, {
|
|
|
|
|
icon: faLink,
|
|
|
|
|
text: this.$t('copyLink'),
|
|
|
|
|
action: this.copyLink
|
2020-04-02 06:59:14 -06:00
|
|
|
|
}, (this.appearNote.url || this.appearNote.uri) ? {
|
2020-02-08 07:52:40 -07:00
|
|
|
|
icon: faExternalLinkSquareAlt,
|
|
|
|
|
text: this.$t('showOnRemote'),
|
|
|
|
|
action: () => {
|
2020-04-02 06:59:14 -06:00
|
|
|
|
window.open(this.appearNote.url || this.appearNote.uri, '_blank');
|
2020-02-08 07:52:40 -07:00
|
|
|
|
}
|
|
|
|
|
} : undefined,
|
|
|
|
|
null,
|
|
|
|
|
state.isFavorited ? {
|
|
|
|
|
icon: faStar,
|
|
|
|
|
text: this.$t('unfavorite'),
|
|
|
|
|
action: () => this.toggleFavorite(false)
|
|
|
|
|
} : {
|
|
|
|
|
icon: faStar,
|
|
|
|
|
text: this.$t('favorite'),
|
|
|
|
|
action: () => this.toggleFavorite(true)
|
|
|
|
|
},
|
|
|
|
|
this.appearNote.userId != this.$store.state.i.id ? state.isWatching ? {
|
|
|
|
|
icon: faEyeSlash,
|
|
|
|
|
text: this.$t('unwatch'),
|
|
|
|
|
action: () => this.toggleWatch(false)
|
|
|
|
|
} : {
|
|
|
|
|
icon: faEye,
|
|
|
|
|
text: this.$t('watch'),
|
|
|
|
|
action: () => this.toggleWatch(true)
|
|
|
|
|
} : undefined,
|
|
|
|
|
this.appearNote.userId == this.$store.state.i.id ? (this.$store.state.i.pinnedNoteIds || []).includes(this.appearNote.id) ? {
|
|
|
|
|
icon: faThumbtack,
|
|
|
|
|
text: this.$t('unpin'),
|
|
|
|
|
action: () => this.togglePin(false)
|
|
|
|
|
} : {
|
|
|
|
|
icon: faThumbtack,
|
|
|
|
|
text: this.$t('pin'),
|
|
|
|
|
action: () => this.togglePin(true)
|
|
|
|
|
} : undefined,
|
2020-02-17 16:41:32 -07:00
|
|
|
|
...(this.$store.state.i.isModerator || this.$store.state.i.isAdmin ? [
|
|
|
|
|
null,
|
|
|
|
|
{
|
|
|
|
|
icon: faBullhorn,
|
|
|
|
|
text: this.$t('promote'),
|
|
|
|
|
action: this.promote
|
|
|
|
|
}]
|
|
|
|
|
: []
|
|
|
|
|
),
|
2020-04-13 08:27:12 -06:00
|
|
|
|
...(this.appearNote.userId == this.$store.state.i.id || this.$store.state.i.isModerator || this.$store.state.i.isAdmin ? [
|
2020-02-08 07:52:40 -07:00
|
|
|
|
null,
|
2020-04-13 08:27:12 -06:00
|
|
|
|
this.appearNote.userId == this.$store.state.i.id ? {
|
2020-03-21 03:58:05 -06:00
|
|
|
|
icon: faEdit,
|
|
|
|
|
text: this.$t('deleteAndEdit'),
|
|
|
|
|
action: this.delEdit
|
2020-04-13 08:27:12 -06:00
|
|
|
|
} : undefined,
|
2020-02-08 07:52:40 -07:00
|
|
|
|
{
|
|
|
|
|
icon: faTrashAlt,
|
|
|
|
|
text: this.$t('delete'),
|
|
|
|
|
action: this.del
|
|
|
|
|
}]
|
|
|
|
|
: []
|
|
|
|
|
)]
|
|
|
|
|
.filter(x => x !== undefined);
|
|
|
|
|
} else {
|
|
|
|
|
menu = [{
|
|
|
|
|
icon: faCopy,
|
|
|
|
|
text: this.$t('copyContent'),
|
|
|
|
|
action: this.copyContent
|
|
|
|
|
}, {
|
|
|
|
|
icon: faLink,
|
|
|
|
|
text: this.$t('copyLink'),
|
|
|
|
|
action: this.copyLink
|
2020-04-02 06:59:14 -06:00
|
|
|
|
}, (this.appearNote.url || this.appearNote.uri) ? {
|
2020-02-08 07:52:40 -07:00
|
|
|
|
icon: faExternalLinkSquareAlt,
|
|
|
|
|
text: this.$t('showOnRemote'),
|
|
|
|
|
action: () => {
|
2020-04-02 06:59:14 -06:00
|
|
|
|
window.open(this.appearNote.url || this.appearNote.uri, '_blank');
|
2020-02-08 07:52:40 -07:00
|
|
|
|
}
|
|
|
|
|
} : undefined]
|
|
|
|
|
.filter(x => x !== undefined);
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-11 09:38:55 -06:00
|
|
|
|
if (this.$store.state.noteActions.length > 0) {
|
|
|
|
|
menu = menu.concat([null, ...this.$store.state.noteActions.map(action => ({
|
|
|
|
|
icon: faPlug,
|
|
|
|
|
text: action.title,
|
|
|
|
|
action: () => {
|
|
|
|
|
action.handler(this.appearNote);
|
|
|
|
|
}
|
|
|
|
|
}))]);
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-08 07:52:40 -07:00
|
|
|
|
this.$root.menu({
|
|
|
|
|
items: menu,
|
|
|
|
|
source: this.$refs.menuButton,
|
|
|
|
|
viaKeyboard
|
|
|
|
|
}).then(this.focus);
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-09 02:52:53 -07:00
|
|
|
|
showRenoteMenu(viaKeyboard = false) {
|
2020-05-15 21:15:59 -06:00
|
|
|
|
if (!this.isMyRenote) return;
|
2020-02-05 17:09:24 -07:00
|
|
|
|
this.$root.menu({
|
|
|
|
|
items: [{
|
|
|
|
|
text: this.$t('unrenote'),
|
|
|
|
|
icon: faTrashAlt,
|
|
|
|
|
action: () => {
|
|
|
|
|
this.$root.api('notes/delete', {
|
|
|
|
|
noteId: this.note.id
|
|
|
|
|
});
|
2020-07-26 17:46:21 -06:00
|
|
|
|
this.isDeleted = true;
|
2020-02-05 17:09:24 -07:00
|
|
|
|
}
|
|
|
|
|
}],
|
2020-02-09 02:52:53 -07:00
|
|
|
|
source: this.$refs.renoteTime,
|
2020-02-08 07:52:40 -07:00
|
|
|
|
viaKeyboard: viaKeyboard
|
2020-02-05 17:09:24 -07:00
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
toggleShowContent() {
|
|
|
|
|
this.showContent = !this.showContent;
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-08 07:52:40 -07:00
|
|
|
|
copyContent() {
|
|
|
|
|
copyToClipboard(this.appearNote.text);
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
copyLink() {
|
|
|
|
|
copyToClipboard(`${url}/notes/${this.appearNote.id}`);
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
togglePin(pin: boolean) {
|
|
|
|
|
this.$root.api(pin ? 'i/pin' : 'i/unpin', {
|
|
|
|
|
noteId: this.appearNote.id
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
if (e.id === '72dab508-c64d-498f-8740-a8eec1ba385a') {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'error',
|
|
|
|
|
text: this.$t('pinLimitExceeded')
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-02-17 16:41:32 -07:00
|
|
|
|
async promote() {
|
|
|
|
|
const { canceled, result: days } = await this.$root.dialog({
|
|
|
|
|
title: this.$t('numberOfDays'),
|
|
|
|
|
input: { type: 'number' }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (canceled) return;
|
|
|
|
|
|
|
|
|
|
this.$root.api('admin/promo/create', {
|
|
|
|
|
noteId: this.appearNote.id,
|
|
|
|
|
expiresAt: Date.now() + (86400000 * days)
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'success',
|
|
|
|
|
iconOnly: true, autoClose: true
|
|
|
|
|
});
|
|
|
|
|
}).catch(e => {
|
|
|
|
|
this.$root.dialog({
|
|
|
|
|
type: 'error',
|
|
|
|
|
text: e
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
focus() {
|
|
|
|
|
this.$el.focus();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
blur() {
|
|
|
|
|
this.$el.blur();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
focusBefore() {
|
2020-02-08 07:52:40 -07:00
|
|
|
|
focusPrev(this.$el);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
focusAfter() {
|
2020-02-08 07:52:40 -07:00
|
|
|
|
focusNext(this.$el);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.note {
|
|
|
|
|
position: relative;
|
|
|
|
|
transition: box-shadow 0.1s ease;
|
2020-03-06 08:31:48 -07:00
|
|
|
|
overflow: hidden;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
|
|
|
|
&:focus {
|
|
|
|
|
outline: none;
|
|
|
|
|
box-shadow: 0 0 0 3px var(--focus);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:hover > .article > .main > .footer > .button {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 02:14:38 -07:00
|
|
|
|
> .info {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
padding: 16px 32px 8px 32px;
|
|
|
|
|
line-height: 24px;
|
|
|
|
|
font-size: 90%;
|
|
|
|
|
white-space: pre;
|
|
|
|
|
color: #d28a3f;
|
|
|
|
|
|
|
|
|
|
> [data-icon] {
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
2020-02-18 02:14:38 -07:00
|
|
|
|
|
|
|
|
|
> .hide {
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
color: inherit;
|
|
|
|
|
}
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
|
|
|
|
|
2020-02-18 02:14:38 -07:00
|
|
|
|
> .info + .article {
|
2020-01-29 12:37:25 -07:00
|
|
|
|
padding-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-20 04:19:28 -06:00
|
|
|
|
> .reply-to {
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
padding-bottom: 0;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-10 02:37:11 -06:00
|
|
|
|
> .reply-to-more {
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-29 12:37:25 -07:00
|
|
|
|
> .renote {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 16px 32px 8px 32px;
|
|
|
|
|
line-height: 28px;
|
|
|
|
|
white-space: pre;
|
|
|
|
|
color: var(--renote);
|
|
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 28px;
|
|
|
|
|
height: 28px;
|
|
|
|
|
margin: 0 8px 0 0;
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> [data-icon] {
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> span {
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
flex-shrink: 1;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
|
|
> .name {
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .info {
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
font-size: 0.9em;
|
|
|
|
|
|
2020-02-05 17:09:24 -07:00
|
|
|
|
> .time {
|
2020-01-29 12:37:25 -07:00
|
|
|
|
flex-shrink: 0;
|
2020-02-05 17:09:24 -07:00
|
|
|
|
color: inherit;
|
2020-05-15 05:39:11 -06:00
|
|
|
|
|
|
|
|
|
> .dropdownIcon {
|
|
|
|
|
margin-right: 4px;
|
|
|
|
|
}
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .visibility {
|
|
|
|
|
margin-left: 8px;
|
2020-05-16 07:06:39 -06:00
|
|
|
|
}
|
2020-01-29 12:37:25 -07:00
|
|
|
|
|
2020-05-16 07:06:39 -06:00
|
|
|
|
> .localOnly {
|
|
|
|
|
margin-left: 8px;
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .renote + .article {
|
|
|
|
|
padding-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .article {
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 28px 32px 18px;
|
|
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
display: block;
|
|
|
|
|
//position: sticky;
|
|
|
|
|
//top: 72px;
|
|
|
|
|
margin: 0 14px 8px 0;
|
|
|
|
|
width: 58px;
|
|
|
|
|
height: 58px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .main {
|
|
|
|
|
flex: 1;
|
|
|
|
|
min-width: 0;
|
|
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
|
> .cw {
|
|
|
|
|
cursor: default;
|
|
|
|
|
display: block;
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
|
|
|
|
|
> .text {
|
|
|
|
|
margin-right: 8px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .content {
|
|
|
|
|
> .text {
|
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
|
|
|
|
|
> .reply {
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
margin-right: 0.5em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .rp {
|
|
|
|
|
margin-left: 4px;
|
|
|
|
|
font-style: oblique;
|
|
|
|
|
color: var(--renote);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .url-preview {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-10 02:06:20 -06:00
|
|
|
|
> .poll {
|
2020-01-29 12:37:25 -07:00
|
|
|
|
font-size: 80%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .renote {
|
|
|
|
|
padding: 8px 0;
|
|
|
|
|
|
|
|
|
|
> * {
|
|
|
|
|
padding: 16px;
|
|
|
|
|
border: dashed 1px var(--renote);
|
|
|
|
|
border-radius: 8px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .footer {
|
|
|
|
|
> .button {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 8px;
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
|
|
|
|
|
&:not(:last-child) {
|
|
|
|
|
margin-right: 28px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&:hover {
|
2020-02-14 09:18:48 -07:00
|
|
|
|
color: var(--fgHighlighted);
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .count {
|
|
|
|
|
display: inline;
|
|
|
|
|
margin: 0 0 0 8px;
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.reacted {
|
|
|
|
|
color: var(--accent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-03-20 21:32:40 -06:00
|
|
|
|
|
|
|
|
|
> .reply {
|
|
|
|
|
border-top: solid 1px var(--divider);
|
|
|
|
|
}
|
2020-07-10 19:13:11 -06:00
|
|
|
|
|
|
|
|
|
&.max-width_500px {
|
|
|
|
|
font-size: 0.9em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.max-width_450px {
|
|
|
|
|
> .renote {
|
|
|
|
|
padding: 8px 16px 0 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .info {
|
|
|
|
|
padding: 8px 16px 0 16px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .article {
|
|
|
|
|
padding: 14px 16px 9px;
|
|
|
|
|
|
|
|
|
|
> .avatar {
|
|
|
|
|
margin: 0 10px 8px 0;
|
|
|
|
|
width: 50px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.max-width_350px {
|
|
|
|
|
> .article {
|
|
|
|
|
> .main {
|
|
|
|
|
> .footer {
|
|
|
|
|
> .button {
|
|
|
|
|
&:not(:last-child) {
|
|
|
|
|
margin-right: 18px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&.max-width_300px {
|
|
|
|
|
font-size: 0.825em;
|
|
|
|
|
|
|
|
|
|
> .article {
|
|
|
|
|
> .avatar {
|
|
|
|
|
width: 44px;
|
|
|
|
|
height: 44px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .main {
|
|
|
|
|
> .footer {
|
|
|
|
|
> .button {
|
|
|
|
|
&:not(:last-child) {
|
|
|
|
|
margin-right: 12px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-01-29 12:37:25 -07:00
|
|
|
|
}
|
2020-07-26 22:34:20 -06:00
|
|
|
|
|
|
|
|
|
.muted {
|
|
|
|
|
padding: 8px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
opacity: 0.7;
|
|
|
|
|
}
|
2020-01-29 12:37:25 -07:00
|
|
|
|
</style>
|