diff --git a/src/components/display/DictionaryDetails/DetailsSection/OrthographyDisplay.jsx b/src/components/display/DictionaryDetails/DetailsSection/OrthographyDisplay.jsx
new file mode 100644
index 0000000..f9da91a
--- /dev/null
+++ b/src/components/display/DictionaryDetails/DetailsSection/OrthographyDisplay.jsx
@@ -0,0 +1,25 @@
+import Inferno from 'inferno';
+import marked from 'marked';
+import sanitizeHtml from 'sanitize-html';
+
+export const OrthographyDisplay = ({
+ orthographyContent,
+}) => {
+ return (
+
+ );
+}
diff --git a/src/components/display/DictionaryDetails/DetailsSection/index.jsx b/src/components/display/DictionaryDetails/DetailsSection/index.jsx
index 79d3268..e61dfd1 100644
--- a/src/components/display/DictionaryDetails/DetailsSection/index.jsx
+++ b/src/components/display/DictionaryDetails/DetailsSection/index.jsx
@@ -7,6 +7,7 @@ import './styles.scss';
import { GeneralDisplay } from './GeneralDisplay';
import { PhonologyDisplay } from './PhonologyDisplay';
+import { OrthographyDisplay } from './OrthographyDisplay';
const DISPLAY = {
NONE: false,
@@ -22,6 +23,7 @@ export class DetailsSection extends Component {
this.defaultMenuItems = [
'General',
'Phonology',
+ 'Orthography',
'Grammar',
];
@@ -118,6 +120,13 @@ export class DetailsSection extends Component {
);
break;
}
+ case 'Orthography': {
+ detailsDisplay = (
+
+ );
+ break;
+ }
case 'Grammar': {
detailsDisplay = 'Grammar content!';
break;
diff --git a/src/components/management/EditDictionaryModal/EditLinguisticsForm.jsx b/src/components/management/EditDictionaryModal/EditLinguisticsForm.jsx
index 22fed86..576ccc7 100644
--- a/src/components/management/EditDictionaryModal/EditLinguisticsForm.jsx
+++ b/src/components/management/EditDictionaryModal/EditLinguisticsForm.jsx
@@ -12,6 +12,7 @@ export const EditLinguisticsForm = ({
nucleus,
coda,
exceptions,
+ orthographyNotes,
}) => {
return (
@@ -190,6 +191,37 @@ export const EditLinguisticsForm = ({
+
+
+ Orthography
+
+
+
+
+
+
+
+
+ Any notes on orthography or how phonemes are written, Markdown enabled
+
+
+
+
+
+
+
);
diff --git a/src/components/management/EditDictionaryModal/index.jsx b/src/components/management/EditDictionaryModal/index.jsx
index 9629fef..c797d1c 100644
--- a/src/components/management/EditDictionaryModal/index.jsx
+++ b/src/components/management/EditDictionaryModal/index.jsx
@@ -32,6 +32,7 @@ export class EditDictionaryModal extends Component {
nucleus: props.details.phonology.phonotactics.nucleus.join('\n'),
coda: props.details.phonology.phonotactics.coda.join('\n'),
exceptions: props.details.phonology.phonotactics.exceptions,
+ orthographyNotes: props.details.orthography.notes,
hasChanged: false,
}
@@ -81,6 +82,7 @@ export class EditDictionaryModal extends Component {
nucleus={ this.state.nucleus }
coda={ this.state.coda }
exceptions={ this.state.exceptions }
+ orthographyNotes={ this.state.orthographyNotes }
/>
);
break;
@@ -176,6 +178,10 @@ export class EditDictionaryModal extends Component {
updatedDetails['exceptions'] = this.state.exceptions;
}
+ if (this.state.orthographyNotes !== this.props.details.orthography.notes) {
+ updatedDetails['orthographyNotes'] = this.state.orthographyNotes;
+ }
+
// console.log(updatedDetails);
this.props.updater.updateDictionaryDetails(updatedDetails)
diff --git a/src/managers/DictionaryData.js b/src/managers/DictionaryData.js
index 5c32bd0..be1fd4c 100644
--- a/src/managers/DictionaryData.js
+++ b/src/managers/DictionaryData.js
@@ -209,6 +209,18 @@ class DictionaryData {
return store.set('Lexiconga', updatedValues);
}
+ get orthographyNotes () {
+ return store.get('Lexiconga').details.orthography.notes
+ || defaultDictionary.details.orthography.notes;
+ }
+
+ set orthographyNotes (value) {
+ assert(typeof value === 'string', 'Orthography Notes must be passed as a string.');
+ const updatedValues = store.get('Lexiconga');
+ updatedValues.details.orthography.notes = value.trim();
+ return store.set('Lexiconga', updatedValues);
+ }
+
get alphabeticalOrder () {
return store.get('Lexiconga').alphabeticalOrder
|| defaultDictionary.alphabeticalOrder;
diff --git a/src/managers/Updater.js b/src/managers/Updater.js
index 45da831..17eedc1 100644
--- a/src/managers/Updater.js
+++ b/src/managers/Updater.js
@@ -24,7 +24,16 @@ export class Updater {
return new Promise((resolve, reject) => {
const updatedDetails = {};
- const detailKeys = ['consonants', 'vowels', 'blends', 'onset', 'nucleus', 'coda', 'exceptions'];
+ const detailKeys = [
+ 'consonants',
+ 'vowels',
+ 'blends',
+ 'onset',
+ 'nucleus',
+ 'coda',
+ 'exceptions',
+ 'orthographyNotes',
+ ];
for (const key in dictionaryDetails) {
this.dictionary[key] = dictionaryDetails[key];