add cp links to route build page
This commit is contained in:
parent
1b56a8ba12
commit
51f3418bcf
19
main.js
19
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()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user