From f7093b4c1abf73363e65dba54a098b76d0f2ba50 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Tue, 8 Sep 2020 11:01:08 -0400 Subject: Anki note clipboard marker (#780) * Update fields reference * Add support for adding clipboard images to anki notes * Add handlebars templates * Add markers * Add markers to readme --- ext/bg/js/options.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ext/bg/js/options.js') diff --git a/ext/bg/js/options.js b/ext/bg/js/options.js index fc2403e1..9dc0c166 100644 --- a/ext/bg/js/options.js +++ b/ext/bg/js/options.js @@ -432,7 +432,7 @@ class OptionsUtil { update: this._updateVersion3.bind(this) }, { - async: false, + async: true, update: this._updateVersion4.bind(this) } ]; @@ -468,10 +468,11 @@ class OptionsUtil { return options; } - static _updateVersion4(options) { + static async _updateVersion4(options) { // Version 4 changes: // Options conditions converted to string representations. // Added usePopupWindow. + // Updated handlebars templates to include "clipboard-image" definition. for (const {conditionGroups} of options.profiles) { for (const {conditions} of conditionGroups) { for (const condition of conditions) { @@ -487,6 +488,7 @@ class OptionsUtil { for (const {options: profileOptions} of options.profiles) { profileOptions.general.usePopupWindow = false; } + await this._addFieldTemplatesToOptions(options, '/bg/data/anki-field-templates-upgrade-v4.handlebars'); return options; } } -- cgit v1.2.3