ecf5248962
* Set a static projector title * absolute_urls for the activate links * update the projector when a slide changes (in save()) * insert the absolute_url template filter * Preview to slides * renamed is_active to is_active_slide * The SlideMixin has to come before the PersonMixin * Update list of speakers * Render Countdown via JS * Reconnect projector after connection lost * Overlays can allways be active and do not appear in the widget * Rewrote the clock as overlay
26 lines
778 B
JavaScript
26 lines
778 B
JavaScript
function update_countdown() {
|
|
var time = new Date().getTime() / 1000;
|
|
var seconds;
|
|
var start = projector.projector_countdown_start;
|
|
var duration = projector.projector_countdown_duration;
|
|
var pause = projector.projector_countdown_pause;
|
|
|
|
switch (projector.projector_countdown_state) {
|
|
case 'active':
|
|
seconds = start + duration - time;
|
|
break;
|
|
case 'paused':
|
|
seconds = start + duration - pause;
|
|
break;
|
|
case 'inactive':
|
|
seconds = duration;
|
|
break;
|
|
}
|
|
if (seconds !== undefined) {
|
|
seconds = Math.max(0, Math.floor(seconds));
|
|
$('#overlay_countdown_inner').html(seconds);
|
|
}
|
|
setTimeout('update_countdown()', 200);
|
|
}
|
|
update_countdown();
|