plan selection possible via uri parameter

This commit is contained in:
Wolfgang 2024-05-26 12:50:29 +02:00
parent c142be9e4a
commit 39d1ff0d9e

View file

@ -35,6 +35,16 @@ div#togglebuttons>button {
const path = require('https://unpkg.com/path-browserify/index.js'); const path = require('https://unpkg.com/path-browserify/index.js');
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
location.search.substr(1).split("&").forEach((param) => {
let p = param.split("=");
let key = p[0];
if (key === "base") {
document.getElementById("base_plan").value = decodeURIComponent(p[1]);
}
if (key === "add") {
document.getElementById("additions_plan").value = decodeURIComponent(p[1]);
}
});
update_plan(); update_plan();
document.getElementById("base_plan").addEventListener("keydown", (event) => { document.getElementById("base_plan").addEventListener("keydown", (event) => {