Cleanup
This commit is contained in:
parent
4241b4f859
commit
540d0e239c
@ -17,6 +17,19 @@
|
||||
*/
|
||||
|
||||
|
||||
function kanjiLinks(options) {
|
||||
let result = '';
|
||||
for (const c of options.fn(this)) {
|
||||
if (isKanji(c)) {
|
||||
result += Handlebars.templates['kanji-link.html']({kanji: c}).trim();
|
||||
} else {
|
||||
result += c;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function loadJson(url) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const xhr = new XMLHttpRequest();
|
||||
|
@ -20,18 +20,7 @@
|
||||
class Yomichan {
|
||||
constructor() {
|
||||
Handlebars.partials = Handlebars.templates;
|
||||
Handlebars.registerHelper('kanjiLinks', function(options) {
|
||||
let result = '';
|
||||
for (const c of options.fn(this)) {
|
||||
if (isKanji(c)) {
|
||||
result += Handlebars.templates['kanji-link.html']({kanji: c}).trim();
|
||||
} else {
|
||||
result += c;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
Handlebars.registerHelper('kanjiLinks', kanjiLinks);
|
||||
|
||||
this.translator = new Translator();
|
||||
this.asyncPools = {};
|
||||
|
Loading…
Reference in New Issue
Block a user