Skip to content
Snippets Groups Projects
Commit 5d6bae83 authored by Denis Peters's avatar Denis Peters
Browse files

Merged in dev (pull request #6)

departure panel bugfixes
parents 2f6dd2b4 8bbe0c4b
No related branches found
No related tags found
No related merge requests found
...@@ -78,6 +78,7 @@ ...@@ -78,6 +78,7 @@
echo "<div error><h1>NAME ERROR!</h1>$stop<br/>Not a propper stop name. Usage: city:stop[;city:stop]*</div>"; echo "<div error><h1>NAME ERROR!</h1>$stop<br/>Not a propper stop name. Usage: city:stop[;city:stop]*</div>";
// get departures // get departures
ob_start();
$plain = file_get_contents("http://vrrf.finalrewind.org/$stopsplit[0]/$stopsplit[1].json?frontend=json"); $plain = file_get_contents("http://vrrf.finalrewind.org/$stopsplit[0]/$stopsplit[1].json?frontend=json");
$data = json_decode($plain, true); $data = json_decode($plain, true);
// version // version
...@@ -115,6 +116,11 @@ ...@@ -115,6 +116,11 @@
continue; continue;
} }
} }
if (isset($options['filter']['bl']['destination']) ) {
if (in_array($entry['destination'], $options['filter']['bl']['destination'])) {
continue;
}
}
} }
if (isset($options['filter']['wl'])) { if (isset($options['filter']['wl'])) {
if (isset($options['filter']['wl']['line']) ) { if (isset($options['filter']['wl']['line']) ) {
...@@ -132,6 +138,11 @@ ...@@ -132,6 +138,11 @@
continue; continue;
} }
} }
if (isset($options['filter']['wl']['destination']) ) {
if (!in_array($entry['destination'], $options['filter']['wl']['destination'])) {
continue;
}
}
} }
// !filter // !filter
......
...@@ -122,7 +122,7 @@ var update = function(config, fields) { ...@@ -122,7 +122,7 @@ var update = function(config, fields) {
} else { } else {
$(actDep.self).css("display", ""); $(actDep.self).css("display", "");
$(actDep.line).html(strDep.line.toUpperCase()); $(actDep.line).html(strDep.line.toUpperCase());
$(actDep.name).html(strDep.destination); $(actDep.name).html(strDep.destination.replace("Dortmund ", ""));
for (var j = 0; j < 3; ++j) { for (var j = 0; j < 3; ++j) {
var var
actStn = actDep.sttn[j], actStn = actDep.sttn[j],
...@@ -135,7 +135,7 @@ var update = function(config, fields) { ...@@ -135,7 +135,7 @@ var update = function(config, fields) {
} else { } else {
$(actStn.self).css("display", ""); $(actStn.self).css("display", "");
$(actStn.time).html(strStn.time); $(actStn.time).html(strStn.time);
$(actStn.name).html(strStn.name); $(actStn.name).html(strStn.name.replace("Dortmund - ", ""));
if (strStn.cancel == 1) { if (strStn.cancel == 1) {
$(actStn.name).css("text-decoration", "outline"); $(actStn.name).css("text-decoration", "outline");
} else { } else {
...@@ -163,6 +163,8 @@ var resize = function(panel, config, cont) { ...@@ -163,6 +163,8 @@ var resize = function(panel, config, cont) {
lineStp = $(cont).find('[data-stop]'), lineStp = $(cont).find('[data-stop]'),
infoTtl = $(cont).find('[data-title]'), infoTtl = $(cont).find('[data-title]'),
infoMsg = $(cont).find('[data-message]'), infoMsg = $(cont).find('[data-message]'),
stopTme = $(lineStp).find('[data-time]'),
stopDly = $(lineStp).find('[data-delay]'),
// setze größen der schriften mit scale * n wobei n in prozent von panelhöhe // setze größen der schriften mit scale * n wobei n in prozent von panelhöhe
lineHedH = scale * 5, // überschriften der linien lineHedH = scale * 5, // überschriften der linien
lineStpH = scale * 4, // haltestellen der linien lineStpH = scale * 4, // haltestellen der linien
...@@ -172,13 +174,17 @@ var resize = function(panel, config, cont) { ...@@ -172,13 +174,17 @@ var resize = function(panel, config, cont) {
$(lineHed).css('height', lineHedH + 'px'); $(lineHed).css('height', lineHedH + 'px');
$(lineHed).css('fontSize', (lineHedH-2) + 'px'); $(lineHed).css('fontSize', (lineHedH-2) + 'px');
$(lineHed).css('lineHeight', lineHedH + 'px'); $(lineHed).css('lineHeight', lineHedH + 'px');
$(lineLin).css('width', lineHedH * 2); $(lineLin).css('width', getStringWidth((lineHedH-2), "00000"));
// setze linien haltestellen größe // setze linien haltestellen größe
$(lineStp).css('height', lineStpH + 'px'); $(lineStp).css('height', lineStpH + 'px');
$(lineStp).css('fontSize', (lineStpH-2) + 'px'); $(lineStp).css('fontSize', (lineStpH-2) + 'px');
$(lineStp).css('lineHeight', lineStpH + 'px'); $(lineStp).css('lineHeight', lineStpH + 'px');
// setze zeit und delay breite
$(stopTme).css('width', getStringWidth((lineStpH-2), "00:00") + 'px');
$(stopDly).css('width', getStringWidth((lineStpH-2), "+00") + 'px');
// setze info überschriften größe // setze info überschriften größe
$(infoTtl).css('height', infoTtlH + 'px'); $(infoTtl).css('height', infoTtlH + 'px');
$(infoTtl).css('fontSize', (infoTtlH-2) + 'px'); $(infoTtl).css('fontSize', (infoTtlH-2) + 'px');
...@@ -190,6 +196,16 @@ var resize = function(panel, config, cont) { ...@@ -190,6 +196,16 @@ var resize = function(panel, config, cont) {
$(infoMsg).css('lineHeight', infoMsgH + 'px'); $(infoMsg).css('lineHeight', infoMsgH + 'px');
} }
var getStringWidth = function(fontSize, string) {
var
o = $('<div>' + string + '</div>')
.css({'position': 'absolute', 'float': 'left', 'white-space': 'nowrap', 'visibility': 'hidden', 'font-family': 'display', 'fontSize': fontSize + 'px'})
.appendTo($('body')),
w = o.width();
o.remove();
return w;
}
var generate = function(config, stations, departs, tplDeparture, tplStop, tplMsg) { var generate = function(config, stations, departs, tplDeparture, tplStop, tplMsg) {
console.log("departures: generating structure [" + config + "]"); console.log("departures: generating structure [" + config + "]");
var var
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
box-sizing: border-box; box-sizing: border-box;
overflow: hidden; overflow: hidden;
font-family: display; font-family: display;
/* font-weight: bold */
[data-departure] { [data-departure] {
position: relative; position: relative;
...@@ -33,7 +32,7 @@ ...@@ -33,7 +32,7 @@
display: inline-table; display: inline-table;
background-color: #FFFFFF; background-color: #FFFFFF;
color: #0000A0; color: #0000A0;
width: 10%; /*width: 10%;*/
height: 100%; height: 100%;
text-align: right; text-align: right;
padding: 0px 5px; padding: 0px 5px;
...@@ -63,7 +62,6 @@ ...@@ -63,7 +62,6 @@
[data-time] { [data-time] {
position: relative; position: relative;
flex: 2;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
text-align: right; text-align: right;
...@@ -71,7 +69,6 @@ ...@@ -71,7 +69,6 @@
} }
[data-delay] { [data-delay] {
position: relative; position: relative;
flex: 1;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
text-align: right; text-align: right;
...@@ -82,7 +79,7 @@ ...@@ -82,7 +79,7 @@
[data-name] { [data-name] {
position: relative; position: relative;
flex: 16; flex: 1;
height: 100%; height: 100%;
overflow: hidden; overflow: hidden;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment