1 class WordFinder extends WordQuiz {
5 const worditem = put(catitem, 'li');
6 const figitem = put(worditem, 'figure');
8 put(figitem, 'img[src=$]', word.thumb());
11 put(figitem, 'figcaption', {
15 if (this.preset.debug) {
16 put(figitem, '[title=$]', `id ${word.id} level ${word.level}`);
18 put(worditem, '.level' + word.level);
19 if (!word.subs.length) {
22 if (word.level <= 1 && word.subs.length >= 4) {
23 put(worditem, '.large');
25 put(worditem, '.parent.expand');
27 put(figitem, '[data-sup=$]', word.subs.length);
28 figitem.onclick = () => {
30 if (expansion = worditem.querySelector('ul')) {
32 put(worditem, '.expand');
35 expansion = put(worditem, 'ul');
36 this.add(expansion, word.subs);
37 put(worditem, '!expand');
41 // delve into subcategory
42 const expansion = put(worditem, 'ul');
43 //expansion.style.display = 'none';
44 this.add(expansion, word.subs);
45 //worditem.onclick = () => expansion.style.display = '';
50 this.preset.level = 3;
51 this.preset.images = false;
52 return super.configure(input);
57 if (this.preset.debug) {
58 put(document.head, 'link', {rel: 'stylesheet', href: '/word/debug.css'});
60 this.form.innerHTML = '';
61 put(this.form, 'p', 'Under construction.');
62 for (let cat of this.data.root()) {
63 this.add(put(this.form, 'ul.gallery'), [cat]);