Skip to content
Snippets Groups Projects
Commit ba306353 authored by Hotte's avatar Hotte
Browse files

skel digga

parent 83e34ed8
No related branches found
No related tags found
No related merge requests found
......@@ -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