mirror of
https://github.com/Alamantus/Lexiconga.git
synced 2025-06-22 00:56:40 +02:00
Move default stuff to a Constants.js file; Use stored user data for IPA pronunciation
This commit is contained in:
parent
c496bd77c0
commit
3ed0ba0e72
8 changed files with 99 additions and 99 deletions
52
src/Constants.js
Normal file
52
src/Constants.js
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
import { timestampInSeconds } from './Helpers';
|
||||||
|
|
||||||
|
export const DEFAULT_USER_DATA = {
|
||||||
|
email: '',
|
||||||
|
username: '',
|
||||||
|
publicName: '',
|
||||||
|
allowEmails: true,
|
||||||
|
useIPAPronunciation: true,
|
||||||
|
itemsPerPage: 30,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const DEFAULT_DICTIONARY = {
|
||||||
|
name: 'New',
|
||||||
|
specification: 'Dictionary',
|
||||||
|
description: 'A new dictionary.',
|
||||||
|
partsOfSpeech: ['Noun', 'Adjective', 'Verb'],
|
||||||
|
alphabeticalOrder: [],
|
||||||
|
details: {
|
||||||
|
phonology: {
|
||||||
|
consonants: [],
|
||||||
|
vowels: [],
|
||||||
|
blends: [],
|
||||||
|
phonotactics: {
|
||||||
|
onset: [],
|
||||||
|
nucleus: [],
|
||||||
|
coda: [],
|
||||||
|
exceptions: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
orthography: {
|
||||||
|
notes: '',
|
||||||
|
},
|
||||||
|
grammar: {
|
||||||
|
notes: '',
|
||||||
|
},
|
||||||
|
// custom: [
|
||||||
|
// // {
|
||||||
|
// // name: 'Example Tab',
|
||||||
|
// // content: `This is an _example_ tab to show how **tabs** work with [Markdown](${ MARKDOWN_LINK })!`,
|
||||||
|
// // }
|
||||||
|
// ],
|
||||||
|
},
|
||||||
|
settings: {
|
||||||
|
allowDuplicates: false,
|
||||||
|
caseSensitive: false,
|
||||||
|
sortByDefinition: false,
|
||||||
|
isComplete: false,
|
||||||
|
isPublic: false,
|
||||||
|
},
|
||||||
|
lastUpdated: null,
|
||||||
|
createdOn: timestampInSeconds(),
|
||||||
|
};
|
|
@ -1,6 +1,7 @@
|
||||||
import Inferno from 'inferno';
|
import Inferno from 'inferno';
|
||||||
import { Component } from 'inferno';
|
import { Component } from 'inferno';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import store from 'store';
|
||||||
|
|
||||||
import { LeftColumn } from './structure/LeftColumn';
|
import { LeftColumn } from './structure/LeftColumn';
|
||||||
import { RightColumn } from './structure/RightColumn';
|
import { RightColumn } from './structure/RightColumn';
|
||||||
|
@ -9,6 +10,7 @@ import { Pagination } from './structure/Pagination';
|
||||||
import { WordForm } from './management/WordForm';
|
import { WordForm } from './management/WordForm';
|
||||||
import { DictionaryDetails } from './display/DictionaryDetails';
|
import { DictionaryDetails } from './display/DictionaryDetails';
|
||||||
import { WordsList } from './display/WordsList';
|
import { WordsList } from './display/WordsList';
|
||||||
|
import { DEFAULT_USER_DATA } from '../Constants';
|
||||||
|
|
||||||
export class MainDisplay extends Component {
|
export class MainDisplay extends Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
|
@ -21,8 +23,6 @@ export class MainDisplay extends Component {
|
||||||
wordsAreFiltered: PropTypes.bool,
|
wordsAreFiltered: PropTypes.bool,
|
||||||
wordsInCurrentList: PropTypes.number,
|
wordsInCurrentList: PropTypes.number,
|
||||||
currentPage: PropTypes.number,
|
currentPage: PropTypes.number,
|
||||||
itemsPerPage: PropTypes.number,
|
|
||||||
useIpaPronunciationField: PropTypes.bool,
|
|
||||||
stats: PropTypes.object.isRequired,
|
stats: PropTypes.object.isRequired,
|
||||||
setPage: PropTypes.func.isRequired,
|
setPage: PropTypes.func.isRequired,
|
||||||
updateDisplay: PropTypes.func.isRequired,
|
updateDisplay: PropTypes.func.isRequired,
|
||||||
|
@ -56,6 +56,8 @@ export class MainDisplay extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const userData = store.get('LexicongaUserData');
|
||||||
|
const itemsPerPage = userData ? userData.itemsPerPage : DEFAULT_USER_DATA.itemsPerPage;
|
||||||
const {
|
const {
|
||||||
dictionaryInfo,
|
dictionaryInfo,
|
||||||
isLoadingWords,
|
isLoadingWords,
|
||||||
|
@ -63,7 +65,6 @@ export class MainDisplay extends Component {
|
||||||
wordsAreFiltered,
|
wordsAreFiltered,
|
||||||
wordsInCurrentList,
|
wordsInCurrentList,
|
||||||
currentPage,
|
currentPage,
|
||||||
itemsPerPage,
|
|
||||||
useIpaPronunciationField,
|
useIpaPronunciationField,
|
||||||
stats,
|
stats,
|
||||||
setPage,
|
setPage,
|
||||||
|
@ -86,7 +87,6 @@ export class MainDisplay extends Component {
|
||||||
closeWordForm={ this.closeWordForm.bind(this) }
|
closeWordForm={ this.closeWordForm.bind(this) }
|
||||||
>
|
>
|
||||||
<WordForm
|
<WordForm
|
||||||
useIpaField={ useIpaPronunciationField }
|
|
||||||
updateDisplay={ updateDisplay }
|
updateDisplay={ updateDisplay }
|
||||||
/>
|
/>
|
||||||
</LeftColumn>
|
</LeftColumn>
|
||||||
|
@ -124,7 +124,6 @@ export class MainDisplay extends Component {
|
||||||
isLoadingWords={ isLoadingWords }
|
isLoadingWords={ isLoadingWords }
|
||||||
words={ wordsToDisplay }
|
words={ wordsToDisplay }
|
||||||
adsEveryXWords={ 10 }
|
adsEveryXWords={ 10 }
|
||||||
useIpaFieldOnEdit={ useIpaPronunciationField }
|
|
||||||
updateDisplay={ updateDisplay } />
|
updateDisplay={ updateDisplay } />
|
||||||
|
|
||||||
<Pagination
|
<Pagination
|
||||||
|
|
|
@ -17,7 +17,6 @@ export class WordDisplay extends Component {
|
||||||
|
|
||||||
PropTypes.checkPropTypes({
|
PropTypes.checkPropTypes({
|
||||||
word: PropTypes.object.isRequired,
|
word: PropTypes.object.isRequired,
|
||||||
useIpaFieldOnEdit: PropTypes.bool,
|
|
||||||
updateDisplay: PropTypes.func.isRequired,
|
updateDisplay: PropTypes.func.isRequired,
|
||||||
}, props, 'prop', 'WordDisplay');
|
}, props, 'prop', 'WordDisplay');
|
||||||
|
|
||||||
|
@ -66,13 +65,12 @@ export class WordDisplay extends Component {
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { menuIsOpen, isEditing } = this.state;
|
const { menuIsOpen, isEditing } = this.state;
|
||||||
const { word, useIpaFieldOnEdit, updateDisplay } = this.props;
|
const { word, updateDisplay } = this.props;
|
||||||
|
|
||||||
if (isEditing) {
|
if (isEditing) {
|
||||||
return (
|
return (
|
||||||
<WordForm
|
<WordForm
|
||||||
word={word}
|
word={word}
|
||||||
useIpaField={ useIpaFieldOnEdit }
|
|
||||||
updateDisplay={updateDisplay}
|
updateDisplay={updateDisplay}
|
||||||
callback={() => {
|
callback={() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
|
@ -16,7 +16,6 @@ export class WordsList extends Component {
|
||||||
isLoadingWords: PropTypes.bool,
|
isLoadingWords: PropTypes.bool,
|
||||||
adsEveryXWords: PropTypes.number,
|
adsEveryXWords: PropTypes.number,
|
||||||
words: PropTypes.array,
|
words: PropTypes.array,
|
||||||
useIpaFieldOnEdit: PropTypes.bool,
|
|
||||||
updateDisplay: PropTypes.func.isRequired,
|
updateDisplay: PropTypes.func.isRequired,
|
||||||
}, props, 'prop', 'WordList');
|
}, props, 'prop', 'WordList');
|
||||||
}
|
}
|
||||||
|
@ -42,7 +41,6 @@ export class WordsList extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
<WordDisplay word={ word }
|
<WordDisplay word={ word }
|
||||||
useIpaFieldOnEdit={ this.props.useIpaFieldOnEdit }
|
|
||||||
updateDisplay={ this.props.updateDisplay } />
|
updateDisplay={ this.props.updateDisplay } />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -8,16 +8,9 @@ import { Modal } from '../../structure/Modal';
|
||||||
import { LoginForm } from './LoginForm';
|
import { LoginForm } from './LoginForm';
|
||||||
import { MyAccount } from './MyAccount';
|
import { MyAccount } from './MyAccount';
|
||||||
|
|
||||||
|
import { DEFAULT_USER_DATA } from '../../../Constants';
|
||||||
import { request } from '../../../Helpers';
|
import { request } from '../../../Helpers';
|
||||||
|
|
||||||
const defaultUserData = {
|
|
||||||
email: '',
|
|
||||||
username: '',
|
|
||||||
publicName: '',
|
|
||||||
allowEmails: true,
|
|
||||||
useIPAPronunciation: true,
|
|
||||||
};
|
|
||||||
|
|
||||||
export class AccountManager extends Component {
|
export class AccountManager extends Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
@ -31,11 +24,12 @@ export class AccountManager extends Component {
|
||||||
this.state = {
|
this.state = {
|
||||||
isLoggedIn: false,
|
isLoggedIn: false,
|
||||||
userData: {
|
userData: {
|
||||||
email: userData ? userData.email : defaultUserData.email,
|
email: userData ? userData.email : DEFAULT_USER_DATA.email,
|
||||||
username: userData ? userData.username : defaultUserData.username,
|
username: userData ? userData.username : DEFAULT_USER_DATA.username,
|
||||||
publicName: userData ? userData.publicName : defaultUserData.publicName,
|
publicName: userData ? userData.publicName : DEFAULT_USER_DATA.publicName,
|
||||||
allowEmails: userData ? userData.allowEmails : defaultUserData.allowEmails,
|
allowEmails: userData ? userData.allowEmails : DEFAULT_USER_DATA.allowEmails,
|
||||||
useIPAPronunciation: userData ? userData.useIPAPronunciation : defaultUserData.useIPAPronunciation,
|
useIPAPronunciation: userData ? userData.useIPAPronunciation : DEFAULT_USER_DATA.useIPAPronunciation,
|
||||||
|
itemsPerPage: userData ? userData.itemsPerPage : DEFAULT_USER_DATA.itemsPerPage,
|
||||||
},
|
},
|
||||||
userDictionaries: [],
|
userDictionaries: [],
|
||||||
};
|
};
|
||||||
|
@ -52,7 +46,7 @@ export class AccountManager extends Component {
|
||||||
store.remove('LexicongaUserData');
|
store.remove('LexicongaUserData');
|
||||||
this.setState({
|
this.setState({
|
||||||
isLoggedIn: false,
|
isLoggedIn: false,
|
||||||
userData: Object.assign({}, defaultUserData),
|
userData: Object.assign({}, DEFAULT_USER_DATA),
|
||||||
userDictionaries: [],
|
userDictionaries: [],
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
import Inferno from 'inferno';
|
import Inferno from 'inferno';
|
||||||
import { Component } from 'inferno';
|
import { Component } from 'inferno';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import store from 'store';
|
||||||
|
|
||||||
import dictionaryData from '../../managers/DictionaryData';
|
import dictionaryData from '../../managers/DictionaryData';
|
||||||
|
import { DEFAULT_USER_DATA } from '../../Constants';
|
||||||
import { IPAField } from './IPAField';
|
import { IPAField } from './IPAField';
|
||||||
import { LargeTextArea } from './LargeTextArea';
|
import { LargeTextArea } from './LargeTextArea';
|
||||||
import { Word } from '../../managers/Word';
|
import { Word } from '../../managers/Word';
|
||||||
|
@ -13,7 +15,6 @@ export class WordForm extends Component {
|
||||||
|
|
||||||
PropTypes.checkPropTypes({
|
PropTypes.checkPropTypes({
|
||||||
word: PropTypes.object,
|
word: PropTypes.object,
|
||||||
useIpaField: PropTypes.bool.isRequired,
|
|
||||||
callback: PropTypes.func,
|
callback: PropTypes.func,
|
||||||
updateDisplay: PropTypes.func,
|
updateDisplay: PropTypes.func,
|
||||||
}, props, 'prop', 'WordForm');
|
}, props, 'prop', 'WordForm');
|
||||||
|
@ -102,6 +103,8 @@ export class WordForm extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const userData = store.get('LexicongaUserData');
|
||||||
|
const useIpaField = userData ? userData.useIPAPronunciation : DEFAULT_USER_DATA.useIPAPronunciation;
|
||||||
return (
|
return (
|
||||||
<div className='box'>
|
<div className='box'>
|
||||||
<div className='field'>
|
<div className='field'>
|
||||||
|
@ -121,7 +124,7 @@ export class WordForm extends Component {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<IPAField value={ this.state.wordPronunciation }
|
<IPAField value={ this.state.wordPronunciation }
|
||||||
preventIPA={ !this.props.useIpaField }
|
preventIPA={ !useIpaField }
|
||||||
onChange={ (newValue) => this.setState({ wordPronunciation: newValue }) } />
|
onChange={ (newValue) => this.setState({ wordPronunciation: newValue }) } />
|
||||||
|
|
||||||
<div className='field'>
|
<div className='field'>
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { Component, render } from 'inferno';
|
||||||
import store from 'store';
|
import store from 'store';
|
||||||
|
|
||||||
import removeDiacritics from '../vendor/StackOverflow/removeDiacritics';
|
import removeDiacritics from '../vendor/StackOverflow/removeDiacritics';
|
||||||
|
import { DEFAULT_USER_DATA } from './Constants';
|
||||||
import { addHelpfulPrototypes, getWordsStats } from './Helpers';
|
import { addHelpfulPrototypes, getWordsStats } from './Helpers';
|
||||||
addHelpfulPrototypes();
|
addHelpfulPrototypes();
|
||||||
|
|
||||||
|
@ -37,8 +38,6 @@ class App extends Component {
|
||||||
|
|
||||||
displayedWords: [],
|
displayedWords: [],
|
||||||
currentPage: 0,
|
currentPage: 0,
|
||||||
itemsPerPage: 30,
|
|
||||||
useIpaPronunciationField: true,
|
|
||||||
searchConfig: {
|
searchConfig: {
|
||||||
searchingIn: 'name',
|
searchingIn: 'name',
|
||||||
searchMethod: SEARCH_METHOD.contains,
|
searchMethod: SEARCH_METHOD.contains,
|
||||||
|
@ -95,9 +94,10 @@ class App extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDisplayedWords (callback = () => {}) {
|
updateDisplayedWords (callback = () => {}) {
|
||||||
const {currentPage, itemsPerPage} = this.state;
|
|
||||||
dictionary.wordsPromise.then(words => {
|
dictionary.wordsPromise.then(words => {
|
||||||
const { searchConfig, partsOfSpeech, currentPage, itemsPerPage } = this.state;
|
const userData = store.get('LexicongaUserData');
|
||||||
|
const itemsPerPage = userData ? userData.itemsPerPage : DEFAULT_USER_DATA.itemsPerPage;
|
||||||
|
const { searchConfig, partsOfSpeech, currentPage } = this.state;
|
||||||
const partsOfSpeechForFilter = [...partsOfSpeech, 'Uncategorized'];
|
const partsOfSpeechForFilter = [...partsOfSpeech, 'Uncategorized'];
|
||||||
const pageStart = currentPage * itemsPerPage;
|
const pageStart = currentPage * itemsPerPage;
|
||||||
const pageEnd = pageStart + itemsPerPage;
|
const pageEnd = pageStart + itemsPerPage;
|
||||||
|
@ -218,8 +218,6 @@ class App extends Component {
|
||||||
wordsAreFiltered={ this.isUsingFilter }
|
wordsAreFiltered={ this.isUsingFilter }
|
||||||
wordsInCurrentList={ this.state.wordsInCurrentList }
|
wordsInCurrentList={ this.state.wordsInCurrentList }
|
||||||
currentPage={ this.state.currentPage }
|
currentPage={ this.state.currentPage }
|
||||||
itemsPerPage={ this.state.itemsPerPage }
|
|
||||||
useIpaPronunciationField={ this.state.useIpaPronunciationField }
|
|
||||||
stats={ this.state.stats }
|
stats={ this.state.stats }
|
||||||
setPage={ this.setPage.bind(this) }
|
setPage={ this.setPage.bind(this) }
|
||||||
updateDisplay={ this.updateDisplayedWords.bind(this) }
|
updateDisplay={ this.updateDisplayedWords.bind(this) }
|
||||||
|
|
|
@ -2,60 +2,18 @@ import assert from 'assert';
|
||||||
import store from 'store';
|
import store from 'store';
|
||||||
import wordDb from './WordDatabase';
|
import wordDb from './WordDatabase';
|
||||||
import idManager from './IDManager';
|
import idManager from './IDManager';
|
||||||
import { timestampInSeconds } from '../Helpers';
|
import { DEFAULT_DICTIONARY } from '../Constants';
|
||||||
|
|
||||||
const defaultDictionary = {
|
|
||||||
name: 'New',
|
|
||||||
specification: 'Dictionary',
|
|
||||||
description: 'A new dictionary.',
|
|
||||||
partsOfSpeech: ['Noun', 'Adjective', 'Verb'],
|
|
||||||
alphabeticalOrder: [],
|
|
||||||
details: {
|
|
||||||
phonology: {
|
|
||||||
consonants: [],
|
|
||||||
vowels: [],
|
|
||||||
blends: [],
|
|
||||||
phonotactics: {
|
|
||||||
onset: [],
|
|
||||||
nucleus: [],
|
|
||||||
coda: [],
|
|
||||||
exceptions: '',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
orthography: {
|
|
||||||
notes: '',
|
|
||||||
},
|
|
||||||
grammar: {
|
|
||||||
notes: '',
|
|
||||||
},
|
|
||||||
// custom: [
|
|
||||||
// // {
|
|
||||||
// // name: 'Example Tab',
|
|
||||||
// // content: `This is an _example_ tab to show how **tabs** work with [Markdown](${ MARKDOWN_LINK })!`,
|
|
||||||
// // }
|
|
||||||
// ],
|
|
||||||
},
|
|
||||||
settings: {
|
|
||||||
allowDuplicates: false,
|
|
||||||
caseSensitive: false,
|
|
||||||
sortByDefinition: false,
|
|
||||||
isComplete: false,
|
|
||||||
isPublic: false,
|
|
||||||
},
|
|
||||||
lastUpdated: null,
|
|
||||||
createdOn: timestampInSeconds(),
|
|
||||||
};
|
|
||||||
|
|
||||||
class DictionaryData {
|
class DictionaryData {
|
||||||
constructor () {
|
constructor () {
|
||||||
this.default = defaultDictionary;
|
this.default = DEFAULT_DICTIONARY;
|
||||||
|
|
||||||
if (['emptydetails', 'donotsave'].includes(process.env.NODE_ENV)) {
|
if (['emptydetails', 'donotsave'].includes(process.env.NODE_ENV)) {
|
||||||
store.remove('Lexiconga');
|
store.remove('Lexiconga');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!store.get('Lexiconga')) {
|
if (!store.get('Lexiconga')) {
|
||||||
this.storedData = defaultDictionary;
|
this.storedData = DEFAULT_DICTIONARY;
|
||||||
} else {
|
} else {
|
||||||
wordDb.words
|
wordDb.words
|
||||||
.orderBy('id').reverse()
|
.orderBy('id').reverse()
|
||||||
|
@ -83,7 +41,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get name () {
|
get name () {
|
||||||
return this.storedData.name
|
return this.storedData.name
|
||||||
|| defaultDictionary.name;
|
|| DEFAULT_DICTIONARY.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
set name (value) {
|
set name (value) {
|
||||||
|
@ -95,7 +53,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get specification () {
|
get specification () {
|
||||||
return this.storedData.specification
|
return this.storedData.specification
|
||||||
|| defaultDictionary.specification;
|
|| DEFAULT_DICTIONARY.specification;
|
||||||
}
|
}
|
||||||
|
|
||||||
set specification (value) {
|
set specification (value) {
|
||||||
|
@ -107,7 +65,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get description () {
|
get description () {
|
||||||
return this.storedData.description
|
return this.storedData.description
|
||||||
|| defaultDictionary.description;
|
|| DEFAULT_DICTIONARY.description;
|
||||||
}
|
}
|
||||||
|
|
||||||
set description (value) {
|
set description (value) {
|
||||||
|
@ -119,7 +77,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get partsOfSpeech () {
|
get partsOfSpeech () {
|
||||||
return this.storedData.partsOfSpeech
|
return this.storedData.partsOfSpeech
|
||||||
|| defaultDictionary.partsOfSpeech;
|
|| DEFAULT_DICTIONARY.partsOfSpeech;
|
||||||
}
|
}
|
||||||
|
|
||||||
set partsOfSpeech (array) {
|
set partsOfSpeech (array) {
|
||||||
|
@ -133,12 +91,12 @@ class DictionaryData {
|
||||||
|
|
||||||
get details () {
|
get details () {
|
||||||
return this.storedData.details
|
return this.storedData.details
|
||||||
|| defaultDictionary.details;
|
|| DEFAULT_DICTIONARY.details;
|
||||||
}
|
}
|
||||||
|
|
||||||
get consonants () {
|
get consonants () {
|
||||||
return this.storedData.details.phonology.consonants
|
return this.storedData.details.phonology.consonants
|
||||||
|| defaultDictionary.details.phonology.consonants;
|
|| DEFAULT_DICTIONARY.details.phonology.consonants;
|
||||||
}
|
}
|
||||||
|
|
||||||
set consonants (array) {
|
set consonants (array) {
|
||||||
|
@ -152,7 +110,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get vowels () {
|
get vowels () {
|
||||||
return this.storedData.details.phonology.vowels
|
return this.storedData.details.phonology.vowels
|
||||||
|| defaultDictionary.details.phonology.vowels;
|
|| DEFAULT_DICTIONARY.details.phonology.vowels;
|
||||||
}
|
}
|
||||||
|
|
||||||
set vowels (array) {
|
set vowels (array) {
|
||||||
|
@ -166,7 +124,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get blends () {
|
get blends () {
|
||||||
return this.storedData.details.phonology.blends
|
return this.storedData.details.phonology.blends
|
||||||
|| defaultDictionary.details.phonology.blends;
|
|| DEFAULT_DICTIONARY.details.phonology.blends;
|
||||||
}
|
}
|
||||||
|
|
||||||
set blends (array) {
|
set blends (array) {
|
||||||
|
@ -180,7 +138,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get onset () {
|
get onset () {
|
||||||
return this.storedData.details.phonology.phonotactics.onset
|
return this.storedData.details.phonology.phonotactics.onset
|
||||||
|| defaultDictionary.details.phonology.phonotactics.onset;
|
|| DEFAULT_DICTIONARY.details.phonology.phonotactics.onset;
|
||||||
}
|
}
|
||||||
|
|
||||||
set onset (array) {
|
set onset (array) {
|
||||||
|
@ -194,7 +152,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get nucleus () {
|
get nucleus () {
|
||||||
return this.storedData.details.phonology.phonotactics.nucleus
|
return this.storedData.details.phonology.phonotactics.nucleus
|
||||||
|| defaultDictionary.details.phonology.phonotactics.nucleus;
|
|| DEFAULT_DICTIONARY.details.phonology.phonotactics.nucleus;
|
||||||
}
|
}
|
||||||
|
|
||||||
set nucleus (array) {
|
set nucleus (array) {
|
||||||
|
@ -208,7 +166,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get coda () {
|
get coda () {
|
||||||
return this.storedData.details.phonology.phonotactics.coda
|
return this.storedData.details.phonology.phonotactics.coda
|
||||||
|| defaultDictionary.details.phonology.phonotactics.coda;
|
|| DEFAULT_DICTIONARY.details.phonology.phonotactics.coda;
|
||||||
}
|
}
|
||||||
|
|
||||||
set coda (array) {
|
set coda (array) {
|
||||||
|
@ -222,7 +180,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get exceptions () {
|
get exceptions () {
|
||||||
return this.storedData.details.phonology.phonotactics.exceptions
|
return this.storedData.details.phonology.phonotactics.exceptions
|
||||||
|| defaultDictionary.details.phonology.phonotactics.exceptions;
|
|| DEFAULT_DICTIONARY.details.phonology.phonotactics.exceptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
set exceptions (value) {
|
set exceptions (value) {
|
||||||
|
@ -234,7 +192,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get orthographyNotes () {
|
get orthographyNotes () {
|
||||||
return this.storedData.details.orthography.notes
|
return this.storedData.details.orthography.notes
|
||||||
|| defaultDictionary.details.orthography.notes;
|
|| DEFAULT_DICTIONARY.details.orthography.notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
set orthographyNotes (value) {
|
set orthographyNotes (value) {
|
||||||
|
@ -246,7 +204,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get grammarNotes () {
|
get grammarNotes () {
|
||||||
return this.storedData.details.grammar.notes
|
return this.storedData.details.grammar.notes
|
||||||
|| defaultDictionary.details.grammar.notes;
|
|| DEFAULT_DICTIONARY.details.grammar.notes;
|
||||||
}
|
}
|
||||||
|
|
||||||
set grammarNotes (value) {
|
set grammarNotes (value) {
|
||||||
|
@ -258,7 +216,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get alphabeticalOrder () {
|
get alphabeticalOrder () {
|
||||||
return this.storedData.alphabeticalOrder
|
return this.storedData.alphabeticalOrder
|
||||||
|| defaultDictionary.alphabeticalOrder;
|
|| DEFAULT_DICTIONARY.alphabeticalOrder;
|
||||||
}
|
}
|
||||||
|
|
||||||
set alphabeticalOrder (array) {
|
set alphabeticalOrder (array) {
|
||||||
|
@ -272,12 +230,12 @@ class DictionaryData {
|
||||||
|
|
||||||
get settings () {
|
get settings () {
|
||||||
return this.storedData.settings
|
return this.storedData.settings
|
||||||
|| defaultDictionary.settings;
|
|| DEFAULT_DICTIONARY.settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
get allowDuplicates () {
|
get allowDuplicates () {
|
||||||
return this.storedData.settings.allowDuplicates
|
return this.storedData.settings.allowDuplicates
|
||||||
|| defaultDictionary.settings.allowDuplicates;
|
|| DEFAULT_DICTIONARY.settings.allowDuplicates;
|
||||||
}
|
}
|
||||||
|
|
||||||
set allowDuplicates (value) {
|
set allowDuplicates (value) {
|
||||||
|
@ -289,7 +247,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get caseSensitive () {
|
get caseSensitive () {
|
||||||
return this.storedData.settings.caseSensitive
|
return this.storedData.settings.caseSensitive
|
||||||
|| defaultDictionary.settings.caseSensitive;
|
|| DEFAULT_DICTIONARY.settings.caseSensitive;
|
||||||
}
|
}
|
||||||
|
|
||||||
set caseSensitive (value) {
|
set caseSensitive (value) {
|
||||||
|
@ -301,7 +259,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get sortByDefinition () {
|
get sortByDefinition () {
|
||||||
return this.storedData.settings.sortByDefinition
|
return this.storedData.settings.sortByDefinition
|
||||||
|| defaultDictionary.settings.sortByDefinition;
|
|| DEFAULT_DICTIONARY.settings.sortByDefinition;
|
||||||
}
|
}
|
||||||
|
|
||||||
set sortByDefinition (value) {
|
set sortByDefinition (value) {
|
||||||
|
@ -313,7 +271,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get isComplete () {
|
get isComplete () {
|
||||||
return this.storedData.settings.isComplete
|
return this.storedData.settings.isComplete
|
||||||
|| defaultDictionary.settings.isComplete;
|
|| DEFAULT_DICTIONARY.settings.isComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
set isComplete (value) {
|
set isComplete (value) {
|
||||||
|
@ -325,7 +283,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get isPublic () {
|
get isPublic () {
|
||||||
return this.storedData.settings.isPublic
|
return this.storedData.settings.isPublic
|
||||||
|| defaultDictionary.settings.isPublic;
|
|| DEFAULT_DICTIONARY.settings.isPublic;
|
||||||
}
|
}
|
||||||
|
|
||||||
set isPublic (value) {
|
set isPublic (value) {
|
||||||
|
@ -337,7 +295,7 @@ class DictionaryData {
|
||||||
|
|
||||||
get lastUpdated () {
|
get lastUpdated () {
|
||||||
return this.storedData.lastUpdated
|
return this.storedData.lastUpdated
|
||||||
|| defaultDictionary.lastUpdated;
|
|| DEFAULT_DICTIONARY.lastUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
set lastUpdated (value) {
|
set lastUpdated (value) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue