mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-24 16:24:32 +00:00
First attempt at converting "sig" to "activity" for v3
This commit is contained in:
@@ -33,16 +33,6 @@ function saveSettings() {
|
||||
// Load settings from local storage and set up the filter selectors. Suppressed if "use local storage" is false.
|
||||
function loadSettings() {
|
||||
if (useLocalStorage) {
|
||||
// Spothole v2 and earlier stored activity filter settings with "sig" in the element IDs, so migrate these to
|
||||
// their new names.
|
||||
Object.keys(localStorage).forEach(function (key) {
|
||||
if (key.startsWith("#filter-button-sig-")) {
|
||||
const newKey = key.replace("#filter-button-sig-", "#filter-button-activity-").replace("-NO_SIG:", "-NO_ACTIVITY:");
|
||||
localStorage.setItem(newKey, localStorage.getItem(key));
|
||||
localStorage.removeItem(key);
|
||||
}
|
||||
});
|
||||
|
||||
// Find all local storage entries and push their data to the corresponding UI element
|
||||
Object.keys(localStorage).forEach(function (key) {
|
||||
if (key.startsWith("#") && key.includes(":")) {
|
||||
@@ -78,11 +68,6 @@ function loadURLParams() {
|
||||
updateSelectFromParam(params, "max_age", "max_spot_age"); // Only on Map & Bands pages
|
||||
updateFilterFromParam(params, "band", "band");
|
||||
updateFilterFromParam(params, "activity", "activity");
|
||||
// Spothole v2 and earlier called the "activity" param "sig", so support this for existing embeds
|
||||
if (params.get("activity") == null && params.get("sig") != null) {
|
||||
params.set("activity", params.get("sig").replace("NO_SIG", "NO_ACTIVITY"));
|
||||
updateFilterFromParam(params, "activity", "activity");
|
||||
}
|
||||
updateFilterFromParam(params, "source", "source");
|
||||
updateFilterFromParam(params, "mode", "mode");
|
||||
updateFilterFromParam(params, "dx_continent", "dx_continent");
|
||||
|
||||
Reference in New Issue
Block a user