Skip to content
Snippets Groups Projects
Commit 036585c6 authored by Tilman Vatteroth's avatar Tilman Vatteroth :robot:
Browse files

Merge branch 'dev' of bitbucket.org:FsInformatikDortmund/infoscreen

parents 6824bccc c73a789a
No related branches found
No related tags found
No related merge requests found
*
!.gitignore
!.json.skel
......@@ -38,6 +38,10 @@
{
"type": "panel",
"name": "mensaPlan"
},
{
"type": "panel",
"name": "lsfView"
}
]
}
......
var lsfViewJson = null;
this.checkShowCondition = function() {
return 20;
var date = new Date();
if(date.getHours()%2 == 1 && date.getMinutes() > 44){
return 120;
} else {
return 0; //Skip Panel
}
}
this.show = function() {
......@@ -11,24 +18,27 @@ this.hide = function() {
}
this.loaded = function(panel, config) {
// reload data
setInterval(function() {
getMensaPlan();
}, 30*60*1000);
function getMensaPlan() {
function lsfDataUpdate() {
$.getJSON("tmp/lsfView.json?"+( new Date().getTime()) ).done(function(json) {
fillTable(json);
lsfViewJson = json;
fillTable(lsfViewJson);
}).fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
console.log("Request Failed: " + err);
});
}
function toNextRound(i){
if(i%2 == 1){
return i+1;
}
return i;
}
function fillTable(json) {
var date = new Date();
document.getElementById("lsfViewTitleBar").innerHTML = "Vorlesungen zwischen 123 und 123";
document.getElementById("lsfViewTitleBar").innerHTML = "Vorlesungen zwischen " + toNextRound(date.getHours()) + " und " + (toNextRound(date.getHours())+2);
}
getMensaPlan();
lsfDataUpdate();
}
/* Table */
#mensaPlanTable {
#lsfViewTable {
font-weight: bold;
}
#mensaPlanTableHead {
background-color: #0000f0;
color: #000000;
}
#mensaPlanTableBody {
#lsfViewTableBody {
background-color: #ffffff;
color: #000000;
}
#mensaPlanTitleBar {
#lsfViewTitleBar {
text-align: center;
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment