return selection;
}
- configure(params) {
+ configure(params = window.location.hash.split('#')) {
const opts = new Map(params.map(arg => arg.split(/[:=](.*)/)));
for (let [query, val] of opts) {
if (query.match(/^\d+$/)) {
this.preset.dataurl = `/data/wordlist.${this.preset.lang}.json`
}
+ setup() {
+ this.form = document.getElementById('quiz');
+ }
+
load() {
- this.configure(window.location.hash.split('#'));
+ this.configure();
fetch(this.preset.dataurl).then(res => res.json()).then(json => {
this.words = this.dataselect(json)
this.setup();