Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Infoscreen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Evy Storozhenko
Infoscreen
Commits
5d6bae83
Commit
5d6bae83
authored
9 years ago
by
Denis Peters
Browse files
Options
Downloads
Plain Diff
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
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
panels/departure/departures.php
+11
-0
11 additions, 0 deletions
panels/departure/departures.php
panels/departure/script.js
+20
-4
20 additions, 4 deletions
panels/departure/script.js
panels/departure/style.less
+2
-5
2 additions, 5 deletions
panels/departure/style.less
with
33 additions
and
9 deletions
panels/departure/departures.php
+
11
−
0
View file @
5d6bae83
...
...
@@ -78,6 +78,7 @@
echo
"<div error><h1>NAME ERROR!</h1>
$stop
<br/>Not a propper stop name. Usage: city:stop[;city:stop]*</div>"
;
// get departures
ob_start
();
$plain
=
file_get_contents
(
"http://vrrf.finalrewind.org/
$stopsplit[0]/$stopsplit[1]
.json?frontend=json"
);
$data
=
json_decode
(
$plain
,
true
);
// version
...
...
@@ -115,6 +116,11 @@
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']['line']
) ) {
...
...
@@ -132,6 +138,11 @@
continue;
}
}
if (isset(
$options['filter']['wl']['destination']
) ) {
if (!in_array(
$entry['destination']
,
$options['filter']['wl']['destination']
)) {
continue;
}
}
}
// !filter
...
...
This diff is collapsed.
Click to expand it.
panels/departure/script.js
+
20
−
4
View file @
5d6bae83
...
...
@@ -122,7 +122,7 @@ var update = function(config, fields) {
}
else
{
$
(
actDep
.
self
).
css
(
"
display
"
,
""
);
$
(
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
)
{
var
actStn
=
actDep
.
sttn
[
j
],
...
...
@@ -135,7 +135,7 @@ var update = function(config, fields) {
}
else
{
$
(
actStn
.
self
).
css
(
"
display
"
,
""
);
$
(
actStn
.
time
).
html
(
strStn
.
time
);
$
(
actStn
.
name
).
html
(
strStn
.
name
);
$
(
actStn
.
name
).
html
(
strStn
.
name
.
replace
(
"
Dortmund -
"
,
""
)
);
if
(
strStn
.
cancel
==
1
)
{
$
(
actStn
.
name
).
css
(
"
text-decoration
"
,
"
outline
"
);
}
else
{
...
...
@@ -163,6 +163,8 @@ var resize = function(panel, config, cont) {
lineStp
=
$
(
cont
).
find
(
'
[data-stop]
'
),
infoTtl
=
$
(
cont
).
find
(
'
[data-title]
'
),
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
lineHedH
=
scale
*
5
,
// überschriften der linien
lineStpH
=
scale
*
4
,
// haltestellen der linien
...
...
@@ -172,13 +174,17 @@ var resize = function(panel, config, cont) {
$
(
lineHed
).
css
(
'
height
'
,
lineHedH
+
'
px
'
);
$
(
lineHed
).
css
(
'
fontSize
'
,
(
lineHedH
-
2
)
+
'
px
'
);
$
(
lineHed
).
css
(
'
lineHeight
'
,
lineHedH
+
'
px
'
);
$
(
lineLin
).
css
(
'
width
'
,
lineHedH
*
2
);
$
(
lineLin
).
css
(
'
width
'
,
getStringWidth
((
lineHedH
-
2
),
"
00000
"
)
);
// setze linien haltestellen größe
$
(
lineStp
).
css
(
'
height
'
,
lineStpH
+
'
px
'
);
$
(
lineStp
).
css
(
'
fontSize
'
,
(
lineStpH
-
2
)
+
'
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
$
(
infoTtl
).
css
(
'
height
'
,
infoTtlH
+
'
px
'
);
$
(
infoTtl
).
css
(
'
fontSize
'
,
(
infoTtlH
-
2
)
+
'
px
'
);
...
...
@@ -190,6 +196,16 @@ var resize = function(panel, config, cont) {
$
(
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
)
{
console
.
log
(
"
departures: generating structure [
"
+
config
+
"
]
"
);
var
...
...
This diff is collapsed.
Click to expand it.
panels/departure/style.less
+
2
−
5
View file @
5d6bae83
...
...
@@ -9,7 +9,6 @@
box-sizing: border-box;
overflow: hidden;
font-family: display;
/* font-weight: bold */
[data-departure] {
position: relative;
...
...
@@ -33,7 +32,7 @@
display: inline-table;
background-color: #FFFFFF;
color: #0000A0;
width: 10%;
/*
width: 10%;
*/
height: 100%;
text-align: right;
padding: 0px 5px;
...
...
@@ -63,7 +62,6 @@
[data-time] {
position: relative;
flex: 2;
height: 100%;
overflow: hidden;
text-align: right;
...
...
@@ -71,7 +69,6 @@
}
[data-delay] {
position: relative;
flex: 1;
height: 100%;
overflow: hidden;
text-align: right;
...
...
@@ -82,7 +79,7 @@
[data-name] {
position: relative;
flex: 1
6
;
flex: 1;
height: 100%;
overflow: hidden;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment