aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/bg/js/util.js')
-rw-r--r--ext/bg/js/util.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/bg/js/util.js b/ext/bg/js/util.js
index bba4d797..dcaf1e47 100644
--- a/ext/bg/js/util.js
+++ b/ext/bg/js/util.js
@@ -39,6 +39,18 @@ function isKanji(c) {
return code >= 0x4e00 && code < 0x9fb0 || code >= 0x3400 && code < 0x4dc0;
}
+function enabledDicts(options) {
+ const dictionaries = {};
+ for (const title in options.dictionaries) {
+ const dictionary = options.dictionaries[title];
+ if (dictionary.enabled) {
+ dictionaries[title] = dictionary;
+ }
+ }
+
+ return dictionaries;
+}
+
function promiseCallback(promise, callback) {
return promise.then(result => {
callback({result});