From: Mischa POSLAWSKY Date: Tue, 19 Dec 2023 19:40:15 +0000 (+0100) Subject: word/quiz: apply subsequent hash parameters X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/3761a259f4f129aae70bb30e8dbb255fa09acd6c word/quiz: apply subsequent hash parameters Broken (or unfinished) in commit v1.13-53-ged90e77238 (2023-02-09) [decode uri-encoded location hash]. --- diff --git a/word/quiz.js b/word/quiz.js index dce5f7a..5498809 100644 --- a/word/quiz.js +++ b/word/quiz.js @@ -7,9 +7,12 @@ Array.prototype.shuffle = function () { }; function hashparams() { - // location.hash is not encoded in firefox - const encodedhash = (window.location.href.split('#'))[1] || ''; - return decodeURIComponent(encodedhash).split('#'); + const encodedhash = window.location.href.split('#').slice(1) || ''; + if (encodedhash.length == 1) { + // location.hash is not encoded in firefox + return decodeURIComponent(encodedhash).split('#'); + } + return encodedhash; } class Words {