2020-01-29 11:37:25 -08:00
|
|
|
<template>
|
2021-11-19 01:56:30 -08:00
|
|
|
<div class="wrmlmaau" :class="{ collapsed }">
|
2020-01-29 11:37:25 -08:00
|
|
|
<div class="body">
|
2020-12-25 17:47:36 -08:00
|
|
|
<span v-if="note.isHidden" style="opacity: 0.5">({{ $ts.private }})</span>
|
|
|
|
<span v-if="note.deletedAt" style="opacity: 0.5">({{ $ts.deleted }})</span>
|
2021-11-19 02:36:12 -08:00
|
|
|
<MkA v-if="note.replyId" class="reply" :to="`/notes/${note.replyId}`"><i class="fas fa-reply"></i></MkA>
|
2020-12-18 17:55:52 -08:00
|
|
|
<Mfm v-if="note.text" :text="note.text" :author="note.user" :i="$i" :custom-emojis="note.emojis"/>
|
2021-11-19 02:36:12 -08:00
|
|
|
<MkA v-if="note.renoteId" class="rp" :to="`/notes/${note.renoteId}`">RN: ...</MkA>
|
2020-01-29 11:37:25 -08:00
|
|
|
</div>
|
|
|
|
<details v-if="note.files.length > 0">
|
|
|
|
<summary>({{ $t('withNFiles', { n: note.files.length }) }})</summary>
|
2020-10-17 04:12:00 -07:00
|
|
|
<XMediaList :media-list="note.files"/>
|
2020-01-29 11:37:25 -08:00
|
|
|
</details>
|
|
|
|
<details v-if="note.poll">
|
2020-12-25 17:47:36 -08:00
|
|
|
<summary>{{ $ts.poll }}</summary>
|
2020-10-17 04:12:00 -07:00
|
|
|
<XPoll :note="note"/>
|
2020-01-29 11:37:25 -08:00
|
|
|
</details>
|
2021-11-19 01:56:30 -08:00
|
|
|
<button v-if="collapsed" class="fade _button" @click="collapsed = false">
|
|
|
|
<span>{{ $ts.showMore }}</span>
|
|
|
|
</button>
|
2020-01-29 11:37:25 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2020-10-17 04:12:00 -07:00
|
|
|
import { defineComponent } from 'vue';
|
2020-01-29 11:37:25 -08:00
|
|
|
import XPoll from './poll.vue';
|
|
|
|
import XMediaList from './media-list.vue';
|
2021-11-11 09:02:25 -08:00
|
|
|
import * as os from '@/os';
|
2020-01-29 11:37:25 -08:00
|
|
|
|
2020-10-17 04:12:00 -07:00
|
|
|
export default defineComponent({
|
2020-01-29 11:37:25 -08:00
|
|
|
components: {
|
|
|
|
XPoll,
|
|
|
|
XMediaList,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
note: {
|
|
|
|
type: Object,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-11-19 01:56:30 -08:00
|
|
|
collapsed: false,
|
2020-01-29 11:37:25 -08:00
|
|
|
};
|
2021-11-19 01:56:30 -08:00
|
|
|
},
|
|
|
|
created() {
|
|
|
|
this.collapsed = this.note.cw == null && this.note.text && (
|
|
|
|
(this.note.text.split('\n').length > 9) ||
|
|
|
|
(this.note.text.length > 500)
|
|
|
|
);
|
2020-01-29 11:37:25 -08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.wrmlmaau {
|
|
|
|
overflow-wrap: break-word;
|
|
|
|
|
|
|
|
> .body {
|
|
|
|
> .reply {
|
|
|
|
margin-right: 6px;
|
|
|
|
color: var(--accent);
|
|
|
|
}
|
|
|
|
|
|
|
|
> .rp {
|
|
|
|
margin-left: 4px;
|
|
|
|
font-style: oblique;
|
|
|
|
color: var(--renote);
|
|
|
|
}
|
|
|
|
}
|
2021-11-19 01:56:30 -08:00
|
|
|
|
|
|
|
&.collapsed {
|
|
|
|
position: relative;
|
|
|
|
max-height: 9em;
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
> .fade {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 64px;
|
|
|
|
background: linear-gradient(0deg, var(--panel), var(--X15));
|
|
|
|
|
|
|
|
> span {
|
|
|
|
display: inline-block;
|
|
|
|
background: var(--panel);
|
|
|
|
padding: 6px 10px;
|
|
|
|
font-size: 0.8em;
|
|
|
|
border-radius: 999px;
|
|
|
|
box-shadow: 0 2px 6px rgb(0 0 0 / 20%);
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
> span {
|
|
|
|
background: var(--panelHighlight);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-29 11:37:25 -08:00
|
|
|
}
|
|
|
|
</style>
|