aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/yomichan.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-12 19:29:30 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-12 19:29:30 -0800
commitb5cc47a9d1d7df7ec5a596fb72fad21f79d2e01c (patch)
tree6bfa32412591355593d25d6dc007470ea44ca9bd /ext/bg/js/yomichan.js
parent0ff41d5843b3bf39994ae32e4ab623bfe0e4e3ca (diff)
WIP
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}) {