| | |
| | | } |
| | | |
| | | function fail(message, more) { |
| | | if(refresh_timer) clearInterval(refresh_timer); |
| | | if(times_timer) clearTimeout(times_timer); |
| | | |
| | | setText(alert_text, message); |
| | |
| | | e.preventDefault(); |
| | | if(!stop_name_autocomplete.value) return; |
| | | stop_id = stop_name_autocomplete.value; |
| | | window.location.hash = '#!' + stop_id; |
| | | loadTimes(stop_id, true); |
| | | }); |
| | | |
| | |
| | | alert_close.addEventListener('click', function(e) { |
| | | alert.style.display = 'none'; |
| | | }); |
| | | |
| | | if(window.location.hash.match(/^#![0-9]+$/)) { |
| | | stop_id = parseInt(window.location.hash.slice(2)); |
| | | loadTimes(stop_id); |
| | | } |
| | | } |
| | | |
| | | init(); |