From 51f3418bcf5095760614d56615ea478546b143c5 Mon Sep 17 00:00:00 2001 From: Zhora Shalyapin Date: Wed, 26 Mar 2025 07:03:53 +0000 Subject: [PATCH] add cp links to route build page --- main.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/main.js b/main.js index a07293c..adaf783 100644 --- a/main.js +++ b/main.js @@ -2176,6 +2176,24 @@ `) } + function addLinksToCp() { + let pointCells = [...document.querySelectorAll(`#props table td:first-child`)] + for (const pointCell of pointCells) { + let cellContent = pointCell.textContent + let pointNumber = cellContent.trim().match(/^\d+/) + if (pointNumber == null) continue + + ;(async () => { + let cpId = (await getPointIdByNumber(pointNumber)).id + pointCell.innerHTML = '' + pointCell.append(Tag.a({ + href: cpLink(cpId), + textContent: cellContent + })) + })() + } + } + function getRouteName() { return document.querySelector(`#content h1`).textContent.match(/(?<=\")[^\"]+/) } @@ -2218,6 +2236,7 @@ hideStartRow() useColspanForFinishWarning() countCp() + addLinksToCp() sendRouteData() showUnknownPoints() }