From 0ba7498c8b7397c579a1c5ade8ad22bcabd1e5cf Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Mon, 25 Mar 2019 21:20:58 +0000 Subject: [PATCH] Fix stop point table - stop table is displayed instead --- common.js | 39 ++++++++++++++++++++++++++++++--------- 1 files changed, 30 insertions(+), 9 deletions(-) diff --git a/common.js b/common.js index 59b8a10..6733d46 100644 --- a/common.js +++ b/common.js @@ -1,7 +1,20 @@ +"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 = { - '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; @@ -104,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; + } } } } @@ -119,13 +140,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