From e24075e1a91ab8b58bb5836cf7abcefae5cbf8c3 Mon Sep 17 00:00:00 2001 From: James Maa Date: Mon, 10 Jun 2024 10:59:54 -0700 Subject: Add context menu interface for Yomitan (#1028) * --wip-- [skip ci] * Draft * Remove weird code * Use existing API instead of dulpicating * Small improvements * remove console.log * remove console.log * Add setting for contextMenu * Fix test * Address comments * Add option-util upgrade * fix option-utils --- ext/js/data/options-util.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ext/js/data') diff --git a/ext/js/data/options-util.js b/ext/js/data/options-util.js index 5ef30adb..c6bdf025 100644 --- a/ext/js/data/options-util.js +++ b/ext/js/data/options-util.js @@ -546,6 +546,7 @@ export class OptionsUtil { this._updateVersion36, this._updateVersion37, this._updateVersion38, + this._updateVersion39, ]; /* eslint-enable @typescript-eslint/unbound-method */ if (typeof targetVersion === 'number' && targetVersion < result.length) { @@ -1313,6 +1314,16 @@ export class OptionsUtil { await this._applyAnkiFieldTemplatesPatch(options, '/data/templates/anki-field-templates-upgrade-v38.handlebars'); } + /** + * - Add new setting enableContextMenuScanSelected + * @type {import('options-util').UpdateFunction} + */ + async _updateVersion39(options) { + for (const profile of options.profiles) { + profile.options.general.enableContextMenuScanSelected = true; + } + } + /** * @param {string} url * @returns {Promise} -- cgit v1.2.3