aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/options-form.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/options-form.js')
-rw-r--r--ext/bg/js/options-form.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/bg/js/options-form.js b/ext/bg/js/options-form.js
index eb562142..589d92b1 100644
--- a/ext/bg/js/options-form.js
+++ b/ext/bg/js/options-form.js
@@ -154,6 +154,16 @@ function populateAnkiDeckAndModel(opts) {
});
}
+function populateDictionaries() {
+ const dictionaries = $('.dictionaries');
+ yomichan().translator.dictionary.getDictionaries().then(rows => {
+ for (const row of rows) {
+ const dictionary = $('<p>').text(row.dictionary);
+ dictionaries.append(dictionary);
+ }
+ });
+}
+
function populateAnkiFields(element, opts) {
const table = element.closest('.tab-pane').find('.anki-fields');
table.find('tbody').remove();
@@ -274,6 +284,7 @@ $(document).ready(() => {
$('input, select').not('.anki-model').change(onOptionsChanged);
$('.anki-model').change(onAnkiModelChanged);
+ populateDictionaries();
populateAnkiDeckAndModel(opts);
updateVisibility(opts);
});