allow update for uploaded routes and implement creator id for routes
Sonarqube Scanner / Prepare environment (push) Successful in 8s
Sonarqube Scanner / Build and test (push) Successful in 21s
Sonarqube Scanner / SonarQube analysis (push) Failing after 1m3s
Sonarqube Scanner / Deploy to Server (push) Successful in 6s

This commit is contained in:
Florian Zumpe
2026-10-03 16:43:08 +02:00
parent 4b8bdcad5f
commit 0db91660b3
20 changed files with 423 additions and 91 deletions
+15 -1
View File
@@ -3,6 +3,7 @@ globalThis.Wegwichtel ??= {};
'use strict';
const INTERVAL_MS = 30000;
let id = null;
let editingId = null;
let status = 'idle';
let timer = null;
let generation = 0;
@@ -79,9 +80,21 @@ globalThis.Wegwichtel ??= {};
function start(routeId) {
lastPosition = null;
id = String(routeId);
editingId = id;
resume();
}
function beginEditing(routeId) {
if (editingId === String(routeId)) return;
stop();
start(routeId);
}
function endEditing() {
editingId = null;
stop();
}
function addPositionField(position = {}, index = null) {
const container = document.getElementById('editor-recorded-positions');
if (!container) return;
@@ -132,6 +145,7 @@ globalThis.Wegwichtel ??= {};
}
function bind() {
globalThis.addEventListener?.('pagehide', endEditing);
const activate = (elementId, action) => {
const element = document.getElementById(elementId);
element?.addEventListener('pointerup', event => {
@@ -153,7 +167,7 @@ globalThis.Wegwichtel ??= {};
});
}
ns.RouteRecorder = Object.freeze({ start, pause, resume, stop, renderPoints, editGpx, get status() { return status; }, get routeId() { return id; }, get position() { return lastPosition; } });
ns.RouteRecorder = Object.freeze({ start, pause, resume, stop, beginEditing, endEditing, renderPoints, editGpx, get status() { return status; }, get routeId() { return id; }, get position() { return lastPosition; } });
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', bind, { once: true });
else bind();
}(globalThis.Wegwichtel));