aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/yomichan.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-11-13 11:58:23 -0800
committerAlex Yatskov <alex@foosoft.net>2016-11-13 11:58:23 -0800
commitdab46eda3e42e5f0a624bb285a555b078b999a99 (patch)
treede2729f5370cdc5ed0af544fe743fb9ea6b2e3c4 /ext/bg/js/yomichan.js
parent7598de2234393433e98c9af3c312a1bcfd82c32f (diff)
WIP
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r--ext/bg/js/yomichan.js17
1 files changed, 1 insertions, 16 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index d471add4..62b6c7b1 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -25,7 +25,6 @@ class Yomichan {
this.translator = new Translator();
this.anki = new AnkiNull();
this.options = null;
- this.importTabId = null;
this.setState('disabled');
chrome.runtime.onMessage.addListener(this.onMessage.bind(this));
@@ -39,20 +38,6 @@ class Yomichan {
});
}
- onImport({state, progress}) {
- if (state === 'begin') {
- chrome.tabs.create({url: chrome.extension.getURL('bg/import.html')}, tab => this.importTabId = tab.id);
- }
-
- if (this.importTabId !== null) {
- this.tabInvoke(this.importTabId, 'setProgress', progress);
- }
-
- if (state === 'end') {
- this.importTabId = null;
- }
- }
-
onMessage(request, sender, callback) {
const {action, params} = request, method = this['api_' + action];
@@ -91,7 +76,7 @@ class Yomichan {
break;
case 'loading':
chrome.browserAction.setBadgeText({text: '...'});
- this.translator.loadData(this.onImport.bind(this)).then(() => this.setState('enabled'));
+ this.translator.prepare().then(this.setState('enabled'));
break;
}