From 619a5fa09701d4df386aea0931aa851d93916334 Mon Sep 17 00:00:00 2001 From: Manfred Stock Date: Thu, 23 Feb 2023 12:40:31 +0100 Subject: [PATCH] Add button to show/hide inactive streams --- assets/css/_overview.less | 33 +++++++++++++++++++++++++++++++++ assets/js/lustiges-script.js | 9 +++++---- template/overview.phtml | 7 +++++++ 3 files changed, 45 insertions(+), 4 deletions(-) diff --git a/assets/css/_overview.less b/assets/css/_overview.less index e7c341c3..d8a85c8d 100644 --- a/assets/css/_overview.less +++ b/assets/css/_overview.less @@ -115,6 +115,39 @@ body.overview { .panel-body h2 { margin: 0; } + + &.inactive-stream { + display: none; + } + } + + input.show-inactive { + display: none; + } + .show-inactive-toggle { + width: ~"calc(100% - 30px)"; + margin-left: 15px; + + .show-inactive-text { + display: inline; + } + .hide-inactive-text { + display: none; + } + } + input[type="checkbox"]:checked.show-inactive { + ~ .room { + display: block; + } + + ~ .show-inactive-toggle { + .show-inactive-text { + display: none; + } + .hide-inactive-text { + display: inline; + } + } } .recordings a { diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index 7833845d..a90929b2 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -303,7 +303,8 @@ $(function() { $(function() { var roomSelector = '.room.has-preview', - previewSelector = roomSelector + ' .preview'; + previewSelector = roomSelector + ' .preview', + inactiveClass = 'inactive-stream'; $(previewSelector).each(function() { var @@ -311,7 +312,7 @@ $(function() { $room = $teaser.parents(roomSelector); $teaser.on('error', function() { - $room.addClass('hidden'); + $room.addClass(inactiveClass); }); }); @@ -330,9 +331,9 @@ $(function() { $preload.on('load', function() { $teaser.prop('src', $preload.prop('src')); - $room.removeClass('hidden'); + $room.removeClass(inactiveClass); }).on('error', function() { - $room.addClass('hidden'); + $room.addClass(inactiveClass); }).prop('src', src + '?'+(new Date()).getTime()); }); }, 1000*60); diff --git a/template/overview.phtml b/template/overview.phtml index 3bbd832d..20da91f9 100644 --- a/template/overview.phtml +++ b/template/overview.phtml @@ -10,6 +10,7 @@
+
+ + hasReleases() || $conference->hasRelive()): ?>