pleroma-fe/src/components/post_status_form/post_status_form.vue

121 lines
3.1 KiB
Vue
Raw Normal View History

2016-10-30 16:53:58 +01:00
<template>
<div class="post-status-form">
<form @submit.prevent="postStatus(newStatus)">
<div class="form-group base03-border" >
2017-06-15 22:25:19 +02:00
<textarea @click="setCaret" @keyup="setCaret" v-model="newStatus.status" placeholder="Just landed in L.A." rows="1" class="form-control" @keydown.meta.enter="postStatus(newStatus)" @keyup.ctrl.enter="postStatus(newStatus)" @drop="fileDrop" @dragover.prevent="fileDrag" @input="resize"></textarea>
2016-10-30 16:53:58 +01:00
</div>
2017-03-15 17:06:48 +01:00
<div>
<h1>Word</h1>
<h2>{{textAtCaret}}</h2>
<h1>Candidates</h1>
<h3 v-for="candidate in candidates" @click="replace('@' + candidate)">{{candidate}}</h3>
</div>
2016-10-30 16:53:58 +01:00
<div class='form-bottom'>
<media-upload @uploading="disableSubmit" @uploaded="addMediaFile" @upload-failed="enableSubmit" :drop-files="dropFiles"></media-upload>
<button :disabled="submitDisabled" type="submit" class="btn btn-default base05 base01-background">Submit</button>
2016-10-30 16:53:58 +01:00
</div>
<div class="attachments">
<div class="attachment" v-for="file in newStatus.files">
2017-02-21 15:24:35 +01:00
<i class="fa icon-cancel" @click="removeMediaFile(file)"></i>
2016-11-25 18:21:25 +01:00
<img class="thumbnail media-upload" :src="file.image" v-if="type(file) === 'image'"></img>
2016-11-26 01:19:25 +01:00
<video v-if="type(file) === 'video'" :src="file.image" controls></video>
<audio v-if="type(file) === 'audio'" :src="file.image" controls></audio>
<a v-if="type(file) === 'unknown'" :href="file.image">{{file.url}}</a>
2016-10-30 16:53:58 +01:00
</div>
</div>
</form>
</div>
</template>
<script src="./post_status_form.js"></script>
<style lang="scss">
.tribute-container {
ul {
padding: 0px;
li {
display: flex;
align-items: center;
}
}
img {
padding: 3px;
width: 16px;
height: 16px;
border-radius: 50%;
}
}
.post-status-form, .login {
.form-bottom {
display: flex;
padding: 0.5em;
height: 32px;
button {
width: 10em;
}
}
.attachments {
padding: 0 0.5em;
2017-02-21 15:24:35 +01:00
.attachment {
position: relative;
2017-04-17 10:42:33 +02:00
margin: 0.5em 0.8em 0.2em 0;
}
2017-02-21 15:24:35 +01:00
i {
position: absolute;
margin: 10px;
padding: 5px;
background: rgba(230,230,230,0.6);
border-radius: 5px;
2017-02-21 15:24:35 +01:00
font-weight: bold;
}
}
form {
display: flex;
flex-direction: column;
2017-02-18 08:48:35 +01:00
padding: 0.6em;
}
.form-group {
display: flex;
flex-direction: column;
2017-02-18 08:48:35 +01:00
padding: 0.3em 0.5em 0.6em;
line-height:24px;
}
2017-02-19 00:41:51 +01:00
2017-02-18 08:48:35 +01:00
form textarea {
border: solid;
border-width: 1px;
border-color: inherit;
border-radius: 5px;
2017-02-18 08:54:54 +01:00
line-height:16px;
padding: 5px;
resize: none;
overflow: hidden;
}
form textarea:focus {
min-height: 48px;
}
.btn {
cursor: pointer;
}
.btn[disabled] {
cursor: not-allowed;
}
2016-11-26 03:00:06 +01:00
.icon-cancel {
cursor: pointer;
}
}
</style>