Merged existing changes from 'develop'

This commit is contained in:
shpuld 2017-02-22 15:04:28 +02:00
commit ded2d54cca
10 changed files with 83 additions and 28 deletions

View file

@ -16,8 +16,6 @@
<audio v-if="type === 'audio'" :src="attachment.url" controls></audio>
<span v-if="type === 'unknown'">Don't know how to display this...</span>
<div @click.prevent="linkClicked" v-if="type === 'html' && attachment.oembed" class="oembed">
<div v-if="attachment.thumb_url" class="image">
<img :src="attachment.thumb_url"></img>
@ -38,12 +36,12 @@
flex-wrap: wrap;
.attachment {
flex: 1 0 30%;
display: flex;
margin: 0.5em 0.8em 0.6em 0.1em;
align-self: flex-start;
&.html {
flex-basis: 100%;
display: flex;
}
.hider {

View file

@ -16,7 +16,7 @@ const mediaUpload = {
}
},
methods: {
uploadFile(file) {
uploadFile (file) {
const self = this
const store = this.$store
const formData = new FormData()
@ -54,8 +54,9 @@ const mediaUpload = {
],
watch: {
'dropFiles': function (fileInfos) {
if (!this.uploading)
if (!this.uploading) {
this.uploadFile(fileInfos[0])
}
}
}
}

View file

@ -144,7 +144,7 @@ const PostStatusForm = {
return fileTypeService.fileType(fileInfo.mimetype)
},
fileDrop (e) {
if(e.dataTransfer.files.length > 0) {
if (e.dataTransfer.files.length > 0) {
e.preventDefault() // allow dropping text like before
this.dropFiles = e.dataTransfer.files
}

View file

@ -2,15 +2,15 @@
<div class="post-status-form">
<form @submit.prevent="postStatus(newStatus)">
<div class="form-group" >
<textarea v-model="newStatus.status" placeholder="Just landed in L.A." rows="3" class="form-control" @keyup.ctrl.enter="postStatus(newStatus)" @drop="fileDrop" @dragover.prevent="fileDrag"></textarea>
<textarea v-model="newStatus.status" placeholder="Just landed in L.A." rows="3" class="form-control" @keyup.meta.enter="postStatus(newStatus)" @keyup.ctrl.enter="postStatus(newStatus)" @drop="fileDrop" @dragover.prevent="fileDrag"></textarea>
</div>
<div class="attachments">
<div class="attachment" v-for="file in newStatus.files">
<i class="fa icon-cancel" @click="removeMediaFile(file)"></i>
<img class="thumbnail media-upload" :src="file.image" v-if="type(file) === 'image'"></img>
<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>
<i class="fa icon-cancel" @click="removeMediaFile(file)"></i>
</div>
</div>
<div class='form-bottom'>
@ -52,6 +52,15 @@
.attachments {
padding: 0.5em;
i {
position: absolute;
margin: 10px;
padding: 5px;
background: rgba(230,230,230,0.6);
border-radius: 0.5em;
font-weight: bold;
}
}
form {

View file

@ -7,18 +7,18 @@
<div class='user-name'>{{user.name}}</div>
<div class='user-screen-name'>@{{user.screen_name}}</div>
<div v-if="isOtherUser" class="user-interactions">
<div v-if="user.follows_you" class="following base06">
<div v-if="user.follows_you && loggedIn" class="following base06">
Follows you!
</div>
<div class="follow">
<div class="follow" v-if="loggedIn">
<span v-if="user.following">
<!--Following them!-->
<button @click="unfollowUser" class="base06 base01-background base06-border">
<button @click="unfollowUser" class="base06 base01-background">
Unfollow
</button>
</span>
<span v-if="!user.following">
<button @click="followUser" class="base01 base04-background base01-border">
<button @click="followUser" class="base01 base04-background">
Follow
</button>
</span>
@ -66,6 +66,9 @@
},
isOtherUser () {
return this.user !== this.$store.state.users.currentUser
},
loggedIn () {
return this.$store.state.users.currentUser
}
},
methods: {

View file

@ -51,7 +51,7 @@ export default function createPersistedState ({
}
return value && value !== 'undefined' ? JSON.parse(value) : undefined
},
setState = throttle(defaultSetState, 5000),
setState = throttle(defaultSetState, 60000),
reducer = defaultReducer,
storage = defaultStorage,
subscriber = store => handler => store.subscribe(handler)

View file

@ -67,8 +67,7 @@ new Vue({
router,
store,
el: '#app',
template: '<App/>',
components: { App }
render: h => h(App)
})
window.fetch('/static/config.json')