summaryrefslogtreecommitdiff
path: root/ext/mixed/js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mixed/js')
-rw-r--r--ext/mixed/js/api.js4
-rw-r--r--ext/mixed/js/display.js10
2 files changed, 9 insertions, 5 deletions
diff --git a/ext/mixed/js/api.js b/ext/mixed/js/api.js
index f7711cbd..e826b68b 100644
--- a/ext/mixed/js/api.js
+++ b/ext/mixed/js/api.js
@@ -77,8 +77,8 @@ const api = (() => {
return this._invoke('getAnkiNoteInfo', {notes, duplicateScope});
}
- injectAnkiNoteMedia(expression, reading, timestamp, audioDetails, screenshotDetails, clipboardImage) {
- return this._invoke('injectAnkiNoteMedia', {expression, reading, timestamp, audioDetails, screenshotDetails, clipboardImage});
+ injectAnkiNoteMedia(expression, reading, timestamp, audioDetails, screenshotDetails, clipboardDetails) {
+ return this._invoke('injectAnkiNoteMedia', {expression, reading, timestamp, audioDetails, screenshotDetails, clipboardDetails});
}
noteView(noteId) {
diff --git a/ext/mixed/js/display.js b/ext/mixed/js/display.js
index 689fa7e4..377a491d 100644
--- a/ext/mixed/js/display.js
+++ b/ext/mixed/js/display.js
@@ -1389,18 +1389,22 @@ class Display extends EventDispatcher {
const {expression, reading} = Array.isArray(definitionExpressions) ? definitionExpressions[0] : definition;
const audioDetails = (mode !== 'kanji' && this._ankiNoteBuilder.containsMarker(fields, 'audio') ? {sources, customSourceUrl} : null);
const screenshotDetails = (this._ankiNoteBuilder.containsMarker(fields, 'screenshot') ? {ownerFrameId, format, quality} : null);
- const clipboardImage = (this._ankiNoteBuilder.containsMarker(fields, 'clipboard-image'));
- const {screenshotFileName, clipboardImageFileName, audioFileName} = await api.injectAnkiNoteMedia(
+ const clipboardDetails = {
+ image: this._ankiNoteBuilder.containsMarker(fields, 'clipboard-image'),
+ text: this._ankiNoteBuilder.containsMarker(fields, 'clipboard-text')
+ };
+ const {screenshotFileName, clipboardImageFileName, clipboardText, audioFileName} = await api.injectAnkiNoteMedia(
expression,
reading,
timestamp,
audioDetails,
screenshotDetails,
- clipboardImage
+ clipboardDetails
);
if (screenshotFileName !== null) { definition.screenshotFileName = screenshotFileName; }
if (clipboardImageFileName !== null) { definition.clipboardImageFileName = clipboardImageFileName; }
if (audioFileName !== null) { definition.audioFileName = audioFileName; }
+ if (clipboardText !== null) { definition.clipboardText = clipboardText; }
}
return await this._ankiNoteBuilder.createNote({