summaryrefslogtreecommitdiff
path: root/src/client/app/mobile
diff options
context:
space:
mode:
authorAcid Chicken (硫酸鶏) <root@acid-chicken.com>2018-09-10 18:02:46 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2018-09-10 18:02:46 +0900
commitb24f368d3f207554735e4edc5c5a2b7e16a6d281 (patch)
tree97f0167c425fafa38451aecfaeab0c94eb3bf463 /src/client/app/mobile
parentOptimize booting script (diff)
downloadmisskey-b24f368d3f207554735e4edc5c5a2b7e16a6d281.tar.gz
misskey-b24f368d3f207554735e4edc5c5a2b7e16a6d281.tar.bz2
misskey-b24f368d3f207554735e4edc5c5a2b7e16a6d281.zip
サロゲートペアを字数にカウントしないようにする (#2661)
* Update post-form.vue * Update messaging-message.ts * Update post-form.vue * Update note.ts * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update messaging-message.ts refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update note.ts refs: https://github.com/syuilo/misskey/pull/2661#issuecomment-419579444 * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216175581 * Update post-form.vue * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216242002 * Update post-form.vue refs: https://github.com/syuilo/misskey/pull/2661#discussion_r216242105
Diffstat (limited to 'src/client/app/mobile')
-rw-r--r--src/client/app/mobile/views/components/post-form.vue7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue
index 7e6a4c38e1..be20b11f14 100644
--- a/src/client/app/mobile/views/components/post-form.vue
+++ b/src/client/app/mobile/views/components/post-form.vue
@@ -4,7 +4,7 @@
<header>
<button class="cancel" @click="cancel">%fa:times%</button>
<div>
- <span class="text-count" :class="{ over: text.length > 1000 }">{{ 1000 - text.length }}</span>
+ <span class="text-count" :class="{ over: trimmedLength(text) > 1000 }">{{ 1000 - trimmedLength(text) }}</span>
<span class="geo" v-if="geo">%fa:map-marker-alt%</span>
<button class="submit" :disabled="!canPost" @click="post">{{ submitText }}</button>
</div>
@@ -60,6 +60,7 @@ import getFace from '../../../common/scripts/get-face';
import parse from '../../../../../mfm/parse';
import { host } from '../../../config';
import { erase } from '../../../../../prelude/array';
+import { length } from 'stringz';
import parseAcct from '../../../../../misc/acct/parse';
export default Vue.extend({
@@ -180,6 +181,10 @@ export default Vue.extend({
},
methods: {
+ trimmedLength(text: string) {
+ return length(text.trim());
+ },
+
addTag(tag: string) {
insertTextAtCursor(this.$refs.text, ` #${tag} `);
},