2020-04-27 09:53:04 +00:00
|
|
|
<template>
|
2020-07-27 22:27:11 +00:00
|
|
|
<div class="StatusContent">
|
2020-04-27 09:53:04 +00:00
|
|
|
<slot name="header" />
|
|
|
|
<div
|
2020-06-26 11:07:39 +00:00
|
|
|
v-if="status.summary_html"
|
|
|
|
class="summary-wrapper"
|
|
|
|
:class="{ 'tall-subject': (longSubject && !showingLongSubject) }"
|
2020-04-27 09:53:04 +00:00
|
|
|
>
|
2021-06-07 00:14:48 +00:00
|
|
|
<RichContent
|
2020-06-26 11:07:39 +00:00
|
|
|
class="media-body summary"
|
2021-06-07 00:14:48 +00:00
|
|
|
:html="status.summary_raw_html"
|
2021-06-07 09:24:11 +00:00
|
|
|
:emoji="status.emojis"
|
|
|
|
@click.prevent="linkClicked"
|
|
|
|
/>
|
2020-11-24 10:32:42 +00:00
|
|
|
<button
|
2020-06-26 11:07:39 +00:00
|
|
|
v-if="longSubject && showingLongSubject"
|
2020-11-24 10:32:42 +00:00
|
|
|
class="button-unstyled -link tall-subject-hider"
|
2020-04-27 09:53:04 +00:00
|
|
|
@click.prevent="showingLongSubject=false"
|
2020-11-24 10:32:42 +00:00
|
|
|
>
|
|
|
|
{{ $t("status.hide_full_subject") }}
|
|
|
|
</button>
|
|
|
|
<button
|
2020-06-26 11:07:39 +00:00
|
|
|
v-else-if="longSubject"
|
2020-11-24 10:32:42 +00:00
|
|
|
class="button-unstyled -link tall-subject-hider"
|
2020-06-26 11:07:39 +00:00
|
|
|
:class="{ 'tall-subject-hider_focused': focused }"
|
|
|
|
@click.prevent="showingLongSubject=true"
|
|
|
|
>
|
2020-06-26 15:20:32 +00:00
|
|
|
{{ $t("status.show_full_subject") }}
|
2020-11-24 10:32:42 +00:00
|
|
|
</button>
|
2020-04-27 09:53:04 +00:00
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
:class="{'tall-status': hideTallStatus}"
|
|
|
|
class="status-content-wrapper"
|
|
|
|
>
|
2020-11-24 10:32:42 +00:00
|
|
|
<button
|
2020-04-27 09:53:04 +00:00
|
|
|
v-if="hideTallStatus"
|
2020-11-24 10:32:42 +00:00
|
|
|
class="button-unstyled -link tall-status-hider"
|
2020-04-27 09:53:04 +00:00
|
|
|
:class="{ 'tall-status-hider_focused': focused }"
|
|
|
|
@click.prevent="toggleShowMore"
|
2020-06-26 11:07:39 +00:00
|
|
|
>
|
|
|
|
{{ $t("general.show_more") }}
|
2020-11-24 10:32:42 +00:00
|
|
|
</button>
|
2021-06-07 00:14:48 +00:00
|
|
|
<RichContent
|
2020-06-19 10:46:48 +00:00
|
|
|
v-if="!hideSubjectStatus"
|
2020-07-07 20:33:08 +00:00
|
|
|
:class="{ 'single-line': singleLine }"
|
2020-04-27 09:53:04 +00:00
|
|
|
class="status-content media-body"
|
2021-06-07 00:14:48 +00:00
|
|
|
:html="postBodyHtml"
|
2021-06-07 09:24:11 +00:00
|
|
|
:emoji="status.emojis"
|
|
|
|
@click.prevent="linkClicked"
|
|
|
|
/>
|
2020-11-24 10:32:42 +00:00
|
|
|
<button
|
2020-04-27 09:53:04 +00:00
|
|
|
v-if="hideSubjectStatus"
|
2020-11-24 10:32:42 +00:00
|
|
|
class="button-unstyled -link cw-status-hider"
|
2020-04-27 09:53:04 +00:00
|
|
|
@click.prevent="toggleShowMore"
|
2020-06-26 11:07:39 +00:00
|
|
|
>
|
2020-06-26 15:20:32 +00:00
|
|
|
{{ $t("status.show_content") }}
|
2020-10-20 21:01:28 +00:00
|
|
|
<FAIcon
|
2020-07-06 11:01:03 +00:00
|
|
|
v-if="attachmentTypes.includes('image')"
|
2020-10-20 21:01:28 +00:00
|
|
|
icon="image"
|
2020-06-26 11:07:39 +00:00
|
|
|
/>
|
2020-10-20 21:01:28 +00:00
|
|
|
<FAIcon
|
2020-07-06 11:01:03 +00:00
|
|
|
v-if="attachmentTypes.includes('video')"
|
2020-10-20 21:01:28 +00:00
|
|
|
icon="video"
|
2020-06-26 11:07:39 +00:00
|
|
|
/>
|
2020-10-20 21:01:28 +00:00
|
|
|
<FAIcon
|
2020-07-06 11:01:03 +00:00
|
|
|
v-if="attachmentTypes.includes('audio')"
|
2020-10-20 21:01:28 +00:00
|
|
|
icon="music"
|
2020-07-06 11:01:03 +00:00
|
|
|
/>
|
2020-10-20 21:01:28 +00:00
|
|
|
<FAIcon
|
2020-07-06 11:01:03 +00:00
|
|
|
v-if="attachmentTypes.includes('unknown')"
|
2020-10-20 21:01:28 +00:00
|
|
|
icon="file"
|
2020-07-06 11:01:03 +00:00
|
|
|
/>
|
2020-10-20 21:01:28 +00:00
|
|
|
<FAIcon
|
2020-08-31 08:50:26 +00:00
|
|
|
v-if="status.poll && status.poll.options"
|
2020-10-20 21:01:28 +00:00
|
|
|
icon="poll-h"
|
2020-08-31 08:50:26 +00:00
|
|
|
/>
|
2020-10-20 21:01:28 +00:00
|
|
|
<FAIcon
|
2020-06-26 11:07:39 +00:00
|
|
|
v-if="status.card"
|
2020-10-20 21:01:28 +00:00
|
|
|
icon="link"
|
2020-06-26 11:07:39 +00:00
|
|
|
/>
|
2020-11-24 10:32:42 +00:00
|
|
|
</button>
|
|
|
|
<button
|
2020-05-07 13:10:53 +00:00
|
|
|
v-if="showingMore && !fullContent"
|
2020-11-24 10:32:42 +00:00
|
|
|
class="button-unstyled -link status-unhider"
|
2020-04-27 09:53:04 +00:00
|
|
|
@click.prevent="toggleShowMore"
|
2020-06-26 15:20:32 +00:00
|
|
|
>
|
|
|
|
{{ tallStatus ? $t("general.show_less") : $t("status.hide_content") }}
|
2020-11-24 10:32:42 +00:00
|
|
|
</button>
|
2020-04-27 09:53:04 +00:00
|
|
|
</div>
|
|
|
|
|
2020-08-31 08:50:26 +00:00
|
|
|
<div v-if="status.poll && status.poll.options && !hideSubjectStatus">
|
2020-04-27 09:53:04 +00:00
|
|
|
<poll :base-poll="status.poll" />
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
v-if="status.attachments.length !== 0 && (!hideSubjectStatus || showingLongSubject)"
|
|
|
|
class="attachments media-body"
|
|
|
|
>
|
|
|
|
<attachment
|
|
|
|
v-for="attachment in nonGalleryAttachments"
|
|
|
|
:key="attachment.id"
|
|
|
|
class="non-gallery"
|
|
|
|
:size="attachmentSize"
|
|
|
|
:nsfw="nsfwClickthrough"
|
|
|
|
:attachment="attachment"
|
|
|
|
:allow-play="true"
|
|
|
|
:set-media="setMedia()"
|
2020-09-29 10:18:37 +00:00
|
|
|
@play="$emit('mediaplay', attachment.id)"
|
|
|
|
@pause="$emit('mediapause', attachment.id)"
|
2020-04-27 09:53:04 +00:00
|
|
|
/>
|
|
|
|
<gallery
|
|
|
|
v-if="galleryAttachments.length > 0"
|
|
|
|
:nsfw="nsfwClickthrough"
|
|
|
|
:attachments="galleryAttachments"
|
|
|
|
:set-media="setMedia()"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
|
|
|
v-if="status.card && !hideSubjectStatus && !noHeading"
|
|
|
|
class="link-preview media-body"
|
|
|
|
>
|
|
|
|
<link-preview
|
|
|
|
:card="status.card"
|
|
|
|
:size="attachmentSize"
|
|
|
|
:nsfw="nsfwClickthrough"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<slot name="footer" />
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./status_content.js" ></script>
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
|
|
|
$status-margin: 0.75em;
|
|
|
|
|
2020-07-27 22:27:11 +00:00
|
|
|
.StatusContent {
|
2020-04-27 09:53:04 +00:00
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
|
|
|
|
2020-06-26 11:07:39 +00:00
|
|
|
.status-content-wrapper {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
}
|
|
|
|
|
2020-04-27 09:53:04 +00:00
|
|
|
.tall-status {
|
|
|
|
position: relative;
|
|
|
|
height: 220px;
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: hidden;
|
|
|
|
z-index: 1;
|
|
|
|
.status-content {
|
2020-06-26 11:07:39 +00:00
|
|
|
min-height: 0;
|
2020-04-27 09:53:04 +00:00
|
|
|
mask: linear-gradient(to top, white, transparent) bottom/100% 70px no-repeat,
|
|
|
|
linear-gradient(to top, white, white);
|
|
|
|
/* Autoprefixed seem to ignore this one, and also syntax is different */
|
|
|
|
-webkit-mask-composite: xor;
|
|
|
|
mask-composite: exclude;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tall-status-hider {
|
|
|
|
display: inline-block;
|
|
|
|
word-break: break-all;
|
|
|
|
position: absolute;
|
|
|
|
height: 70px;
|
|
|
|
margin-top: 150px;
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
line-height: 110px;
|
|
|
|
z-index: 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
.status-unhider, .cw-status-hider {
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
display: inline-block;
|
|
|
|
word-break: break-all;
|
2020-10-20 21:01:28 +00:00
|
|
|
|
|
|
|
svg {
|
|
|
|
color: inherit;
|
|
|
|
}
|
2020-04-27 09:53:04 +00:00
|
|
|
}
|
|
|
|
|
2021-06-07 09:49:54 +00:00
|
|
|
video {
|
2020-06-18 12:41:40 +00:00
|
|
|
max-width: 100%;
|
|
|
|
max-height: 400px;
|
|
|
|
vertical-align: middle;
|
|
|
|
object-fit: contain;
|
|
|
|
}
|
|
|
|
|
2020-06-26 11:07:39 +00:00
|
|
|
.summary-wrapper {
|
|
|
|
margin-bottom: 0.5em;
|
|
|
|
border-style: solid;
|
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
border-color: var(--border, $fallback--border);
|
|
|
|
flex-grow: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.summary {
|
|
|
|
font-style: italic;
|
|
|
|
padding-bottom: 0.5em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.tall-subject {
|
|
|
|
position: relative;
|
|
|
|
.summary {
|
|
|
|
max-height: 2em;
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.tall-subject-hider {
|
|
|
|
display: inline-block;
|
|
|
|
word-break: break-all;
|
|
|
|
// position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
text-align: center;
|
|
|
|
padding-bottom: 0.5em;
|
|
|
|
}
|
|
|
|
|
2020-04-27 09:53:04 +00:00
|
|
|
.status-content {
|
2020-07-07 20:33:08 +00:00
|
|
|
&.single-line {
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2020-07-23 13:39:01 +00:00
|
|
|
height: 1.4em;
|
2020-07-07 20:33:08 +00:00
|
|
|
}
|
2020-04-27 09:53:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.greentext {
|
|
|
|
color: $fallback--cGreen;
|
2020-06-19 10:49:42 +00:00
|
|
|
color: var(--postGreentext, $fallback--cGreen);
|
2020-04-27 09:53:04 +00:00
|
|
|
}
|
|
|
|
</style>
|