diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/data/templates/anki-field-templates-upgrade-v24.handlebars | 56 | ||||
-rw-r--r-- | ext/js/data/options-util.js | 12 |
2 files changed, 56 insertions, 12 deletions
diff --git a/ext/data/templates/anki-field-templates-upgrade-v24.handlebars b/ext/data/templates/anki-field-templates-upgrade-v24.handlebars index 717cb74b..1459fd49 100644 --- a/ext/data/templates/anki-field-templates-upgrade-v24.handlebars +++ b/ext/data/templates/anki-field-templates-upgrade-v24.handlebars @@ -1,3 +1,7 @@ +{{#*inline "cloze-body-kana"}} + {{~#if definition.cloze}}{{definition.cloze.bodyKana}}{{/if~}} +{{/inline}} + {{#*inline "phonetic-transcriptions"}} {{~#if (op ">" definition.phoneticTranscriptions.length 0)~}} <ul> @@ -21,6 +25,15 @@ {{<<<<<<<}} {{#*inline "conjugation"}} + {{~#if definition.reasons~}} + {{~#each definition.reasons~}} + {{~#if (op ">" @index 0)}} « {{/if~}} + {{.}} + {{~/each~}} + {{~/if~}} +{{/inline}} +{{=======}} +{{#*inline "conjugation"}} {{~#if (op ">" definition.inflectionRuleChainCandidates.length 0)~}} {{~set "multiple" false~}} {{~#if (op ">" definition.inflectionRuleChainCandidates.length 1)~}} @@ -40,13 +53,40 @@ {{~#if (get "multiple")~}}</ul>{{/if~}} {{~/if~}} {{/inline}} -{{=======}} -{{#*inline "conjugation"}} - {{~#if definition.reasons~}} - {{~#each definition.reasons~}} - {{~#if (op ">" @index 0)}} « {{/if~}} - {{.}} - {{~/each~}} +{{>>>>>>>}} + +{{#*inline "frequency-harmonic-rank"}} + {{~#if (op "===" definition.frequencyHarmonic -1) ~}} + 9999999 + {{~else ~}} + {{definition.frequencyHarmonic}} {{~/if~}} {{/inline}} -{{>>>>>>>}} + +{{#*inline "frequency-harmonic-occurrence"}} + {{~#if (op "===" definition.frequencyHarmonic -1) ~}} + 0 + {{~else ~}} + {{definition.frequencyHarmonic}} + {{~/if~}} +{{/inline}} + +{{#*inline "frequency-average-rank"}} + {{~#if (op "===" definition.frequencyAverage -1) ~}} + 9999999 + {{~else ~}} + {{definition.frequencyAverage}} + {{~/if~}} +{{/inline}} + +{{#*inline "frequency-average-occurrence"}} + {{~#if (op "===" definition.frequencyAverage -1) ~}} + 0 + {{~else ~}} + {{definition.frequencyAverage}} + {{~/if~}} +{{/inline}} + +{{~#*inline "pitch-accent-categories"~}} + {{~#each (pitchCategories @root)~}}{{~.~}}{{~#unless @last~}},{{~/unless~}}{{~/each~}} +{{~/inline~}}
\ No newline at end of file diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 2ecd5527..312c6efc 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -1115,8 +1115,10 @@ export class OptionsUtil { */ _updateVersion23(options) { for (const {options: profileOptions} of options.profiles) { - for (const dictionary of profileOptions.dictionaries) { - dictionary.partsOfSpeechFilter = true; + if (Array.isArray(profileOptions.dictionaries)) { + for (const dictionary of profileOptions.dictionaries) { + dictionary.partsOfSpeechFilter = true; + } } } } @@ -1129,8 +1131,10 @@ export class OptionsUtil { await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v24.handlebars'); for (const {options: profileOptions} of options.profiles) { - for (const dictionary of profileOptions.dictionaries) { - dictionary.useDeinflections = true; + if (Array.isArray(profileOptions.dictionaries)) { + for (const dictionary of profileOptions.dictionaries) { + dictionary.useDeinflections = true; + } } } } |