add counter for history
This commit is contained in:
parent
bb0f44d4c7
commit
a5b62f30a2
29
main.js
29
main.js
@ -2163,6 +2163,10 @@
|
||||
let stageCount = 0
|
||||
let fullPuzzleCount = 0
|
||||
let stagePuzzleCount = 0
|
||||
let fullNeedHistoryCount = 0
|
||||
let stageNeedHistoryCount = 0
|
||||
let fullHistoryCount = 0
|
||||
let stageHistoryCount = 0
|
||||
|
||||
let stageRow = null
|
||||
for (const [i, row] of rows.entries()) {
|
||||
@ -2174,6 +2178,8 @@
|
||||
let stageHeader = stageRow.querySelector("th")
|
||||
stageHeader.append(makeStatsSpan(`КП в этапе: ${stageCount}`))
|
||||
stageHeader.append(makeStatsSpan(`Загадок: ${stagePuzzleCount}`))
|
||||
stageHeader.append(makeStatsSpan(`Нужно ИС: ${stageNeedHistoryCount}`))
|
||||
stageHeader.append(makeStatsSpan(`ИС: ${stageHistoryCount}`))
|
||||
}
|
||||
|
||||
if (isFinish) break
|
||||
@ -2181,22 +2187,41 @@
|
||||
stageRow = row
|
||||
stageCount = 0
|
||||
stagePuzzleCount = 0
|
||||
stageNeedHistoryCount = 0
|
||||
stageHistoryCount = 0
|
||||
continue
|
||||
}
|
||||
|
||||
let pointNumber = getPointNumberFromCell(row.querySelector("td"))
|
||||
if (!pointNumber) continue
|
||||
|
||||
fullCount++
|
||||
stageCount++
|
||||
|
||||
let pointNumber = getPointNumberFromCell(row.querySelector("td"))
|
||||
if (pointNumber && points[pointNumber].is_puzzle) {
|
||||
let point = points[pointNumber]
|
||||
if (!point) continue
|
||||
|
||||
if (point.is_puzzle) {
|
||||
fullPuzzleCount++
|
||||
stagePuzzleCount++
|
||||
}
|
||||
|
||||
if (point.history_needed) {
|
||||
fullNeedHistoryCount++
|
||||
stageNeedHistoryCount++
|
||||
}
|
||||
|
||||
if (point.history_ru) {
|
||||
fullHistoryCount++
|
||||
stageHistoryCount++
|
||||
}
|
||||
}
|
||||
|
||||
let tableHeader = document.querySelector("table tr:nth-child(2) th")
|
||||
tableHeader.append(makeStatsSpan(`Всего КП: ${fullCount}`))
|
||||
tableHeader.append(makeStatsSpan(`Загадок: ${fullPuzzleCount}`))
|
||||
tableHeader.append(makeStatsSpan(`Нужно ИС: ${fullNeedHistoryCount}`))
|
||||
tableHeader.append(makeStatsSpan(`ИС: ${fullHistoryCount}`))
|
||||
|
||||
addStylesToHead(`
|
||||
.stats {
|
||||
|
Loading…
Reference in New Issue
Block a user