- load(dataurl) {
- this.preset = {};
- let input;
- if (input = window.location.hash.match(/\d+/)) {
- this.preset.cat = parseInt(input[0]);
- }
- if (window.location.hash.match(/a/)) {
- this.preset.level = 3;
+ configure(params) {
+ const opts = new Map(params.map(arg => arg.split(/[:=](.*)/)));
+ for (let [query, val] of opts) {
+ if (query.match(/^\d+$/)) {
+ this.preset.cat = [parseInt(query)];
+ }
+ else if (query === 'level') {
+ this.preset.level = parseInt(val);
+ }
+ else {
+ this.preset[query] = val;
+ }