Compare commits

..

4 commits

Author SHA1 Message Date
fenris b3a25c42d7 Merge branch 'temp-20251021' 2025-10-22 00:42:55 +02:00
fenris cb8b48c818 [del] old style sheets 2025-10-22 00:42:34 +02:00
fenris f97c33de1e [int] 2025-10-22 00:41:22 +02:00
fenris 76e2e0560f [int] 2025-10-21 23:06:11 +02:00
13 changed files with 959 additions and 985 deletions

View file

@ -226,9 +226,10 @@ declare namespace lib_plankton.base {
function object_merge(core: Record<string, any>, mantle: Record<string, any>): Record<string, any>;
/**
*/
function buffer_show(buffer: Buffer, { "block_size": option_block_size, "break_char": option_break_char, }?: {
function buffer_show(buffer: Buffer, { "block_size": option_block_size, "break_char": option_break_char, "render_readable_characters": render_readable_characters, }?: {
block_size?: int;
break_char?: string;
render_readable_characters?: boolean;
}): string;
}
declare module lib_plankton.pod {
@ -4224,6 +4225,59 @@ declare namespace lib_plankton.zoo_input {
/**
*/
write(value: type_value): Promise<void>;
/**
*/
lock(mode: boolean): Promise<void>;
/**
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
/**
* @author fenris
*/
abstract class class_input_simple<type_value> implements interface_input<type_value> {
/**
*/
private dom_input;
/**
*/
private type;
/**
*/
private decode;
/**
*/
private encode;
/**
*/
private additional_attributes?;
/**
*/
constructor(type: string, decode: ((representation: string) => type_value), encode: ((value: type_value) => string), { "additional_attributes": additional_attributes, }?: {
additional_attributes?: Record<string, (null | string)>;
});
/**
* [implementation]
*/
setup(parent: HTMLElement): Promise<void>;
/**
* [implementation]
*/
read(): Promise<type_value>;
/**
* [implementation]
*/
write(value: type_value): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4255,6 +4309,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: type_value_outer): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4262,6 +4324,9 @@ declare namespace lib_plankton.zoo_input {
* @author fenris
*/
class class_input_soft<type_value_core> implements interface_input<(null | type_value_core)> {
/**
*/
private read_only;
/**
*/
private core;
@ -4273,7 +4338,9 @@ declare namespace lib_plankton.zoo_input {
private dom_wrapper;
/**
*/
constructor(core: interface_input<type_value_core>, options?: {});
constructor(core: interface_input<type_value_core>, { "read_only": read_only, }?: {
read_only?: boolean;
});
/**
*/
private toggle;
@ -4289,6 +4356,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: (null | type_value_core)): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4304,7 +4379,7 @@ declare namespace lib_plankton.zoo_input {
private value;
/**
*/
constructor(options?: {
constructor({ "initial_value": initial_value, }?: {
initial_value?: any;
});
/**
@ -4319,6 +4394,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: any): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4326,61 +4409,22 @@ declare namespace lib_plankton.zoo_input {
* @author fenris
* @todo abstract
*/
class class_input_text implements interface_input<string> {
class class_input_text extends class_input_simple<string> implements interface_input<string> {
/**
*/
private read_only;
/**
*/
private pattern;
/**
*/
/**
*/
private dom_input;
/**
*/
constructor(options?: {
read_only?: boolean;
constructor({ "pattern": pattern, }?: {
pattern?: (null | string);
});
/**
* [implementation]
*/
setup(parent: HTMLElement): Promise<void>;
/**
* [implementation]
*/
read(): Promise<string>;
/**
* [implementation]
*/
write(value: string): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
/**
* @author fenris
*/
class class_input_email implements interface_input<string> {
/**
*/
private dom_input;
class class_input_email extends class_input_simple<string> implements interface_input<string> {
/**
*/
constructor();
/**
* [implementation]
*/
setup(parent: HTMLElement): Promise<void>;
/**
* [implementation]
*/
read(): Promise<string>;
/**
* [implementation]
*/
write(value: string): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4406,6 +4450,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: string): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4421,7 +4473,7 @@ declare namespace lib_plankton.zoo_input {
private dom_input;
/**
*/
constructor(options?: {
constructor({ "required": required, }?: {
required?: boolean;
});
/**
@ -4436,6 +4488,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: (null | lib_plankton.pit.type_date)): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4443,34 +4503,12 @@ declare namespace lib_plankton.zoo_input {
* @author fenris
* @todo abstract
*/
class class_input_number implements interface_input<number> {
class class_input_number extends class_input_simple<number> implements interface_input<number> {
/**
*/
private read_only;
/**
*/
private step;
/**
*/
private dom_input;
/**
*/
constructor(options?: {
read_only?: boolean;
constructor({ "step": step, }?: {
step?: (null | float);
});
/**
* [implementation]
*/
setup(parent: HTMLElement): Promise<void>;
/**
* [implementation]
*/
read(): Promise<number>;
/**
* [implementation]
*/
write(value: number): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4478,21 +4516,12 @@ declare namespace lib_plankton.zoo_input {
* @author fenris
*/
class class_input_checkbox implements interface_input<boolean> {
/**
*/
private read_only;
/**
*/
private dom_input;
/**
*/
private hooks_change;
/**
*/
constructor(options?: {
read_only?: boolean;
hooks_change?: Array<((value: boolean) => void)>;
});
constructor();
/**
* [implementation]
*/
@ -4505,6 +4534,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: boolean): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4536,13 +4573,27 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: string): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
/**
* @author fenris
*/
class class_input_enumeration implements interface_input<string> {
class class_input_enumeration<type_value> implements interface_input<type_value> {
/**
*/
private encode_value;
/**
*/
private decode_value;
/**
*/
private options;
@ -4551,8 +4602,8 @@ declare namespace lib_plankton.zoo_input {
private dom_inputs;
/**
*/
constructor(options: Array<{
value: string;
constructor(encode_value: ((value: type_value) => string), decode_value: ((representation: string) => type_value), options: Array<{
value: type_value;
label: string;
}>);
/**
@ -4563,11 +4614,19 @@ declare namespace lib_plankton.zoo_input {
/**
* [implementation]
*/
read(): Promise<string>;
read(): Promise<type_value>;
/**
* [implementation]
*/
write(value: string): Promise<void>;
write(value: type_value): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4598,7 +4657,10 @@ declare namespace lib_plankton.zoo_input {
private translations;
/**
*/
constructor(element_input_factory: (() => interface_input<type_element>), options?: {
private locked;
/**
*/
constructor(element_input_factory: (() => interface_input<type_element>), { "read_only": read_only, "translations": translations, }?: {
read_only?: boolean;
translations?: type_translations;
});
@ -4620,6 +4682,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: Array<type_element>): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
export {};
}
@ -4656,6 +4726,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: Set<string>): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4700,6 +4778,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: string): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4715,7 +4801,15 @@ declare namespace lib_plankton.zoo_input {
private value;
/**
*/
constructor();
private symbols;
/**
*/
constructor({ "symbols": symbols, }?: {
symbols?: {
yes: string;
no: string;
};
});
/**
* [implementation]
*/
@ -4728,31 +4822,24 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: boolean): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
/**
* @author fenris
*/
class class_input_time implements interface_input<(null | lib_plankton.pit.type_time)> {
/**
*/
private dom_input;
class class_input_time extends class_input_simple<(null | lib_plankton.pit.type_time)> implements interface_input<(null | lib_plankton.pit.type_time)> {
/**
*/
constructor();
/**
* [implementation]
*/
setup(parent: HTMLElement): Promise<void>;
/**
* [implementation]
*/
read(): Promise<(null | lib_plankton.pit.type_time)>;
/**
* [implementation]
*/
write(value: (null | lib_plankton.pit.type_time)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4783,12 +4870,20 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(value: type_record): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
/**
*/
class class_input_hashmap<type_key, type_value> implements lib_plankton.zoo_input.interface_input<lib_plankton.map.type_map<type_key, type_value>> {
class class_input_hashmap<type_key, type_value> implements interface_input<lib_plankton.map.type_map<type_key, type_value>> {
/**
*/
private hash_key;
@ -4797,7 +4892,7 @@ declare namespace lib_plankton.zoo_input {
private core;
/**
*/
constructor(hash_key: ((key: type_key) => string), key_input_factory: (() => lib_plankton.zoo_input.interface_input<type_key>), value_input_factory: (() => lib_plankton.zoo_input.interface_input<type_value>));
constructor(hash_key: ((key: type_key) => string), key_input_factory: (() => interface_input<type_key>), value_input_factory: (() => interface_input<type_value>));
/**
* [implementation]
*/
@ -4810,6 +4905,14 @@ declare namespace lib_plankton.zoo_input {
* [implementation]
*/
write(map: lib_plankton.map.type_map<type_key, type_value>): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4835,6 +4938,14 @@ declare namespace lib_plankton.zoo_input {
/**
*/
write(value: lib_plankton.pit.type_datetime): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4847,7 +4958,7 @@ declare namespace lib_plankton.zoo_input {
private core;
/**
*/
constructor(options?: {
constructor({ "label_date": label_date, "label_time": label_time, }?: {
label_date?: string;
label_time?: string;
});
@ -4860,30 +4971,23 @@ declare namespace lib_plankton.zoo_input {
/**
*/
write(value: lib_plankton.pit.type_datetime): Promise<void>;
/**
* [implementation]
*/
lock(mode: boolean): Promise<void>;
/**
* [implementation]
*/
hook_change(action: (() => void)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
/**
*/
class class_input_color implements interface_input<(null | lib_plankton.color.type_color)> {
/**
*/
private dom_input;
class class_input_color extends class_input_simple<(null | lib_plankton.color.type_color)> implements interface_input<(null | lib_plankton.color.type_color)> {
/**
*/
constructor();
/**
* [implementation]
*/
setup(parent: HTMLElement): Promise<void>;
/**
* [implementation]
*/
read(): Promise<(null | lib_plankton.color.type_color)>;
/**
* [implementation]
*/
write(value: (null | lib_plankton.color.type_color)): Promise<void>;
}
}
declare namespace lib_plankton.zoo_input {
@ -4919,7 +5023,7 @@ declare namespace lib_plankton.zoo_form {
name: string;
type: string;
label?: (null | string);
}>, encode: ((value: type_value) => Record<string, string>), decode: ((raw: Record<string, string>) => type_value), options?: {
}>, encode: ((value: type_value) => Record<string, string>), decode: ((raw: Record<string, string>) => type_value), { "class_prefix": class_prefix, }?: {
class_prefix?: string;
}): type_form<type_value>;
/**
@ -4984,6 +5088,9 @@ declare namespace lib_plankton.zoo_form {
/**
*/
input_write(value: type_value): Promise<void>;
/**
*/
input_lock(mode: boolean): Promise<void>;
}
export {};
}

File diff suppressed because it is too large Load diff

View file

@ -36,13 +36,18 @@ namespace _dali.pages.overview
}
/**
* @todo add return type
*/
async function get_available_calendars(
)
: Promise<
Array<
_dali.type_calendar_object_reduced_with_id
>
>
{
return (
(await _dali.model.calendar_list())
/*
.filter(
(entry) => (
(entry.access_level === _dali.enum_access_level.edit)
@ -50,6 +55,7 @@ namespace _dali.pages.overview
(entry.access_level === _dali.enum_access_level.admin)
)
)
*/
);
}
@ -131,6 +137,29 @@ namespace _dali.pages.overview
{
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
await _dali.model.user_list(),
{
"name": "",
"hue": lib_plankton.random.generate_unit(),
"access": {
"public": false,
"default_level": _dali.enum_access_level.view,
"attributed": lib_plankton.map.hashmap.implementation_map<
_dali.type_user_id,
_dali.enum_access_level
>(
lib_plankton.map.hashmap.make<
_dali.type_user_id,
_dali.enum_access_level
>(
user_id => user_id.toFixed(0),
)
),
},
/**
* @todo
*/
"resource_id": 0,
},
{
"read_only": false,
"action_cancel": () => {
@ -155,7 +184,6 @@ namespace _dali.pages.overview
}
);
},
"initial_value": null,
}
);
_dali.overlay.clear();
@ -163,6 +191,88 @@ namespace _dali.pages.overview
await widget.load(_dali.overlay.get_content_element());
}
/**
*/
async function action_edit_calendar(
calendar_object_reduced_with_id : type_calendar_object_reduced_with_id
)
: Promise<void>
{
const read_only : boolean = (() => {
switch (calendar_object_reduced_with_id.access_level)
{
case _dali.enum_access_level.none:
{
throw (new Error("this event should not be visible"));
break;
}
case _dali.enum_access_level.edit:
case _dali.enum_access_level.view:
{
return true;
break;
}
case _dali.enum_access_level.admin:
{
return false;
break;
}
}
}) ();
if (read_only)
{
lib_plankton.log.notice(
"dali.overview.may_not_edit_calendar",
{
"calendar_id": calendar_object_reduced_with_id.id,
}
);
}
else
{
const calendar_id : _dali.type_calendar_id = calendar_object_reduced_with_id.id;
const calendar_object : _dali.type_calendar_object = await _dali.model.calendar_get(
calendar_id
);
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
await _dali.model.user_list(),
calendar_object,
{
"read_only": read_only,
"action_cancel": () => {
_dali.overlay.toggle({"mode": false});
},
"action_change": (data) => {
_dali.model.calendar_change(
calendar_id,
data
)
.then(
() => {
update_sources_and_entries();
_dali.overlay.toggle({"mode": false});
}
);
},
"action_remove": (data) => {
_dali.model.calendar_remove(
calendar_id
)
.then(
() => {
update_sources_and_entries();
_dali.overlay.toggle({"mode": false});
}
);
},
}
);
_dali.overlay.clear();
_dali.overlay.toggle({"mode": true});
await widget.load(_dali.overlay.get_content_element());
}
}
/**
* @todo unterschiedliches Verhalten bei Anmeldung?
*/
@ -253,27 +363,15 @@ namespace _dali.pages.overview
/**
*/
async function action_select_event
async function action_edit_event
(
event_key : _dali.type_event_key
)
: Promise<void>
{
const event_object_extended : _dali.type_event_object_extended = await _dali.model.event_get(event_key);
const calendar_id = event_object_extended.calendar_id;
const access_level = event_object_extended.access_level;
const event_id = event_object_extended.event_id;
/*
if (! _dali.is_logged_in())
{
// do nothing
}
else
{
}
*/
let read_only : boolean;
switch (access_level)
const read_only : boolean = (() => {
switch (event_object_extended.access_level)
{
case _dali.enum_access_level.none:
{
@ -282,31 +380,27 @@ namespace _dali.pages.overview
}
case _dali.enum_access_level.view:
{
read_only = true;
return true;
break;
}
case _dali.enum_access_level.edit:
case _dali.enum_access_level.admin:
{
read_only = false;
return false;
break;
}
}
(async () => {
const event_object : _dali.type_event_object = await _dali.backend.calendar_event_get(
calendar_id,
event_id
);
}) ();
const widget = new _dali.widgets.event_edit.class_widget_event_edit(
(await get_available_calendars()),
{
"calendar_id": calendar_id,
"event_name": event_object.name,
"event_begin": event_object.begin,
"event_end": event_object.end,
"event_location": event_object.location,
"event_link": event_object.link,
"event_description": event_object.description,
"calendar_id": event_object_extended.calendar_id,
"event_name": event_object_extended.event_object.name,
"event_begin": event_object_extended.event_object.begin,
"event_end": event_object_extended.event_object.end,
"event_location": event_object_extended.event_object.location,
"event_link": event_object_extended.event_object.link,
"event_description": event_object_extended.event_object.description,
},
{
"read_only": read_only,
@ -361,10 +455,10 @@ namespace _dali.pages.overview
},
}
);
_dali.overlay.clear();
_dali.overlay.toggle({"mode": true});
await widget.load(_dali.overlay.get_content_element());
}) ();
}
// hint
@ -412,72 +506,9 @@ namespace _dali.pages.overview
_dali.model.calendar_list,
{
"initial_priviliged": _dali.is_logged_in(),
"action_create": action_create_calendar,
"action_open": (entry) => {
let read_only : boolean;
switch (entry.access_level)
{
case _dali.enum_access_level.none:
{
throw (new Error("this event should not be visible"));
break;
}
case _dali.enum_access_level.edit:
case _dali.enum_access_level.view:
{
read_only = true;
break;
}
case _dali.enum_access_level.admin:
{
read_only = false;
break;
}
}
(async () => {
const calendar_id : _dali.type_calendar_id = entry.id;
const calendar_object : _dali.type_calendar_object = await _dali.model.calendar_get(
calendar_id
);
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
await _dali.model.user_list(),
{
"read_only": read_only,
"action_cancel": () => {
_dali.overlay.toggle({"mode": false});
},
"action_change": (data) => {
_dali.model.calendar_change(
calendar_id,
data
)
.then(
() => {
update_sources_and_entries();
_dali.overlay.toggle({"mode": false});
}
);
},
"action_remove": (data) => {
_dali.model.calendar_remove(
calendar_id
)
.then(
() => {
update_sources_and_entries();
_dali.overlay.toggle({"mode": false});
}
);
},
"initial_value": calendar_object,
}
);
_dali.overlay.clear();
_dali.overlay.toggle({"mode": true});
await widget.load(_dali.overlay.get_content_element());
}) ();
},
"action_toggle_visibility": (entry, mode) => {
"action_add": action_create_calendar,
"action_select": (entry) => action_edit_calendar(entry),
"action_toggle": (entry, mode) => {
widget_weekview.toggle_visibility(entry.id, {"mode": mode});
widget_listview.toggle_visibility(entry.id, {"mode": mode});
},
@ -492,7 +523,7 @@ namespace _dali.pages.overview
new _dali.widgets.weekview.class_widget_weekview(
get_entries,
{
"action_select_event": (event_key) => action_select_event(event_key),
"action_select_event": (event_key) => action_edit_event(event_key),
"action_select_day": (date) => action_create_event({"date": date}),
}
)
@ -506,7 +537,7 @@ namespace _dali.pages.overview
new _dali.widgets.listview.class_widget_listview(
get_entries,
{
"action_select": (event_key) => action_select_event(event_key),
"action_select": (event_key) => action_edit_event(event_key),
"action_add": () => action_create_event(),
}
)

View file

@ -1,22 +0,0 @@
.caldav-conf-section
{
margin-bottom: 16px;
}
.caldav-conf-section-label
{
margin-left: 16px;
display: block;
font-weight: bold;
text-transform: capitalize;
}
.caldav-conf-section-value
{
margin-left: 32px;
}
.caldav-conf-section-value-regular
{
font-family: monospace;
}

View file

@ -1,46 +0,0 @@
#overview-head
{
padding-bottom: 12px;
margin-bottom: 12px;
border-bottom: 2px solid;
}
#overview-hint
{
text-align: center;
font-weight: bold;
}
#overview-hint.overview-hint-hidden
{
display: none;
}
#overview-body
{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
#overview-body #overview-pane-left
{
flex-grow: 0;
flex-shrink: 1;
}
#overview-body #overview-pane-right
{
flex-grow: 1;
flex-shrink: 1;
}
#overview.overview-compact #overview-pane-left {flex-basis: 25%;}
#overview.overview-compact #overview-pane-right {flex-basis: 75%;}
#overview.overview-compact #overview-pane-right-listview {}
#overview.overview-compact #overview-pane-right-weekview {display: none;}
#overview:not(.overview-compact) #overview-pane-left {flex-basis: 12.5%;}
#overview:not(.overview-compact) #overview-pane-right {flex-basis: 87.5%;}
#overview:not(.overview-compact) #overview-pane-right-listview {display: none;}
#overview:not(.overview-compact) #overview-pane-right-weekview {}

View file

@ -1,62 +0,0 @@
.listview-add
{
/*
text-transform: capitalize;
*/
}
.listview-add-hidden
{
display: none;
}
.listview-entries
{
padding: 0;
margin: 0;
list-style-type: none;
}
.listview-entry
{
background: hsl(0,0%,25%);
padding: 12px;
border-radius: 4px;
margin: 12px;
cursor: pointer;
}
.listview-entry-hidden
{
display: none;
}
.listview-entry-name
{
font-weight: bold;
font-size: 1.25em;
}
.listview-entry-label
{
font-weight: bold;
}
.listview-entry-label::before
{
content: "[";
}
.listview-entry-label::after
{
content: "] ";
}
.listview-entry-field-empty {
display: none;
}
.listview-entry-field:not(:last-child)
{
margin-bottom: 16px;
}

View file

@ -1,75 +0,0 @@
.widget-menu
{
margin-left: auto;
margin-right: 8px;
width: fit-content;
}
.widget-menu.widget-menu-collapsed > .widget-menu-platform
{
display: none;
}
.widget-menu-button
{
text-transform: initial;
}
.widget-menu-entry
{
cursor: pointer;
}
.widget-menu-platform
{
background-color: hsl(var(--hue), 0%, 25%);
border-radius: 2px;
border: 1px solid hsl(var(--hue), 0%, 0%);
padding: 8px;
min-width: 200px;
}
.widget-menu-platform:not(.widget-menu-platform-collapsed)
{
position: fixed;
top: 32px;
right: 32px;
z-index: 2;
}
.widget-menu-entries
{
padding: 0;
margin: 0;
list-style-type: none;
}
.widget-menu-entry
{
margin: 12px 16px;
padding: 8px;
text-transform: capitalize;
}
.widget-menu-entry:not(:hover)
{
background-color: hsl(var(--hue), 0%, 25%);
color: hsl(var(--hue), 0%, 100%);
}
.widget-menu-entry:hover::after
{
content: " «";
/*
background-color: hsl(var(--hue), 0%, 50%);
color: hsl(var(--hue), 0%, 100%);
*/
}
.widget-menu-entry.widget-menu-entry-hidden
{
display: none;
}

View file

@ -1,66 +0,0 @@
.sources
{
font-size: 0.75em;
}
.sources:not(.sources-priviliged) > .sources-create
{
display: none;
}
.sources-create
{
margin-left: 8px;
}
.sources-entries
{
margin: 0;
padding: 0;
list-style-type: none;
}
.sources-entry
{
margin: 8px;
padding: 4px;
}
.sources-entry-head
{
cursor: pointer;
}
.sources-entry-body
{
display: block;
transition: max-height ease 0.5s;
}
.sources-entry-body > ul
{
list-style-type: none;
padding: 0;
margin-left: 8px;
margin-bottom: 8px;
}
.sources-entry-body > ul > li
{
/*
display: block;
*/
margin-top: 8px;
cursor: pointer;
}
.sources-entry:not(.sources-entry-open) > .sources-entry-head {}
.sources-entry:not(.sources-entry-open) > .sources-entry-body {max-height: 0; overflow: hidden;}
.sources-entry.sources-entry-open > .sources-entry-head {}
.sources-entry.sources-entry-open > .sources-entry-body {max-height: 240px; overflow: auto;}
.sources-entry-hidden
{
filter: saturate(0);
}

View file

@ -1,96 +0,0 @@
.weekview-controls
{
margin-bottom: 12px;
text-align: center;
}
.weekview-control
{
margin: 0 12px;
}
.weekview-table table
{
width: 100%;
border-collapse: collapse;
}
.weekview-cell
{
border: 1px solid hsl(0,0%,37.5%);
padding: 8px;
vertical-align: top;
}
.weekview-cell-day
{
width: 13.5%;
}
.weekview-cell-week
{
width: 5.5%;
}
.weekview-cell-regular
{
width: 13.5%;
height: 120px;
cursor: copy;
}
.weekview-cell-today
{
outline: 2px solid hsl(0, 0%, 100%);
}
.weekview-cell-hidden
{
display: none;
}
.weekview-day
{
font-size: 0.75em;
cursor: help;
}
.weekview-events
{
margin: 0; padding: 0;
list-style-type: none;
}
.weekview-event_entry
{
margin: 4px;
padding: 4px;
border-radius: 2px;
font-size: 0.75em;
color: #FFF;
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
max-width: 100%;
min-width: 75px;
word-wrap: anywhere;
}
.weekview-event_entry.access_level-none
,
.weekview-event_entry.access_level-view
{
/*
cursor: default;
*/
cursor: pointer;
}
.weekview-event_entry.access_level-edit
,
.weekview-event_entry.access_level-admin
{
cursor: pointer;
}

View file

@ -39,20 +39,20 @@ namespace _dali.widgets.calendar_edit
/**
*/
private initial_value : (null | _dali.type_calendar_object);
private initial_value : _dali.type_calendar_object;
/**
*/
public constructor(
users : Array<{id : _dali.type_user_id; name : string;}>,
initial_value : _dali.type_calendar_object,
{
"read_only": read_only = false,
"action_cancel": action_cancel = null,
"action_add": action_add = null,
"action_change": action_change = null,
"action_remove": action_remove = null,
"initial_value": initial_value = null,
}
:
{
@ -61,7 +61,6 @@ namespace _dali.widgets.calendar_edit
action_add ?: (null | ((value : _dali.type_calendar_object) => void))
action_change ?: (null | ((value : _dali.type_calendar_object) => void));
action_remove ?: (null | ((value : _dali.type_calendar_object) => void));
initial_value ?: (null | _dali.type_calendar_object);
}
=
{
@ -69,12 +68,12 @@ namespace _dali.widgets.calendar_edit
)
{
this.users = users;
this.initial_value = initial_value;
this.read_only = read_only;
this.action_cancel = action_cancel;
this.action_add = action_add;
this.action_change = action_change;
this.action_remove = action_remove;
this.initial_value = initial_value;
}
@ -213,35 +212,8 @@ namespace _dali.widgets.calendar_edit
)
);
await form.setup(target_element);
await form.input_write(
(! (this.initial_value === null))
?
this.initial_value
:
{
"name": "",
"hue": lib_plankton.random.generate_unit(),
"access": {
"public": false,
"default_level": _dali.enum_access_level.view,
"attributed": lib_plankton.map.hashmap.implementation_map<
_dali.type_user_id,
_dali.enum_access_level
>(
lib_plankton.map.hashmap.make<
_dali.type_user_id,
_dali.enum_access_level
>(
user_id => user_id.toFixed(0),
)
),
},
/**
* @todo
*/
"resource_id": 0,
}
);
await form.input_lock(this.read_only);
await form.input_write(this.initial_value);
}
}

View file

@ -184,13 +184,15 @@ namespace _dali.widgets.event_edit
},
{
"name": "event_begin",
"input": _dali.helpers.datetime_input(),
"input": _dali.helpers.datetime_input(
),
"label": lib_plankton.translate.get("event.begin")
},
{
"name": "event_end",
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
_dali.helpers.datetime_input()
_dali.helpers.datetime_input(
)
),
"label": lib_plankton.translate.get("event.end")
},
@ -295,6 +297,7 @@ namespace _dali.widgets.event_edit
)
);
await form.setup(target_element);
await form.input_lock(this.read_only);
await form.input_write(this.initial_value);
}

View file

@ -25,19 +25,19 @@ namespace _dali.widgets.sources
/**
* [hook]
*/
private action_open : ((entry : type_entry) => void);
private action_toggle : ((entry : type_entry, mode : boolean) => void);
/**
* [hook]
*/
private action_toggle_visibility : ((entry : type_entry, mode : boolean) => void);
private action_select : ((entry : type_entry) => void);
/**
* [hook]
*/
private action_create : (() => void);
private action_add : (() => void);
/**
@ -57,16 +57,16 @@ namespace _dali.widgets.sources
public constructor(
get_entries : (() => Promise<Array<type_entry>>),
{
"action_open": action_open = ((calendar_id) => {}),
"action_toggle_visibility": action_toggle_visibility = ((calendar_id, mode) => {}),
"action_create": action_create = (() => {}),
"action_select": action_select = ((calendar_id) => {}),
"action_toggle": action_toggle = ((calendar_id, mode) => {}),
"action_add": action_add = (() => {}),
"initial_priviliged": initial_priviliged = false,
}
:
{
action_open ?: ((entry : type_entry) => void);
action_toggle_visibility ?: ((entry : type_entry, mode : boolean) => void);
action_create ?: (() => void);
action_select ?: ((entry : type_entry) => void);
action_toggle ?: ((entry : type_entry, mode : boolean) => void);
action_add ?: (() => void);
initial_priviliged ?: boolean;
}
=
@ -78,9 +78,9 @@ namespace _dali.widgets.sources
this.get_entries = get_entries;
// hooks
this.action_open = action_open;
this.action_toggle_visibility = action_toggle_visibility;
this.action_create = action_create;
this.action_select = action_select;
this.action_toggle = action_toggle;
this.action_add = action_add;
// state
this.priviliged = initial_priviliged;
@ -191,7 +191,7 @@ namespace _dali.widgets.sources
"click",
(event) => {
event.preventDefault();
this.action_create();
this.action_add();
}
);
this.container.querySelectorAll(".sources-entry-visibility").forEach(
@ -204,7 +204,7 @@ namespace _dali.widgets.sources
const calendar_id : _dali.type_calendar_id = class_widget_sources.id_decode(key_encoded);
const entry : type_entry = data.get(calendar_id);
element.parentElement.classList.toggle("sources-entry-hidden", (! mode));
this.action_toggle_visibility(entry, mode);
this.action_toggle(entry, mode);
}
);
}
@ -223,7 +223,7 @@ namespace _dali.widgets.sources
const key_encoded : string = element.getAttribute("rel");
const calendar_id : _dali.type_calendar_id = class_widget_sources.id_decode(key_encoded);
const entry : type_entry = data.get(calendar_id);
this.action_open(entry);
this.action_select(entry);
}
}
);

View file

@ -366,10 +366,13 @@ namespace _dali.widgets.weekview
"tableview-cell-entry",
{
"color": _dali.helpers.event_color(entry.hue),
/*
"title": class_widget_weekview.event_generate_tooltip(
entry.calendar_name,
entry.event_object
),
*/
"title": "",
"name": entry.event_object.name,
"rel": entry.key,
"additional_classes": lib_plankton.string.coin(