interlude/ractive-init.js

27 lines
972 B
JavaScript
Raw Normal View History

2014-05-13 07:27:47 +03:00
var reactive = new Ractive({
// The `el` option can be a node, an ID, or a CSS selector.
el: '.slides',
// We could pass in a string, but for the sake of convenience
// we're passing the ID of the script tag above.
template: '#slides_template',
// Here, we're passing in some initial data
2014-05-13 15:43:58 +03:00
data: {pastEvents: schedule.pastEvents(),
2014-06-21 05:08:15 +03:00
currentEvent: schedule.currentEvent(),
2014-05-13 15:43:58 +03:00
nextEvent: schedule.nextEvent(),
futureEvents: schedule.futureEvents(),
eventCount: schedule.allEvents().length}
2014-05-13 07:27:47 +03:00
});
function refreshEvent() {
2015-08-12 21:03:48 +03:00
schedule.update();
2014-05-13 15:43:58 +03:00
reactive.set({pastEvents: schedule.pastEvents(),
2014-06-21 05:08:15 +03:00
currentEvent: schedule.currentEvent(),
2014-05-13 15:43:58 +03:00
nextEvent: schedule.nextEvent(),
futureEvents: schedule.futureEvents(),
eventCount: schedule.allEvents().length,
now: schedule.now(),
room: schedule.room()});
2014-05-13 07:27:47 +03:00
}