diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-10-15 20:10:42 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-10-15 20:10:42 +0200 |
commit | c0dcbabbbb7ea9ecdbf382b112df447b6c60956f (patch) | |
tree | 159dd2aa32db99b324b96bae426d5149e4777ec8 /public/static/js/collapse.js | |
parent | 4412dc8cf30d7ac812178d91ce5674c9c773902e (diff) |
moreinfo: Fix platform check, add IRIS messages2.3.9
Diffstat (limited to 'public/static/js/collapse.js')
-rw-r--r-- | public/static/js/collapse.js | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/public/static/js/collapse.js b/public/static/js/collapse.js index bd0b02f..79c809f 100644 --- a/public/static/js/collapse.js +++ b/public/static/js/collapse.js @@ -13,6 +13,7 @@ function dbf_reg_handlers() { var trainElem = $(this); var routeprev = trainElem.data('routeprev').split('|'); var routenext = trainElem.data('routenext').split('|'); + var moreinfo = trainElem.data('moreinfo').split('|'); $('.moreinfo').each(function() { var infoElem = $(this); $('.moreinfo .train-line').removeClass('bahn sbahn fern ext').addClass(trainElem.data('linetype')); @@ -21,29 +22,37 @@ function dbf_reg_handlers() { $('.moreinfo .train-origin').text(trainElem.data('from')); $('.moreinfo .train-dest').text(trainElem.data('to')); $('.moreinfo .minfo').text(''); - $('.moreinfo .mfooter').html('<div style="text-align: center; width: 100%; color: #888888;">Lade Daten, bitte warten...</div>'); + $('.moreinfo .mheader').append('<div style="text-align: center; width: 100%; color: #888888;">Lade Daten, bitte warten...</div>'); + $('.moreinfo .mfooter').html(''); $('.moreinfo .verbose').html(''); $('.moreinfo .mroute').html(''); $('.moreinfo ul').html(''); - if (trainElem.data('platform').length > 0) { - $('.moreinfo .mfooter').append('<div class="platforminfo">Gleis ' + trainElem.data('platform') + '</div>') + if (trainElem.data('platform') != '') { + $('.moreinfo .mfooter').append('<div class="platforminfo">Gleis ' + trainElem.data('platform') + '</div>'); } var timebuf = ''; - if (trainElem.data('arrival').length > 0) { + if (trainElem.data('arrival') != '') { timebuf += 'Ankunft: ' + trainElem.data('arrival') + '<br/>'; } - if (trainElem.data('departure').length > 0) { + if (trainElem.data('departure') != '') { timebuf += 'Abfahrt: ' + trainElem.data('departure'); } $('.moreinfo .mfooter').append('<div class="timeinfo">' + timebuf + '</div>'); - if (trainElem.data('routeprev').length > 0) { + if (trainElem.data('moreinfo') != '') { + var ibuf = ''; + for (var key in moreinfo) { + ibuf += '<li>' + moreinfo[key] + '</li>'; + } + $('.moreinfo .mfooter').append('Meldungen: <ul>' + ibuf + '</ul>'); + } + if (trainElem.data('routeprev') != '') { var routebuf = ''; for (var key in routeprev) { routebuf += '<li>' + routeprev[key] + '</li>'; } $('.moreinfo .mfooter').append('Von: <ul class="mroute">' + routebuf + '</ul>'); } - if (trainElem.data('routenext').length > 0) { + if (trainElem.data('routenext') != '') { var routebuf = ''; for (var key in routenext) { routebuf += '<li>' + routenext[key] + '</li>'; |