forked from AkkomaGang/akkoma-fe
#255 - support textarea and update user settings page
This commit is contained in:
parent
441deb405d
commit
2927454233
5 changed files with 34 additions and 6 deletions
|
@ -5,7 +5,8 @@ const EmojiInput = {
|
||||||
props: [
|
props: [
|
||||||
'value',
|
'value',
|
||||||
'placeholder',
|
'placeholder',
|
||||||
'type'
|
'type',
|
||||||
|
'classname'
|
||||||
],
|
],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="emoji-input">
|
<div class="emoji-input">
|
||||||
<input
|
<input
|
||||||
class="form-control"
|
v-if="type !== 'textarea'"
|
||||||
|
:class="classname"
|
||||||
:type="type"
|
:type="type"
|
||||||
:value="value"
|
:value="value"
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
@ -15,6 +16,21 @@
|
||||||
@keydown.tab="cycleForward"
|
@keydown.tab="cycleForward"
|
||||||
@keydown.enter="replaceEmoji"
|
@keydown.enter="replaceEmoji"
|
||||||
/>
|
/>
|
||||||
|
<textarea
|
||||||
|
v-else
|
||||||
|
:class="classname"
|
||||||
|
:value="value"
|
||||||
|
:placeholder="placeholder"
|
||||||
|
@input="onInput"
|
||||||
|
@click="setCaret"
|
||||||
|
@keyup="setCaret"
|
||||||
|
@keydown="onKeydown"
|
||||||
|
@keydown.down="cycleForward"
|
||||||
|
@keydown.up="cycleBackward"
|
||||||
|
@keydown.shift.tab="cycleBackward"
|
||||||
|
@keydown.tab="cycleForward"
|
||||||
|
@keydown.enter="replaceEmoji"
|
||||||
|
></textarea>
|
||||||
<div class="autocomplete-panel" v-if="suggestions">
|
<div class="autocomplete-panel" v-if="suggestions">
|
||||||
<div class="autocomplete-panel-body">
|
<div class="autocomplete-panel-body">
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
type="text"
|
type="text"
|
||||||
:placeholder="$t('post_status.content_warning')"
|
:placeholder="$t('post_status.content_warning')"
|
||||||
v-model="newStatus.spoilerText"
|
v-model="newStatus.spoilerText"
|
||||||
class="form-cw"
|
classname="form-control"
|
||||||
/>
|
/>
|
||||||
<textarea
|
<textarea
|
||||||
ref="textarea"
|
ref="textarea"
|
||||||
|
|
|
@ -7,6 +7,7 @@ import StyleSwitcher from '../style_switcher/style_switcher.vue'
|
||||||
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
|
import fileSizeFormatService from '../../services/file_size_format/file_size_format.js'
|
||||||
import BlockCard from '../block_card/block_card.vue'
|
import BlockCard from '../block_card/block_card.vue'
|
||||||
import MuteCard from '../mute_card/mute_card.vue'
|
import MuteCard from '../mute_card/mute_card.vue'
|
||||||
|
import EmojiInput from '../emoji-input/emoji-input.vue'
|
||||||
import withSubscription from '../../hocs/with_subscription/with_subscription'
|
import withSubscription from '../../hocs/with_subscription/with_subscription'
|
||||||
import withList from '../../hocs/with_list/with_list'
|
import withList from '../../hocs/with_list/with_list'
|
||||||
|
|
||||||
|
@ -69,7 +70,8 @@ const UserSettings = {
|
||||||
TabSwitcher,
|
TabSwitcher,
|
||||||
ImageCropper,
|
ImageCropper,
|
||||||
BlockList,
|
BlockList,
|
||||||
MuteList
|
MuteList,
|
||||||
|
EmojiInput
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
user () {
|
user () {
|
||||||
|
|
|
@ -22,9 +22,18 @@
|
||||||
<div class="setting-item" >
|
<div class="setting-item" >
|
||||||
<h2>{{$t('settings.name_bio')}}</h2>
|
<h2>{{$t('settings.name_bio')}}</h2>
|
||||||
<p>{{$t('settings.name')}}</p>
|
<p>{{$t('settings.name')}}</p>
|
||||||
<input class='name-changer' id='username' v-model="newName"></input>
|
<EmojiInput
|
||||||
|
type="text"
|
||||||
|
v-model="newName"
|
||||||
|
id="username"
|
||||||
|
classname="name-changer"
|
||||||
|
/>
|
||||||
<p>{{$t('settings.bio')}}</p>
|
<p>{{$t('settings.bio')}}</p>
|
||||||
<textarea class="bio" v-model="newBio"></textarea>
|
<EmojiInput
|
||||||
|
type="textarea"
|
||||||
|
v-model="newBio"
|
||||||
|
classname="bio"
|
||||||
|
/>
|
||||||
<p>
|
<p>
|
||||||
<input type="checkbox" v-model="newLocked" id="account-locked">
|
<input type="checkbox" v-model="newLocked" id="account-locked">
|
||||||
<label for="account-locked">{{$t('settings.lock_account_description')}}</label>
|
<label for="account-locked">{{$t('settings.lock_account_description')}}</label>
|
||||||
|
|
Loading…
Reference in a new issue