1 class WordFinder extends WordQuiz {
3 let aliases = name.split('/');
4 let html = aliases.shift();
5 html = html.replace(/\((.+)\)/, '<small>$1</small>');
6 for (let alias of aliases) {
7 html += ` <small>(${alias})</small>`;
13 rows.forEach(word => {
15 const worditem = put(catitem, 'li');
16 const figitem = put(worditem, 'figure');
18 put(figitem, 'img[src=$]', word.thumb());
21 put(figitem, 'figcaption', {
22 innerHTML: this.namehtml(word.title),
25 put(worditem, '.level' + word.level);
26 if (word.level <= 1 && word.subs.length >= 4) {
27 put(worditem, '.large');
29 if (word.subs.length) {
30 // delve into subcategory
31 put(worditem, '.parent');
32 this.add(put(worditem, 'ul'), word.subs);
34 if (this.preset.debug) {
35 put(figitem, '[title=$]', `id ${ref} level ${word.level}`);
41 this.preset.level = 3;
42 this.preset.images = false;
43 return super.configure(input);
48 if (this.preset.debug) {
49 put(document.head, 'link', {rel: 'stylesheet', href: '/word/debug.css'});
51 this.form.innerHTML = '';
52 put(this.form, 'p', 'Under construction.');
53 for (let cat of this.data.root()) {
54 this.add(put(this.form, 'ul.gallery'), [cat]);