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 event_info = (event) => {
|
|
|
|
const ti = serv.type_index(sol.eventType(event));
|
|
|
|
return html`
|
2023-11-02 02:59:42 +01:00
|
|
|
<div class="speaker_event_logo"></div>
|
2023-11-01 01:59:19 +01:00
|
|
|
<div class="speaker-box type-${ti}">
|
|
|
|
<div class="speaker">
|
|
|
|
<div class="names">${serv.fix_dash(serv.person_names_concat(sol.eventPersons(event)))}</div>
|
|
|
|
</div>
|
|
|
|
</div>`;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
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 thisRoom = config.roomName;
|
|
|
|
|
|
|
|
const events = sol.allEvents(schedule);
|
|
|
|
const eventsHere = sol.eventsByRoomName(events, thisRoom);
|
|
|
|
const eventsHereNow = sol.currentEvents(eventsHere, time);
|
|
|
|
|
|
|
|
const inner = html`
|
|
|
|
${eventsHereNow.slice(0,1).map(e => event_info(e))}`;
|
|
|
|
|
|
|
|
// Add main slide to frame
|
|
|
|
const anchorElId = "main";
|
|
|
|
const el = document.getElementById(anchorElId);
|
|
|
|
preact.render(inner, el);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export {
|
|
|
|
update_main_slide
|
|
|
|
};
|