Added events from the wiki
parent
501f8dc7c7
commit
55c5b80e5c
|
@ -25,6 +25,7 @@ body:after {
|
|||
box-shadow: 0px 1px 0px 0px rgba(0,0,0,0.25);
|
||||
padding: 0.2em 1em 1em 1em;
|
||||
color: #777;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<div class="col-md-4">
|
||||
<div class="panel busses"></div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-4 events">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
39
js/level2.js
39
js/level2.js
|
@ -24,6 +24,12 @@
|
|||
l2status();
|
||||
}, 60000);
|
||||
|
||||
l2events();
|
||||
|
||||
setInterval( function() {
|
||||
l2events();
|
||||
}, 3600000);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
@ -213,3 +219,36 @@ function l2status() {
|
|||
console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated Level2 status' );
|
||||
|
||||
}
|
||||
|
||||
function l2events() {
|
||||
|
||||
var request = $.ajax({
|
||||
type: 'get',
|
||||
url: 'http://getcontents.herokuapp.com/?url=https%3A%2F%2Fwiki.hackerspace.lu%2Fwiki%2FSpecial%3AAsk%2F-5B-5BCategory%3AEvent-5D-5D-20-5B-5BStartDate%3A%3A-3E' + moment().format('YYYY') + '-2D' + moment().format('MM') + '-2D' + moment().format('DD') + '-5D-5D-20-3Cq-3E-5B-5BHas-20organizer%3A%3AOrganisation%3ASyn2cat-5D-5D-20OR-20-5B-5BIs-20External%3A%3Ano-5D-5D-3C-2Fq-3E-20-5B-5BDo-20Announce%3A%3Ayes-5D-5D%2F-3FStartDate%2F-3FEndDate%2F-3FHas-20subtitle%2F-3FHas-20description%2F-3FIs-20Event-20of-20Type%253DIs-20type%2F-3FHas-20location%2F-3FHas-20picture%2F-3FHas-20cost%2F-3FCategory%2Fformat%253Djson%2Fsort%253DStartDate%2Forder%253Dascending%2Fsearchlabel%253DJSON-20(Internal%2C-20announceable-20events-20only%2C-20only-20upcoming-20events)',
|
||||
complete: function( response ) {
|
||||
|
||||
var events = JSON.parse( response.responseText );
|
||||
|
||||
var output = '';
|
||||
|
||||
$.each( events.items , function( nr, l2event ) {
|
||||
|
||||
console.log( l2event );
|
||||
|
||||
output += '<div class="panel">'
|
||||
+ '<h1>' + l2event.label + ' <small>'
|
||||
+ moment( l2event.startdate, "YYYY-MM-DD HH:mm:ss").format( 'dddd, Do \of MMMM' )
|
||||
+ '</small></h1>'
|
||||
+ l2event.has_subtitle
|
||||
+ '</div>';
|
||||
|
||||
});
|
||||
|
||||
$('.events').html('').append( output );
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
console.log( moment().format('YYYY.MM.DD - HH:mm:ss') + ' updated Level2 events' );
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue