aboutsummaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorMaZderMind2016-12-18 13:31:34 +0100
committerMaZderMind2016-12-18 13:31:34 +0100
commit35e7a2b2adad42b077de60d1566c22da62edeb77 (patch)
treebe89253bbf80fc8383311137761a8a472e5d8b40 /assets/js
parent46634852dc1af3fe53136a2d48bc3157e3bbad62 (diff)
move upcoming & current logic from javascript/ajax into php
Diffstat (limited to 'assets/js')
-rw-r--r--assets/js/lustiges-script.js74
1 files changed, 0 insertions, 74 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js
index 78b8758..65fc6ef 100644
--- a/assets/js/lustiges-script.js
+++ b/assets/js/lustiges-script.js
@@ -176,80 +176,6 @@ $(function() {
});
});
-// startpage schedule teaser
-$(function() {
- var
- updateTimer = 5*1000, /* update display every 5 seconds */
- refetchTimer = 10*60*1000, /* re-request current / upcoming schedule every 10 minutes */
- scheduleData = {},
- $lecture = $('.room.has-schedule');
-
- if($lecture.length == 0)
- return;
-
- function fetchProgram() {
- $.ajax({
- url: $('div[data-schedule-url]').data('schedule-url'),
- dataType: 'json',
- success: function(data) {
- scheduleData = data;
- updateProgtamTeaser();
- },
-
- // success & error
- complete: function() {
- setTimeout(fetchProgram, refetchTimer);
- }
- });
- }
-
- function updateProgtamTeaser() {
- var
- // corrected "now" timestamp in unix-counting (seconds, not microseconds)
- now = (Date.now() / 1000);
-
- $.each(scheduleData, function(room, talks) {
- var currentTalk, nextTalk;
-
- $.each(talks, function(room, talk) {
-
- if(!talk.room_known)
- return;
-
- if(talk.start < now && talk.end > now)
- currentTalk = talk;
-
- if(!nextTalk && !talk.special && talk.start > now)
- nextTalk = talk;
-
- });
-
- var s = nextTalk ? new Date(nextTalk.start*1000) : new Date();
- if(currentTalk)
- $lecture.filter('.room-'+room)
- .find('.current-talk')
- .removeClass('hidden')
- .find('.t')
- .text(currentTalk.special ? 'none' : currentTalk.title)
-
- if(nextTalk)
- $lecture.filter('.room-'+room)
- .find('.next-talk')
- .toggleClass('hidden', !nextTalk || nextTalk.special || (nextTalk.start - now > 60*60))
- .find('strong')
- .text(s.getHours()+':'+(s.getMinutes() < 10 ? '0' : '')+s.getMinutes())
- .end()
- .find('.t')
- .text(nextTalk ? nextTalk.title : '')
- .end()
- });
-
- setTimeout(updateProgtamTeaser, updateTimer);
- }
-
- fetchProgram();
-});
-
// feedback form
$(function() {
$('.feedback-form').on('submit', function(e) {