diff --git a/index.html b/index.html index 134fc26..a9adf8e 100644 --- a/index.html +++ b/index.html @@ -145,7 +145,7 @@
diff --git a/src/constants.js b/src/constants.js index 1c29ef3..11abc87 100644 --- a/src/constants.js +++ b/src/constants.js @@ -54,6 +54,11 @@ export const DEFAULT_DICTIONARY = { version: MIGRATE_VERSION, }; +export const DEFAULT_SETTINGS = { + useIPAPronunciationField: true, +}; + export const DEFAULT_PAGE_SIZE = 50; export const LOCAL_STORAGE_KEY = 'dictionary'; +export const SETTINGS_KEY = 'settings'; diff --git a/src/index.js b/src/index.js index 836e5eb..e47eed6 100644 --- a/src/index.js +++ b/src/index.js @@ -4,10 +4,12 @@ import setupListeners from './js/setupListeners'; import { renderAll } from './js/render'; import { generateRandomWords, addMessage } from './js/utilities'; import { loadDictionary } from './js/dictionaryManagement'; +import { loadSettings } from './js/settings'; function initialize() { addMessage('Loading!'); loadDictionary(); + loadSettings(); // generateRandomWords(100); setupListeners(); renderAll(); diff --git a/src/js/render.js b/src/js/render.js index 6319340..e85693e 100644 --- a/src/js/render.js +++ b/src/js/render.js @@ -231,14 +231,18 @@ export function renderEditForm(wordId = false) { wordId = typeof wordId.target === 'undefined' ? wordId : parseInt(this.id.replace('edit_', '')); const word = window.currentDictionary.words.find(w => w.wordId === wordId); if (word) { + const ipaPronunciationField = ``; + const plainPronunciationField = ``; const editForm = ` - + ${window.settings.useIPAPronunciationField ? ipaPronunciationField : plainPronunciationField}