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

ufc panel eingefügt

parent 08b08194
No related branches found
No related tags found
No related merge requests found
var semester = null;
var nextMovie = null;
var img=null;
var titleDiv=null;
var zeitDiv=null;
this.loaded=function(panel,config) {
img = $(panel).find("#image img");
titleDiv=$(panel).find("#title span");
zeitDiv=$(panel).find("#zeit span");
$.ajax("http://localhost/infoscreen/panels/ufc/semester.json",{
async:false
})
.done(function(e) {
semester=e;
});
}
this.resize=function() {
titleDiv.parent().textfill({
maxFontPixels:-1
});
zeitDiv.parent().textfill({
maxFontPixels:-1
});
}
this.checkShowCondition=function() {
if (!semester)
return -1;
return 0;
}
this.show=function() {
var now = new Date().getTime();
if (!nextMovie || (now > new Date(nextMovie.date).getTime()))
{
for (var film in semester){
film = semester[film];
if (new Date(film.date).getTime() > now) {
nextMovie = film;
console.log(film);
break;
}
}
img.attr("src","https://ufc.tu-dortmund.de" + nextMovie.movie.image_url_medium );
titleDiv.text(nextMovie.title);
var d = new Date(nextMovie.date);
var tag = d.getDate();
tag = tag<10?"0"+tag:tag;
zeitDiv.text(tag+". "+this.getLongMonth(d.getMonth())+" "+ d.getFullYear() + " " + d.toLocaleTimeString());
this.resize();
}
}
this.getLongMonth = function(month){
switch(month)
{
case 1:
return "Januar";
case 2:
return "Feburar";
case 3:
return "März";
case 4:
return "April";
case 5:
return "Mai";
case 6:
return "Juni";
case 7:
return "Juli";
case 8:
return "August";
case 9:
return "September";
case 10:
return "Oktober";
case 11:
return "November";
case 12:
return "Dezember";
default:
return "undefined";
}
}
\ No newline at end of file
This diff is collapsed.
#image{
height:70%;
text-align:center;
}
#title{
height:20%;
}
#zeit{
height:10%;
color:white;
}
#image img {
height: 100%;
margin:auto;
width:auto;
border: solid black 1px;
}
#zeit, #title{
}
#zeit span {
background:#b00;
display:inline-block;
padding: 3px;
}
#background {
height:100%;
width:100%;
background:white;
font-family:NewCicle, Verdana, Arial, sans-serif;
text-transform: Capitalize;
color:black;
}
* {
box-sizing:border-box;
}
<div id="background">
<!-- TODO: fallback image -->
<div id="zeit"><span></span></div>
<div id="title"><span></span></div>
<div id="image"><img></div>
</div>
\ 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