From 3d2439faecd44be86f2da5aa7cafff6eb2df0491 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Mon, 5 Oct 2015 17:28:37 +0200 Subject: fix js-errors with rooms in the schedule unknown to the streaming-ws --- assets/js/lustiges-script.js | 3 +++ model/Schedule.php | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index fff3896..15f0358 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -350,6 +350,9 @@ $(function() { $.each(talks, function(room, talk) { + if(!talk.known) + return; + if(talk.start < now) currentTalk = talk; diff --git a/model/Schedule.php b/model/Schedule.php index bce1719..d4e9acc 100644 --- a/model/Schedule.php +++ b/model/Schedule.php @@ -102,7 +102,9 @@ class Schedule extends ModelBase if($this->isRoomFiltered($name)) continue; - if(isset($mapping[$name])) + $room_known = isset($mapping[$name]); + + if($room_known) $name = $mapping[$name]; foreach($room->event as $event) @@ -125,6 +127,7 @@ class Schedule extends ModelBase 'start' => $lastend, 'end' => $start, 'duration' => $pauseduration, + 'room_known' => $room_known, ); } else if(!$lastend && $daystart < $start) @@ -138,6 +141,7 @@ class Schedule extends ModelBase 'start' => $daystart, 'end' => $start, 'duration' => $start - $daystart, + 'room_known' => $room_known, ); } @@ -155,6 +159,7 @@ class Schedule extends ModelBase 'start' => $start, 'end' => $end, 'duration' => $duration, + 'room_known' => $room_known, ); $lastend = $end; -- cgit v1.2.3