| | |
| | | var candidate; |
| | | for(var i = 0; i < stop_name_autocomplete.options.length; i++) { |
| | | candidate = stop_name_autocomplete.options[i].value; |
| | | if(candidate.substr(0, 1) != prefix && candidate.substr(1) == stop) { |
| | | if(candidate.substr(0, 1) !== prefix && candidate.substr(1) == stop) { |
| | | alternative_stop = candidate; |
| | | break; |
| | | } |
| | |
| | | |
| | | if(alternative_stop !== null) { |
| | | var a = addParaWithText(times_alerts, ''); |
| | | a = addElementWithText(a, 'a', (prefix == 'b' ? lang.departures_for_trams : lang.departures_for_buses)); |
| | | a = addElementWithText(a, 'a', (prefix === 'b' ? lang.departures_for_trams : lang.departures_for_buses)); |
| | | a.href = ''; |
| | | a.onclick = function(e) { |
| | | e.preventDefault(); |
| | |
| | | tr = document.createElement('tr'); |
| | | addCellWithText(tr, all_departures[i].patternText); |
| | | dir_cell = addCellWithText(tr, all_departures[i].direction); |
| | | vehicle = parseVehicle(prefix + all_departures[i].vehicleId); |
| | | vehicle = vehicles_info.getParsed(prefix + all_departures[i].vehicleId); |
| | | dir_cell.appendChild(displayVehicle(vehicle)); |
| | | addCellWithText(tr, (vehicle ? vehicle.num : '')).className = 'vehicleData'; |
| | | status = parseStatus(all_departures[i]); |
| | |
| | | setText(vehicle_data_style, '.vehicleData { display: table-cell; }') |
| | | }); |
| | | |
| | | updateVehicleInfo() |
| | | vehicles_info.update(); |
| | | |
| | | hash(); |
| | | |