From ab1de5a22a8294e3d992e335967c0d57cb7fa111 Mon Sep 17 00:00:00 2001 From: Oskar Date: Sat, 16 Jan 2021 17:20:02 +0100 Subject: [PATCH] Update URL and delete state when going back to editor --- web/index.html | 2 +- web/quiz.js | 9 +++++++++ web/share.js | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/web/index.html b/web/index.html index e503bc1..8f34d73 100644 --- a/web/index.html +++ b/web/index.html @@ -99,7 +99,7 @@

0:00

- + diff --git a/web/quiz.js b/web/quiz.js index 437bdaf..070451c 100644 --- a/web/quiz.js +++ b/web/quiz.js @@ -372,6 +372,15 @@ function abortQuiz() { } +function deleteQuiz() { + + clearState() + removeLink() + changeView('spreadsheet') + +} + + window.onload = async function() { var browserWarning = document.getElementById('browserwarning') diff --git a/web/share.js b/web/share.js index 8c08461..f2919db 100644 --- a/web/share.js +++ b/web/share.js @@ -14,6 +14,9 @@ function showLink() { function removeLink() { + var link = location.origin + history.pushState('', '', link) + var linkEl = document.getElementById('shareLink') linkEl.href = '' linkEl.innerHTML = ''