+class WordFinder extends WordQuiz {
+ add(parentitem, rows) {
+ const catitem = put(parentitem, 'ul');
+ rows.forEach(ref => {
+ const [title, level, imgid] = this.data[ref];
+ const worditem = put(catitem, 'li');
+ const figitem = put(worditem, 'figure');
+ if (imgid) {
+ put(figitem, 'img[src=$]', `/data/word/32/${imgid}.jpg`);
+ }
+ if (title) {
+ let html = title.replace(/\/(.*)/, ' <small>($1)</small>');
+ put(figitem, 'figcaption', {
+ innerHTML: html,
+ });
+ }
+ if (this.cats[ref]) {
+ // delve into subcategory
+ put(worditem, '.parent');
+ this.add(worditem, this.cats[ref]);
+ }
+ });
+ }
+
+ setup() {
+ this.gallery = document.getElementById('gallery');
+ put(this.gallery, '-p', 'Under construction.');
+ this.add(this.gallery, this.preset.cat ? [this.preset.cat] : this.cats[null]);
+ }
+
+ stop() {}
+};