media description support

This commit is contained in:
William Pitcock 2019-02-18 05:03:26 +00:00 committed by xenofem
parent 391f796cb4
commit 2c6ec37e6a
9 changed files with 23 additions and 5 deletions

View file

@ -51,7 +51,6 @@
:class="{'hidden': hidden && preloadImage }"
:href="attachment.url"
target="_blank"
:title="attachment.description"
@click="openModal"
>
<StillImage
@ -59,6 +58,7 @@
:mimetype="attachment.mimetype"
:src="attachment.large_thumb_url || attachment.url"
:image-load-handler="onImageLoad"
:alt="attachment.description"
/>
</a>

View file

@ -8,6 +8,8 @@
v-if="type === 'image'"
class="modal-image"
:src="currentMedia.url"
:alt="currentMedia.description"
:title="currentMedia.description"
@touchstart.stop="mediaTouchStart"
@touchmove.stop="mediaTouchMove"
@click="hide"

View file

@ -78,6 +78,7 @@ const PostStatusForm = {
nsfw: false,
files: [],
poll: {},
mediaDescriptions: {},
visibility: scope,
contentType
},
@ -190,6 +191,7 @@ const PostStatusForm = {
visibility: newStatus.visibility,
sensitive: newStatus.nsfw,
media: newStatus.files,
mediaDescriptions: newStatus.mediaDescriptions || {},
store: this.$store,
inReplyToStatusId: this.replyTo,
contentType: newStatus.contentType,
@ -200,6 +202,7 @@ const PostStatusForm = {
status: '',
spoilerText: '',
files: [],
mediaDescriptions: {},
visibility: newStatus.visibility,
contentType: newStatus.contentType,
poll: {}

View file

@ -266,6 +266,7 @@
:href="file.url"
>{{ file.url }}</a>
</div>
<input type="text" :placeholder="$t('post_status.media_description')" v-model="newStatus.mediaDescriptions[file.id]"></input>
</div>
</div>
<div
@ -399,6 +400,11 @@
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
input {
min-width: 300px;
flex: 1;
}
}
.status-input-wrapper {

View file

@ -4,7 +4,8 @@ const StillImage = {
'referrerpolicy',
'mimetype',
'imageLoadError',
'imageLoadHandler'
'imageLoadHandler',
'alt'
],
data () {
return {

View file

@ -10,6 +10,8 @@
<!-- NOTE: key is required to force to re-render img tag when src is changed -->
<img
ref="src"
:alt="alt"
:title="alt"
:key="src"
:src="src"
:referrerpolicy="referrerpolicy"