Improved www.ttss.krakow.pl
Jacek Kowalski
2019-04-10 1eea9a4798620620e54411a061c483d226bbab1c
common.js
@@ -1,7 +1,12 @@
//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';
"use strict";
var ttss_urls = {
   t: 'proxy_tram.php',
   // t: 'http://www.ttss.krakow.pl/internetservice',
   b: 'proxy_bus.php',
   // b: 'http://91.223.13.70/internetservice',
};
var ttss_types = ['t', 'b'];
// Special directions
var special_directions = {
@@ -112,10 +117,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) == typeHelper && vehicles_info[prop]['num'].substr(2) == depotId) {
            return prop;
         }
      }
   } else {
      for(var prop in vehicles_info) {
         if(vehicles_info[prop]['num'] == depotId) {
            return prop;
         }
      }
   }
}