Tools can be selected through URL (solves #161) #207

Merged
bema merged 2 commits from bema/func/individual_urls into master 2023-05-24 14:40:10 +02:00

View File

@@ -30,7 +30,14 @@ function init() {
tools.set("mock", "tools/mock.html");
changeActiveTools('XML');
loadLastPage();
var toolUrl = window.location.search.substring(1);
if (toolUrl == "")
loadLastPage();
else if (tools.has(toolUrl))
changeTool(toolUrl);
else
loadLastPage();
}
/**
@@ -81,6 +88,7 @@ function changeTool(tool) {
const url = tools.get(tool);
localStorage.setItem("lastPage", tool);
document.getElementById("iframe").src = url;
document.location.search = tool;
}
/**