diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/components/attachment/attachment.vue | 4 | ||||
| -rw-r--r-- | src/components/media_upload/media_upload.js | 5 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.js | 2 | ||||
| -rw-r--r-- | src/components/post_status_form/post_status_form.vue | 13 | ||||
| -rw-r--r-- | src/components/user_card_content/user_card_content.vue | 11 | ||||
| -rw-r--r-- | src/lib/persisted_state.js | 2 | ||||
| -rw-r--r-- | src/main.js | 3 |
7 files changed, 25 insertions, 15 deletions
diff --git a/src/components/attachment/attachment.vue b/src/components/attachment/attachment.vue index 738a1e86..e0eba6a9 100644 --- a/src/components/attachment/attachment.vue +++ b/src/components/attachment/attachment.vue @@ -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 { diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js index 2f312ec9..985916cf 100644 --- a/src/components/media_upload/media_upload.js +++ b/src/components/media_upload/media_upload.js @@ -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]) + } } } } diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index 21d9759f..42ebcd48 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -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 } diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue index fa471ec5..d345ec13 100644 --- a/src/components/post_status_form/post_status_form.vue +++ b/src/components/post_status_form/post_status_form.vue @@ -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 { diff --git a/src/components/user_card_content/user_card_content.vue b/src/components/user_card_content/user_card_content.vue index 59cee734..ee4384fa 100644 --- a/src/components/user_card_content/user_card_content.vue +++ b/src/components/user_card_content/user_card_content.vue @@ -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: { diff --git a/src/lib/persisted_state.js b/src/lib/persisted_state.js index de1e5383..31ced37d 100644 --- a/src/lib/persisted_state.js +++ b/src/lib/persisted_state.js @@ -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) diff --git a/src/main.js b/src/main.js index 97156b64..22879b34 100644 --- a/src/main.js +++ b/src/main.js @@ -67,8 +67,7 @@ new Vue({ router, store, el: '#app', - template: '<App/>', - components: { App } + render: h => h(App) }) window.fetch('/static/config.json') |
