Added wort, moved the events section

fixes #2
gh-pages
Thierry Degeling 2014-07-23 17:07:21 +01:00
parent ed7696ee9b
commit 0898ccd358
3 changed files with 53 additions and 3 deletions

View File

@ -26,6 +26,15 @@ body:after {
padding: 0.2em 1em 1em 1em;
color: #777;
margin-bottom: 15px;
overflow: hidden;
}
.panel img {
display: block;
position: absolute;
right: 0;
top: 0;
height: 100%;
}
h1, h2, h3, h4, h5, h6 {
@ -91,4 +100,4 @@ h1, h2, h3, h4, h5, h6 {
text-align: center;
font-size: 7em;
padding: 0;
}
}

View File

@ -49,11 +49,12 @@
<div class="col-md-4">
<div class="panel status"></div>
<div class="events"></div>
</div>
<div class="col-md-4">
<div class="panel busses"></div>
</div>
<div class="col-md-4 events">
<div class="col-md-4 news">
</div>
</div>
@ -65,4 +66,5 @@
<script src="js/level2.js"></script>
</body>
</html>
</html>

View File

@ -30,6 +30,12 @@
l2events();
}, 3600000);
wortLuNews();
setInterval( function() {
wortLuNews();
}, 900000);
});
@ -251,3 +257,36 @@ function l2events() {
console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated Level2 events' );
}
function wortLuNews() {
var request = $.ajax({
type: 'get',
url: 'http://device.wort.lu/api/v303/sites/en/sections/4f4e59a1e4b056b73debc870',
complete: function( response ) {
var articles = response.responseJSON.articles;
console.log( articles )
var output = '';
for ( var ArticleNR = 0; ArticleNR < 5; ArticleNR++ ) {
var article = articles[ ArticleNR ];
output += '<div class="panel">'
+ '<h1>' + article.title + '</h1>'
+ article.teaser
+ '</div>';
}
$('.news').html('').append( output );
}
});
console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated WortLu News' );
}