return this;
};
+function hashparams() {
+ // location.hash is not encoded in firefox
+ const encodedhash = (window.location.href.split('#'))[1] || '';
+ return decodeURIComponent(encodedhash).split('#');
+}
+
class Words {
constructor(data, root = undefined) {
this.data = data;
return selection;
}
- configure(params = window.location.hash.split('#')) {
+ configure(params = hashparams()) {
const opts = new Map(params.map(arg => arg.split(/[:=](.*)/)));
for (let [query, val] of opts) {
if (query.match(/^\d+$/)) {