From ef968d8e1e4f3194a0856fd93bc03d8030112b12 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 25 Sep 2018 15:16:26 +0300 Subject: now it actually works --- src/components/post_status_form/post_status_form.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/components/post_status_form') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index a84e764c..804c4bc2 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -24,7 +24,7 @@ const PostStatusForm = { 'replyTo', 'repliedUser', 'attentions', - 'messageScope', + 'copyMessageScope', 'subject' ], components: { @@ -46,6 +46,12 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } + console.log(this.copyMessageScope) + const scope = (this.copyMessageScope && this.$store.state.config.copyScope || this.copyMessageScope === 'direct') + ? this.copyMessageScope + : this.$store.state.users.currentUser.default_scope + + console.log(this) return { dropFiles: [], submitDisabled: false, @@ -58,7 +64,7 @@ const PostStatusForm = { contentType: 'text/plain', nsfw: false, files: [], - visibility: this.messageScope || this.$store.state.users.currentUser.default_scope + visibility: scope }, caret: 0 } -- cgit v1.2.3-70-g09d2 From 6f668df6976d7210a9768931b5f4b58994289479 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Wed, 7 Nov 2018 17:20:33 +0100 Subject: Count spoiler text in the character count. Fixes #135. --- src/components/post_status_form/post_status_form.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/components/post_status_form') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index a84e764c..af7d8810 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -53,7 +53,7 @@ const PostStatusForm = { posting: false, highlighted: 0, newStatus: { - spoilerText: this.subject, + spoilerText: this.subject || '', status: statusText, contentType: 'text/plain', nsfw: false, @@ -128,6 +128,9 @@ const PostStatusForm = { statusLength () { return this.newStatus.status.length }, + spoilerTextLength () { + return this.newStatus.spoilerText.length + }, statusLengthLimit () { return this.$store.state.instance.textlimit }, @@ -135,10 +138,10 @@ const PostStatusForm = { return this.statusLengthLimit > 0 }, charactersLeft () { - return this.statusLengthLimit - this.statusLength + return this.statusLengthLimit - (this.statusLength + this.spoilerTextLength) }, isOverLengthLimit () { - return this.hasStatusLengthLimit && (this.statusLength > this.statusLengthLimit) + return this.hasStatusLengthLimit && (this.charactersLeft < 0) }, scopeOptionsEnabled () { return this.$store.state.instance.scopeOptionsEnabled -- cgit v1.2.3-70-g09d2 From 2c2c4452b93efa53ff03e871e525b3a096855063 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 8 Nov 2018 19:34:59 +0100 Subject: Fix posting. --- src/components/post_status_form/post_status_form.js | 1 + 1 file changed, 1 insertion(+) (limited to 'src/components/post_status_form') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index af7d8810..c0e34d72 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -226,6 +226,7 @@ const PostStatusForm = { if (!data.error) { this.newStatus = { status: '', + spoilerText: '', files: [], visibility: newStatus.visibility, contentType: newStatus.contentType -- cgit v1.2.3-70-g09d2 From b948234aec2ec1d140a46303c09d24424262bd66 Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Mon, 26 Nov 2018 04:44:54 +0300 Subject: whoops --- src/components/post_status_form/post_status_form.js | 2 -- src/main.js | 2 -- 2 files changed, 4 deletions(-) (limited to 'src/components/post_status_form') diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js index e49c3ccc..fa86ee59 100644 --- a/src/components/post_status_form/post_status_form.js +++ b/src/components/post_status_form/post_status_form.js @@ -46,12 +46,10 @@ const PostStatusForm = { statusText = buildMentionsString({ user: this.repliedUser, attentions: this.attentions }, currentUser) } - console.log(this.copyMessageScope) const scope = (this.copyMessageScope && this.$store.state.config.copyScope || this.copyMessageScope === 'direct') ? this.copyMessageScope : this.$store.state.users.currentUser.default_scope - console.log(this) return { dropFiles: [], submitDisabled: false, diff --git a/src/main.js b/src/main.js index 5f459d46..9f094ada 100644 --- a/src/main.js +++ b/src/main.js @@ -43,7 +43,6 @@ const i18n = new VueI18n({ messages }) -======= const persistedStateOptions = { paths: [ 'config', @@ -67,7 +66,6 @@ createPersistedState(persistedStateOptions).then((persistedState) => { plugins: [persistedState], strict: false // Socket modifies itself, let's ignore this for now. // strict: process.env.NODE_ENV !== 'production' ->>>>>>> upstream/develop }) afterStoreSetup({store, i18n}) -- cgit v1.2.3-70-g09d2