git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
chars: font coverage from hashed data entry
[sheet.git]
/
word
/
quiz.js
diff --git
a/word/quiz.js
b/word/quiz.js
index 5283628407e51fbe84ff5cc54ea02f1c7e88c623..dce5f7a43ace9c973c726432f70d651112cbea69 100644
(file)
--- a/
word/quiz.js
+++ b/
word/quiz.js
@@
-6,6
+6,12
@@
Array.prototype.shuffle = function () {
return this;
};
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;
class Words {
constructor(data, root = undefined) {
this.data = data;
@@
-111,7
+117,7
@@
class WordQuiz {
return selection;
}
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+$/)) {
const opts = new Map(params.map(arg => arg.split(/[:=](.*)/)));
for (let [query, val] of opts) {
if (query.match(/^\d+$/)) {