aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/translator.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-08-23 22:28:37 -0700
committerAlex Yatskov <alex@foosoft.net>2016-08-23 22:28:37 -0700
commitb2d9b613ad3a673abb20033808877962545644d4 (patch)
tree46f95c67332136992ae0f346ab0d10d056a4dc62 /ext/bg/js/translator.js
parent8b5f74f99bdbaeb1b7c72614f2a71abfc72be479 (diff)
Cleanup
Diffstat (limited to 'ext/bg/js/translator.js')
-rw-r--r--ext/bg/js/translator.js18
1 files changed, 2 insertions, 16 deletions
diff --git a/ext/bg/js/translator.js b/ext/bg/js/translator.js
index 8af0e31b..30045378 100644
--- a/ext/bg/js/translator.js
+++ b/ext/bg/js/translator.js
@@ -31,9 +31,9 @@ class Translator {
return;
}
- Translator.loadJson('bg/data/rules.json').then((rules) => {
+ loadJson('bg/data/rules.json').then((rules) => {
this.deinflector.setRules(rules);
- return Translator.loadJson('bg/data/tags.json');
+ return loadJson('bg/data/tags.json');
}).then((tagMeta) => {
this.tagMeta = tagMeta;
return this.dictionary.existsDb();
@@ -240,18 +240,4 @@ class Translator {
return 0;
});
}
-
- static isKanji(c) {
- const code = c.charCodeAt(0);
- return code >= 0x4e00 && code < 0x9fb0 || code >= 0x3400 && code < 0x4dc0;
- }
-
- static loadJson(url) {
- return new Promise((resolve, reject) => {
- const xhr = new XMLHttpRequest();
- xhr.addEventListener('load', () => resolve(JSON.parse(xhr.responseText)));
- xhr.open('GET', chrome.extension.getURL(url), true);
- xhr.send();
- });
- }
}