class WordFinder extends WordQuiz {
- namehtml(name) {
- let aliases = name.split('/');
- let html = aliases.shift();
- html = html.replace(/\((.+)\)/, '<small>$1</small>');
- for (let alias of aliases) {
- html += ` <small>(${alias})</small>`;
- }
- return html;
- }
-
add(catitem, rows) {
rows.forEach(word => {
if (!word) return;
}
if (word.title) {
put(figitem, 'figcaption', {
- innerHTML: this.namehtml(word.title),
+ innerHTML: word.html,
});
}
if (this.preset.debug) {
get label() {
return row[0].replace(/\/.*/, ''); // primary form
},
+ get html() {
+ let aliases = this.title.split('/');
+ let html = aliases.shift();
+ html = html.replace(/\((.+)\)/, '<small>$1</small>');
+ for (let alias of aliases) {
+ html += ` <small>(${alias})</small>`;
+ }
+ return html;
+ },
level: row[1],
imgid: row[2],
thumb(size = 32) {