2020-04-27 02:53:04 -07:00
|
|
|
<template>
|
|
|
|
<!-- eslint-disable vue/no-v-html -->
|
2020-07-27 15:27:11 -07:00
|
|
|
<div class="StatusContent">
|
2020-04-27 02:53:04 -07:00
|
|
|
<slot name="header" />
|
|
|
|
<div
|
2020-06-26 04:07:39 -07:00
|
|
|
v-if="status.summary_html"
|
|
|
|
class="summary-wrapper"
|
|
|
|
:class="{ 'tall-subject': (longSubject && !showingLongSubject) }"
|
2020-04-27 02:53:04 -07:00
|
|
|
>
|
|
|
|
<div
|
2020-06-26 04:07:39 -07:00
|
|
|
class="media-body summary"
|
2020-04-27 02:53:04 -07:00
|
|
|
@click.prevent="linkClicked"
|
2020-06-26 04:07:39 -07:00
|
|
|
v-html="status.summary_html"
|
2020-04-27 02:53:04 -07:00
|
|
|
/>
|
|
|
|
<a
|
2020-06-26 04:07:39 -07:00
|
|
|
v-if="longSubject && showingLongSubject"
|
2020-04-27 02:53:04 -07:00
|
|
|
href="#"
|
2020-06-26 04:07:39 -07:00
|
|
|
class="tall-subject-hider"
|
2020-04-27 02:53:04 -07:00
|
|
|
@click.prevent="showingLongSubject=false"
|
2020-06-26 08:20:32 -07:00
|
|
|
>{{ $t("status.hide_full_subject") }}</a>
|
2020-06-26 04:07:39 -07:00
|
|
|
<a
|
|
|
|
v-else-if="longSubject"
|
|
|
|
class="tall-subject-hider"
|
|
|
|
:class="{ 'tall-subject-hider_focused': focused }"
|
|
|
|
href="#"
|
|
|
|
@click.prevent="showingLongSubject=true"
|
|
|
|
>
|
2020-06-26 08:20:32 -07:00
|
|
|
{{ $t("status.show_full_subject") }}
|
2020-06-26 04:07:39 -07:00
|
|
|
</a>
|
2020-04-27 02:53:04 -07:00
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
:class="{'tall-status': hideTallStatus}"
|
|
|
|
class="status-content-wrapper"
|
|
|
|
>
|
|
|
|
<a
|
|
|
|
v-if="hideTallStatus"
|
|
|
|
class="tall-status-hider"
|
|
|
|
:class="{ 'tall-status-hider_focused': focused }"
|
|
|
|
href="#"
|
|
|
|
@click.prevent="toggleShowMore"
|
2020-06-26 04:07:39 -07:00
|
|
|
>
|
|
|
|
{{ $t("general.show_more") }}
|
|
|
|
</a>
|
2020-04-27 02:53:04 -07:00
|
|
|
<div
|
2020-06-19 03:46:48 -07:00
|
|
|
v-if="!hideSubjectStatus"
|
2020-07-07 13:33:08 -07:00
|
|
|
:class="{ 'single-line': singleLine }"
|
2020-04-27 02:53:04 -07:00
|
|
|
class="status-content media-body"
|
|
|
|
@click.prevent="linkClicked"
|
2020-06-19 03:46:48 -07:00
|
|
|
v-html="postBodyHtml"
|
2020-04-27 02:53:04 -07:00
|
|
|
/>
|
|
|
|
<a
|
|
|
|
v-if="hideSubjectStatus"
|
|
|
|
href="#"
|
|
|
|
class="cw-status-hider"
|
|
|
|
@click.prevent="toggleShowMore"
|
2020-06-26 04:07:39 -07:00
|
|
|
>
|
2020-06-26 08:20:32 -07:00
|
|
|
{{ $t("status.show_content") }}
|
2020-06-26 04:07:39 -07:00
|
|
|
<span
|
2020-07-06 04:01:03 -07:00
|
|
|
v-if="attachmentTypes.includes('image')"
|
2020-06-26 04:07:39 -07:00
|
|
|
class="icon-picture"
|
|
|
|
/>
|
|
|
|
<span
|
2020-07-06 04:01:03 -07:00
|
|
|
v-if="attachmentTypes.includes('video')"
|
2020-06-26 04:07:39 -07:00
|
|
|
class="icon-video"
|
|
|
|
/>
|
2020-07-06 04:01:03 -07:00
|
|
|
<span
|
|
|
|
v-if="attachmentTypes.includes('audio')"
|
|
|
|
class="icon-music"
|
|
|
|
/>
|
|
|
|
<span
|
|
|
|
v-if="attachmentTypes.includes('unknown')"
|
|
|
|
class="icon-doc"
|
|
|
|
/>
|
2020-08-31 01:50:26 -07:00
|
|
|
<span
|
|
|
|
v-if="status.poll && status.poll.options"
|
|
|
|
class="icon-chart-bar"
|
|
|
|
/>
|
2020-06-26 04:07:39 -07:00
|
|
|
<span
|
|
|
|
v-if="status.card"
|
|
|
|
class="icon-link"
|
|
|
|
/>
|
|
|
|
</a>
|
2020-04-27 02:53:04 -07:00
|
|
|
<a
|
2020-05-07 06:10:53 -07:00
|
|
|
v-if="showingMore && !fullContent"
|
2020-04-27 02:53:04 -07:00
|
|
|
href="#"
|
|
|
|
class="status-unhider"
|
|
|
|
@click.prevent="toggleShowMore"
|
2020-06-26 08:20:32 -07:00
|
|
|
>
|
|
|
|
{{ tallStatus ? $t("general.show_less") : $t("status.hide_content") }}
|
|
|
|
</a>
|
2020-04-27 02:53:04 -07:00
|
|
|
</div>
|
|
|
|
|
2020-08-31 01:50:26 -07:00
|
|
|
<div v-if="status.poll && status.poll.options && !hideSubjectStatus">
|
2020-04-27 02:53:04 -07: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()"
|
|
|
|
/>
|
|
|
|
<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>
|
|
|
|
<!-- eslint-enable vue/no-v-html -->
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./status_content.js" ></script>
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
|
|
|
$status-margin: 0.75em;
|
|
|
|
|
2020-07-27 15:27:11 -07:00
|
|
|
.StatusContent {
|
2020-04-27 02:53:04 -07:00
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
|
|
|
|
2020-06-26 04:07:39 -07:00
|
|
|
.status-content-wrapper {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
}
|
|
|
|
|
2020-04-27 02:53:04 -07:00
|
|
|
.tall-status {
|
|
|
|
position: relative;
|
|
|
|
height: 220px;
|
|
|
|
overflow-x: hidden;
|
|
|
|
overflow-y: hidden;
|
|
|
|
z-index: 1;
|
|
|
|
.status-content {
|
2020-06-26 04:07:39 -07:00
|
|
|
min-height: 0;
|
2020-04-27 02:53:04 -07: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-06-18 05:41:40 -07:00
|
|
|
img, video {
|
|
|
|
max-width: 100%;
|
|
|
|
max-height: 400px;
|
|
|
|
vertical-align: middle;
|
|
|
|
object-fit: contain;
|
|
|
|
|
|
|
|
&.emoji {
|
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-06-26 04:07:39 -07: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 02:53:04 -07:00
|
|
|
.status-content {
|
|
|
|
font-family: var(--postFont, sans-serif);
|
|
|
|
line-height: 1.4em;
|
|
|
|
white-space: pre-wrap;
|
2020-06-28 06:40:39 -07:00
|
|
|
overflow-wrap: break-word;
|
|
|
|
word-wrap: break-word;
|
|
|
|
word-break: break-word;
|
2020-04-27 02:53:04 -07:00
|
|
|
|
|
|
|
blockquote {
|
|
|
|
margin: 0.2em 0 0.2em 2em;
|
|
|
|
font-style: italic;
|
|
|
|
}
|
|
|
|
|
|
|
|
pre {
|
|
|
|
overflow: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
code, samp, kbd, var, pre {
|
|
|
|
font-family: var(--postCodeFont, monospace);
|
|
|
|
}
|
|
|
|
|
|
|
|
p {
|
|
|
|
margin: 0 0 1em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
p:last-child {
|
|
|
|
margin: 0 0 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
h1 {
|
|
|
|
font-size: 1.1em;
|
|
|
|
line-height: 1.2em;
|
|
|
|
margin: 1.4em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
h2 {
|
|
|
|
font-size: 1.1em;
|
|
|
|
margin: 1.0em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
h3 {
|
|
|
|
font-size: 1em;
|
|
|
|
margin: 1.2em 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
h4 {
|
|
|
|
margin: 1.1em 0;
|
|
|
|
}
|
2020-07-07 13:33:08 -07:00
|
|
|
|
|
|
|
&.single-line {
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
overflow: hidden;
|
2020-07-23 06:39:01 -07:00
|
|
|
height: 1.4em;
|
2020-07-07 13:33:08 -07:00
|
|
|
}
|
2020-04-27 02:53:04 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.greentext {
|
|
|
|
color: $fallback--cGreen;
|
2020-06-19 03:49:42 -07:00
|
|
|
color: var(--postGreentext, $fallback--cGreen);
|
2020-04-27 02:53:04 -07:00
|
|
|
}
|
|
|
|
</style>
|