mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-06-04 00:06:39 +02:00
Update Phonotactics fields to multiline entries
This commit is contained in:
parent
211cb5f5f9
commit
49e7788a59
2 changed files with 72 additions and 42 deletions
|
@ -95,42 +95,72 @@ export const EditLinguisticsForm = ({
|
||||||
<div className='columns'>
|
<div className='columns'>
|
||||||
|
|
||||||
<div className='column'>
|
<div className='column'>
|
||||||
<IPAField label='Onset' id='editOnset'
|
<div className='field'>
|
||||||
helpText='Separate phonemes/groups with a space'
|
<label className='label' htmlFor='editOnset'>
|
||||||
placeholder='consonants blends'
|
Onset
|
||||||
value={ onset }
|
</label>
|
||||||
onInput={ (newValue) => {
|
<p className='help'>
|
||||||
editDictionaryModal.setState({
|
Put each phoneme or group on a separate line
|
||||||
onset: newValue,
|
</p>
|
||||||
hasChanged: newValue != editDictionaryModal.props.details.phonology.phonotactics.onset.join(' '),
|
<div className='control'>
|
||||||
});
|
<textarea className='textarea' id='editOnset'
|
||||||
}} />
|
placeholder={ `none\nconsonant blends\n...` }
|
||||||
|
value={ onset }
|
||||||
|
onInput={ (event) => {
|
||||||
|
editDictionaryModal.setState({
|
||||||
|
onset: event.target.value,
|
||||||
|
hasChanged: event.target.value != editDictionaryModal.props.details.phonology.phonotactics.onset.join('\n'),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='column'>
|
<div className='column'>
|
||||||
<IPAField label='Nucleus' id='editNucleus'
|
<div className='field'>
|
||||||
helpText='Separate phonemes/groups with a space'
|
<label className='label' htmlFor='editNucleus'>
|
||||||
placeholder='vowels'
|
Nucleus
|
||||||
value={ nucleus }
|
</label>
|
||||||
onInput={ (newValue) => {
|
<p className='help'>
|
||||||
editDictionaryModal.setState({
|
Put each phoneme or group on a separate line
|
||||||
nucleus: newValue,
|
</p>
|
||||||
hasChanged: newValue != editDictionaryModal.props.details.phonology.phonotactics.nucleus.join(' '),
|
<div className='control'>
|
||||||
});
|
<textarea className='textarea' id='editNucleus'
|
||||||
}} />
|
placeholder={ `vowels\nvowel blends\n...` }
|
||||||
|
value={ nucleus }
|
||||||
|
onInput={ (event) => {
|
||||||
|
editDictionaryModal.setState({
|
||||||
|
nucleus: event.target.value,
|
||||||
|
hasChanged: event.target.value != editDictionaryModal.props.details.phonology.phonotactics.nucleus.join('\n'),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='column'>
|
<div className='column'>
|
||||||
<IPAField label='Coda' id='editCoda'
|
<div className='field'>
|
||||||
helpText='Separate phonemes/groups with a space'
|
<label className='label' htmlFor='editCoda'>
|
||||||
placeholder='any'
|
Coda
|
||||||
value={ coda }
|
</label>
|
||||||
onInput={ (newValue) => {
|
<p className='help'>
|
||||||
editDictionaryModal.setState({
|
Put each phoneme or group on a separate line
|
||||||
coda: newValue,
|
</p>
|
||||||
hasChanged: newValue != editDictionaryModal.props.details.phonology.phonotactics.coda.join(' '),
|
<div className='control'>
|
||||||
});
|
<textarea className='textarea' id='editCoda'
|
||||||
}} />
|
placeholder={ `consonants\nconsonant blends\n...` }
|
||||||
|
value={ coda }
|
||||||
|
onInput={ (event) => {
|
||||||
|
editDictionaryModal.setState({
|
||||||
|
coda: event.target.value,
|
||||||
|
hasChanged: event.target.value != editDictionaryModal.props.details.phonology.phonotactics.coda.join('\n'),
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -149,10 +179,10 @@ export const EditLinguisticsForm = ({
|
||||||
<textarea className='textarea' id='editExceptions'
|
<textarea className='textarea' id='editExceptions'
|
||||||
placeholder='Vowel blends are not allowed in the onset, and [e], including blends with [e] comprising it, is not allowed in the coda.'
|
placeholder='Vowel blends are not allowed in the onset, and [e], including blends with [e] comprising it, is not allowed in the coda.'
|
||||||
value={ exceptions }
|
value={ exceptions }
|
||||||
onInput={ (newValue) => {
|
onInput={ (event) => {
|
||||||
editDictionaryModal.setState({
|
editDictionaryModal.setState({
|
||||||
exceptions: newValue,
|
exceptions: event.target.value,
|
||||||
hasChanged: newValue != editDictionaryModal.props.details.phonology.exceptions.join(' '),
|
hasChanged: event.target.value != editDictionaryModal.props.details.phonology.phonotactics.exceptions,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -28,9 +28,9 @@ export class EditDictionaryModal extends Component {
|
||||||
consonants: props.details.phonology.consonants.join(' '),
|
consonants: props.details.phonology.consonants.join(' '),
|
||||||
vowels: props.details.phonology.vowels.join(' '),
|
vowels: props.details.phonology.vowels.join(' '),
|
||||||
blends: props.details.phonology.blends.join(' '),
|
blends: props.details.phonology.blends.join(' '),
|
||||||
onset: props.details.phonology.phonotactics.onset.join(' '),
|
onset: props.details.phonology.phonotactics.onset.join('\n'),
|
||||||
nucleus: props.details.phonology.phonotactics.nucleus.join(' '),
|
nucleus: props.details.phonology.phonotactics.nucleus.join('\n'),
|
||||||
coda: props.details.phonology.phonotactics.coda.join(' '),
|
coda: props.details.phonology.phonotactics.coda.join('\n'),
|
||||||
exceptions: props.details.phonology.phonotactics.exceptions,
|
exceptions: props.details.phonology.phonotactics.exceptions,
|
||||||
|
|
||||||
hasChanged: false,
|
hasChanged: false,
|
||||||
|
@ -154,20 +154,20 @@ export class EditDictionaryModal extends Component {
|
||||||
.map((value) => { return value.trim() });
|
.map((value) => { return value.trim() });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.onset !== this.props.details.phonology.phonotactics.onset.join(' ')) {
|
if (this.state.onset !== this.props.details.phonology.phonotactics.onset.join('\n')) {
|
||||||
updatedDetails['onset'] = this.state.onset.split(' ')
|
updatedDetails['onset'] = this.state.onset.split('\n')
|
||||||
.filter((value) => { return value !== '' })
|
.filter((value) => { return value !== '' })
|
||||||
.map((value) => { return value.trim() });
|
.map((value) => { return value.trim() });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.nucleus !== this.props.details.phonology.phonotactics.nucleus.join(' ')) {
|
if (this.state.nucleus !== this.props.details.phonology.phonotactics.nucleus.join('\n')) {
|
||||||
updatedDetails['nucleus'] = this.state.nucleus.split(' ')
|
updatedDetails['nucleus'] = this.state.nucleus.split('\n')
|
||||||
.filter((value) => { return value !== '' })
|
.filter((value) => { return value !== '' })
|
||||||
.map((value) => { return value.trim() });
|
.map((value) => { return value.trim() });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.state.coda !== this.props.details.phonology.phonotactics.coda.join(' ')) {
|
if (this.state.coda !== this.props.details.phonology.phonotactics.coda.join('\n')) {
|
||||||
updatedDetails['coda'] = this.state.coda.split(' ')
|
updatedDetails['coda'] = this.state.coda.split('\n')
|
||||||
.filter((value) => { return value !== '' })
|
.filter((value) => { return value !== '' })
|
||||||
.map((value) => { return value.trim() });
|
.map((value) => { return value.trim() });
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue