show history data

This commit is contained in:
Zhora Shalyapin 2025-04-04 08:30:35 +00:00
parent a0483cb07e
commit d5e32b4829

32
main.js
View File

@ -2295,6 +2295,37 @@
}
}
function showHistoryData(points) {
let pointCells = getPointCells()
for (const [i, pointCell] of pointCells.entries()) {
let pointNumber = getPointNumberFromCell(pointCell)
if (pointNumber == null) continue
let point = points[pointNumber]
if (point.history_needed) {
pointCell.append(Tag.span({ classes: "point-info", textContent: "Нужна ИС" }))
}
if (point.history_ru) {
pointCell.append(Tag.span({ classes: "point-info", textContent: "Есть ИС" }))
}
}
addStylesToHead(`
.point-info {
&:first-of-type {
margin-left: 5px;
}
& + &::before {
content: " | "
}
}
`)
}
function getRouteName() {
return document.querySelector(`#content h1`).textContent.match(/(?<=\")[^\"]+/)
}
@ -2340,6 +2371,7 @@
let points = await getPointsFromRows()
countCp(points)
addLinksToCp(points)
showHistoryData(points)
})()
sendRouteData()
showUnknownPoints()