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 @@ ...@@ -38,6 +38,10 @@
{ {
"type": "panel", "type": "panel",
"name": "mensaPlan" "name": "mensaPlan"
},
{
"type": "panel",
"name": "lsfView"
} }
] ]
} }
......
var lsfViewJson = null;
this.checkShowCondition = function() { 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() { this.show = function() {
...@@ -11,24 +18,27 @@ this.hide = function() { ...@@ -11,24 +18,27 @@ this.hide = function() {
} }
this.loaded = function(panel, config) { this.loaded = function(panel, config) {
// reload data function lsfDataUpdate() {
setInterval(function() {
getMensaPlan();
}, 30*60*1000);
function getMensaPlan() {
$.getJSON("tmp/lsfView.json?"+( new Date().getTime()) ).done(function(json) { $.getJSON("tmp/lsfView.json?"+( new Date().getTime()) ).done(function(json) {
fillTable(json); lsfViewJson = json;
fillTable(lsfViewJson);
}).fail(function(jqxhr, textStatus, error) { }).fail(function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error; var err = textStatus + ", " + error;
console.log("Request Failed: " + err); console.log("Request Failed: " + err);
}); });
} }
function toNextRound(i){
if(i%2 == 1){
return i+1;
}
return i;
}
function fillTable(json) { function fillTable(json) {
var date = new Date(); 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 */ /* Table */
#mensaPlanTable { #lsfViewTable {
font-weight: bold; font-weight: bold;
} }
#mensaPlanTableHead { #lsfViewTableBody {
background-color: #0000f0;
color: #000000;
}
#mensaPlanTableBody {
background-color: #ffffff; background-color: #ffffff;
color: #000000; color: #000000;
} }
#mensaPlanTitleBar { #lsfViewTitleBar {
text-align: center; 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