Skip to content
Snippets Groups Projects
Commit a52678be authored by Rico van Endern's avatar Rico van Endern
Browse files

Merged in dev (pull request #36)

Dev
parents 6d91b947 bef6af0d
Branches
No related tags found
No related merge requests found
...@@ -17,6 +17,22 @@ ...@@ -17,6 +17,22 @@
"type": "cycler", "type": "cycler",
"duration": 5, "duration": 5,
"panels": [ "panels": [
{
"type": "panel",
"name": "werbung",
"config": {
"files": [
{
"filename": "itour2016_0.png",
"enddate": "02.11.2016"
},
{
"filename": "DAT_2016_Flyer_DINA6.png",
"enddate": "18.11.2016"
}
]
}
},
{ {
"type": "panel", "type": "panel",
"name": "ufc" "name": "ufc"
...@@ -24,6 +40,10 @@ ...@@ -24,6 +40,10 @@
{ {
"type": "panel", "type": "panel",
"name": "mensaPlan" "name": "mensaPlan"
},
{
"type": "panel",
"name": "lsfView"
} }
] ]
} }
......
...@@ -22,11 +22,13 @@ ...@@ -22,11 +22,13 @@
"name": "werbung", "name": "werbung",
"config": { "config": {
"files": [ "files": [
{ {
"filename": "Grillen2016_0.png" "filename": "itour2016_0.png",
"enddate": "02.11.2016"
}, },
{ {
"filename": "itour2016_0.png" "filename": "DAT_2016_Flyer_DINA6.png",
"enddate": "18.11.2016"
} }
] ]
} }
...@@ -46,4 +48,4 @@ ...@@ -46,4 +48,4 @@
] ]
} }
} }
} }
\ No newline at end of file
...@@ -2,10 +2,18 @@ var lsfViewJson = null; ...@@ -2,10 +2,18 @@ var lsfViewJson = null;
this.checkShowCondition = function() { this.checkShowCondition = function() {
var date = new Date(); var date = new Date();
var roundH = date.getHours()%2 == 1? date.getHours()+1 : date.getHours();
if(date.getHours() >= 8 && date.getHours() <= 18 && date.getHours()%2 == 1 && date.getMinutes() > 44){ if(date.getHours() >= 8 && date.getHours() <= 18 && date.getHours()%2 == 1 && date.getMinutes() > 44){
console.log("TITTEN"); for (i = 0; i < lsfViewJson.events.length; i++) {
return 120; if(lsfViewJson.events[i].StartTime.substring(0, 2) == roundH) {
console.log("LSF-View: Event Found");
return 10;
}
}
console.log("LSF-View: No Events");
return 0;
} else { } else {
console.log("LSF-View: Out Of Time");
return 0; //Skip Panel? return 0; //Skip Panel?
} }
} }
......
...@@ -7,7 +7,13 @@ this.loaded=function(panel,config) { ...@@ -7,7 +7,13 @@ this.loaded=function(panel,config) {
img = $(panel).find("#background"); img = $(panel).find("#background");
titleDiv=$(panel).find("#title span"); titleDiv=$(panel).find("#title span");
zeitDiv=$(panel).find("#zeit span"); zeitDiv=$(panel).find("#zeit span");
$.ajax("https://ufc.tu-dortmund.de/semesters/winter2016.json",{ var semesterString = "";
if (Date.now() >= Date.UTC(new Date().getFullYear(),4,1) && Date.now() < Date.UTC(new Date().getFullYear(),10,1)) {
semesterString = "sommer"+new Date().getFullYear();
} else {
semesterString = "winter"+new Date().getFullYear();
}
$.ajax("https://ufc.tu-dortmund.de/semesters/"+semesterString+".json",{
async:false async:false
}) })
.done(function(e) { .done(function(e) {
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -7,8 +7,7 @@ this.loaded=function(panel,config) { ...@@ -7,8 +7,7 @@ this.loaded=function(panel,config) {
werbung_config = config werbung_config = config
} }
this.show=function() { function setNextWerbung() {
$(werbung_panel).find("#werbung_display").attr("src", "panels/werbung/img/"+werbung_config.files[nextWerbung].filename);
if(nextWerbung+1<werbung_config.files.length) { if(nextWerbung+1<werbung_config.files.length) {
nextWerbung += 1; nextWerbung += 1;
} else { } else {
...@@ -16,6 +15,11 @@ this.show=function() { ...@@ -16,6 +15,11 @@ this.show=function() {
} }
} }
this.show=function() {
$(werbung_panel).find("#werbung_display").attr("src", "panels/werbung/img/"+werbung_config.files[nextWerbung].filename);
setNextWerbung();
}
this.resize=function() { this.resize=function() {
} }
...@@ -23,5 +27,23 @@ this.hide = function() { ...@@ -23,5 +27,23 @@ this.hide = function() {
} }
this.checkShowCondition = function() { this.checkShowCondition = function() {
return 20; var werbungOriginalNext = nextWerbung;
var enddateEl = werbung_config.files[nextWerbung].enddate.split(".");
if(Date.now() <= Date.UTC(enddateEl[2], enddateEl[1], enddateEl[0])) {
return 20;
} else {
console.log("Werbung: Skipped - Out Of Date");
setNextWerbung()
}
while(nextWerbung != werbungOriginalNext){
console.log("Werbung: IN LOOP");
enddateEl = werbung_config.files[nextWerbung].enddate.split(".");
if(Date.now() <= Date.UTC(enddateEl[2], enddateEl[1], enddateEl[0])) {
return 20;
} else {
console.log("Werbung: Skipped - Out Of Date");
setNextWerbung()
}
}
return 0;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment