Merge branch 'feature/post-length-indicator' into 'develop'
Add an indicator for characters left before hitting the limit See merge request pleroma/pleroma-fe!205
This commit is contained in:
commit
b0f248c483
@ -94,6 +94,18 @@ const PostStatusForm = {
|
|||||||
},
|
},
|
||||||
customEmoji () {
|
customEmoji () {
|
||||||
return this.$store.state.config.customEmoji || []
|
return this.$store.state.config.customEmoji || []
|
||||||
|
},
|
||||||
|
statusLength () {
|
||||||
|
return this.newStatus.status.length
|
||||||
|
},
|
||||||
|
statusLengthLimit () {
|
||||||
|
return this.$store.state.config.textlimit
|
||||||
|
},
|
||||||
|
hasStatusLengthLimit () {
|
||||||
|
return this.statusLengthLimit > 0
|
||||||
|
},
|
||||||
|
charactersLeft () {
|
||||||
|
return this.statusLengthLimit - this.statusLength
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -18,6 +18,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class='form-bottom'>
|
<div class='form-bottom'>
|
||||||
<media-upload @uploading="disableSubmit" @uploaded="addMediaFile" @upload-failed="enableSubmit" :drop-files="dropFiles"></media-upload>
|
<media-upload @uploading="disableSubmit" @uploaded="addMediaFile" @upload-failed="enableSubmit" :drop-files="dropFiles"></media-upload>
|
||||||
|
|
||||||
|
<p v-if="hasStatusLengthLimit" class="base04">{{ charactersLeft }}</p>
|
||||||
|
|
||||||
<button v-if="posting" disabled class="btn btn-default base05 base02-background">{{$t('post_status.posting')}}</button>
|
<button v-if="posting" disabled class="btn btn-default base05 base02-background">{{$t('post_status.posting')}}</button>
|
||||||
<button v-else :disabled="submitDisabled" type="submit" class="btn btn-default base05 base02-background">{{$t('general.submit')}}</button>
|
<button v-else :disabled="submitDisabled" type="submit" class="btn btn-default base05 base02-background">{{$t('general.submit')}}</button>
|
||||||
</div>
|
</div>
|
||||||
@ -67,6 +70,12 @@
|
|||||||
button {
|
button {
|
||||||
width: 10em;
|
width: 10em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: 0.35em;
|
||||||
|
padding: 0.35em;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.error {
|
.error {
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
14
src/main.js
14
src/main.js
@ -75,15 +75,23 @@ const i18n = new VueI18n({
|
|||||||
messages
|
messages
|
||||||
})
|
})
|
||||||
|
|
||||||
|
window.fetch('/api/statusnet/config.json')
|
||||||
|
.then((res) => res.json())
|
||||||
|
.then((data) => {
|
||||||
|
const {name, closed: registrationClosed, textlimit} = data.site
|
||||||
|
|
||||||
|
store.dispatch('setOption', { name: 'name', value: name })
|
||||||
|
store.dispatch('setOption', { name: 'registrationOpen', value: (registrationClosed === '0') })
|
||||||
|
store.dispatch('setOption', { name: 'textlimit', value: parseInt(textlimit) })
|
||||||
|
})
|
||||||
|
|
||||||
window.fetch('/static/config.json')
|
window.fetch('/static/config.json')
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then((data) => {
|
.then((data) => {
|
||||||
const {name, theme, background, logo, registrationOpen} = data
|
const {theme, background, logo} = data
|
||||||
store.dispatch('setOption', { name: 'name', value: name })
|
|
||||||
store.dispatch('setOption', { name: 'theme', value: theme })
|
store.dispatch('setOption', { name: 'theme', value: theme })
|
||||||
store.dispatch('setOption', { name: 'background', value: background })
|
store.dispatch('setOption', { name: 'background', value: background })
|
||||||
store.dispatch('setOption', { name: 'logo', value: logo })
|
store.dispatch('setOption', { name: 'logo', value: logo })
|
||||||
store.dispatch('setOption', { name: 'registrationOpen', value: registrationOpen })
|
|
||||||
if (data['chatDisabled']) {
|
if (data['chatDisabled']) {
|
||||||
store.dispatch('disableChat')
|
store.dispatch('disableChat')
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "Pleroma FE",
|
|
||||||
"theme": "pleroma-dark",
|
"theme": "pleroma-dark",
|
||||||
"background": "/static/bg.jpg",
|
"background": "/static/bg.jpg",
|
||||||
"logo": "/static/logo.png",
|
"logo": "/static/logo.png",
|
||||||
"registrationOpen": false,
|
|
||||||
"defaultPath": "/main/all",
|
"defaultPath": "/main/all",
|
||||||
"chatDisabled": false
|
"chatDisabled": false
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user