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
02612137
Commit
02612137
authored
9 years ago
by
Rico van Endern
Browse files
Options
Downloads
Plain Diff
Merged in dev (pull request #12)
Dev
parents
d971faa8
1da8ddf7
No related branches found
No related tags found
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
panels/mensaPlan/script.js
+59
-41
59 additions, 41 deletions
panels/mensaPlan/script.js
panels/mensaPlan/style.less
+1231
-0
1231 additions, 0 deletions
panels/mensaPlan/style.less
panels/mensaPlan/template.html
+1
-2
1 addition, 2 deletions
panels/mensaPlan/template.html
with
1291 additions
and
43 deletions
panels/mensaPlan/script.js
+
59
−
41
View file @
02612137
this
.
loaded
=
function
(
panel
,
config
)
{
setInterval
(
function
(){
getMensaPlan
();},
1800000
);
setInterval
(
function
()
{
getMensaPlan
();
},
1800000
);
setInterval
(
function
()
{
var
currentTab
=
$
(
"
#tabs
"
).
tabs
(
'
option
'
,
'
active
'
);
if
(
currentTab
==
0
)
{
currentTab
=
1
;
}
else
{
currentTab
=
0
;
}
$
(
"
#tabs
"
).
tabs
({
active
:
currentTab
});
},
60000
);
function
getMensaPlan
()
{
$
.
getJSON
(
"
panels/mensaPlan/mensaPlan.json
"
)
.
done
(
function
(
json
)
{
$
.
getJSON
(
"
panels/mensaPlan/mensaPlan.json
"
).
done
(
function
(
json
)
{
fillTable
(
json
);
})
.
fail
(
function
(
jqxhr
,
textStatus
,
error
)
{
}).
fail
(
function
(
jqxhr
,
textStatus
,
error
)
{
var
err
=
textStatus
+
"
,
"
+
error
;
console
.
log
(
"
Request Failed:
"
+
err
);
console
.
log
(
"
Request Failed:
"
+
err
);
});
}
function
fillTable
(
json
)
{
var
day
=
new
Date
();
switch
(
day
.
getDay
()){
case
0
:
var
gerichte
=
json
.
montag
.
gerichte
;
function
fillTable
(
json
)
{
var
date
=
new
Date
();
var
next
=
0
;
if
(
date
.
getHours
()
>
14
||
(
date
.
getHours
()
==
14
&&
date
.
getMinutes
()
>
15
)){
next
=
1
;
}
switch
(
date
.
getDay
()
+
next
)
{
case
0
:
var
day
=
json
.
montag
;
break
;
case
1
:
var
gerichte
=
json
.
montag
.
gerichte
;
case
1
:
var
day
=
json
.
montag
;
break
;
case
2
:
var
gerichte
=
json
.
dienstag
.
gerichte
;
case
2
:
var
day
=
json
.
dienstag
;
break
;
case
3
:
var
gerichte
=
json
.
mittwoch
.
gerichte
;
case
3
:
var
day
=
json
.
mittwoch
;
break
;
case
4
:
var
gerichte
=
json
.
donnerstag
.
gerichte
;
case
4
:
var
day
=
json
.
donnerstag
;
break
;
case
5
:
var
gerichte
=
json
.
freitag
.
gerichte
;
case
5
:
var
day
=
json
.
freitag
;
break
;
case
6
:
var
gerichte
=
json
.
montag
.
gerichte
;
case
6
:
var
day
=
json
.
montag
;
break
;
}
var
tableBody
=
document
.
getElementById
(
"
mensaPlanTable1Body
"
);
tableBody
.
innerHTML
=
""
;
var
counter
=
0
;
var
j
=
0
;
for
(
var
i
=
0
;
i
<
gerichte
.
length
;
i
++
){
if
(
counter
>=
gerichte
.
length
/
2
){
tableBody
=
document
.
getElementById
(
"
mensaPlanTable2Body
"
);
tableBody
.
innerHTML
=
""
;
j
=
0
;
var
gerichte
=
day
.
gerichte
;
document
.
getElementById
(
"
head
"
).
innerHTML
=
"
Mensaplan vom
"
+
day
.
date
;
var
tableBody1
=
document
.
getElementById
(
"
mensaPlanTable1Body
"
);
var
tableBody2
=
document
.
getElementById
(
"
mensaPlanTable2Body
"
);
tableBody1
.
innerHTML
=
""
;
tableBody2
.
innerHTML
=
""
;
var
a
=
0
;
var
b
=
0
;
for
(
var
i
=
0
;
i
<
gerichte
.
length
;
i
++
)
{
var
gericht
=
gerichte
[
i
];
if
(
gericht
.
kategorie
==
"
icon-menue-1.png
"
||
gericht
.
kategorie
==
"
icon-menue-2.png
"
||
gericht
.
kategorie
==
"
icon-tagesgericht.png
"
||
gericht
.
kategorie
==
"
icon-aktionsteller.png
"
){
var
row
=
tableBody1
.
insertRow
(
a
);
a
++
;
}
else
{
counter
++
;
var
row
=
tableBody2
.
insertRow
(
b
);
b
++
;
}
var
gericht
=
gerichte
[
i
];
var
row
=
tableBody
.
insertRow
(
j
);
var
cell1
=
row
.
insertCell
(
0
);
var
cell2
=
row
.
insertCell
(
1
);
var
cell3
=
row
.
insertCell
(
2
);
cell1
.
innerHTML
=
gericht
.
gericht
;
cell2
.
innerHTML
=
gericht
.
art
;
cell3
.
innerHTML
=
'
<img src="../panels/mensaPlan/img/
'
+
gericht
.
kategorie
+
'
" />
'
;
cell3
.
innerHTML
=
'
<img src="panels/mensaPlan/img/
'
+
gericht
.
kategorie
+
'
" />
'
;
j
++
;
}
}
getMensaPlan
();
$
(
function
()
{
$
(
"
#tabs
"
).
tabs
();
$
(
"
#tabs
"
).
tabs
();
});
setInterval
(
function
(){
var
currentTab
=
$
(
"
#tabs
"
).
tabs
(
'
option
'
,
'
active
'
);
if
(
currentTab
==
0
){
currentTab
=
1
;}
else
{
currentTab
=
0
;};
$
(
"
#tabs
"
).
tabs
({
active
:
currentTab
});},
60000
);
}
This diff is collapsed.
Click to expand it.
panels/mensaPlan/style.less
+
1231
−
0
View file @
02612137
This diff is collapsed.
Click to expand it.
panels/mensaPlan/template.html
+
1
−
2
View file @
02612137
<link
rel=
"stylesheet"
href=
"//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"
>
<div
id=
"tabs"
>
<div
id=
"head"
></div>
<ul>
<li><a
href=
"#tabs-1"
>
Normale Counter
</a></li>
<li><a
href=
"#tabs-2"
>
Grill etc. Counter
</a></li>
...
...
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