This commit is contained in:
syuilo 2018-05-29 01:44:15 +09:00
parent 016386b350
commit 8f79f862b9
4 changed files with 70 additions and 13 deletions

View file

@ -39,6 +39,13 @@ common:
confused: "こまこまのこまり"
pudding: "Pudding"
note-placeholders:
a: "今どうしてる?"
b: "何かありましたか?"
c: "言いたいことは?"
d: "ここに書いてください"
e: "あなたが書くのを待っています..."
delete: "削除"
loading: "読み込み中"
ok: "わかった"
@ -393,10 +400,9 @@ desktop/views/components/notifications.vue:
empty: "ありません!"
desktop/views/components/post-form.vue:
note-placeholder: "いまどうしてる?"
reply-placeholder: "この投稿への返信..."
quote-placeholder: "この投稿を引用..."
note: "投稿"
submit: "投稿"
reply: "返信"
renote: "Renote"
posted: "投稿しました!"
@ -718,7 +724,6 @@ desktop/views/widgets/polls.vue:
desktop/views/widgets/post-form.vue:
title: "投稿"
note: "投稿"
placeholder: "いまどうしてる?"
desktop/views/widgets/profile.vue:
update-banner: "クリックでバナー編集"
@ -819,7 +824,6 @@ mobile/views/components/post-form.vue:
renote: "Renote"
renote-placeholder: "この投稿を引用... (オプション)"
reply-placeholder: "この投稿への返信..."
note-placeholder: "いまどうしてる?"
cw-placeholder: "内容への注釈 (オプション)"
location-alert: "お使いの端末は位置情報に対応していません"
error: "エラー"

View file

@ -86,11 +86,19 @@ export default Vue.extend({
},
placeholder(): string {
const x = [
'%i18n:common.note-placeholders.a%',
'%i18n:common.note-placeholders.b%',
'%i18n:common.note-placeholders.c%',
'%i18n:common.note-placeholders.d%',
'%i18n:common.note-placeholders.e%'
][Math.floor(Math.random() * 5)];
return this.renote
? '%i18n:@quote-placeholder%'
: this.reply
? '%i18n:@reply-placeholder%'
: '%i18n:@note-placeholder%';
: x;
},
submitText(): string {
@ -98,7 +106,7 @@ export default Vue.extend({
? '%i18n:@renote%'
: this.reply
? '%i18n:@reply%'
: '%i18n:@note%';
: '%i18n:@submit%';
},
canPost(): boolean {

View file

@ -3,7 +3,7 @@
<template v-if="props.design == 0">
<p class="title">%fa:pencil-alt%%i18n:@title%</p>
</template>
<textarea :disabled="posting" v-model="text" @keydown="onKeydown" placeholder="%i18n:@placeholder%"></textarea>
<textarea :disabled="posting" v-model="text" @keydown="onKeydown" :placeholder="placeholder"></textarea>
<button @click="post" :disabled="posting">%i18n:@note%</button>
</div>
</template>
@ -22,6 +22,17 @@ export default define({
text: ''
};
},
computed: {
placeholder(): string {
return [
'%i18n:common.note-placeholders.a%',
'%i18n:common.note-placeholders.b%',
'%i18n:common.note-placeholders.c%',
'%i18n:common.note-placeholders.d%',
'%i18n:common.note-placeholders.e%'
][Math.floor(Math.random() * 5)];
}
},
methods: {
func() {
if (this.props.design == 1) {

View file

@ -5,11 +5,7 @@
<div>
<span class="text-count" :class="{ over: text.length > 1000 }">{{ 1000 - text.length }}</span>
<span class="geo" v-if="geo">%fa:map-marker-alt%</span>
<button class="submit" :disabled="posting" @click="post">
<template v-if="reply">%i18n:@reply%</template>
<template v-else-if="renote">%i18n:@renote%</template>
<template v-else>%i18n:@submit%</template>
</button>
<button class="submit" :disabled="posting" @click="post">{{ submitText }}</button>
</div>
</header>
<div class="form">
@ -20,7 +16,7 @@
<a @click="addVisibleUser">+%i18n:@add-visible-user%</a>
</div>
<input v-show="useCw" v-model="cw" placeholder="%i18n:@cw-placeholder%">
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="reply ? '%i18n:@reply-placeholder%' : renote ? '%i18n:@renote-placeholder%' : '%i18n:@note-placeholder%'"></textarea>
<textarea v-model="text" ref="text" :disabled="posting" :placeholder="placeholder"></textarea>
<div class="attaches" v-show="files.length != 0">
<x-draggable class="files" :list="files" :options="{ animation: 150 }">
<div class="file" v-for="file in files" :key="file.id">
@ -74,6 +70,44 @@ export default Vue.extend({
};
},
computed: {
draftId(): string {
return this.renote
? 'renote:' + this.renote.id
: this.reply
? 'reply:' + this.reply.id
: 'note';
},
placeholder(): string {
const x = [
'%i18n:common.note-placeholders.a%',
'%i18n:common.note-placeholders.b%',
'%i18n:common.note-placeholders.c%',
'%i18n:common.note-placeholders.d%',
'%i18n:common.note-placeholders.e%'
][Math.floor(Math.random() * 5)];
return this.renote
? '%i18n:@quote-placeholder%'
: this.reply
? '%i18n:@reply-placeholder%'
: x;
},
submitText(): string {
return this.renote
? '%i18n:@renote%'
: this.reply
? '%i18n:@reply%'
: '%i18n:@submit%';
},
canPost(): boolean {
return !this.posting && (this.text.length != 0 || this.files.length != 0 || this.poll || this.renote);
}
},
mounted() {
if (this.reply && this.reply.user.host != null) {
this.text = `@${this.reply.user.username}@${this.reply.user.host} `;