From 2b87c919bcd879c7f356308bc522b95f33e35f3b Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Sat, 20 Jan 2024 02:25:23 +0100 Subject: Dictionary deinflections (#503) * wip * wip * fix v3 * wip * fix tests * fix maxitems * hide deinflection definitions * fix anki template * undo unnecessary change * delete console.log * refactor * add set false to handlebars * lint * fix tests * fix comments * fix * use Map in areArraysEqualIgnoreOrder * move inflection source icons to css * lint * improve naming * fix tests * add test * typescript * use for of * wip * comments * anki template upgrade * update descriptions --- ext/js/pages/settings/dictionary-controller.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ext/js/pages/settings/dictionary-controller.js') diff --git a/ext/js/pages/settings/dictionary-controller.js b/ext/js/pages/settings/dictionary-controller.js index 18a802be..1d3da532 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -185,6 +185,10 @@ class DictionaryEntry { const partsOfSpeechFilterSetting = querySelectorNotNull(modal.node, '.dictionary-parts-of-speech-filter-setting'); /** @type {HTMLElement} */ const partsOfSpeechFilterToggle = querySelectorNotNull(partsOfSpeechFilterSetting, '.dictionary-parts-of-speech-filter-toggle'); + /** @type {HTMLElement} */ + const useDeinflectionsSetting = querySelectorNotNull(modal.node, '.dictionary-use-deinflections-setting'); + /** @type {HTMLElement} */ + const useDeinflectionsToggle = querySelectorNotNull(useDeinflectionsSetting, '.dictionary-use-deinflections-toggle'); titleElement.textContent = title; versionElement.textContent = `rev.${revision}`; @@ -194,6 +198,9 @@ class DictionaryEntry { partsOfSpeechFilterSetting.hidden = !counts.terms.total; partsOfSpeechFilterToggle.dataset.setting = `dictionaries[${this._index}].partsOfSpeechFilter`; + useDeinflectionsSetting.hidden = !counts.terms.total; + useDeinflectionsToggle.dataset.setting = `dictionaries[${this._index}].useDeinflections`; + this._setupDetails(detailsTableElement); modal.setVisible(true); @@ -521,7 +528,8 @@ export class DictionaryController { enabled, allowSecondarySearches: false, definitionsCollapsible: 'not-collapsible', - partsOfSpeechFilter: true + partsOfSpeechFilter: true, + useDeinflections: true }; } -- cgit v1.2.3