mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2025-04-29 03:00:58 +00:00
add "room info" url to show on room info screens
This commit is contained in:
parent
327981eade
commit
de8065cf22
9 changed files with 238 additions and 81 deletions
|
@ -2,6 +2,43 @@
|
|||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 1.2em;
|
||||
color: white;
|
||||
font-family: "Muli","Open Sans","OpenSans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: black;
|
||||
}
|
||||
|
||||
#broadcast_tools_room_info {
|
||||
display: flex;
|
||||
flex-flow: column;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
#broadcast_tools_room_info_header, #broadcast_tools_room_info_qr {
|
||||
padding: 2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#broadcast_tools_room_info_title {
|
||||
font-size: 6em;
|
||||
margin-bottom: 0.2em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#broadcast_tools_room_info_speaker {
|
||||
font-size: 3em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#broadcast_tools_room_info_qr {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
#broadcast_tools_room_info_qr img {
|
||||
background-color: white;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#l3box {
|
||||
|
@ -11,9 +48,6 @@
|
|||
bottom: 80px;
|
||||
left: 50%;
|
||||
margin-left: -510px;
|
||||
|
||||
color: white;
|
||||
font-family: "Muli","Open Sans","OpenSans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
padding: 15px;
|
||||
|
||||
box-shadow: 5px 5px 10px 0px rgba(50, 50, 50, 0.75);
|
||||
|
|
|
@ -1,42 +1,11 @@
|
|||
schedule = null;
|
||||
room_name = null;
|
||||
event_info = null;
|
||||
|
||||
$(function() {
|
||||
$('#l3speaker').text('Content will appear soon.');
|
||||
});
|
||||
function get_current_talk() {
|
||||
room_name = get_room_name();
|
||||
|
||||
function update_lower_third() {
|
||||
try {
|
||||
hash = decodeURIComponent(window.location.hash.substring(1));
|
||||
room_name = hash;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
return
|
||||
}
|
||||
|
||||
if (!event_info) {
|
||||
console.warn("Waiting for event info ...");
|
||||
return
|
||||
}
|
||||
|
||||
if (!schedule) {
|
||||
$('#l3title').text('Waiting for schedule ...')
|
||||
return
|
||||
}
|
||||
|
||||
if ('error' in schedule) {
|
||||
$('#l3title').text('Error')
|
||||
$('#l3speaker').html(schedule['error'].join('<br>'));
|
||||
$('#l3info_line').text('');
|
||||
return
|
||||
}
|
||||
|
||||
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
|
||||
$('#l3title').text('Error')
|
||||
$('#l3speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
|
||||
$('#l3info_line').text('');
|
||||
return
|
||||
if (!room_name) {
|
||||
return null;
|
||||
}
|
||||
|
||||
current_talk = null;
|
||||
|
@ -67,29 +36,23 @@ function update_lower_third() {
|
|||
}
|
||||
}
|
||||
|
||||
if (current_talk) {
|
||||
$('#l3title').text(current_talk['title']);
|
||||
$('#l3speaker').text(current_talk['persons'].join(', '));
|
||||
$('#l3info_line').text(current_talk['infoline']);
|
||||
} else {
|
||||
$('#l3title').text(event_info['no_talk']);
|
||||
$('#l3speaker').text('');
|
||||
$('#l3info_line').text('');
|
||||
}
|
||||
|
||||
if (current_talk && current_talk['track']) {
|
||||
$('#l3box').css('border-bottom', '10px solid ' + current_talk['track']['color']);
|
||||
} else {
|
||||
$('#l3box').css('border-bottom', 'none');
|
||||
}
|
||||
return current_talk;
|
||||
}
|
||||
|
||||
function get_room_name() {
|
||||
room_name = null;
|
||||
try {
|
||||
hash = decodeURIComponent(window.location.hash.substring(1));
|
||||
room_name = hash;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
return room_name;
|
||||
}
|
||||
window.setInterval(update_lower_third, 1000);
|
||||
|
||||
function update_schedule() {
|
||||
$.getJSON('../event.json', function(data) {
|
||||
event_info = data;
|
||||
|
||||
$('#l3box').css('background-color', data['color']);
|
||||
});
|
||||
$.getJSON('../schedule.json', function(data) {
|
||||
if ('error' in data) {
|
|
@ -0,0 +1,45 @@
|
|||
function update_lower_third() {
|
||||
room_name = get_room_name();
|
||||
|
||||
if (!event_info) {
|
||||
console.warn("Waiting for event info ...");
|
||||
return
|
||||
}
|
||||
|
||||
if (!schedule) {
|
||||
$('#l3title').text('Waiting for schedule ...')
|
||||
return
|
||||
}
|
||||
|
||||
if ('error' in schedule) {
|
||||
$('#l3title').text('Error')
|
||||
$('#l3speaker').html(schedule['error'].join('<br>'));
|
||||
$('#l3info_line').text('');
|
||||
return
|
||||
}
|
||||
|
||||
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
|
||||
$('#l3title').text('Error')
|
||||
$('#l3speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
|
||||
$('#l3info_line').text('');
|
||||
return
|
||||
}
|
||||
|
||||
current_talk = get_current_talk();
|
||||
if (current_talk) {
|
||||
$('#l3title').text(current_talk['title']);
|
||||
$('#l3speaker').text(current_talk['persons'].join(', '));
|
||||
$('#l3info_line').text(current_talk['infoline']);
|
||||
} else {
|
||||
$('#l3title').text(event_info['no_talk']);
|
||||
$('#l3speaker').text('');
|
||||
$('#l3info_line').text('');
|
||||
}
|
||||
|
||||
if (current_talk && current_talk['track']) {
|
||||
$('#l3box').css('border-bottom', '10px solid ' + current_talk['track']['color']);
|
||||
} else {
|
||||
$('#l3box').css('border-bottom', 'none');
|
||||
}
|
||||
}
|
||||
window.setInterval(update_lower_third, 1000);
|
|
@ -0,0 +1,51 @@
|
|||
$(function() {
|
||||
$('#broadcast_tools_room_info_title').text('Content will appear soon.');
|
||||
$('#broadcast_tools_room_info_speaker').text('');
|
||||
$('#broadcast_tools_room_info_qr').text('');
|
||||
});
|
||||
|
||||
function update_room_info() {
|
||||
room_name = get_room_name();
|
||||
|
||||
if (!event_info) {
|
||||
console.warn("Waiting for event info ...");
|
||||
return
|
||||
}
|
||||
|
||||
if (!schedule) {
|
||||
$('#broadcast_tools_room_info_speaker').text('Waiting for schedule ...')
|
||||
return
|
||||
}
|
||||
|
||||
if ('error' in schedule) {
|
||||
$('#broadcast_tools_room_info_title').text('Error')
|
||||
$('#broadcast_tools_room_info_speaker').html(schedule['error'].join('<br>'));
|
||||
$('#broadcast_tools_room_info_qr').text('');
|
||||
return
|
||||
}
|
||||
|
||||
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
|
||||
$('#broadcast_tools_room_info_title').text('Error')
|
||||
$('#broadcast_tools_room_info_speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
|
||||
$('#broadcast_tools_room_info_qr').text('');
|
||||
return
|
||||
}
|
||||
|
||||
current_talk = get_current_talk();
|
||||
if (current_talk) {
|
||||
$('#broadcast_tools_room_info_title').text(current_talk['title']);
|
||||
$('#broadcast_tools_room_info_speaker').text(current_talk['persons'].join(', '));
|
||||
$('#broadcast_tools_room_info_qr').html('<img src="' + current_talk['feedback_qr_url'] + '" alt="Feedback QR Code">');
|
||||
} else {
|
||||
$('#broadcast_tools_room_info_title').text(event_info['no_talk']);
|
||||
$('#broadcast_tools_room_info_speaker').text('');
|
||||
$('#broadcast_tools_room_info_qr').text('');
|
||||
}
|
||||
|
||||
if (current_talk && current_talk['track']) {
|
||||
$('#broadcast_tools_room_info').css('background-color', current_talk['track']['color']);
|
||||
} else {
|
||||
$('#broadcast_tools_room_info').css('background-color', event_info['color']);
|
||||
}
|
||||
}
|
||||
window.setInterval(update_room_info, 1000);
|
Loading…
Add table
Add a link
Reference in a new issue