aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/yomichan.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r--ext/bg/js/yomichan.js24
1 files changed, 22 insertions, 2 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index 7bca579d..d471add4 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -239,11 +239,31 @@ class Yomichan {
}
api_findKanji({text, callback}) {
- promiseCallback(this.translator.findKanji(text), callback);
+ const dictionaries = [];
+ for (const title in this.options.dictionaries) {
+ if (this.options.dictionaries[title].enableKanji) {
+ dictionaries.push(title);
+ }
+ }
+
+ promiseCallback(
+ this.translator.findKanji(text, dictionaries),
+ callback
+ );
}
api_findTerm({text, callback}) {
- promiseCallback(this.translator.findTerm(text, this.options.enableSoftKatakanaSearch), callback);
+ const dictionaries = [];
+ for (const title in this.options.dictionaries) {
+ if (this.options.dictionaries[title].enableTerms) {
+ dictionaries.push(title);
+ }
+ }
+
+ promiseCallback(
+ this.translator.findTerm(text, this.options.enableSoftKatakanaSearch, dictionaries),
+ callback
+ );
}
api_renderText({template, data, callback}) {