aboutsummaryrefslogtreecommitdiff
path: root/ext/js/display/display.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/display/display.js')
-rw-r--r--ext/js/display/display.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/js/display/display.js b/ext/js/display/display.js
index 517b391d..0e029748 100644
--- a/ext/js/display/display.js
+++ b/ext/js/display/display.js
@@ -17,6 +17,7 @@
/* global
* AnkiNoteBuilder
+ * AnkiUtil
* DisplayAudio
* DisplayGenerator
* DisplayHistory
@@ -85,7 +86,7 @@ class Display extends EventDispatcher {
});
this._ankiFieldTemplates = null;
this._ankiFieldTemplatesDefault = null;
- this._ankiNoteBuilder = new AnkiNoteBuilder(true);
+ this._ankiNoteBuilder = new AnkiNoteBuilder();
this._updateAdderButtonsPromise = Promise.resolve();
this._contentScrollElement = document.querySelector('#content-scroll');
this._contentScrollBodyElement = document.querySelector('#content-body');
@@ -1493,7 +1494,7 @@ class Display extends EventDispatcher {
const definitionDetails = this._getDefinitionDetailsForNote(definition);
let audioDetails = null;
- if (definitionDetails.type !== 'kanji' && this._ankiNoteBuilder.containsMarker(fields, 'audio')) {
+ if (definitionDetails.type !== 'kanji' && AnkiUtil.fieldsObjectContainsMarker(fields, 'audio')) {
const primaryCardAudio = this._displayAudio.getPrimaryCardAudio(definitionDetails.expression, definitionDetails.reading);
let preferredAudioIndex = null;
let sources2 = sources;
@@ -1504,11 +1505,11 @@ class Display extends EventDispatcher {
audioDetails = {sources: sources2, preferredAudioIndex, customSourceUrl, customSourceType};
}
- const screenshotDetails = (this._ankiNoteBuilder.containsMarker(fields, 'screenshot') ? {tabId: this._contentOriginTabId, frameId: this._contentOriginFrameId, format, quality} : null);
+ const screenshotDetails = (AnkiUtil.fieldsObjectContainsMarker(fields, 'screenshot') ? {tabId: this._contentOriginTabId, frameId: this._contentOriginFrameId, format, quality} : null);
const clipboardDetails = {
- image: this._ankiNoteBuilder.containsMarker(fields, 'clipboard-image'),
- text: this._ankiNoteBuilder.containsMarker(fields, 'clipboard-text')
+ image: AnkiUtil.fieldsObjectContainsMarker(fields, 'clipboard-image'),
+ text: AnkiUtil.fieldsObjectContainsMarker(fields, 'clipboard-text')
};
return await yomichan.api.injectAnkiNoteMedia(