1
0
Fork 0
mirror of https://github.com/Kunsi/pretalx-plugin-broadcast-tools synced 2025-04-29 08:20:58 +00:00

rename plugin to 'pretalx_broadcast_tools'

This commit is contained in:
Franzi 2021-11-22 12:09:01 +01:00
parent 7c5e58023c
commit 213db3f640
Signed by: kunsi
GPG key ID: 12E3D2136B818350
17 changed files with 81 additions and 82 deletions

View file

@ -0,0 +1,36 @@
* {
margin: 0;
padding: 0;
line-height: 1.2em;
}
#box {
width: 1020px;
position: absolute;
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);
background-color: #3aa57c;
}
#title {
font-size: 30px;
font-weight: 500;
margin-bottom: 15px;
}
#speaker {
font-size: 20px;
}
#info_line {
font-size: 16px;
text-align: right;
}

View file

@ -0,0 +1,82 @@
schedule = null;
room_name = null;
event_info = null;
$(function() {
$('#speaker').text('Content will appear soon.');
});
function update_lower_third() {
current_time = new Date(Date.now()).getTime()
try {
hash = decodeURIComponent(window.location.hash.substring(1));
room_name = hash;
} catch (e) {
console.error(e);
return
}
if (!schedule || !event_info) {
console.warn("There's no schedule or no event info yet, exiting ...");
return
}
if (schedule['rooms'].length > 1 && !schedule['rooms'].includes(room_name)) {
$('#title').text('Error')
$('#speaker').text('Invalid room_name. Valid names: ' + schedule['rooms'].join(', '));
return
}
current_talk = null;
for (talk_i in schedule['talks']) {
talk = schedule['talks'][talk_i]
if (schedule['rooms'].length > 1 && talk['room'] != room_name) {
// not in this room
continue;
}
talk_start = new Date(talk['start']).getTime();
talk_end = new Date(talk['end']).getTime();
if (talk_start < current_time && talk_end > current_time) {
current_talk = talk;
}
}
if (current_talk) {
$('#title').text(current_talk['title']);
$('#speaker').text(current_talk['persons'].join(', '));
$('#info_line').text(current_talk['infoline']);
} else {
$('#title').text(event_info['no_talk']);
$('#speaker').text('');
$('#info_line').text('');
}
if (current_talk && current_talk['track']) {
$('#box').css('border-bottom', '10px solid ' + current_talk['track']['color']);
} else {
$('#box').css('border-bottom', 'none');
}
}
window.setInterval(update_lower_third, 1000);
function update_schedule() {
$.getJSON('../event.json', function(data) {
event_info = data;
$('#box').css('background-color', data['color']);
});
$.getJSON('../schedule.json', function(data) {
console.info('schedule updated with ' + data['talks'].length + ' talks in ' + data['rooms'].length + ' rooms');
schedule = data;
window.setTimeout(update_schedule, 30000);
});
}
update_schedule();