This commit is contained in:
syuilo
2020-12-26 10:47:36 +09:00
parent 9d81d06853
commit 5a8cc7851b
200 changed files with 1562 additions and 1533 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="_section">
<div class="mk-messaging _content" v-size="{ max: [400] }">
<MkButton @click="start" primary class="start"><Fa :icon="faPlus"/> {{ $t('startMessaging') }}</MkButton>
<MkButton @click="start" primary class="start"><Fa :icon="faPlus"/> {{ $ts.startMessaging }}</MkButton>
<div class="history" v-if="messages.length > 0">
<MkA v-for="(message, i) in messages"
@@ -23,14 +23,14 @@
<MkTime :time="message.createdAt" class="time"/>
</header>
<div class="body">
<p class="text"><span class="me" v-if="isMe(message)">{{ $t('you') }}:</span>{{ message.text }}</p>
<p class="text"><span class="me" v-if="isMe(message)">{{ $ts.you }}:</span>{{ message.text }}</p>
</div>
</div>
</MkA>
</div>
<div class="_fullinfo" v-if="!fetching && messages.length == 0">
<img src="https://xn--931a.moe/assets/info.jpg" class="_ghost"/>
<div>{{ $t('noHistory') }}</div>
<div>{{ $ts.noHistory }}</div>
</div>
<MkLoading v-if="fetching"/>
</div>
@@ -53,7 +53,7 @@ export default defineComponent({
data() {
return {
INFO: {
title: this.$t('messaging'),
title: this.$ts.messaging,
icon: faComments
},
fetching: true,
@@ -119,11 +119,11 @@ export default defineComponent({
start(ev) {
os.modalMenu([{
text: this.$t('messagingWithUser'),
text: this.$ts.messagingWithUser,
icon: faUser,
action: () => { this.startUser() }
}, {
text: this.$t('messagingWithGroup'),
text: this.$ts.messagingWithGroup,
icon: faUsers,
action: () => { this.startGroup() }
}], ev.currentTarget || ev.target);
@@ -141,14 +141,14 @@ export default defineComponent({
if (groups1.length === 0 && groups2.length === 0) {
os.dialog({
type: 'warning',
title: this.$t('youHaveNoGroups'),
text: this.$t('joinOrCreateGroup'),
title: this.$ts.youHaveNoGroups,
text: this.$ts.joinOrCreateGroup,
});
return;
}
const { canceled, result: group } = await os.dialog({
type: null,
title: this.$t('group'),
title: this.$ts.group,
select: {
items: groups1.concat(groups2).map(group => ({
value: group, text: group.name

View File

@@ -8,10 +8,10 @@
ref="text"
@keypress="onKeypress"
@paste="onPaste"
:placeholder="$t('inputMessageHere')"
:placeholder="$ts.inputMessageHere"
></textarea>
<div class="file" @click="file = null" v-if="file">{{ file.name }}</div>
<button class="send _button" @click="send" :disabled="!canSend || sending" :title="$t('send')">
<button class="send _button" @click="send" :disabled="!canSend || sending" :title="$ts.send">
<template v-if="!sending"><Fa :icon="faPaperPlane"/></template><template v-if="sending"><Fa icon="spinner .spin"/></template>
</button>
<button class="_button" @click="chooseFile"><Fa :icon="faPhotoVideo"/></button>
@@ -94,7 +94,7 @@ export default defineComponent({
const formatted = `${formatTimeString(new Date(file.lastModified), this.$store.state.pastedFileName).replace(/{{number}}/g, '1')}${ext}`;
const name = this.$store.state.pasteDialog
? await os.dialog({
title: this.$t('enterFileName'),
title: this.$ts.enterFileName,
input: {
default: formatted
},
@@ -107,7 +107,7 @@ export default defineComponent({
if (items[0].kind == 'file') {
os.dialog({
type: 'error',
text: this.$t('onlyOneFileCanBeAttached')
text: this.$ts.onlyOneFileCanBeAttached
});
}
}
@@ -132,7 +132,7 @@ export default defineComponent({
e.preventDefault();
os.dialog({
type: 'error',
text: this.$t('onlyOneFileCanBeAttached')
text: this.$ts.onlyOneFileCanBeAttached
});
return;
}
@@ -153,7 +153,7 @@ export default defineComponent({
},
chooseFile(e) {
selectFile(e.currentTarget || e.target, this.$t('selectFile'), false).then(file => {
selectFile(e.currentTarget || e.target, this.$ts.selectFile, false).then(file => {
this.file = file;
});
},

View File

@@ -3,7 +3,7 @@
<MkAvatar class="avatar" :user="message.user"/>
<div class="content">
<div class="balloon" :class="{ noText: message.text == null }" >
<button class="delete-button" v-if="isMe" :title="$t('delete')" @click="del">
<button class="delete-button" v-if="isMe" :title="$ts.delete" @click="del">
<img src="/assets/remove.png" alt="Delete"/>
</button>
<div class="content" v-if="!message.isDeleted">
@@ -16,17 +16,17 @@
</div>
</div>
<div class="content" v-else>
<p class="is-deleted">{{ $t('deleted') }}</p>
<p class="is-deleted">{{ $ts.deleted }}</p>
</div>
</div>
<div></div>
<MkUrlPreview v-for="url in urls" :url="url" :key="url" style="margin: 8px 0;"/>
<footer>
<template v-if="isGroup">
<span class="read" v-if="message.reads.length > 0">{{ $t('messageRead') }} {{ message.reads.length }}</span>
<span class="read" v-if="message.reads.length > 0">{{ $ts.messageRead }} {{ message.reads.length }}</span>
</template>
<template v-else>
<span class="read" v-if="isMe && message.isRead">{{ $t('messageRead') }}</span>
<span class="read" v-if="isMe && message.isRead">{{ $ts.messageRead }}</span>
</template>
<MkTime :time="message.createdAt"/>
<template v-if="message.is_edited"><Fa icon="pencil-alt"/></template>

View File

@@ -6,10 +6,10 @@
<div class="_content mk-messaging-room">
<div class="body">
<MkLoading v-if="fetching"/>
<p class="empty" v-if="!fetching && messages.length == 0"><Fa :icon="faInfoCircle"/>{{ $t('noMessagesYet') }}</p>
<p class="no-history" v-if="!fetching && messages.length > 0 && !existMoreMessages"><Fa :icon="faFlag"/>{{ $t('noMoreHistory') }}</p>
<p class="empty" v-if="!fetching && messages.length == 0"><Fa :icon="faInfoCircle"/>{{ $ts.noMessagesYet }}</p>
<p class="no-history" v-if="!fetching && messages.length > 0 && !existMoreMessages"><Fa :icon="faFlag"/>{{ $ts.noMoreHistory }}</p>
<button class="more _button" ref="loadMore" :class="{ fetching: fetchingMoreMessages }" v-show="existMoreMessages" @click="fetchMoreMessages" :disabled="fetchingMoreMessages">
<template v-if="fetchingMoreMessages"><Fa icon="spinner" pulse fixed-width/></template>{{ fetchingMoreMessages ? $t('loading') : $t('loadMore') }}
<template v-if="fetchingMoreMessages"><Fa icon="spinner" pulse fixed-width/></template>{{ fetchingMoreMessages ? $ts.loading : $ts.loadMore }}
</button>
<XList class="messages" :items="messages" v-slot="{ item: message }" direction="up" reversed>
<XMessage :message="message" :is-group="group != null" :key="message.id"/>
@@ -18,7 +18,7 @@
<footer>
<transition name="fade">
<div class="new-message" v-show="showIndicator">
<button class="_buttonPrimary" @click="onIndicatorClick"><i><Fa :icon="faArrowCircleDown"/></i>{{ $t('newMessageExists') }}</button>
<button class="_buttonPrimary" @click="onIndicatorClick"><i><Fa :icon="faArrowCircleDown"/></i>{{ $ts.newMessageExists }}</button>
</div>
</transition>
<XForm v-if="!fetching" :user="user" :group="group" ref="form"/>
@@ -174,7 +174,7 @@ const Component = defineComponent({
} else if (e.dataTransfer.files.length > 1) {
os.dialog({
type: 'error',
text: this.$t('onlyOneFileCanBeAttached')
text: this.$ts.onlyOneFileCanBeAttached
});
return;
}
@@ -311,14 +311,14 @@ const Component = defineComponent({
const path = this.groupId ? `/my/messaging/group/${this.groupId}` : `/my/messaging/${this.userAcct}`;
os.modalMenu([this.inWindow ? undefined : {
text: this.$t('openInWindow'),
text: this.$ts.openInWindow,
icon: faWindowMaximize,
action: () => {
os.pageWindow(path);
this.$router.back();
},
}, this.inWindow ? undefined : {
text: this.$t('popout'),
text: this.$ts.popout,
icon: faExternalLinkAlt,
action: () => {
popout(path);