word/finder: enable stylesheet on #debug option
authorMischa POSLAWSKY <perl@shiar.org>
Mon, 6 Jun 2022 21:56:17 +0000 (23:56 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 11 Jul 2022 02:02:34 +0000 (04:02 +0200)
word/debug.css [moved from word-debug.css with 100% similarity]
word/finder.js

similarity index 100%
rename from word-debug.css
rename to word/debug.css
index 86442c922082394352c1c6b2b2957929641a9a5a..e720bfdf47dc52cfdad840a6609042c6854907cd 100644 (file)
@@ -23,6 +23,7 @@ class WordFinder extends WordQuiz {
                                        innerHTML: this.namehtml(title),
                                });
                        }
+                       put(worditem, '.level' + level);
                        if (level <= 1 && subs.length >= 4) {
                                put(worditem, '.large');
                        }
@@ -45,6 +46,9 @@ class WordFinder extends WordQuiz {
 
        setup() {
                super.setup();
+               if (this.preset.debug) {
+                       put(document.head, 'link', {rel: 'stylesheet', href: '/word/debug.css'});
+               }
                this.form.innerHTML = '';
                put(this.form, 'p', 'Under construction.');
                for (let cat of this.preset.cat || this.data[''][3]) {