mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-08 01:07:06 +01:00
* migrate to esbuild from terser, since now js source needs bundling * (temporary?) hijack inline-source object handling to inline html files * get rid of legacy removeIf comments in source in favour of explicit removal either through bundling tree-shaking and / or manual module-* class element removal w/ jsdom * get rid of multi-layered custom checkboxes in favour of `appearance: none` directly styling the `input` elem also removes scripting part that was supposed to adjust for=... labels * update to html-minifier-terser, up-to-date html-minifier fork * update to iro.js 5.5.x, using npm to manage dependencies * build script can now update resulting html output (called after bundling stage, before minification)
27 lines
725 B
JavaScript
27 lines
725 B
JavaScript
import { addFromTemplate } from './template.mjs';
|
|
import { groupSettingsOnAdd, variableListeners, fromSchema } from './settings.mjs';
|
|
|
|
function addNode(cfg) {
|
|
addFromTemplate(document.getElementById("schedules"), "schedule-config", cfg);
|
|
}
|
|
|
|
function listeners() {
|
|
return {
|
|
"schConfig": (_, value) => {
|
|
let container = document.getElementById("schedules");
|
|
container.dataset["settingsMax"] = value.max;
|
|
|
|
value.schedules.forEach((entries) => {
|
|
addNode(fromSchema(entries, value.schema));
|
|
});
|
|
},
|
|
};
|
|
}
|
|
|
|
export function init() {
|
|
variableListeners(listeners());
|
|
groupSettingsOnAdd("schedules", () => {
|
|
addNode();
|
|
});
|
|
}
|