From 7a4cdfcca7ce08339a6a7fbcf1ea74f3c2e4e348 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Fri, 27 Feb 2026 20:58:10 +0000 Subject: [PATCH] Include route name in page title MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update document.title to " – OSM Public Transport → GeoJSON" when a route or route_master is loaded. Co-Authored-By: Claude Sonnet 4.6 --- web/static/app.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/web/static/app.js b/web/static/app.js index 78c3b97..72f645a 100644 --- a/web/static/app.js +++ b/web/static/app.js @@ -22,6 +22,7 @@ let routeMasterLayers = []; // coloured polylines when viewing a route_master // ── State ───────────────────────────────────────────────────────────────── +const DEFAULT_TITLE = document.title; let currentRelationId = RELATION_ID; // tracks the currently loaded relation let routeData = null; // response from /api/route/ let segmentGeoJson = null; // last response from /api/segment/ (always includes stops) @@ -349,6 +350,7 @@ async function loadRoute(relationId) { // Show route panel document.getElementById('route-panel').classList.remove('d-none'); document.getElementById('route-name').textContent = data.name; + document.title = `${data.name} – ${DEFAULT_TITLE}`; document.getElementById('route-osm-link').href = `https://www.openstreetmap.org/relation/${relationId}`; @@ -437,6 +439,7 @@ async function loadRouteMaster(relationId) { document.getElementById('route-panel').classList.add('d-none'); document.getElementById('route-master-panel').classList.remove('d-none'); document.getElementById('route-master-name').textContent = data.name; + document.title = `${data.name} – ${DEFAULT_TITLE}`; document.getElementById('route-master-osm-link').href = `https://www.openstreetmap.org/relation/${relationId}`;