diff --git a/modules/ui/options.js b/modules/ui/options.js index 4d789173..f5f2d4b9 100644 --- a/modules/ui/options.js +++ b/modules/ui/options.js @@ -109,6 +109,8 @@ optionsContent.addEventListener("change", function(event) { if (id === "zoomExtentMin" || id === "zoomExtentMax") changeZoomExtent(value); else if (id === "optionsSeed") generateMapWithSeed(); else if (id === "uiSizeInput") changeUIsize(value); + else if (id === "yearInput") changeYear(); + else if (id === "eraInput") changeEra(); }); optionsContent.addEventListener("click", function(event) { @@ -408,6 +410,18 @@ function regenerateEra() { options.eraShort = options.era.split(" ").map(w => w[0].toUpperCase()).join(""); } +function changeYear() { + if (!yearInputthis.value) return; + if (isNaN(+yearInput.value)) {tip("Current year should be a number", false, "error"); return;} + options.year = +yearInput.value; +} + +function changeEra() { + if (!eraInput.value) return; + lock("era"); + options.era = eraInput.value; +} + // remove all saved data from LocalStorage and reload the page function restoreDefaultOptions() { localStorage.clear();