diff --git a/src/constants.js b/src/constants.js index d30aae9..dca587e 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,6 +1,6 @@ import { getTimestampInSeconds } from "./helpers"; -export const MIGRATE_VERSION = '2.1.0'; +export const MIGRATE_VERSION = '2.0.1'; export const DEFAULT_DICTIONARY = { name: 'New', specification: 'Dictionary', diff --git a/src/js/dictionaryManagement.js b/src/js/dictionaryManagement.js index 3c609e1..c464d7e 100644 --- a/src/js/dictionaryManagement.js +++ b/src/js/dictionaryManagement.js @@ -30,6 +30,7 @@ export function openEditModal() { document.getElementById('editCoda').value = phonotactics.coda.join(','); document.getElementById('editPhonotacticsNotes').value = phonotactics.notes; + document.getElementById('editTranslations').value = orthography.translations.join('\n'); document.getElementById('editOrthography').value = orthography.notes; document.getElementById('editGrammar').value = grammar.notes; @@ -59,18 +60,16 @@ export function saveEditModal() { window.currentDictionary.details.phonotactics.coda = document.getElementById('editCoda').value.split(',').map(val => val.trim()).filter(val => val !== ''); window.currentDictionary.details.phonotactics.notes = removeTags(document.getElementById('editPhonotacticsNotes').value.trim()); + window.currentDictionary.details.orthography.translations = document.getElementById('editTranslations').value.split('\n').map(val => val.trim()).filter(val => val !== ''); window.currentDictionary.details.orthography.notes = removeTags(document.getElementById('editOrthography').value.trim()); window.currentDictionary.details.grammar.notes = removeTags(document.getElementById('editGrammar').value.trim()); window.currentDictionary.settings.allowDuplicates = !document.getElementById('editPreventDuplicates').checked; window.currentDictionary.settings.caseSensitive = document.getElementById('editCaseSensitive').checked; - const needsReSort = window.currentDictionary.settings.sortByDefinition !== document.getElementById('editSortByDefinition').checked; window.currentDictionary.settings.sortByDefinition = document.getElementById('editSortByDefinition').checked; window.currentDictionary.settings.theme = document.getElementById('editTheme').value; - let needsWordRender = false; if (hasToken()) { - needsWordRender = window.currentDictionary.settings.isPublic !== document.getElementById('editIsPublic').checked; window.currentDictionary.settings.isPublic = document.getElementById('editIsPublic').checked; } else { window.currentDictionary.settings.isPublic = false; @@ -81,10 +80,7 @@ export function saveEditModal() { renderTheme(); renderDictionaryDetails(); renderPartsOfSpeech(); - - if (needsReSort || needsWordRender) { - sortWords(true); - } + sortWords(true); if (hasToken()) { import('./account/index.js').then(account => { diff --git a/src/js/migration.js b/src/js/migration.js index f716ef6..5976bf6 100644 --- a/src/js/migration.js +++ b/src/js/migration.js @@ -110,7 +110,7 @@ export function migrateDictionary() { delete window.currentDictionary.details.phonology.phonotactics; window.currentDictionary.details.phonotactics.notes = window.currentDictionary.details.phonotactics.exceptions; delete window.currentDictionary.details.phonotactics.exceptions; - // Add window.currentDictionary.details.orthography.translations = []; + window.currentDictionary.details.orthography.translations = []; // Add window.currentDictionary.custom.css = ''; window.currentDictionary = Object.assign({}, DEFAULT_DICTIONARY, window.currentDictionary); window.currentDictionary.version = MIGRATE_VERSION; diff --git a/src/js/render.js b/src/js/render.js index dcc025f..8764a48 100644 --- a/src/js/render.js +++ b/src/js/render.js @@ -15,7 +15,7 @@ import { setupIPAFields } from './setupListeners'; import { getPaginationData } from './pagination'; -import { getOpenEditForms, parseReferences } from './wordManagement'; +import { getOpenEditForms, translateOrthography, parseReferences } from './wordManagement'; import { renderAd } from './ads'; import ipaTableFile from './KeyboardFire/phondue/ipa-table.html'; import { getPublicLink } from './account/utilities'; @@ -68,7 +68,7 @@ export function renderName() { } export function renderDescription() { - const descriptionHTML = md(removeTags(window.currentDictionary.description)); + const descriptionHTML = md(parseReferences(removeTags(window.currentDictionary.description))); document.getElementById('detailsPanel').innerHTML = '