aboutsummaryrefslogtreecommitdiff
path: root/ext/bg/js/yomichan.js
diff options
context:
space:
mode:
authorAlex Yatskov <alex@foosoft.net>2016-06-14 16:07:23 -0400
committerAlex Yatskov <alex@foosoft.net>2016-06-14 20:44:38 -0700
commitad617221308b04e8f26ec52d876603e7aec3a03d (patch)
tree005364d7c5485a1b470530b55f90f4e5ed8d6f4c /ext/bg/js/yomichan.js
parentcaf067883275f9b46259c2dbbf1f36aafc7e9108 (diff)
Use `let` instead of `const` in for loops.
Diffstat (limited to 'ext/bg/js/yomichan.js')
-rw-r--r--ext/bg/js/yomichan.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/ext/bg/js/yomichan.js b/ext/bg/js/yomichan.js
index 2c13e8c7..92ed8a27 100644
--- a/ext/bg/js/yomichan.js
+++ b/ext/bg/js/yomichan.js
@@ -22,7 +22,7 @@ class Yomichan {
Handlebars.partials = Handlebars.templates;
Handlebars.registerHelper('kanjiLinks', function(options) {
let result = '';
- for (const c of options.fn(this)) {
+ for (let c of options.fn(this)) {
if (Translator.isKanji(c)) {
result += Handlebars.templates['kanji-link.html']({kanji: c}).trim();
} else {
@@ -111,7 +111,7 @@ class Yomichan {
notifyTabs(name, value) {
chrome.tabs.query({}, (tabs) => {
- for (const tab of tabs) {
+ for (let tab of tabs) {
chrome.tabs.sendMessage(tab.id, {name, value}, () => null);
}
});
@@ -155,7 +155,7 @@ class Yomichan {
formatField(field, definition, mode) {
const supported = ['character', 'expression', 'glossary', 'kunyomi', 'onyomi', 'reading'];
- for (const key in definition) {
+ for (let key in definition) {
if (supported.indexOf(key) === -1) {
continue;
}
@@ -175,7 +175,7 @@ class Yomichan {
if (mode !== 'kanji' && key === 'glossary') {
value = '<ol>';
- for (const gloss of definition.glossary) {
+ for (let gloss of definition.glossary) {
value += `<li>${gloss}</li>`;
}
value += '</ol>';
@@ -201,7 +201,7 @@ class Yomichan {
note.modelName = this.options.ankiVocabModel;
}
- for (const name in fields) {
+ for (let name in fields) {
note.fields[name] = this.formatField(fields[name], definition, mode);
}
@@ -215,8 +215,8 @@ class Yomichan {
api_canAddDefinitions({definitions, modes, callback}) {
let notes = [];
- for (const definition of definitions) {
- for (const mode of modes) {
+ for (let definition of definitions) {
+ for (let mode of modes) {
notes.push(this.formatNote(definition, mode));
}
}