aboutsummaryrefslogtreecommitdiff
path: root/assets/js/lustiges-script.js
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/lustiges-script.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) {