diff options
author | Alex Yatskov <alex@foosoft.net> | 2017-01-28 18:14:07 -0800 |
---|---|---|
committer | Alex Yatskov <alex@foosoft.net> | 2017-01-28 18:14:07 -0800 |
commit | bf9925ec9cabd5a755152aa89df1f87e38d53534 (patch) | |
tree | d2d25ebce8724e624e34bdd2a73c5bbb989aeeed /ext/bg/js/options.js | |
parent | 2398b990af57a4326cf17602c673660bed5b2dec (diff) |
add versioning code for people broken by last update
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r-- | ext/bg/js/options.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index f1f6c9a1..ca2792c0 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -119,6 +119,23 @@ function optionsVersion(options) { dictionary.enabled = dictionary.enableTerms || dictionary.enableKanji; dictionary.priority = 0; } + }, + () => { + const fixupFields = fields => { + const fixups = { + '{expression-furigana}': '{furigana}', + '{glossary-list}': '{glossary}' + }; + + for (const name in fields) { + for (const fixup in fixups) { + fields[name] = fields[name].replace(fixup, fixups[fixup]); + } + } + }; + + fixupFields(options.anki.terms.fields); + fixupFields(options.anki.kanji.fields); } ]; |