This commit is contained in:
syuilo 2018-02-19 00:18:01 +09:00
parent df67bbac9f
commit fed959ae9a
4 changed files with 17 additions and 12 deletions

View file

@ -1,5 +1,5 @@
<template> <template>
<div> <div class="mk-messaging-form">
<textarea v-model="text" @keypress="onKeypress" @paste="onPaste" placeholder="%i18n:common.input-message-here%"></textarea> <textarea v-model="text" @keypress="onKeypress" @paste="onPaste" placeholder="%i18n:common.input-message-here%"></textarea>
<div class="files"></div> <div class="files"></div>
<mk-uploader ref="uploader"/> <mk-uploader ref="uploader"/>

View file

@ -1,23 +1,28 @@
<template> <template>
<div class="mk-messaging-message" :data-is-me="isMe"> <div class="mk-messaging-message" :data-is-me="isMe">
<a class="avatar-anchor" href={ '/' + message.user.username } title={ message.user.username } target="_blank"> <a class="avatar-anchor" :href="`/${message.user.username}`" :title="message.user.username" target="_blank">
<img class="avatar" src={ message.user.avatar_url + '?thumbnail&size=80' } alt=""/> <img class="avatar" :src="`${message.user.avatar_url}?thumbnail&size=80`" alt=""/>
</a> </a>
<div class="content-container"> <div class="content-container">
<div class="balloon"> <div class="balloon">
<p class="read" v-if="message.is_me && message.is_read">%i18n:common.tags.mk-messaging-message.is-read%</p> <p class="read" v-if="message.is_me && message.is_read">%i18n:common.tags.mk-messaging-message.is-read%</p>
<button class="delete-button" v-if="message.is_me" title="%i18n:common.delete%"><img src="/assets/desktop/messaging/delete.png" alt="Delete"/></button> <button class="delete-button" v-if="message.is_me" title="%i18n:common.delete%">
<img src="/assets/desktop/messaging/delete.png" alt="Delete"/>
</button>
<div class="content" v-if="!message.is_deleted"> <div class="content" v-if="!message.is_deleted">
<mk-post-html v-if="message.ast" :ast="message.ast" :i="os.i"/> <mk-post-html class="text" v-if="message.ast" :ast="message.ast" :i="os.i"/>
<mk-url-preview v-for="url in urls" :url="url" :key="url"/> <mk-url-preview v-for="url in urls" :url="url" :key="url"/>
<div class="image" v-if="message.file"><img src={ message.file.url } alt="image" title={ message.file.name }/></div> <div class="image" v-if="message.file">
<img :src="message.file.url" alt="image" :title="message.file.name"/>
</div>
</div> </div>
<div class="content" v-if="message.is_deleted"> <div class="content" v-if="message.is_deleted">
<p class="is-deleted">%i18n:common.tags.mk-messaging-message.deleted%</p> <p class="is-deleted">%i18n:common.tags.mk-messaging-message.deleted%</p>
</div> </div>
</div> </div>
<footer> <footer>
<mk-time time={ message.created_at }/><template v-if="message.is_edited">%fa:pencil-alt%</template> <mk-time :time="message.created_at"/>
<template v-if="message.is_edited">%fa:pencil-alt%</template>
</footer> </footer>
</div> </div>
</div> </div>
@ -139,7 +144,7 @@ export default Vue.extend({
font-size 1em font-size 1em
color rgba(0, 0, 0, 0.5) color rgba(0, 0, 0, 0.5)
> [ref='text'] > .text
display block display block
margin 0 margin 0
padding 8px 16px padding 8px 16px

View file

@ -3,8 +3,8 @@
<div class="stream"> <div class="stream">
<p class="init" v-if="init">%fa:spinner .spin%%i18n:common.loading%</p> <p class="init" v-if="init">%fa:spinner .spin%%i18n:common.loading%</p>
<p class="empty" v-if="!init && messages.length == 0">%fa:info-circle%%i18n:common.tags.mk-messaging-room.empty%</p> <p class="empty" v-if="!init && messages.length == 0">%fa:info-circle%%i18n:common.tags.mk-messaging-room.empty%</p>
<p class="no-history" v-if="!init && messages.length > 0 && !moreMessagesIsInStock">%fa:flag%%i18n:common.tags.mk-messaging-room.no-history%</p> <p class="no-history" v-if="!init && messages.length > 0 && !existMoreMessages">%fa:flag%%i18n:common.tags.mk-messaging-room.no-history%</p>
<button class="more" :class="{ fetching: fetchingMoreMessages }" v-if="moreMessagesIsInStock" @click="fetchMoreMessages" :disabled="fetchingMoreMessages"> <button class="more" :class="{ fetching: fetchingMoreMessages }" v-if="existMoreMessages" @click="fetchMoreMessages" :disabled="fetchingMoreMessages">
<template v-if="fetchingMoreMessages">%fa:spinner .pulse .fw%</template>{{ fetchingMoreMessages ? '%i18n:common.loading%' : '%i18n:common.tags.mk-messaging-room.more%' }} <template v-if="fetchingMoreMessages">%fa:spinner .pulse .fw%</template>{{ fetchingMoreMessages ? '%i18n:common.loading%' : '%i18n:common.tags.mk-messaging-room.more%' }}
</button> </button>
<template v-for="(message, i) in _messages"> <template v-for="(message, i) in _messages">

View file

@ -2,9 +2,9 @@
<mk-window ref="window" @closed="$destroy" width="800px" height="500px" :popout="popout"> <mk-window ref="window" @closed="$destroy" width="800px" height="500px" :popout="popout">
<template slot="header"> <template slot="header">
<p v-if="usage" :class="$style.info"><b>{{ usage.toFixed(1) }}%</b> %i18n:desktop.tags.mk-drive-browser-window.used%</p> <p v-if="usage" :class="$style.info"><b>{{ usage.toFixed(1) }}%</b> %i18n:desktop.tags.mk-drive-browser-window.used%</p>
<span: class="$style.title">%fa:cloud%%i18n:desktop.tags.mk-drive-browser-window.drive%</span> <span :class="$style.title">%fa:cloud%%i18n:desktop.tags.mk-drive-browser-window.drive%</span>
</template> </template>
<mk-drive-browser multiple :folder="folder" ref="browser"/> <mk-drive multiple :folder="folder" ref="browser"/>
</mk-window> </mk-window>
</template> </template>