From 53c3dd8089755738df39e22bfd1b0c116d825cfc Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 26 Jul 2022 12:37:30 +0200 Subject: shorten 'show_realtime=1' to 'rt=1' --- lib/DBInfoscreen/Controller/Stationboard.pm | 19 ++++++++++--------- public/static/js/collapse.js | 4 ++-- templates/_train_details.html.ep | 4 ++-- templates/layouts/app.html.ep | 2 +- templates/layouts/legacy.html.ep | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm index 6931e42..24df23e 100644 --- a/lib/DBInfoscreen/Controller/Stationboard.pm +++ b/lib/DBInfoscreen/Controller/Stationboard.pm @@ -1104,15 +1104,16 @@ sub handle_result { my @departures; my @platforms = split( /,/, $self->param('platforms') // q{} ); - my $template = $self->param('mode') // 'app'; - my $hide_low_delay = $self->param('hidelowdelay') // 0; - my $hide_opts = $self->param('hide_opts') // 0; - my $show_realtime = $self->param('show_realtime') // 0; - my $show_details = $self->param('detailed') // 0; - my $admode = $self->param('admode') // 'deparr'; - my $apiver = $self->param('version') // 0; - my $callback = $self->param('callback'); - my $via = $self->param('via'); + my $template = $self->param('mode') // 'app'; + my $hide_low_delay = $self->param('hidelowdelay') // 0; + my $hide_opts = $self->param('hide_opts') // 0; + my $show_realtime = $self->param('rt') // $self->param('show_realtime') + // 0; + my $show_details = $self->param('detailed') // 0; + my $admode = $self->param('admode') // 'deparr'; + my $apiver = $self->param('version') // 0; + my $callback = $self->param('callback'); + my $via = $self->param('via'); my $now = DateTime->now( time_zone => 'Europe/Berlin' ); diff --git a/public/static/js/collapse.js b/public/static/js/collapse.js index 95088e4..82420c7 100644 --- a/public/static/js/collapse.js +++ b/public/static/js/collapse.js @@ -102,8 +102,8 @@ function dbf_reg_handlers() { if (window.location.href.includes('past=1')) { suffix += '&past=1'; } - if (window.location.href.includes('show_realtime=1')) { - suffix += '&show_realtime=1'; + if (window.location.href.includes('rt=1') || window.location.href.includes('show_realtime=1')) { + suffix += '&rt=1'; } history.pushState({'page':'traindetail','station':station,'train':trainElem.data('no')}, 'test', '/z/' + trainElem.data('train') + '/' + trainElem.data('station') + suffix); dbf_show_moreinfo(trainElem, false); diff --git a/templates/_train_details.html.ep b/templates/_train_details.html.ep index 121f46d..7ef2138 100644 --- a/templates/_train_details.html.ep +++ b/templates/_train_details.html.ep @@ -195,7 +195,7 @@