From 1c0616f0578a246beedbdbaf49a617b46f1e9380 Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 03 Feb 2019 23:17:35 +0000
Subject: [PATCH] Increase IconImageCache max size to 512

---
 common.js |   29 ++++++++++++++++++++++-------
 1 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/common.js b/common.js
index 069a957..f238013 100644
--- a/common.js
+++ b/common.js
@@ -1,3 +1,10 @@
+"use strict";
+
+//var ttss_trams_base = 'http://www.ttss.krakow.pl/internetservice';
+var ttss_trams_base = 'proxy_tram.php';
+//var ttss_buses_base = 'http://91.223.13.70/internetservice';
+var ttss_buses_base = 'proxy_bus.php';
+
 // Special directions
 var special_directions = {
 	'Zajezdnia Nowa Huta' : 'ZH',
@@ -107,10 +114,18 @@
 	});
 }
 
-function tramIdToVehicleId(tramId) {
-	for(var prop in vehicles_info) {
-		if(vehicles_info[prop]['num'].substr(2) == tramId) {
-			return prop;
+function depotIdToVehicleId(depotId, typeHelper) {
+	if(typeHelper) {
+		for(var prop in vehicles_info) {
+			if(prop.substr(0,1) == type && vehicles_info[prop]['num'].substr(2) == depotId) {
+				return prop;
+			}
+		}
+	} else {
+		for(var prop in vehicles_info) {
+			if(vehicles_info[prop]['num'] == depotId) {
+				return prop;
+			}
 		}
 	}
 }
@@ -122,13 +137,13 @@
 	span.className = 'vehicleInfo';
 	
 	var floor_type = '';
-	if(vehicleInfo.low == '0') {
+	if(vehicleInfo.low == 0) {
 		setText(span, lang.high_floor_sign);
 		floor_type = lang.high_floor;
-	} else if(vehicleInfo.low == '1') {
+	} else if(vehicleInfo.low == 1) {
 		setText(span, lang.partially_low_floor_sign);
 		floor_type = lang.partially_low_floor;
-	} else if(vehicleInfo.low == '2') {
+	} else if(vehicleInfo.low == 2) {
 		setText(span, lang.low_floor_sign);
 		floor_type = lang.low_floor;
 	}

--
Gitblit v1.9.1