58 lines
1.3 KiB
TypeScript
58 lines
1.3 KiB
TypeScript
namespace _zeitbild.frontend_web.pages
|
|
{
|
|
|
|
/**
|
|
*/
|
|
lib_plankton.zoo_page.register(
|
|
"events",
|
|
async (parameters, target_element) => {
|
|
const content : string = await _zeitbild.frontend_web.view.calendar_view_table_html(
|
|
{
|
|
"calendar_ids": null,
|
|
// TODO
|
|
"from": {
|
|
"year": 2024,
|
|
"week": 37
|
|
},
|
|
// TODO
|
|
"to": {
|
|
"year": 2024,
|
|
"week": 43
|
|
},
|
|
"timezone_shift": /*conf.timezone_shift*/0,
|
|
}
|
|
);
|
|
target_element.innerHTML = content;
|
|
target_element.querySelectorAll(".calendar-event_entry").forEach(
|
|
(element) => {
|
|
element.addEventListener(
|
|
"click",
|
|
() => {
|
|
const rel : string = element.getAttribute("rel");
|
|
const parts : Array<string> = rel.split("/");
|
|
const calendar_id : _zeitbild.frontend_web.type.calendar_id = parseInt(parts[0]);
|
|
const event_id : (null | _zeitbild.frontend_web.type.local_resource_event_id) = (
|
|
(parts[1] === "-")
|
|
?
|
|
null
|
|
:
|
|
parseInt(parts[1])
|
|
);
|
|
lib_plankton.zoo_page.set(
|
|
{
|
|
"name": "event_edit",
|
|
"parameters": {
|
|
"calendar_id": calendar_id,
|
|
"event_id": event_id,
|
|
}
|
|
}
|
|
);
|
|
}
|
|
);
|
|
}
|
|
);
|
|
return Promise.resolve<void>(undefined);
|
|
},
|
|
);
|
|
|
|
}
|