summaryrefslogtreecommitdiff
path: root/ext/bg/js/dictionary.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-05 18:24:45 -0700
committerAlex Yatskov <alex@foosoft.net>2016-11-05 18:24:45 -0700
commitc24e179b10d31c445ab6393fe1a39b570887a3aa (patch)
treea65340b3f51ac6059d27b9b0c05f824997633bc7 /ext/bg/js/dictionary.js
parent92fbc14e0bea1ca04dd78f0ac788c528918cb133 (diff)
WIP
Diffstat (limited to 'ext/bg/js/dictionary.js')
-rw-r--r--ext/bg/js/dictionary.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/ext/bg/js/dictionary.js b/ext/bg/js/dictionary.js
index 37a799a6..aa5f0b47 100644
--- a/ext/bg/js/dictionary.js
+++ b/ext/bg/js/dictionary.js
@@ -20,7 +20,7 @@
class Dictionary {
constructor() {
this.db = null;
- this.dbVer = 5;
+ this.dbVer = 4;
this.entities = null;
}
@@ -131,6 +131,14 @@ class Dictionary {
});
}
+ getDictionaries() {
+ if (this.db === null) {
+ return Promise.reject('database not initialized');
+ }
+
+ return this.db.dictionaries.toArray();
+ }
+
importTermDict(indexUrl, callback) {
if (this.db === null) {
return Promise.reject('database not initialized');
@@ -204,6 +212,6 @@ class Dictionary {
});
};
- return importJsonDb(indexUrl, null, entriesLoaded);
+ return importJsonDb(indexUrl, indexLoaded, entriesLoaded);
}
}