Loading lib/DBInfoscreen/Controller/Map.pm +28 −2 Original line number Diff line number Diff line Loading @@ -314,13 +314,26 @@ sub route { my ($self) = @_; my $trip_id = $self->stash('tripid'); my $line_no = $self->stash('lineno'); my $hafas = $self->param('hafas'); my $from_name = $self->param('from'); my $to_name = $self->param('to'); $self->render_later; $self->hafas->get_polyline_p( $trip_id, $line_no )->then( my $service = 'DB'; if ( $hafas and $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { $service = $hafas; } $self->hafas->get_polyline_p( id => $trip_id, line => $line_no, service => $service )->then( sub { my ($journey) = @_; Loading Loading @@ -458,12 +471,25 @@ sub ajax_route { my ($self) = @_; my $trip_id = $self->stash('tripid'); my $line_no = $self->stash('lineno'); my $hafas = $self->param('hafas'); delete $self->stash->{layout}; $self->render_later; $self->hafas->get_polyline_p( $trip_id, $line_no )->then( my $service = 'DB'; if ( $hafas and $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { $service = $hafas; } $self->hafas->get_polyline_p( id => $trip_id, line => $line_no, service => $service )->then( sub { my ($journey) = @_; Loading lib/DBInfoscreen/Helper/HAFAS.pm +5 −1 Original line number Diff line number Diff line Loading @@ -161,11 +161,15 @@ sub get_route_p { # Input: (HAFAS TripID, line number) # Output: Promise returning a Travel::Status::DE::HAFAS::Journey instance on success sub get_polyline_p { my ( $self, $trip_id, $line ) = @_; my ( $self, %opt ) = @_; my $trip_id = $opt{id}; my $line = $opt{line}; my $service = $opt{service}; my $promise = Mojo::Promise->new; Travel::Status::DE::HAFAS->new_p( service => $service, journey => { id => $trip_id, name => $line, Loading public/static/js/map-refresh.js +2 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,8 @@ function dbf_anim_fine() { } function dbf_map_reload() { $.get('/_ajax_mapinfo/' + j_reqid, function(data) { const param = new URLSearchParams(window.location.search); $.get('/_ajax_mapinfo/' + j_reqid + '?hafas=' + param.get('hafas'), function(data) { $('#infobox').html(data); dbf_map_parse(); setTimeout(dbf_map_reload, 61000); Loading templates/_map_infobox.html.ep +1 −1 Original line number Diff line number Diff line <div class="container" id="infobox" style="margin-top: 1ex; margin-bottom: 1ex;"> <div class="journey" id="jdata" data-req="<%= stash('ajax_req') %>" data-req="<%= stash('ajax_req') =~ s{#}{%23}gr %>" data-route="<%= stash('ajax_route') %>" data-poly="<%= stash('ajax_polyline') %>" > Loading templates/_train_details.html.ep +2 −2 Original line number Diff line number Diff line Loading @@ -139,10 +139,10 @@ <div class="verbose"> % if ($departure->{trip_id}) { % if (stash('station_name')) { <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= stash('station_name') %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} // 0 %>?from=<%= stash('station_name') %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> % } % else { <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} // 0 %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> % } % } % if ($departure->{wr_link}) { Loading Loading
lib/DBInfoscreen/Controller/Map.pm +28 −2 Original line number Diff line number Diff line Loading @@ -314,13 +314,26 @@ sub route { my ($self) = @_; my $trip_id = $self->stash('tripid'); my $line_no = $self->stash('lineno'); my $hafas = $self->param('hafas'); my $from_name = $self->param('from'); my $to_name = $self->param('to'); $self->render_later; $self->hafas->get_polyline_p( $trip_id, $line_no )->then( my $service = 'DB'; if ( $hafas and $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { $service = $hafas; } $self->hafas->get_polyline_p( id => $trip_id, line => $line_no, service => $service )->then( sub { my ($journey) = @_; Loading Loading @@ -458,12 +471,25 @@ sub ajax_route { my ($self) = @_; my $trip_id = $self->stash('tripid'); my $line_no = $self->stash('lineno'); my $hafas = $self->param('hafas'); delete $self->stash->{layout}; $self->render_later; $self->hafas->get_polyline_p( $trip_id, $line_no )->then( my $service = 'DB'; if ( $hafas and $hafas ne '1' and Travel::Status::DE::HAFAS::get_service($hafas) ) { $service = $hafas; } $self->hafas->get_polyline_p( id => $trip_id, line => $line_no, service => $service )->then( sub { my ($journey) = @_; Loading
lib/DBInfoscreen/Helper/HAFAS.pm +5 −1 Original line number Diff line number Diff line Loading @@ -161,11 +161,15 @@ sub get_route_p { # Input: (HAFAS TripID, line number) # Output: Promise returning a Travel::Status::DE::HAFAS::Journey instance on success sub get_polyline_p { my ( $self, $trip_id, $line ) = @_; my ( $self, %opt ) = @_; my $trip_id = $opt{id}; my $line = $opt{line}; my $service = $opt{service}; my $promise = Mojo::Promise->new; Travel::Status::DE::HAFAS->new_p( service => $service, journey => { id => $trip_id, name => $line, Loading
public/static/js/map-refresh.js +2 −1 Original line number Diff line number Diff line Loading @@ -68,7 +68,8 @@ function dbf_anim_fine() { } function dbf_map_reload() { $.get('/_ajax_mapinfo/' + j_reqid, function(data) { const param = new URLSearchParams(window.location.search); $.get('/_ajax_mapinfo/' + j_reqid + '?hafas=' + param.get('hafas'), function(data) { $('#infobox').html(data); dbf_map_parse(); setTimeout(dbf_map_reload, 61000); Loading
templates/_map_infobox.html.ep +1 −1 Original line number Diff line number Diff line <div class="container" id="infobox" style="margin-top: 1ex; margin-bottom: 1ex;"> <div class="journey" id="jdata" data-req="<%= stash('ajax_req') %>" data-req="<%= stash('ajax_req') =~ s{#}{%23}gr %>" data-route="<%= stash('ajax_route') %>" data-poly="<%= stash('ajax_polyline') %>" > Loading
templates/_train_details.html.ep +2 −2 Original line number Diff line number Diff line Loading @@ -139,10 +139,10 @@ <div class="verbose"> % if ($departure->{trip_id}) { % if (stash('station_name')) { <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>?from=<%= stash('station_name') %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} // 0 %>?from=<%= stash('station_name') %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> % } % else { <a class="smallbutton" href="/map/<%= $departure->{trip_id} %>/<%= $departure->{train_line} // 0 %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> <a class="smallbutton" href="/map/<%= $departure->{trip_id} =~ s{#}{%23}gr %>/<%= $departure->{train_line} // 0 %>"><i class="material-icons" aria-hidden="true">map</i> <%= l 'Karte' %></a> % } % } % if ($departure->{wr_link}) { Loading