From d2c930a94d6e445053bcb5e5bb629851165425fc Mon Sep 17 00:00:00 2001 From: StefanVukovic99 Date: Thu, 20 Jun 2024 19:27:02 +0200 Subject: support css file in dictionaries (#1080) * get styles in db * get styles in settings * use styles * fix test * scope * fix comma separated * escape dict name in css selector * g regex * get styles in anki * fix tests * more specificity * whitespace * test importing * test handlebars * add styles to glossary-first --- ext/js/pages/settings/dictionary-controller.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 e7a9444f..5c0e49d4 100644 --- a/ext/js/pages/settings/dictionary-controller.js +++ b/ext/js/pages/settings/dictionary-controller.js @@ -519,9 +519,10 @@ export class DictionaryController { /** * @param {string} name * @param {boolean} enabled + * @param {string} styles * @returns {import('settings').DictionaryOptions} */ - static createDefaultDictionarySettings(name, enabled) { + static createDefaultDictionarySettings(name, enabled, styles) { return { name, priority: 0, @@ -530,6 +531,7 @@ export class DictionaryController { definitionsCollapsible: 'not-collapsible', partsOfSpeechFilter: true, useDeinflections: true, + styles: styles ?? '', }; } @@ -572,7 +574,7 @@ export class DictionaryController { } for (const name of missingDictionaries) { - const value = DictionaryController.createDefaultDictionarySettings(name, newDictionariesEnabled); + const value = DictionaryController.createDefaultDictionarySettings(name, newDictionariesEnabled, ''); dictionaryOptionsArray.push(value); modified = true; } -- cgit v1.2.3