aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/backend.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-05 19:34:31 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2020-04-07 19:04:47 -0400
commit8a419dfa67b730d777fbefaf9c6ffa649bbb67d3 (patch)
tree29750a1f335084a670d180a9edd4a40103b168da /ext/bg/js/backend.js
parent716ab99fc04e0a02e24d3de20cdf0d3a368c1bf0 (diff)
Pass AudioSystem instance to AnkiNoteBuilder constructor
Diffstat (limited to 'ext/bg/js/backend.js')
-rw-r--r--ext/bg/js/backend.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js
index 9e02cced..1fa7ede1 100644
--- a/ext/bg/js/backend.js
+++ b/ext/bg/js/backend.js
@@ -51,12 +51,16 @@ class Backend {
this.anki = new AnkiNull();
this.mecab = new Mecab();
this.clipboardMonitor = new ClipboardMonitor({getClipboard: this._onApiClipboardGet.bind(this)});
- this.ankiNoteBuilder = new AnkiNoteBuilder({renderTemplate: this._renderTemplate.bind(this)});
this.options = null;
this.optionsSchema = null;
this.defaultAnkiFieldTemplates = null;
this.audioSystem = new AudioSystem({getAudioUri: this._getAudioUri.bind(this)});
this.audioUriBuilder = new AudioUriBuilder();
+ this.ankiNoteBuilder = new AnkiNoteBuilder({
+ audioSystem: this.audioSystem,
+ renderTemplate: this._renderTemplate.bind(this)
+ });
+
this.optionsContext = {
depth: 0,
url: window.location.href
@@ -464,7 +468,6 @@ class Backend {
definition,
options.anki.terms.fields,
options.audio.sources,
- this.audioSystem,
optionsContext
);
}