ctucx.git: trainsearch

web based trip-planner, fork of https://cyberchaos.dev/yuka/trainsearch

commit b26bc1016f782d89c0d8e97df709f97c8903d16e
parent abe1020bcc1b60c6733a26e01d4572824bfca004
Author: Katja (ctucx) <git@ctu.cx>
Date: Mon, 20 Jan 2025 12:30:52 +0100

Add new backends: RMV and VRN
3 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/src/hafas_client.js b/src/hafas_client.js
@@ -21,6 +21,14 @@ export const getHafasClient = async profileName => {
 				const { profile: nahshProfile } = await import('hafas-client/p/nahsh');
 				profile = nahshProfile;
 				break;
+			case "rmv":
+				const { profile: rmvProfile } = await import('hafas-client/p/rmv');
+				profile = rmvProfile;
+				break;
+			case "vrn":
+				const { profile: vrnProfile } = await import('hafas-client/p/vrn');
+				profile = vrnProfile;
+				break;
 			case "oebb":
 				const { profile: oebbProfile } = await import('hafas-client/p/oebb');
 				profile = oebbProfile;
diff --git a/src/searchView.js b/src/searchView.js
@@ -38,6 +38,21 @@ const productIcons = {
 	// SNCB
 	"intercity-p": "icon-ic",
 	"s-train": "icon-suburban",
+
+	// RMV
+	"express-train":       "icon-ice",
+	"long-distance-train": "icon-ic",
+	"regiona-train":       "icon-regional",
+	"s-bahn":              "icon-suburban",
+	"u-bahn":              "icon-subway",
+	"watercraft":          "icon-ferry",
+	"ast":                 "icon-taxi",
+
+	// VRN
+	"regional-train":      "icon-regional",
+	"urban-train":         "icon-suburban",
+	"dial-a-ride":         "icon-taxi",
+//	"long-distance-train": "icon-icice",
 };
 
 const iconFor = id => {
diff --git a/src/settingsView.js b/src/settingsView.js
@@ -25,6 +25,8 @@ const settingsTemplate = () => html`
 		<b>${t('endpoint')}:</b><br>
 		<label><input type="radio" name="profile" ?checked=${settings.profile === 'db'} value="db"> DB</label><br>
 		<label><input type="radio" name="profile" ?checked=${settings.profile === 'nahsh'} value="nahsh"> NAH.SH (${t("experimental")})</label><br>
+		<label><input type="radio" name="profile" ?checked=${settings.profile === 'rmv'} value="rmv"> RMV (${t("experimental")})</label><br>
+		<label><input type="radio" name="profile" ?checked=${settings.profile === 'vrn'} value="vrn"> VRN (${t("experimental")})</label><br>
 		<label><input type="radio" name="profile" ?checked=${settings.profile === 'bvg'} value="bvg"> BVG (${t("experimental")})</label><br>
 		<label><input type="radio" name="profile" ?checked=${settings.profile === 'oebb'} value="oebb"> ÖBB (${t("experimental")})</label><br>
 		<br>