this.preset.cat = input[0];
}
if (window.location.hash.match(/a/)) {
- this.preset.level = 2;
+ this.preset.level = 3;
}
fetch(dataurl).then(res => res.json()).then(json => {
});
}
+ log(...args) {
+ this.history.push([new Date().toISOString(), ...args]);
+ }
+
+ stop(...args) {
+ this.log(...args);
+ window.onbeforeunload = null;
+ fetch('/word/report', {method: 'POST', body: JSON.stringify(this.history)});
+ }
+
constructor(dataurl) {
this.load(dataurl);
+ this.history = [];
+ window.onbeforeunload = e => {
+ this.stop('abort');
+ };
}
}