html5-infobeamer-aalen-geek.../assets/js/custom/dom/voc-speaker.js

64 lines
1.3 KiB
JavaScript
Raw Permalink Normal View History

2023-11-01 01:59:19 +01:00
'use strict';
import * as sol from "../../solight/sol.js";
import * as serv from "../services/general.js";
const html = htm.bind(preact.h);
const person_row = (events, person) =>
html`
<tr>
<td>${sol.personName(person)}</td>
</tr>`;
const persons_table = (events, persons) => {
const ps = sol.sortPersonsByName(persons);
return html`
<h2>Speakers</h2>
<table>
<tr>
<th>Name</th>
</tr>
${ps.map(p => person_row(events, p))}
</table>`;
};
const persons_overview = (schedule) => {
const persons = sol.allPersons(schedule);
const events = sol.allEvents(schedule);
return html`
<h1>Schedule (v ${sol.scheduleVersion(schedule)})</h1>
${persons_table(events, persons)}`;
};
const update_main_slide = (data, time, config) => {
// console.group("Updating Main Slide with:");
// console.info(data);
// console.info(time);
// console.info(config);
// console.groupEnd();
if (sol.defined(data.scheduleData)) {
const schedule = data.scheduleData;
const inner = html`
${persons_overview(schedule)}`;
// Add main slide to frame
const anchorElId = "main";
const el = document.getElementById(anchorElId);
preact.render(inner, el);
};
};
export {
update_main_slide
};