From 8f79f862b90b4f8bbdfed8115ceb2c2764b6eb16 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 29 May 2018 01:44:15 +0900 Subject: :pizza: --- .../app/desktop/views/components/post-form.vue | 12 +++++- src/client/app/desktop/views/widgets/post-form.vue | 13 +++++- .../app/mobile/views/components/post-form.vue | 46 +++++++++++++++++++--- 3 files changed, 62 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue index 8eec677b06..ad829065b0 100644 --- a/src/client/app/desktop/views/components/post-form.vue +++ b/src/client/app/desktop/views/components/post-form.vue @@ -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 { diff --git a/src/client/app/desktop/views/widgets/post-form.vue b/src/client/app/desktop/views/widgets/post-form.vue index 69b21ad37a..fb4adf70b8 100644 --- a/src/client/app/desktop/views/widgets/post-form.vue +++ b/src/client/app/desktop/views/widgets/post-form.vue @@ -3,7 +3,7 @@ - + @@ -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) { 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