summaryrefslogtreecommitdiff
path: root/src/client/app/desktop/views/components/post-form.vue
diff options
context:
space:
mode:
authorMeiMei <30769358+mei23@users.noreply.github.com>2018-10-24 04:00:04 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-10-24 04:00:04 +0900
commitdaa22d68fa8a55a2e65a1de541f903edb64ff042 (patch)
tree6307e3b1ff7a411b96a4213ed4685f9c32b6c3a6 /src/client/app/desktop/views/components/post-form.vue
parent10.30.3 (diff)
downloadmisskey-daa22d68fa8a55a2e65a1de541f903edb64ff042.tar.gz
misskey-daa22d68fa8a55a2e65a1de541f903edb64ff042.tar.bz2
misskey-daa22d68fa8a55a2e65a1de541f903edb64ff042.zip
Make max allowed text length configurable (#2992)
* Make max allowed text length configurable * Fix canPost
Diffstat (limited to 'src/client/app/desktop/views/components/post-form.vue')
-rw-r--r--src/client/app/desktop/views/components/post-form.vue13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/client/app/desktop/views/components/post-form.vue b/src/client/app/desktop/views/components/post-form.vue
index 3835f7228e..a703382f38 100644
--- a/src/client/app/desktop/views/components/post-form.vue
+++ b/src/client/app/desktop/views/components/post-form.vue
@@ -45,7 +45,7 @@
<span v-if="visibility === 'specified'">%fa:envelope%</span>
<span v-if="visibility === 'private'">%fa:lock%</span>
</button>
- <p class="text-count" :class="{ over: this.trimmedLength(text) > 1000 }">{{ 1000 - this.trimmedLength(text) }}</p>
+ <p class="text-count" :class="{ over: this.trimmedLength(text) > this.maxNoteTextLength }">{{ this.maxNoteTextLength - this.trimmedLength(text) }}</p>
<button :class="{ posting }" class="submit" :disabled="!canPost" @click="post">
{{ posting ? '%i18n:@posting%' : submitText }}<mk-ellipsis v-if="posting"/>
</button>
@@ -107,10 +107,17 @@ export default Vue.extend({
visibleUsers: [],
autocomplete: null,
draghover: false,
- recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]')
+ recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'),
+ maxNoteTextLength: 1000
};
},
+ created() {
+ (this as any).os.getMeta().then(meta => {
+ this.maxNoteTextLength = meta.maxNoteTextLength;
+ });
+ },
+
computed: {
draftId(): string {
return this.renote
@@ -149,7 +156,7 @@ export default Vue.extend({
canPost(): boolean {
return !this.posting &&
(1 <= this.text.length || 1 <= this.files.length || this.poll || this.renote) &&
- (length(this.text.trim()) <= 1000);
+ (length(this.text.trim()) <= this.maxNoteTextLength);
}
},