Improved www.ttss.krakow.pl
Jacek Kowalski
2019-01-31 a830993fed93fd4d700c26f3bf8158fa4c0db68e
Add feature type (bus/tram stop) to the headers and listings
4 files modified
54 ■■■■ changed files
lang_en.js 6 ●●●●● patch | view | raw | blame | history
lang_pl.js 12 ●●●● patch | view | raw | blame | history
map.html 4 ●●●● patch | view | raw | blame | history
map.js 32 ●●●● patch | view | raw | blame | history
lang_en.js
@@ -40,8 +40,14 @@
    time_minutes_ago_suffix: ' min ago',
    
    type_vehicle: 'Vehicle',
    type_bus: 'Bus',
    type_tram: 'Tram',
    type_stop: 'Stop',
    type_stop_bus: 'Bus stop',
    type_stop_tram: 'Tram stop',
    type_stoppoint: 'Stop point',
    type_stoppoint_bus: 'Bus stop point',
    type_stoppoint_tram: 'Tram stop point',
    
    select_feature: 'There is more than one feature here. Select the proper one:',
    departures_for_stop: 'Click for stop departures (and not only this stop point).',
lang_pl.js
@@ -19,6 +19,8 @@
    header_line: 'Linia',
    header_direction: 'Kierunek',
    header_vehicle: 'Pojazd',
    header_bus: 'Autobus',
    header_tram: 'Tramwaj',
    header_time: 'Odjazd',
    header_delay: 'Opóźn.',
    header_lines: 'Linie',
@@ -40,11 +42,17 @@
    time_minutes_ago_suffix: ' min temu',
    
    type_vehicle: 'Pojazd',
    type_bus: 'Autobus',
    type_tram: 'Tramwaj',
    type_stop: 'Przystanek',
    type_stoppoint: 'Punkt przystankowy',
    type_stop_bus: 'Przystanek autobusowy',
    type_stop_tram: 'Przystanek tramwajowy',
    type_stoppoint: 'Peron',
    type_stoppoint_bus: 'Peron autobusowy',
    type_stoppoint_tram: 'Peron tramwajowy',
    
    select_feature: 'W tym miejscu znajduje się więcej niż jeden element. Wybierz właściwy z listy:',
    departures_for_stop: 'Kliknij, by zobaczyć odjazdy dla całego przystanku (a nie tylko punktu przystankowego).',
    departures_for_stop: 'Kliknij, by zobaczyć odjazdy dla całego przystanku (a nie tylko peronu).',
    
    tram_type_pattern: '$num $type ($floor)',
    high_floor: 'wysokopodłogowy',
map.html
@@ -16,8 +16,8 @@
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha384-tsQFqpEReu7ZLhBV2VZlAu7zcOV+rXbYlF2cqB8txI/8aZajjp4Bqd+V6D5IgvKT" crossorigin="anonymous"></script>
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList"></script>
<script src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v5.3.0/build/ol.js" integrity="sha384-iQkGyyH4ioz3m+maM3s9MX1Oq67mACa4B9Z3ovUv3Sv37LJ96fx3WnZfLoiC3Wfl" crossorigin="anonymous"></script>
<script tyle="text/javascript" src="lang_pl.js" id="lang_script"></script>
<script tyle="text/javascript" src="lang_pl.js?v2" id="lang_script"></script>
<script tyle="text/javascript" src="common.js?v2"></script>
<script tyle="text/javascript" src="map.js?v3"></script>
<script tyle="text/javascript" src="map.js?v4"></script>
</body>
</html>
map.js
@@ -506,7 +506,10 @@
    switch(feature.getId().substr(0, 1)) {
        case 't':
        case 'b':
            type = lang.type_vehicle;
            type = lang.type_tram;
            if(feature.getId().startsWith('b')) {
                type = lang.type_bus;
            }
            
            var span = displayVehicle(feature.get('vehicle_type'));
            
@@ -524,7 +527,10 @@
            vehicleTable(feature.get('tripId'), tbody, feature.getId());
        break;
        case 's':
            type = lang.type_stop;
            type = lang.type_stop_tram;
            if(feature.getId().startsWith('sb')) {
                type = lang.type_stop_bus;
            }
            
            addElementWithText(thead, 'th', lang.header_line);
            addElementWithText(thead, 'th', lang.header_direction);
@@ -534,7 +540,10 @@
            stopTable('stop', feature.get('shortName'), tbody, feature.getId());
        break;
        case 'p':
            type = lang.type_stoppoint;
            type = lang.type_stoppoint_tram;
            if(feature.getId().startsWith('pb')) {
                type = lang.type_stoppoint_bus;
            }
            
            additional = document.createElement('p');
            additional.className = 'small';
@@ -542,7 +551,7 @@
                'click',
                function() {
                    featureClicked(stops_source.forEachFeature(function(stop_feature) {
                        if(stop_feature.get('shortName') == feature.get('shortName')) {
                        if(stop_feature.get('shortName') == feature.get('shortName') && stop_feature.getId().substr(1,1) == feature.getId().substr(1,1)) {
                            return stop_feature;
                        }
                    }));
@@ -773,16 +782,25 @@
                switch(feature.getId().substr(0, 1)) {
                    case 't':
                    case 'b':
                        type = lang.type_vehicle;
                        type = lang.type_tram;
                        if(feature.getId().startsWith('b')) {
                            type = lang.type_bus;
                        }
                        if(feature.get('vehicle_type').num) {
                            type += ' ' + feature.get('vehicle_type').num;
                        }
                    break;
                    case 's':
                        type = lang.type_stop;
                        type = lang.type_stop_tram;
                        if(feature.getId().startsWith('sb')) {
                            type = lang.type_stop_bus;
                        }
                    break;
                    case 'p':
                        type = lang.type_stoppoint;
                        type = lang.type_stoppoint_tram;
                        if(feature.getId().startsWith('pb')) {
                            type = lang.type_stoppoint_bus;
                        }
                    break;
                }