aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm
diff options
context:
space:
mode:
authorsoriac <soriac@users.noreply.github.com>2021-04-30 18:57:53 -0300
committerGitHub <noreply@github.com>2021-04-30 17:57:53 -0400
commitba3f7b3e96df7f034b56132d8c2c90289e16c288 (patch)
treee8f87b440d79d3c43904d43f04fe9c396602c76a /ext/js/comm
parent69a739f00a335496e9222b4758d9c8bf2190df92 (diff)
Show any custom tags on words that have anki cards created (#1628)
* Proof-of-concept for showing card tags (#1626) * Resolved most PR comments: - Added a snackbar notification when clicking tag button - Replaced magnifying glass icon with new tag icon - Button now contains a span w/icon, to use text color - Removed unnecessary attributes from button - Backend now returns full noteInfos object - Frontend now handles filtering tags * Add options to show/hide tag button & filter tags * Do not show tags button if, after filtering, we have zero tags. * Change tags option to enums, optimize tags intersection check & fix code style. * Update options-util.js to include new tag options. * Fix wording on new tag setting. * Add CSS to remove hidden buttons from the display layout. * getAnkiNoteInfo extra parameter for additional info. * Add new tag option to tests. * Remove unnecessary changes related to anki tags option. * Code style fixes.
Diffstat (limited to 'ext/js/comm')
-rw-r--r--ext/js/comm/anki.js6
-rw-r--r--ext/js/comm/api.js4
2 files changed, 8 insertions, 2 deletions
diff --git a/ext/js/comm/anki.js b/ext/js/comm/anki.js
index da234eff..e8cf7afd 100644
--- a/ext/js/comm/anki.js
+++ b/ext/js/comm/anki.js
@@ -71,6 +71,12 @@ class AnkiConnect {
return await this._invoke('canAddNotes', {notes});
}
+ async notesInfo(notes) {
+ if (!this._enabled) { return []; }
+ await this._checkVersion();
+ return await this._invoke('notesInfo', {notes});
+ }
+
async getDeckNames() {
if (!this._enabled) { return []; }
await this._checkVersion();
diff --git a/ext/js/comm/api.js b/ext/js/comm/api.js
index 137cda41..3795dcf4 100644
--- a/ext/js/comm/api.js
+++ b/ext/js/comm/api.js
@@ -52,8 +52,8 @@ class API {
return this._invoke('addAnkiNote', {note});
}
- getAnkiNoteInfo(notes) {
- return this._invoke('getAnkiNoteInfo', {notes});
+ getAnkiNoteInfo(notes, fetchAdditionalInfo) {
+ return this._invoke('getAnkiNoteInfo', {notes, fetchAdditionalInfo});
}
injectAnkiNoteMedia(timestamp, definitionDetails, audioDetails, screenshotDetails, clipboardDetails) {