summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2017-01-28 18:14:07 -0800
committerAlex Yatskov <alex@foosoft.net>2017-01-28 18:14:07 -0800
commitbf9925ec9cabd5a755152aa89df1f87e38d53534 (patch)
treed2d25ebce8724e624e34bdd2a73c5bbb989aeeed
parent2398b990af57a4326cf17602c673660bed5b2dec (diff)
add versioning code for people broken by last update
-rw-r--r--ext/bg/js/options.js17
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);
}
];