summaryrefslogtreecommitdiff
path: root/ext/bg/js/options.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-09-08 11:01:08 -0400
committerGitHub <noreply@github.com>2020-09-08 11:01:08 -0400
commitf7093b4c1abf73363e65dba54a098b76d0f2ba50 (patch)
treec54fc65cb559d21450a1c2a3596ec222e40fc9ba /ext/bg/js/options.js
parent36fc5abae543840484b3d8f7abff85f57de66ada (diff)
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
Diffstat (limited to 'ext/bg/js/options.js')
-rw-r--r--ext/bg/js/options.js6
1 files changed, 4 insertions, 2 deletions
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;
}
}