diff options
| author | Julia <julia@insertdomain.name> | 2024-10-29 03:04:25 +0000 |
|---|---|---|
| committer | Julia <julia@insertdomain.name> | 2024-10-29 03:04:25 +0000 |
| commit | 1520bc1715cd974faa9c20ae5caeceb16a4c0b8e (patch) | |
| tree | a72cd1371e1c662026b92fa8e631859afed8dbbb /packages/frontend/src | |
| parent | merge: Collapse user activity, files, and listenbrainz on mobile (resolves #7... (diff) | |
| parent | fix poll option limit in masto API (diff) | |
| download | sharkey-1520bc1715cd974faa9c20ae5caeceb16a4c0b8e.tar.gz sharkey-1520bc1715cd974faa9c20ae5caeceb16a4c0b8e.tar.bz2 sharkey-1520bc1715cd974faa9c20ae5caeceb16a4c0b8e.zip | |
merge: Split character limits between local and remote notes (resolves #723) (!669)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/669
Closes #723
Approved-by: dakkar <dakkar@thenautilus.net>
Approved-by: Julia <julia@insertdomain.name>
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/components/MkPostForm.vue | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 4a03234e90..4a29b27ac4 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -65,7 +65,10 @@ SPDX-License-Identifier: AGPL-3.0-only </div> </div> <MkInfo v-if="hasNotSpecifiedMentions" warn :class="$style.hasNotSpecifiedMentions">{{ i18n.ts.notSpecifiedMentionWarning }} - <button class="_textButton" @click="addMissingMention()">{{ i18n.ts.add }}</button></MkInfo> - <input v-show="useCw" ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown"> + <div v-show="useCw" :class="$style.cwFrame"> + <input ref="cwInputEl" v-model="cw" :class="$style.cw" :placeholder="i18n.ts.annotation" @keydown="onKeydown"> + <div v-if="maxCwLength - cwLength < 100" :class="['_acrylic', $style.textCount, { [$style.textOver]: cwLength > maxCwLength }]">{{ maxCwLength - cwLength }}</div> + </div> <div :class="[$style.textOuter, { [$style.withCw]: useCw }]"> <div v-if="channel" :class="$style.colorBar" :style="{ background: channel.color }"></div> <textarea ref="textareaEl" v-model="text" :class="[$style.text]" :disabled="posting || posted" :readonly="textAreaReadOnly" :placeholder="placeholder" data-cy-post-form-text dir="auto" @keydown="onKeydown" @paste="onPaste" @compositionupdate="onCompositionUpdate" @compositionend="onCompositionEnd"/> @@ -247,13 +250,16 @@ const submitText = computed((): string => { }); const textLength = computed((): number => { - return (text.value + imeText.value).length + (cw.value?.length ?? 0); + return (text.value + imeText.value).length; }); const maxTextLength = computed((): number => { return instance ? instance.maxNoteTextLength : 1000; }); +const cwLength = computed(() => cw.value?.length ?? 0); +const maxCwLength = computed(() => instance.maxCwLength); + const canPost = computed((): boolean => { return !props.mock && !posting.value && !posted.value && ( @@ -264,6 +270,7 @@ const canPost = computed((): boolean => { quoteId.value != null ) && (textLength.value <= maxTextLength.value) && + (cwLength.value <= maxCwLength.value) && (!poll.value || poll.value.choices.length >= 2); }); @@ -1316,10 +1323,13 @@ defineExpose({ } } -.cw { +.cwFrame { z-index: 1; padding-bottom: 8px; border-bottom: solid 0.5px var(--divider); + + width: 100%; + position: relative; } .hashtags { |