From 8f79f862b90b4f8bbdfed8115ceb2c2764b6eb16 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 29 May 2018 01:44:15 +0900 Subject: :pizza: --- .../app/mobile/views/components/post-form.vue | 46 +++++++++++++++++++--- 1 file changed, 40 insertions(+), 6 deletions(-) (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index f5badb48cc..61f0462659 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -5,11 +5,7 @@
{{ 1000 - text.length }} %fa:map-marker-alt% - +
@@ -20,7 +16,7 @@ +%i18n:@add-visible-user%
- +
@@ -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} `; -- cgit v1.2.3-freya