| | |
| | | "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' : 'NH', |
| | | 'Zajezdnia Podgórze' : 'P', |
| | | 'Zajezdnia Nowa Huta' : 'ZH', |
| | | 'Zajezdnia Podgórze' : 'ZP', |
| | | 'Zjazd do zajezdni' : 'Z', |
| | | 'Wyjazd na linię' : 'W', |
| | | 'Przejazd techniczny' : 'PT', |
| | | }; |
| | | |
| | | var script_version; |
| | | var script_version_xhr; |
| | | |
| | | var vehicles_info; |
| | | var vehicles_info = {}; |
| | | |
| | | // Check for website updates |
| | | function checkVersion() { |
| | |
| | | }); |
| | | } |
| | | |
| | | function tramIdToVehicleId(tramId) { |
| | | if(0 <= tramId && tramId <= 999) { |
| | | var vehicleId = '0000' + (tramId + 736); |
| | | vehicleId = vehicleId.substr(vehicleId.length - 4) |
| | | return '635218529567218' + vehicleId; |
| | | 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; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |