mirror of
https://github.com/Kunsi/pretalx-plugin-broadcast-tools
synced 2025-04-04 23:34:36 +00:00
UX: show current time if no talk is currently running
This commit is contained in:
parent
283686feb3
commit
ade18a033e
1 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
function _left_zero_pad(i) {
|
||||||
|
if (i < 10) {
|
||||||
|
i = "0" + i;
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
|
||||||
function update_room_info() {
|
function update_room_info() {
|
||||||
room_name = get_room_name();
|
room_name = get_room_name();
|
||||||
|
|
||||||
|
@ -37,6 +44,7 @@ function update_room_info() {
|
||||||
|
|
||||||
current_talk = get_current_talk(60);
|
current_talk = get_current_talk(60);
|
||||||
next_talk = get_next_talk();
|
next_talk = get_next_talk();
|
||||||
|
now = new Date();
|
||||||
|
|
||||||
if (current_talk) {
|
if (current_talk) {
|
||||||
title.innerHTML = current_talk['title'];
|
title.innerHTML = current_talk['title'];
|
||||||
|
@ -45,7 +53,6 @@ function update_room_info() {
|
||||||
scheduledata.innerHTML += ' - ';
|
scheduledata.innerHTML += ' - ';
|
||||||
scheduledata.innerHTML += format_time_from_pretalx(current_talk['end']);
|
scheduledata.innerHTML += format_time_from_pretalx(current_talk['end']);
|
||||||
|
|
||||||
now = new Date();
|
|
||||||
scheduled_start = new Date(current_talk['start']);
|
scheduled_start = new Date(current_talk['start']);
|
||||||
scheduled_end = new Date(current_talk['end']);
|
scheduled_end = new Date(current_talk['end']);
|
||||||
|
|
||||||
|
@ -83,9 +90,10 @@ function update_room_info() {
|
||||||
progressbar_bar.style.width = '0';
|
progressbar_bar.style.width = '0';
|
||||||
speaker.innerHTML = 'Break';
|
speaker.innerHTML = 'Break';
|
||||||
timehint.innerHTML = '';
|
timehint.innerHTML = '';
|
||||||
timeleft.innerHTML = '';
|
|
||||||
title.innerHTML = room_name;
|
title.innerHTML = room_name;
|
||||||
|
|
||||||
|
timeleft.innerHTML = _left_zero_pad(now.getHours()) + ":" + _left_zero_pad(now.getMinutes()) + ":" + _left_zero_pad(now.getSeconds());
|
||||||
|
|
||||||
if (next_talk) {
|
if (next_talk) {
|
||||||
scheduledata.innerHTML = format_time_from_pretalx(next_talk['start']) + ' ' + next_talk['title'];
|
scheduledata.innerHTML = format_time_from_pretalx(next_talk['start']) + ' ' + next_talk['title'];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue