fix: progress indicator

This commit is contained in:
2024-08-21 17:06:50 +02:00
parent 573ebc233b
commit 9f8656e590
4 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
class="stop-label"
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
>
<router-link v-if="/(, podg|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
<router-link v-if="/(, podg$|<strong>)/.test(stop.nameHtml)" :to="sceneryHref">
<span class="name" v-html="stop.nameHtml"></span>
</router-link>
+1 -1
View File
@@ -76,7 +76,7 @@
<div class="general-stops" v-if="train.timetableData">
<span v-if="train.timetableData.followingStops.length > 2">
{{ $t('trains.via-title') }}
<span v-html="displayStopList(train.timetableData.followingStops)"></span>
<span v-html="getTrainStopsHtml(train.timetableData.followingStops)"></span>
</span>
</div>
+1 -1
View File
@@ -249,7 +249,7 @@ export default defineComponent({
i < this.train.timetableData!.followingStops.length;
i++
) {
if (/(, po|sbl|, pe)/gi.test(this.train.timetableData!.followingStops[i].stopNameRAW))
if (/(, po$|sbl|, pe$)/gi.test(this.train.timetableData!.followingStops[i].stopNameRAW))
activeMinorStopList.push(i);
else break;
}
+3 -3
View File
@@ -75,18 +75,18 @@ export default defineComponent({
return positionString.charAt(0).toUpperCase() + positionString.slice(1);
},
displayStopList(stops: TrainStop[]): string | undefined {
getTrainStopsHtml(stops: TrainStop[]): string {
if (!stops) return '';
return stops
.reduce((acc: string[], stop: TrainStop, i: number) => {
if (stop.stopType.includes('ph') && !stop.stopNameRAW.includes(', po'))
if (stop.stopType.includes('ph'))
acc.push(
`<strong style='color:${stop.confirmed ? 'springgreen' : 'white'}'>${
stop.stopName
}</strong>`
);
else if (i > 0 && i < stops.length - 1 && !/(, po|sbl)/gi.test(stop.stopNameRAW))
else if (i > 0 && i < stops.length - 1 && !/(, po$|sbl)/gi.test(stop.stopNameRAW))
acc.push(
`<span style='color:${stop.confirmed ? 'springgreen' : 'lightgray'}'>${
stop.stopName