Compare commits
No commits in common. "main" and "task-408" have entirely different histories.
502
lib/plankton/plankton.d.ts
vendored
502
lib/plankton/plankton.d.ts
vendored
|
|
@ -226,10 +226,9 @@ declare namespace lib_plankton.base {
|
||||||
function object_merge(core: Record<string, any>, mantle: Record<string, any>): Record<string, any>;
|
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, "render_readable_characters": render_readable_characters, }?: {
|
function buffer_show(buffer: Buffer, { "block_size": option_block_size, "break_char": option_break_char, }?: {
|
||||||
block_size?: int;
|
block_size?: int;
|
||||||
break_char?: string;
|
break_char?: string;
|
||||||
render_readable_characters?: boolean;
|
|
||||||
}): string;
|
}): string;
|
||||||
}
|
}
|
||||||
declare module lib_plankton.pod {
|
declare module lib_plankton.pod {
|
||||||
|
|
@ -882,38 +881,6 @@ declare namespace lib_plankton.call {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function sleep(seconds: float): Promise<void>;
|
export function sleep(seconds: float): Promise<void>;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function null_prop<type_value_from, type_value_to>(value_from: (null | type_value_from), function_: ((value: type_value_from) => type_value_to)): (null | type_value_to);
|
|
||||||
export {};
|
|
||||||
}
|
|
||||||
declare namespace lib_plankton.call {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_queue_item<type_data, type_result> = {
|
|
||||||
data: type_data;
|
|
||||||
resolve: ((result: type_result) => void);
|
|
||||||
reject: ((reason: any) => void);
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export type type_queue<type_data, type_result> = {
|
|
||||||
handler: ((data: type_data) => Promise<type_result>);
|
|
||||||
items: Array<type_queue_item<type_data, type_result>>;
|
|
||||||
busy: boolean;
|
|
||||||
paused: boolean;
|
|
||||||
};
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function queue_make<type_data, type_result>(handler: ((data: type_data) => Promise<type_result>)): type_queue<type_data, type_result>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function queue_toggle_paused<type_data, type_result>(queue_subject: type_queue<type_data, type_result>, { "mode": mode, }?: {
|
|
||||||
mode?: (null | boolean);
|
|
||||||
}): void;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function queue_add<type_data, type_result>(queue_subject: type_queue<type_data, type_result>, data: type_data, resolve: ((result: type_result) => void), reject: ((reason: any) => void)): void;
|
|
||||||
export {};
|
export {};
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.file {
|
declare namespace lib_plankton.file {
|
||||||
|
|
@ -4194,49 +4161,6 @@ declare namespace lib_plankton.zoo_widget {
|
||||||
load(target_element: HTMLElement): Promise<void>;
|
load(target_element: HTMLElement): Promise<void>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_widget {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
class class_slider implements interface_widget {
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private conf;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private state;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(content: Array<interface_widget>, { "threshold": threshold, "acceleration_function": acceleration_function, "initial_index": initial_index, }?: {
|
|
||||||
threshold?: float;
|
|
||||||
acceleration_function?: ((float: any) => float);
|
|
||||||
initial_index?: int;
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private static cap;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private static position_subtract;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private static touch_event_position;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private set_translation;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private start;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private update;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private finish;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
load(target_element: HTMLElement): Promise<void>;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
declare namespace lib_plankton.zoo_page {
|
declare namespace lib_plankton.zoo_page {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
@ -4300,66 +4224,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
write(value: type_value): Promise<void>;
|
write(value: type_value): Promise<void>;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
focus(): 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>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4391,18 +4255,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: type_value_outer): Promise<void>;
|
write(value: type_value_outer): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4410,9 +4262,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
class class_input_soft<type_value_core> implements interface_input<(null | type_value_core)> {
|
class class_input_soft<type_value_core> implements interface_input<(null | type_value_core)> {
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private read_only;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private core;
|
private core;
|
||||||
|
|
@ -4424,9 +4273,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private dom_wrapper;
|
private dom_wrapper;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor(core: interface_input<type_value_core>, { "read_only": read_only, }?: {
|
constructor(core: interface_input<type_value_core>, options?: {});
|
||||||
read_only?: boolean;
|
|
||||||
});
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private toggle;
|
private toggle;
|
||||||
|
|
@ -4442,18 +4289,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: (null | type_value_core)): Promise<void>;
|
write(value: (null | type_value_core)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4469,7 +4304,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private value;
|
private value;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "initial_value": initial_value, }?: {
|
constructor(options?: {
|
||||||
initial_value?: any;
|
initial_value?: any;
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
|
|
@ -4484,18 +4319,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: any): Promise<void>;
|
write(value: any): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4503,22 +4326,61 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* @author fenris
|
* @author fenris
|
||||||
* @todo abstract
|
* @todo abstract
|
||||||
*/
|
*/
|
||||||
class class_input_text extends class_input_simple<string> implements interface_input<string> {
|
class class_input_text implements interface_input<string> {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "pattern": pattern, }?: {
|
private read_only;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private pattern;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private dom_input;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(options?: {
|
||||||
|
read_only?: boolean;
|
||||||
pattern?: (null | string);
|
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 {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
class class_input_email extends class_input_simple<string> implements interface_input<string> {
|
class class_input_email implements interface_input<string> {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private dom_input;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor();
|
constructor();
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
setup(parent: HTMLElement): Promise<void>;
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
read(): Promise<string>;
|
||||||
|
/**
|
||||||
|
* [implementation]
|
||||||
|
*/
|
||||||
|
write(value: string): Promise<void>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4544,18 +4406,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: string): Promise<void>;
|
write(value: string): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4571,7 +4421,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private dom_input;
|
private dom_input;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "required": required, }?: {
|
constructor(options?: {
|
||||||
required?: boolean;
|
required?: boolean;
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
|
|
@ -4586,18 +4436,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: (null | lib_plankton.pit.type_date)): Promise<void>;
|
write(value: (null | lib_plankton.pit.type_date)): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4605,12 +4443,34 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* @author fenris
|
* @author fenris
|
||||||
* @todo abstract
|
* @todo abstract
|
||||||
*/
|
*/
|
||||||
class class_input_number extends class_input_simple<number> implements interface_input<number> {
|
class class_input_number implements interface_input<number> {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "step": step, }?: {
|
private read_only;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private step;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private dom_input;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(options?: {
|
||||||
|
read_only?: boolean;
|
||||||
step?: (null | float);
|
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 {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4618,12 +4478,21 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
class class_input_checkbox implements interface_input<boolean> {
|
class class_input_checkbox implements interface_input<boolean> {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private read_only;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private dom_input;
|
private dom_input;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor();
|
private hooks_change;
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
constructor(options?: {
|
||||||
|
read_only?: boolean;
|
||||||
|
hooks_change?: Array<((value: boolean) => void)>;
|
||||||
|
});
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
|
|
@ -4636,18 +4505,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: boolean): Promise<void>;
|
write(value: boolean): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4679,31 +4536,13 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: string): Promise<void>;
|
write(value: string): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
class class_input_enumeration<type_value> implements interface_input<type_value> {
|
class class_input_enumeration implements interface_input<string> {
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private encode_value;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private decode_value;
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private options;
|
private options;
|
||||||
|
|
@ -4712,8 +4551,8 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private dom_inputs;
|
private dom_inputs;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor(encode_value: ((value: type_value) => string), decode_value: ((representation: string) => type_value), options: Array<{
|
constructor(options: Array<{
|
||||||
value: type_value;
|
value: string;
|
||||||
label: string;
|
label: string;
|
||||||
}>);
|
}>);
|
||||||
/**
|
/**
|
||||||
|
|
@ -4724,23 +4563,11 @@ declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
read(): Promise<type_value>;
|
read(): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: type_value): Promise<void>;
|
write(value: string): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4771,10 +4598,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private translations;
|
private translations;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private locked;
|
constructor(element_input_factory: (() => interface_input<type_element>), options?: {
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor(element_input_factory: (() => interface_input<type_element>), { "read_only": read_only, "translations": translations, }?: {
|
|
||||||
read_only?: boolean;
|
read_only?: boolean;
|
||||||
translations?: type_translations;
|
translations?: type_translations;
|
||||||
});
|
});
|
||||||
|
|
@ -4796,18 +4620,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: Array<type_element>): Promise<void>;
|
write(value: Array<type_element>): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
}
|
}
|
||||||
|
|
@ -4844,18 +4656,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: Set<string>): Promise<void>;
|
write(value: Set<string>): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4900,18 +4700,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: string): Promise<void>;
|
write(value: string): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -4927,15 +4715,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private value;
|
private value;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private symbols;
|
constructor();
|
||||||
/**
|
|
||||||
*/
|
|
||||||
constructor({ "symbols": symbols, }?: {
|
|
||||||
symbols?: {
|
|
||||||
yes: string;
|
|
||||||
no: string;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
|
|
@ -4948,28 +4728,31 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: boolean): Promise<void>;
|
write(value: boolean): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
* @author fenris
|
* @author fenris
|
||||||
*/
|
*/
|
||||||
class class_input_time extends class_input_simple<(null | lib_plankton.pit.type_time)> implements interface_input<(null | lib_plankton.pit.type_time)> {
|
class class_input_time implements interface_input<(null | lib_plankton.pit.type_time)> {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private dom_input;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor();
|
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 {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5000,24 +4783,12 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(value: type_record): Promise<void>;
|
write(value: type_record): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class class_input_hashmap<type_key, type_value> implements interface_input<lib_plankton.map.type_map<type_key, type_value>> {
|
class class_input_hashmap<type_key, type_value> implements lib_plankton.zoo_input.interface_input<lib_plankton.map.type_map<type_key, type_value>> {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private hash_key;
|
private hash_key;
|
||||||
|
|
@ -5026,7 +4797,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private core;
|
private core;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor(hash_key: ((key: type_key) => string), key_input_factory: (() => interface_input<type_key>), value_input_factory: (() => interface_input<type_value>));
|
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>));
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
|
|
@ -5039,18 +4810,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
write(map: lib_plankton.map.type_map<type_key, type_value>): Promise<void>;
|
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>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5076,18 +4835,6 @@ declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5100,7 +4847,7 @@ declare namespace lib_plankton.zoo_input {
|
||||||
private core;
|
private core;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor({ "label_date": label_date, "label_time": label_time, }?: {
|
constructor(options?: {
|
||||||
label_date?: string;
|
label_date?: string;
|
||||||
label_time?: string;
|
label_time?: string;
|
||||||
});
|
});
|
||||||
|
|
@ -5113,27 +4860,30 @@ declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
write(value: lib_plankton.pit.type_datetime): Promise<void>;
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
hook_change(action: (() => void)): Promise<void>;
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
focus(): void;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
declare namespace lib_plankton.zoo_input {
|
declare namespace lib_plankton.zoo_input {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
class class_input_color extends class_input_simple<(null | lib_plankton.color.type_color)> implements interface_input<(null | lib_plankton.color.type_color)> {
|
class class_input_color implements interface_input<(null | lib_plankton.color.type_color)> {
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private dom_input;
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
constructor();
|
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 {
|
declare namespace lib_plankton.zoo_input {
|
||||||
|
|
@ -5169,7 +4919,7 @@ declare namespace lib_plankton.zoo_form {
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: string;
|
||||||
label?: (null | string);
|
label?: (null | string);
|
||||||
}>, encode: ((value: type_value) => Record<string, string>), decode: ((raw: Record<string, string>) => type_value), { "class_prefix": class_prefix, }?: {
|
}>, encode: ((value: type_value) => Record<string, string>), decode: ((raw: Record<string, string>) => type_value), options?: {
|
||||||
class_prefix?: string;
|
class_prefix?: string;
|
||||||
}): type_form<type_value>;
|
}): type_form<type_value>;
|
||||||
/**
|
/**
|
||||||
|
|
@ -5234,12 +4984,6 @@ declare namespace lib_plankton.zoo_form {
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
input_write(value: type_value): Promise<void>;
|
input_write(value: type_value): Promise<void>;
|
||||||
/**
|
|
||||||
*/
|
|
||||||
input_lock(mode: boolean): Promise<void>;
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
input_focus(): void;
|
|
||||||
}
|
}
|
||||||
export {};
|
export {};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -7,7 +7,7 @@
|
||||||
"path": ""
|
"path": ""
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
"oidc_redirect_uri_template": "http://localhost:8888/?action=oidc_finish&session_key={{session_key}}",
|
"oidc_redirect_uri_template": "http://localhost:8888/#oidc_finish,session_key={{session_key}}",
|
||||||
"use_central_europe_specific_datetime_inputs": true
|
"use_central_europe_specific_datetime_inputs": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,3 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali
|
namespace _dali
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
@ -106,19 +86,8 @@ namespace _dali
|
||||||
{
|
{
|
||||||
await _dali.backend.set_session_key(session_key);
|
await _dali.backend.set_session_key(session_key);
|
||||||
const status = await _dali.backend.status();
|
const status = await _dali.backend.status();
|
||||||
if (! status.logged_in)
|
await _dali.notify_login(status.name);
|
||||||
{
|
return Promise.resolve<void>(undefined);
|
||||||
lib_plankton.log.error(
|
|
||||||
"dali.oidc_login_failed"
|
|
||||||
);
|
|
||||||
await _dali.notify_logout();
|
|
||||||
return Promise.reject<void>(new Error("oidc login failed"));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
await _dali.notify_login(status.name);
|
|
||||||
return Promise.resolve<void>(undefined);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,27 +14,13 @@
|
||||||
"common.weekday.friday": "Fr",
|
"common.weekday.friday": "Fr",
|
||||||
"common.weekday.saturday": "Sa",
|
"common.weekday.saturday": "Sa",
|
||||||
"common.weekday.sunday": "So",
|
"common.weekday.sunday": "So",
|
||||||
"common.monthname.january": "Jan",
|
|
||||||
"common.monthname.february": "Feb",
|
|
||||||
"common.monthname.march": "Mär",
|
|
||||||
"common.monthname.april": "Apr",
|
|
||||||
"common.monthname.may": "Mai",
|
|
||||||
"common.monthname.june": "Jun",
|
|
||||||
"common.monthname.july": "Jul",
|
|
||||||
"common.monthname.august": "Aug",
|
|
||||||
"common.monthname.september": "Sep",
|
|
||||||
"common.monthname.october": "Okt",
|
|
||||||
"common.monthname.november": "Nov",
|
|
||||||
"common.monthname.december": "Dez",
|
|
||||||
"common.open": "öffnen",
|
"common.open": "öffnen",
|
||||||
"common.close": "schließen",
|
|
||||||
"common.edit": "bearbeiten",
|
"common.edit": "bearbeiten",
|
||||||
"common.show": "zeigen",
|
"common.show": "zeigen",
|
||||||
"common.hide": "ausblenden",
|
"common.hide": "ausblenden",
|
||||||
"common.cancel": "abbrechen",
|
"common.cancel": "abbrechen",
|
||||||
"common.login": "anmelden",
|
"common.login": "anmelden",
|
||||||
"common.logout": "abmelden",
|
"common.logout": "abmelden",
|
||||||
"common.confirm_deletion": "sicher?",
|
|
||||||
"access_level.none": "nichts",
|
"access_level.none": "nichts",
|
||||||
"access_level.view": "nur lesen",
|
"access_level.view": "nur lesen",
|
||||||
"access_level.edit": "lesen und bearbeiten",
|
"access_level.edit": "lesen und bearbeiten",
|
||||||
|
|
@ -60,13 +46,11 @@
|
||||||
"calendar.access.access": "Zugriff",
|
"calendar.access.access": "Zugriff",
|
||||||
"calendar.access.public": "öffentlich",
|
"calendar.access.public": "öffentlich",
|
||||||
"calendar.access.default_level": "Standard",
|
"calendar.access.default_level": "Standard",
|
||||||
"calendar.access.attributed_group": "Gruppen-Zuweisungen",
|
"calendar.access.attributed": "Zuweisungen",
|
||||||
"calendar.access.attributed_user": "Nutzer-Zuweisungen",
|
|
||||||
"widget.listview.add": "Termin anlegen",
|
"widget.listview.add": "Termin anlegen",
|
||||||
"widget.weekview.controls.year": "Jahr",
|
"widget.weekview.controls.year": "Jahr",
|
||||||
"widget.weekview.controls.week": "Woche",
|
"widget.weekview.controls.week": "Woche",
|
||||||
"widget.weekview.controls.count": "Anzahl",
|
"widget.weekview.controls.count": "Anzahl",
|
||||||
"widget.weekview.controls.vertical": "senkrecht",
|
|
||||||
"widget.weekview.controls.apply": "Laden",
|
"widget.weekview.controls.apply": "Laden",
|
||||||
"widget.calendar_edit.actions.add": "Kalender anlegen",
|
"widget.calendar_edit.actions.add": "Kalender anlegen",
|
||||||
"widget.calendar_edit.actions.change": "ändern",
|
"widget.calendar_edit.actions.change": "ändern",
|
||||||
|
|
@ -79,20 +63,27 @@
|
||||||
"widget.login.internal.password": "Kennwort",
|
"widget.login.internal.password": "Kennwort",
|
||||||
"widget.login.internal.do": "Anmelden",
|
"widget.login.internal.do": "Anmelden",
|
||||||
"widget.login.oidc.via": "via {{title}}",
|
"widget.login.oidc.via": "via {{title}}",
|
||||||
"widget.caldav.title": "CalDAV",
|
"page.caldav.title": "CalDAV",
|
||||||
"widget.caldav.unavailable": "CalDAV nicht verfügbar",
|
"page.caldav.unavailable": "CalDAV nicht verfügbar",
|
||||||
"widget.caldav.conf.title": "Zugangsdaten",
|
"page.caldav.conf.title": "Zugangsdaten",
|
||||||
"widget.caldav.conf.address": "Adresse (URL)",
|
"page.caldav.conf.address": "Adresse (URL)",
|
||||||
"widget.caldav.conf.username": "Nutzername",
|
"page.caldav.conf.username": "Nutzername",
|
||||||
"widget.caldav.conf.password": "Kennwort",
|
"page.caldav.conf.password": "Kennwort",
|
||||||
"widget.caldav.conf.setup_hints": "Einrichtungs-Hinweise",
|
"page.caldav.conf.setup_hints": "Einrichtungs-Hinweise",
|
||||||
"widget.caldav.conf.token_unset": "es muss zunächst ein Token gesetzt werden",
|
"page.caldav.conf.token_unset": "es muss zunächst ein Token gesetzt werden",
|
||||||
"widget.caldav.set_token.title": "Token setzen",
|
"page.caldav.set_token.title": "Token setzen",
|
||||||
"widget.caldav.set_token.action.set": "setzen",
|
"page.caldav.set_token.action.set": "setzen",
|
||||||
"widget.caldav.set_token.action.overwrite": "überschreiben",
|
"page.caldav.set_token.action.overwrite": "überschreiben",
|
||||||
"widget.overview.title": "Übersicht",
|
"page.calendar_add.title": "Kalendar anlegen",
|
||||||
"widget.overview.login_hint": "anmelden um nicht-öffentliche Termine zu sehen",
|
"page.calendar_add.actions.do": "anlegen",
|
||||||
"widget.overview.mode.week": "Wochen-Ansicht",
|
"page.calendar_edit.title.regular": "Kalendar bearbeiten",
|
||||||
"widget.overview.mode.list": "Listen-Ansicht"
|
"page.calendar_edit.title.read_only": "Kalendar-Details",
|
||||||
|
"page.event_add.title": "Termin anlegen",
|
||||||
|
"page.event_edit.title.regular": "Termin bearbeiten",
|
||||||
|
"page.event_edit.title.read_only": "Termin-Details",
|
||||||
|
"page.overview.title": "Übersicht",
|
||||||
|
"page.overview.login_hint": "anmelden um nicht-öffentliche Termine zu sehen",
|
||||||
|
"page.overview.mode.week": "Wochen-Ansicht",
|
||||||
|
"page.overview.mode.list": "Listen-Ansicht"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,27 +14,13 @@
|
||||||
"common.weekday.friday": "Fri",
|
"common.weekday.friday": "Fri",
|
||||||
"common.weekday.saturday": "Sat",
|
"common.weekday.saturday": "Sat",
|
||||||
"common.weekday.sunday": "Sun",
|
"common.weekday.sunday": "Sun",
|
||||||
"common.monthname.january": "jan",
|
|
||||||
"common.monthname.february": "feb",
|
|
||||||
"common.monthname.march": "mar",
|
|
||||||
"common.monthname.april": "apr",
|
|
||||||
"common.monthname.may": "may",
|
|
||||||
"common.monthname.june": "jun",
|
|
||||||
"common.monthname.july": "jul",
|
|
||||||
"common.monthname.august": "aug",
|
|
||||||
"common.monthname.september": "sep",
|
|
||||||
"common.monthname.october": "oct",
|
|
||||||
"common.monthname.november": "nov",
|
|
||||||
"common.monthname.december": "dec",
|
|
||||||
"common.open": "open",
|
"common.open": "open",
|
||||||
"common.close": "close",
|
|
||||||
"common.edit": "edit",
|
"common.edit": "edit",
|
||||||
"common.show": "show",
|
"common.show": "show",
|
||||||
"common.hide": "hide",
|
"common.hide": "hide",
|
||||||
"common.cancel": "cancel",
|
"common.cancel": "cancel",
|
||||||
"common.login": "login",
|
"common.login": "login",
|
||||||
"common.logout": "logout",
|
"common.logout": "logout",
|
||||||
"common.confirm_deletion": "sure?",
|
|
||||||
"access_level.none": "none",
|
"access_level.none": "none",
|
||||||
"access_level.view": "read only",
|
"access_level.view": "read only",
|
||||||
"access_level.edit": "read and write",
|
"access_level.edit": "read and write",
|
||||||
|
|
@ -60,13 +46,11 @@
|
||||||
"calendar.access.access": "access",
|
"calendar.access.access": "access",
|
||||||
"calendar.access.public": "public",
|
"calendar.access.public": "public",
|
||||||
"calendar.access.default_level": "default",
|
"calendar.access.default_level": "default",
|
||||||
"calendar.access.attributed_group": "group attributed",
|
"calendar.access.attributed": "attributed",
|
||||||
"calendar.access.attributed_user": "user attributed",
|
|
||||||
"widget.listview.add": "add event",
|
"widget.listview.add": "add event",
|
||||||
"widget.weekview.controls.year": "year",
|
"widget.weekview.controls.year": "Year",
|
||||||
"widget.weekview.controls.week": "week",
|
"widget.weekview.controls.week": "Week",
|
||||||
"widget.weekview.controls.count": "count",
|
"widget.weekview.controls.count": "Count",
|
||||||
"widget.weekview.controls.vertical": "vertical",
|
|
||||||
"widget.weekview.controls.apply": "Load",
|
"widget.weekview.controls.apply": "Load",
|
||||||
"widget.calendar_edit.actions.add": "add calendar",
|
"widget.calendar_edit.actions.add": "add calendar",
|
||||||
"widget.calendar_edit.actions.change": "change",
|
"widget.calendar_edit.actions.change": "change",
|
||||||
|
|
@ -79,20 +63,27 @@
|
||||||
"widget.login.internal.password": "password",
|
"widget.login.internal.password": "password",
|
||||||
"widget.login.internal.do": "login",
|
"widget.login.internal.do": "login",
|
||||||
"widget.login.oidc.via": "via {{title}}",
|
"widget.login.oidc.via": "via {{title}}",
|
||||||
"widget.caldav.title": "CalDAV",
|
"page.caldav.title": "CalDAV",
|
||||||
"widget.caldav.unavailable": "CalDAV not available",
|
"page.caldav.unavailable": "CalDAV not available",
|
||||||
"widget.caldav.conf.title": "credentials",
|
"page.caldav.conf.title": "credentials",
|
||||||
"widget.caldav.conf.address": "address (URL)",
|
"page.caldav.conf.address": "address (URL)",
|
||||||
"widget.caldav.conf.username": "username",
|
"page.caldav.conf.username": "username",
|
||||||
"widget.caldav.conf.password": "password",
|
"page.caldav.conf.password": "password",
|
||||||
"widget.caldav.conf.setup_hints": "setup hints",
|
"page.caldav.conf.setup_hints": "setup hints",
|
||||||
"widget.caldav.conf.token_unset": "a token has to be set",
|
"page.caldav.conf.token_unset": "a token has to be set",
|
||||||
"widget.caldav.set_token.title": "set token",
|
"page.caldav.set_token.title": "set token",
|
||||||
"widget.caldav.set_token.action.set": "set",
|
"page.caldav.set_token.action.set": "set",
|
||||||
"widget.caldav.set_token.action.overwrite": "overwrite",
|
"page.caldav.set_token.action.overwrite": "overwrite",
|
||||||
"widget.overview.title": "Overview",
|
"page.calendar_add.title": "Add calendar",
|
||||||
"widget.overview.login_hint": "log in to view non-public events",
|
"page.calendar_add.actions.do": "anlegen",
|
||||||
"widget.overview.mode.week": "week view",
|
"page.event_add.title": "Add event",
|
||||||
"widget.overview.mode.list": "list view"
|
"page.calendar_edit.title.regular": "Edit calendar",
|
||||||
|
"page.calendar_edit.title.read_only": "Calendar details",
|
||||||
|
"page.event_edit.title.regular": "Edit event",
|
||||||
|
"page.event_edit.title.read_only": "Event details",
|
||||||
|
"page.overview.title": "Overview",
|
||||||
|
"page.overview.login_hint": "log in to view non-public events",
|
||||||
|
"page.overview.mode.week": "week view",
|
||||||
|
"page.overview.mode.list": "list view"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,45 +1,9 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
namespace _dali.helpers
|
namespace _dali.helpers
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo outsource
|
|
||||||
*/
|
|
||||||
function is_touch_device(
|
|
||||||
)
|
|
||||||
: boolean
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
("ontouchstart" in window)
|
|
||||||
||
|
|
||||||
(navigator.maxTouchPoints > 0)
|
|
||||||
||
|
|
||||||
(navigator["msMaxTouchPoints"] > 0)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
var _template_cache : Record<string, string> = {};
|
var _template_cache : Record<string, string> = {};
|
||||||
|
|
@ -49,13 +13,12 @@ namespace _dali.helpers
|
||||||
*/
|
*/
|
||||||
export function view_mode_determine(
|
export function view_mode_determine(
|
||||||
mode_descriptor : string
|
mode_descriptor : string
|
||||||
)
|
) : _dali.enum_view_mode
|
||||||
: _dali.enum_view_mode
|
|
||||||
{
|
{
|
||||||
if (mode_descriptor === "auto")
|
if (mode_descriptor === "auto")
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
(window.innerWidth >= 1000)
|
(window.innerWidth >= 800)
|
||||||
?
|
?
|
||||||
_dali.enum_view_mode.week
|
_dali.enum_view_mode.week
|
||||||
:
|
:
|
||||||
|
|
@ -69,30 +32,6 @@ namespace _dali.helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function view_kind_determine(
|
|
||||||
mode_descriptor : string
|
|
||||||
)
|
|
||||||
: _dali.enum_view_kind
|
|
||||||
{
|
|
||||||
if (mode_descriptor === "auto")
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
is_touch_device()
|
|
||||||
?
|
|
||||||
_dali.enum_view_kind.touch
|
|
||||||
:
|
|
||||||
_dali.enum_view_kind.regular
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return view_kind_decode(mode_descriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export async function template_coin(
|
export async function template_coin(
|
||||||
|
|
@ -138,25 +77,6 @@ namespace _dali.helpers
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function element_from_template(
|
|
||||||
group : string,
|
|
||||||
name : string,
|
|
||||||
data : Record<string, string>
|
|
||||||
)
|
|
||||||
: Promise<HTMLElement>
|
|
||||||
{
|
|
||||||
const dom_dummy = document.createElement("div");
|
|
||||||
dom_dummy.innerHTML = await _dali.helpers.template_coin(
|
|
||||||
group,
|
|
||||||
name,
|
|
||||||
data
|
|
||||||
);
|
|
||||||
return (dom_dummy.children[0] as HTMLElement);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo outsource
|
* @todo outsource
|
||||||
*/
|
*/
|
||||||
|
|
@ -164,8 +84,7 @@ namespace _dali.helpers
|
||||||
members : Array<
|
members : Array<
|
||||||
() => Promise<type_result>
|
() => Promise<type_result>
|
||||||
>
|
>
|
||||||
)
|
) : Promise<
|
||||||
: Promise<
|
|
||||||
Array<
|
Array<
|
||||||
type_result
|
type_result
|
||||||
>
|
>
|
||||||
|
|
@ -182,8 +101,7 @@ namespace _dali.helpers
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function input_access_level(
|
export function input_access_level(
|
||||||
)
|
) : lib_plankton.zoo_input.interface_input<_dali.enum_access_level>
|
||||||
: lib_plankton.zoo_input.interface_input<_dali.enum_access_level>
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
new lib_plankton.zoo_input.class_input_wrapped<
|
new lib_plankton.zoo_input.class_input_wrapped<
|
||||||
|
|
@ -233,42 +151,7 @@ namespace _dali.helpers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function input_attributed_access_group(
|
export function input_attributed_access(
|
||||||
groups : Array<{id : _dali.type_group_id; object : _dali.type_group_object;}>
|
|
||||||
)
|
|
||||||
: lib_plankton.zoo_input.class_input_hashmap<
|
|
||||||
_dali.type_group_id,
|
|
||||||
_dali.enum_access_level
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return (
|
|
||||||
new lib_plankton.zoo_input.class_input_hashmap<_dali.type_group_id, _dali.enum_access_level>(
|
|
||||||
// hash_key
|
|
||||||
(group_id) => group_id.toFixed(0),
|
|
||||||
// key_input_factory
|
|
||||||
() => new lib_plankton.zoo_input.class_input_wrapped<string, int>(
|
|
||||||
new lib_plankton.zoo_input.class_input_selection(
|
|
||||||
groups
|
|
||||||
.map(
|
|
||||||
(group) => ({
|
|
||||||
"value": group.id.toFixed(0),
|
|
||||||
"label": group.object.label,
|
|
||||||
})
|
|
||||||
)
|
|
||||||
),
|
|
||||||
x => parseInt(x),
|
|
||||||
x => x.toFixed(0)
|
|
||||||
),
|
|
||||||
// value_input_factory
|
|
||||||
() => input_access_level()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function input_attributed_access_user(
|
|
||||||
users : Array<{id : _dali.type_user_id; name : string;}>
|
users : Array<{id : _dali.type_user_id; name : string;}>
|
||||||
)
|
)
|
||||||
: lib_plankton.zoo_input.class_input_hashmap<
|
: lib_plankton.zoo_input.class_input_hashmap<
|
||||||
|
|
@ -304,8 +187,7 @@ namespace _dali.helpers
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function datetime_input(
|
export function datetime_input(
|
||||||
)
|
) : lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
||||||
: lib_plankton.zoo_input.interface_input<lib_plankton.pit.type_datetime>
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
_dali.conf.get().misc.use_central_europe_specific_datetime_inputs
|
||||||
|
|
@ -327,68 +209,4 @@ namespace _dali.helpers
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function event_color(
|
|
||||||
hue : float
|
|
||||||
)
|
|
||||||
:
|
|
||||||
string
|
|
||||||
{
|
|
||||||
return lib_plankton.color.output_hex(
|
|
||||||
lib_plankton.color.make_hsv(
|
|
||||||
{
|
|
||||||
"hue": hue,
|
|
||||||
"saturation": 0.375,
|
|
||||||
"value": 0.375,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function month_name(
|
|
||||||
month : int
|
|
||||||
)
|
|
||||||
: string
|
|
||||||
{
|
|
||||||
const keys : Array<string> = [
|
|
||||||
"common.monthname.january",
|
|
||||||
"common.monthname.february",
|
|
||||||
"common.monthname.march",
|
|
||||||
"common.monthname.april",
|
|
||||||
"common.monthname.may",
|
|
||||||
"common.monthname.june",
|
|
||||||
"common.monthname.july",
|
|
||||||
"common.monthname.august",
|
|
||||||
"common.monthname.september",
|
|
||||||
"common.monthname.october",
|
|
||||||
"common.monthname.november",
|
|
||||||
"common.monthname.december",
|
|
||||||
];
|
|
||||||
return lib_plankton.translate.get(keys[month-1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function loading(
|
|
||||||
mode : boolean
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
if (! mode)
|
|
||||||
{
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_dali.overlay.get_content_element().innerHTML = ". . .";
|
|
||||||
_dali.overlay.toggle({"mode": true});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,15 @@ document.addEventListener(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
{{templates}}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<div id="overlay">
|
||||||
<div id="overlay">
|
<div id="overlay_content">
|
||||||
<div id="overlay_content">
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<body>
|
||||||
<header>
|
<header>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
|
|
|
||||||
212
source/main.ts
212
source/main.ts
|
|
@ -1,28 +1,42 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
namespace _dali
|
namespace _dali
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
function nav_groups(
|
||||||
|
logged_in : boolean
|
||||||
|
)
|
||||||
|
: Array<string>
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
logged_in
|
||||||
|
?
|
||||||
|
["logged_in"]
|
||||||
|
:
|
||||||
|
["logged_out"]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo reload page when switching to "logged_out"
|
||||||
|
*/
|
||||||
|
async function update(
|
||||||
|
)
|
||||||
|
: Promise<void>
|
||||||
|
{
|
||||||
|
lib_plankton.log.debug(
|
||||||
|
"dali.update"
|
||||||
|
);
|
||||||
|
const logged_in : boolean = _dali.is_logged_in();
|
||||||
|
lib_plankton.zoo_page.nav_set_groups(nav_groups(logged_in));
|
||||||
|
// lib_plankton.zoo_page.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export async function main(
|
export async function main(
|
||||||
|
|
@ -34,56 +48,28 @@ namespace _dali
|
||||||
"conf.json"
|
"conf.json"
|
||||||
);
|
);
|
||||||
|
|
||||||
// init:logger
|
// init
|
||||||
lib_plankton.log.set_main_logger(
|
lib_plankton.log.set_main_logger(
|
||||||
[
|
[
|
||||||
{
|
{"kind": "console", "data": {"threshold": "info"}},
|
||||||
"kind": "minlevel",
|
|
||||||
"data": {
|
|
||||||
"core": {
|
|
||||||
"kind": "console",
|
|
||||||
"data": {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"threshold": "info"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
// init:overlay
|
await lib_plankton.translate.initialize(
|
||||||
{
|
{
|
||||||
await _dali.overlay.initialize();
|
"verbosity": 1,
|
||||||
_dali.helpers.loading(true);
|
"packages": [
|
||||||
}
|
JSON.parse(await lib_plankton.file.read("data/localization/deu.loc.json")),
|
||||||
// init:localization
|
JSON.parse(await lib_plankton.file.read("data/localization/eng.loc.json")),
|
||||||
{
|
],
|
||||||
const order : Array<string> = ["deu", "eng"];
|
"order": ["deu", "eng"],
|
||||||
await lib_plankton.translate.initialize(
|
"autopromote": false,
|
||||||
{
|
}
|
||||||
"verbosity": 1,
|
);
|
||||||
"packages": await Promise.all(
|
|
||||||
order.map(
|
|
||||||
code => (
|
|
||||||
Promise.resolve(code)
|
|
||||||
.then<string>(code => Promise.resolve(lib_plankton.string.coin("data/localization/{{code}}.loc.json", {"code": code})))
|
|
||||||
.then<string>(lib_plankton.file.read)
|
|
||||||
.then<any>(content => Promise.resolve(JSON.parse(content)))
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"order": order,
|
|
||||||
"autopromote": false,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// init:backend
|
|
||||||
await _dali.backend.initialize(
|
await _dali.backend.initialize(
|
||||||
_dali.conf.get()["backend"]
|
_dali.conf.get()["backend"]
|
||||||
);
|
);
|
||||||
// init:model
|
|
||||||
await _dali.model.initialize(
|
await _dali.model.initialize(
|
||||||
);
|
);
|
||||||
// init:page
|
|
||||||
lib_plankton.zoo_page.init(
|
lib_plankton.zoo_page.init(
|
||||||
document.querySelector("main"),
|
document.querySelector("main"),
|
||||||
{
|
{
|
||||||
|
|
@ -91,55 +77,69 @@ namespace _dali
|
||||||
"name": "overview",
|
"name": "overview",
|
||||||
"parameters": {}
|
"parameters": {}
|
||||||
},
|
},
|
||||||
|
/*
|
||||||
|
"nav_entries": [
|
||||||
|
],
|
||||||
|
*/
|
||||||
|
"nav_initial_groups": [],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// init:menu
|
// menu widget
|
||||||
{
|
{
|
||||||
const widget_menu : _dali.widgets.class_widget_menu = new _dali.widgets.class_widget_menu(
|
const widget_menu : _dali.widgets.menu.class_widget_menu = new _dali.widgets.menu.class_widget_menu(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("common.login"),
|
"label": lib_plankton.translate.get("common.login"),
|
||||||
"groups": ["logged_out"],
|
"groups": ["logged_out"],
|
||||||
"action": async () => {
|
"action": () => {
|
||||||
_dali.helpers.loading(true);
|
const widget_login = new _dali.widgets.login.class_widget_login(
|
||||||
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_login(
|
|
||||||
{
|
{
|
||||||
"action_cancel": () => {
|
"action_cancel": () => {
|
||||||
_dali.overlay.clear();
|
_dali.overlay.clear();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
},
|
},
|
||||||
"action_success": async () => {
|
"action_success": async () => {
|
||||||
_dali.helpers.loading(true);
|
|
||||||
const status = await _dali.backend.status();
|
const status = await _dali.backend.status();
|
||||||
_dali.notify_login(status.name);
|
_dali.notify_login(status.name);
|
||||||
// _dali.overlay.clear();
|
_dali.overlay.clear();
|
||||||
_dali.helpers.loading(false);
|
_dali.overlay.toggle({"mode": false});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
_dali.overlay.clear();
|
||||||
// _dali.helpers.loading(false);
|
|
||||||
_dali.overlay.toggle({"mode": true});
|
_dali.overlay.toggle({"mode": true});
|
||||||
|
widget_login.load(_dali.overlay.get_content_element());
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("widget.caldav.title"),
|
"label": lib_plankton.translate.get("page.overview.title"),
|
||||||
|
"groups": ["logged_out", "logged_in"],
|
||||||
|
"action": () => {
|
||||||
|
lib_plankton.zoo_page.set(
|
||||||
|
{
|
||||||
|
"name": "overview",
|
||||||
|
"parameters": {}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": lib_plankton.translate.get("page.caldav.title"),
|
||||||
"groups": ["logged_in"],
|
"groups": ["logged_in"],
|
||||||
"action": async () => {
|
"action": () => {
|
||||||
_dali.helpers.loading(true);
|
lib_plankton.zoo_page.set(
|
||||||
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_caldav();
|
{
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
"name": "caldav",
|
||||||
// _dali.helpers.loading(false);
|
"parameters": {}
|
||||||
_dali.overlay.toggle({"mode": true});
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("common.logout"),
|
"label": lib_plankton.translate.get("common.logout"),
|
||||||
"groups": ["logged_in"],
|
"groups": ["logged_in"],
|
||||||
"action": async () => {
|
"action": () => {
|
||||||
_dali.helpers.loading(true);
|
_dali.logout();
|
||||||
await _dali.logout();
|
|
||||||
_dali.helpers.loading(false);
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -158,36 +158,18 @@ namespace _dali
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
await update();
|
||||||
|
await _dali.overlay.initialize();
|
||||||
|
/*
|
||||||
|
lib_plankton.call.loop(
|
||||||
|
() => {
|
||||||
|
update();
|
||||||
|
},
|
||||||
|
_dali.conf.get().misc.update_interval
|
||||||
|
);
|
||||||
|
*/
|
||||||
|
|
||||||
// process actions
|
// check if logged_in
|
||||||
{
|
|
||||||
let url_search_params : URLSearchParams = new URLSearchParams(window.location.search);
|
|
||||||
const action : (null | string) = url_search_params.get("action");
|
|
||||||
switch (action)
|
|
||||||
{
|
|
||||||
case "oidc_finish":
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _dali.oidc_finish(url_search_params.get("session_key"));
|
|
||||||
}
|
|
||||||
catch (error_)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
document.location = "/";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
case null:
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// process status
|
|
||||||
{
|
{
|
||||||
const status = await _dali.backend.status();
|
const status = await _dali.backend.status();
|
||||||
lib_plankton.log.info(
|
lib_plankton.log.info(
|
||||||
|
|
@ -204,15 +186,7 @@ namespace _dali
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load overview
|
lib_plankton.zoo_page.start();
|
||||||
{
|
|
||||||
const widget : lib_plankton.zoo_widget.interface_widget = (
|
|
||||||
new _dali.widgets.class_widget_overview(
|
|
||||||
)
|
|
||||||
);
|
|
||||||
await widget.load(document.querySelector("main"));
|
|
||||||
}
|
|
||||||
_dali.helpers.loading(false);
|
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
126
source/model.ts
126
source/model.ts
|
|
@ -1,35 +1,9 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.model
|
namespace _dali.model
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
type type_state = {
|
type type_state = {
|
||||||
groups : Array<
|
|
||||||
{
|
|
||||||
id : _dali.type_group_id;
|
|
||||||
object : _dali.type_group_object;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
users : Array<
|
users : Array<
|
||||||
{
|
{
|
||||||
id : _dali.type_user_id;
|
id : _dali.type_user_id;
|
||||||
|
|
@ -136,23 +110,6 @@ namespace _dali.model
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export async function group_list(
|
|
||||||
)
|
|
||||||
: Promise<
|
|
||||||
Array<
|
|
||||||
{
|
|
||||||
id : _dali.type_group_id;
|
|
||||||
object : _dali.type_group_object;
|
|
||||||
}
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return Promise.resolve(_state.groups);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export async function user_list(
|
export async function user_list(
|
||||||
|
|
@ -171,8 +128,10 @@ namespace _dali.model
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @todo clear after login/logout
|
||||||
|
* @todo do not export
|
||||||
*/
|
*/
|
||||||
async function sync_calendars(
|
export async function sync_calendars(
|
||||||
)
|
)
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
|
|
@ -239,30 +198,12 @@ namespace _dali.model
|
||||||
"access": {
|
"access": {
|
||||||
"public": data.access.public,
|
"public": data.access.public,
|
||||||
"default_level": _dali.access_level_decode(data.access.default_level),
|
"default_level": _dali.access_level_decode(data.access.default_level),
|
||||||
"attributed_group": lib_plankton.map.hashmap.implementation_map(
|
"attributed": lib_plankton.map.hashmap.implementation_map(
|
||||||
lib_plankton.map.hashmap.make(
|
lib_plankton.map.hashmap.make(
|
||||||
x => x.toFixed(0),
|
x => x.toFixed(0),
|
||||||
{
|
{
|
||||||
"pairs": (
|
"pairs": (
|
||||||
data.access.attributed_group
|
data.access.attributed
|
||||||
.map(
|
|
||||||
(entry) => (
|
|
||||||
{
|
|
||||||
"key": entry.group_id,
|
|
||||||
"value": _dali.access_level_decode(entry.level),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attributed_user": lib_plankton.map.hashmap.implementation_map(
|
|
||||||
lib_plankton.map.hashmap.make(
|
|
||||||
x => x.toFixed(0),
|
|
||||||
{
|
|
||||||
"pairs": (
|
|
||||||
data.access.attributed_user
|
|
||||||
.map(
|
.map(
|
||||||
(entry) => (
|
(entry) => (
|
||||||
{
|
{
|
||||||
|
|
@ -305,19 +246,8 @@ namespace _dali.model
|
||||||
"access": {
|
"access": {
|
||||||
"public": calendar_object.access.public,
|
"public": calendar_object.access.public,
|
||||||
"default_level": _dali.access_level_encode(calendar_object.access.default_level),
|
"default_level": _dali.access_level_encode(calendar_object.access.default_level),
|
||||||
"attributed_group": (
|
"attributed": (
|
||||||
lib_plankton.map.dump(calendar_object.access.attributed_group)
|
lib_plankton.map.dump(calendar_object.access.attributed)
|
||||||
.map(
|
|
||||||
(pair) => (
|
|
||||||
{
|
|
||||||
"group_id": pair.key,
|
|
||||||
"level": _dali.access_level_encode(pair.value),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attributed_user": (
|
|
||||||
lib_plankton.map.dump(calendar_object.access.attributed_user)
|
|
||||||
.map(
|
.map(
|
||||||
(pair) => (
|
(pair) => (
|
||||||
{
|
{
|
||||||
|
|
@ -326,7 +256,7 @@ namespace _dali.model
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* @todo
|
* @todo
|
||||||
|
|
@ -370,24 +300,15 @@ namespace _dali.model
|
||||||
"access": {
|
"access": {
|
||||||
"public": calendar_object.access.public,
|
"public": calendar_object.access.public,
|
||||||
"default_level": _dali.access_level_encode(calendar_object.access.default_level),
|
"default_level": _dali.access_level_encode(calendar_object.access.default_level),
|
||||||
"attributed_group": (
|
"attributed": (
|
||||||
lib_plankton.map.dump(calendar_object.access.attributed_group)
|
lib_plankton.map.dump(calendar_object.access.attributed)
|
||||||
.map(
|
|
||||||
(pair) => ({
|
|
||||||
"group_id": pair.key,
|
|
||||||
"level": _dali.access_level_encode(pair.value),
|
|
||||||
})
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attributed_user": (
|
|
||||||
lib_plankton.map.dump(calendar_object.access.attributed_user)
|
|
||||||
.map(
|
.map(
|
||||||
(pair) => ({
|
(pair) => ({
|
||||||
"user_id": pair.key,
|
"user_id": pair.key,
|
||||||
"level": _dali.access_level_encode(pair.value),
|
"level": _dali.access_level_encode(pair.value),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
),
|
)
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -437,6 +358,7 @@ namespace _dali.model
|
||||||
* @todo heed calendar_ids
|
* @todo heed calendar_ids
|
||||||
* @todo mutex
|
* @todo mutex
|
||||||
* @todo only update outside timeframe
|
* @todo only update outside timeframe
|
||||||
|
* @todo clear after login/logout
|
||||||
*/
|
*/
|
||||||
export async function sync_events(
|
export async function sync_events(
|
||||||
timeframe : {
|
timeframe : {
|
||||||
|
|
@ -635,8 +557,13 @@ namespace _dali.model
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
_state = {
|
_state = {
|
||||||
"groups": [],
|
"users": (
|
||||||
"users": [],
|
_dali.is_logged_in()
|
||||||
|
?
|
||||||
|
(await _dali.backend.user_list())
|
||||||
|
:
|
||||||
|
[]
|
||||||
|
),
|
||||||
"calendars": lib_plankton.map.hashmap.implementation_map(
|
"calendars": lib_plankton.map.hashmap.implementation_map(
|
||||||
lib_plankton.map.hashmap.make(
|
lib_plankton.map.hashmap.make(
|
||||||
calendar_id => calendar_id.toFixed(0)
|
calendar_id => calendar_id.toFixed(0)
|
||||||
|
|
@ -653,20 +580,6 @@ namespace _dali.model
|
||||||
|
|
||||||
_dali.listen_login(
|
_dali.listen_login(
|
||||||
async () => {
|
async () => {
|
||||||
_state.groups = (
|
|
||||||
(await _dali.backend.group_list())
|
|
||||||
.map(
|
|
||||||
entry => (
|
|
||||||
{
|
|
||||||
"id": entry.id,
|
|
||||||
"object": {
|
|
||||||
"name": entry.name,
|
|
||||||
"label": entry.label,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
_state.users = await _dali.backend.user_list();
|
_state.users = await _dali.backend.user_list();
|
||||||
await sync_calendars();
|
await sync_calendars();
|
||||||
lib_plankton.map.clear(_state.events);
|
lib_plankton.map.clear(_state.events);
|
||||||
|
|
@ -676,7 +589,6 @@ namespace _dali.model
|
||||||
);
|
);
|
||||||
_dali.listen_logout(
|
_dali.listen_logout(
|
||||||
async () => {
|
async () => {
|
||||||
_state.groups = [];
|
|
||||||
_state.users = [];
|
_state.users = [];
|
||||||
await sync_calendars();
|
await sync_calendars();
|
||||||
lib_plankton.map.clear(_state.events);
|
lib_plankton.map.clear(_state.events);
|
||||||
|
|
|
||||||
|
|
@ -1,31 +1,10 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.overlay
|
namespace _dali.overlay
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function get_container_element(
|
function get_container_element(
|
||||||
)
|
) : HTMLElement
|
||||||
: HTMLElement
|
|
||||||
{
|
{
|
||||||
return document.querySelector("#overlay");
|
return document.querySelector("#overlay");
|
||||||
}
|
}
|
||||||
|
|
@ -34,8 +13,7 @@ namespace _dali.overlay
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function get_content_element(
|
export function get_content_element(
|
||||||
)
|
) : HTMLElement
|
||||||
: HTMLElement
|
|
||||||
{
|
{
|
||||||
return document.querySelector("#overlay_content");
|
return document.querySelector("#overlay_content");
|
||||||
}
|
}
|
||||||
|
|
@ -44,8 +22,7 @@ namespace _dali.overlay
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function clear(
|
export function clear(
|
||||||
)
|
) : void
|
||||||
: void
|
|
||||||
{
|
{
|
||||||
get_content_element().innerHTML = "";
|
get_content_element().innerHTML = "";
|
||||||
}
|
}
|
||||||
|
|
@ -64,8 +41,7 @@ namespace _dali.overlay
|
||||||
=
|
=
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
)
|
) : void
|
||||||
: void
|
|
||||||
{
|
{
|
||||||
get_container_element().classList.toggle("overlay_active", mode ?? undefined);
|
get_container_element().classList.toggle("overlay_active", mode ?? undefined);
|
||||||
}
|
}
|
||||||
|
|
@ -74,8 +50,7 @@ namespace _dali.overlay
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function initialize(
|
export function initialize(
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
clear();
|
clear();
|
||||||
const container_element : HTMLElement = get_container_element();
|
const container_element : HTMLElement = get_container_element();
|
||||||
|
|
|
||||||
119
source/pages/caldav/logic.ts
Normal file
119
source/pages/caldav/logic.ts
Normal file
|
|
@ -0,0 +1,119 @@
|
||||||
|
namespace _dali.pages
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
lib_plankton.zoo_page.register(
|
||||||
|
"caldav",
|
||||||
|
async (parameters, target_element) => {
|
||||||
|
target_element.innerHTML = "";
|
||||||
|
const conf = await _dali.backend.user_dav_conf();
|
||||||
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
|
"caldav",
|
||||||
|
"main",
|
||||||
|
{
|
||||||
|
"label": lib_plankton.translate.get("page.caldav.title"),
|
||||||
|
"content": (
|
||||||
|
(conf === null)
|
||||||
|
?
|
||||||
|
await _dali.helpers.template_coin(
|
||||||
|
"caldav",
|
||||||
|
"unavailable",
|
||||||
|
{
|
||||||
|
"text": lib_plankton.translate.get("page.caldav.unavailable"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
:
|
||||||
|
await _dali.helpers.template_coin(
|
||||||
|
"caldav",
|
||||||
|
"available",
|
||||||
|
{
|
||||||
|
"conf_title": lib_plankton.translate.get("page.caldav.conf.title"),
|
||||||
|
"conf_content": (
|
||||||
|
(conf.password === null)
|
||||||
|
?
|
||||||
|
await _dali.helpers.template_coin(
|
||||||
|
"caldav",
|
||||||
|
"conf-token_unset",
|
||||||
|
{
|
||||||
|
"text": lib_plankton.translate.get("page.caldav.conf.token_unset")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
:
|
||||||
|
await _dali.helpers.template_coin(
|
||||||
|
"caldav",
|
||||||
|
"conf-token_set",
|
||||||
|
{
|
||||||
|
"address_label": lib_plankton.translate.get("page.caldav.conf.address"),
|
||||||
|
"address_value": conf.address,
|
||||||
|
"username_label": lib_plankton.translate.get("page.caldav.conf.username"),
|
||||||
|
"username_value": conf.username,
|
||||||
|
"password_label": lib_plankton.translate.get("page.caldav.conf.password"),
|
||||||
|
"password_value": conf.password,
|
||||||
|
"setup_hints_label": lib_plankton.translate.get("page.caldav.conf.setup_hints"),
|
||||||
|
"setup_hint_entries": (
|
||||||
|
await lib_plankton.call.promise_condense<string, unknown>(
|
||||||
|
conf.setup_hints
|
||||||
|
.map(
|
||||||
|
entry => () => _dali.helpers.template_coin(
|
||||||
|
"caldav",
|
||||||
|
"conf-setup_hint_entry",
|
||||||
|
{
|
||||||
|
"text": entry.label,
|
||||||
|
"href": entry.link,
|
||||||
|
"remark": (
|
||||||
|
(entry.remark === null)
|
||||||
|
?
|
||||||
|
""
|
||||||
|
:
|
||||||
|
lib_plankton.string.coin(
|
||||||
|
" — {{content}}",
|
||||||
|
{
|
||||||
|
"content": entry.remark,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
).join("")
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
"set_token_title": lib_plankton.translate.get("page.caldav.set_token.title"),
|
||||||
|
"set_token_action": (
|
||||||
|
(conf.password === null)
|
||||||
|
?
|
||||||
|
lib_plankton.translate.get("page.caldav.set_token.action.set")
|
||||||
|
:
|
||||||
|
lib_plankton.translate.get("page.caldav.set_token.action.overwrite")
|
||||||
|
),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* logic: set token
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
if (conf !== null)
|
||||||
|
{
|
||||||
|
document.querySelector("#caldav-set_token > button").addEventListener(
|
||||||
|
"click",
|
||||||
|
async () => {
|
||||||
|
await _dali.backend.user_dav_token();
|
||||||
|
lib_plankton.zoo_page.reload();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Promise.resolve<void>(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<div class="widget-caldav-conf">
|
<div id="caldav-conf">
|
||||||
<h3>{{conf_title}}</h3>
|
<h3>{{conf_title}}</h3>
|
||||||
{{conf_content}}
|
{{conf_content}}
|
||||||
</div>
|
</div>
|
||||||
<div class="widget-caldav-set_token">
|
<div id="caldav-set_token">
|
||||||
<h3>{{set_token_title}}</h3>
|
<h3>{{set_token_title}}</h3>
|
||||||
<button>{{set_token_action}}</button>
|
<button>{{set_token_action}}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<li class="widget-caldav-conf-setup_hints-entry">
|
<li class="caldav-conf-setup_hints-entry">
|
||||||
<a target="_blank" href="{{href}}">{{text}}</a>{{remark}}
|
<a target="_blank" href="{{href}}">{{text}}</a>{{remark}}
|
||||||
</li>
|
</li>
|
||||||
18
source/pages/caldav/templates/conf-token_set.html.tpl
Normal file
18
source/pages/caldav/templates/conf-token_set.html.tpl
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div class="caldav-conf-section" id="caldav-conf-address">
|
||||||
|
<span class="caldav-conf-section-label">{{address_label}}</span>
|
||||||
|
<span class="caldav-conf-section-value caldav-conf-section-value-regular">{{address_value}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="caldav-conf-section" id="caldav-conf-username">
|
||||||
|
<span class="caldav-conf-section-label">{{username_label}}</span>
|
||||||
|
<span class="caldav-conf-section-value caldav-conf-section-value-regular">{{username_value}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="caldav-conf-section" id="caldav-conf-password">
|
||||||
|
<span class="caldav-conf-section-label">{{password_label}}</span>
|
||||||
|
<span class="caldav-conf-section-value caldav-conf-section-value-regular">{{password_value}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="caldav-conf-section" id="caldav-conf-setup_hints">
|
||||||
|
<span class="caldav-conf-section-label">{{setup_hints_label}}</span>
|
||||||
|
<ul>
|
||||||
|
{{setup_hint_entries}}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
4
source/pages/caldav/templates/conf-token_unset.html.tpl
Normal file
4
source/pages/caldav/templates/conf-token_unset.html.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<div id="caldav-conf-info">
|
||||||
|
({{text}})
|
||||||
|
</div>
|
||||||
|
|
||||||
6
source/pages/caldav/templates/main.html.tpl
Normal file
6
source/pages/caldav/templates/main.html.tpl
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<div id="caldav">
|
||||||
|
<h2>{{label}}</h2>
|
||||||
|
<div id="caldav-content">
|
||||||
|
{{content}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
3
source/pages/caldav/templates/unavailable.html.tpl
Normal file
3
source/pages/caldav/templates/unavailable.html.tpl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div id="caldav-info">
|
||||||
|
{{text}}
|
||||||
|
</div>
|
||||||
21
source/pages/oidc_finish/logic.ts
Normal file
21
source/pages/oidc_finish/logic.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
namespace _dali.pages
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
lib_plankton.zoo_page.register(
|
||||||
|
"oidc_finish",
|
||||||
|
async (parameters, target_element) => {
|
||||||
|
target_element.innerHTML = "";
|
||||||
|
await _dali.oidc_finish(parameters["session_key"]);
|
||||||
|
lib_plankton.zoo_page.set(
|
||||||
|
{
|
||||||
|
"name": "overview",
|
||||||
|
"parameters": {}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
return Promise.resolve<void>(undefined);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
467
source/pages/overview/logic.ts
Normal file
467
source/pages/overview/logic.ts
Normal file
|
|
@ -0,0 +1,467 @@
|
||||||
|
namespace _dali.pages.overview
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
lib_plankton.zoo_page.register(
|
||||||
|
"overview",
|
||||||
|
async (parameters, target_element) => {
|
||||||
|
// params
|
||||||
|
const view_mode : _dali.enum_view_mode = _dali.helpers.view_mode_determine(parameters["mode"] ?? "auto");
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @todo ordentlich machen (nicht nur week und list)
|
||||||
|
*/
|
||||||
|
const set_view_mode = (view_mode) => {
|
||||||
|
const compact : boolean = (view_mode !== _dali.enum_view_mode.week);
|
||||||
|
target_element.querySelector("#overview").classList.toggle("overview-compact", compact);
|
||||||
|
};
|
||||||
|
|
||||||
|
// exec
|
||||||
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
|
"overview",
|
||||||
|
"default",
|
||||||
|
{
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// mode switcher
|
||||||
|
{
|
||||||
|
const widget_mode_switcher : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.mode_switcher.class_widget_mode_switcher(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"mode": _dali.enum_view_mode.week,
|
||||||
|
"label": lib_plankton.translate.get("page.overview.mode.week"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"mode": _dali.enum_view_mode.list,
|
||||||
|
"label": lib_plankton.translate.get("page.overview.mode.list"),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
{
|
||||||
|
"initial_selection": view_mode,
|
||||||
|
"action_change": (view_mode) => {
|
||||||
|
lib_plankton.zoo_page.set(
|
||||||
|
{
|
||||||
|
"name": "overview",
|
||||||
|
"parameters": {
|
||||||
|
"mode": _dali.view_mode_encode(view_mode),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
set_view_mode(view_mode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
set_view_mode(view_mode);
|
||||||
|
await widget_mode_switcher.load(target_element.querySelector("#overview-mode"));
|
||||||
|
}
|
||||||
|
|
||||||
|
let widget_sources : _dali.widgets.sources.class_widget_sources;
|
||||||
|
let widget_weekview : _dali.widgets.weekview.class_widget_weekview;
|
||||||
|
let widget_listview : _dali.widgets.listview.class_widget_listview;
|
||||||
|
|
||||||
|
const get_available_calendars = async () => {
|
||||||
|
return (
|
||||||
|
(await _dali.model.calendar_list())
|
||||||
|
.filter(
|
||||||
|
(entry) => (
|
||||||
|
(entry.access_level === _dali.enum_access_level.edit)
|
||||||
|
||
|
||||||
|
(entry.access_level === _dali.enum_access_level.admin)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @todo update listview
|
||||||
|
*/
|
||||||
|
const update_sources_and_entries = async (priviliged = null) => {
|
||||||
|
await widget_sources.update({"priviliged": priviliged});
|
||||||
|
await widget_weekview.update_entries();
|
||||||
|
};
|
||||||
|
/**
|
||||||
|
* @todo update listview
|
||||||
|
*/
|
||||||
|
const update_entries = async (priviliged = null) => {
|
||||||
|
await widget_weekview.update_entries();
|
||||||
|
};
|
||||||
|
// hint
|
||||||
|
{
|
||||||
|
const dom_hint = target_element.querySelector("#overview-hint");
|
||||||
|
dom_hint.textContent = lib_plankton.translate.get("page.overview.login_hint");
|
||||||
|
dom_hint.classList.toggle("overview-hint-hidden", _dali.is_logged_in());
|
||||||
|
}
|
||||||
|
// sources
|
||||||
|
{
|
||||||
|
widget_sources = new _dali.widgets.sources.class_widget_sources(
|
||||||
|
_dali.model.calendar_list,
|
||||||
|
{
|
||||||
|
"initial_priviliged": _dali.is_logged_in(),
|
||||||
|
"action_create": () => {
|
||||||
|
(async () => {
|
||||||
|
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
|
||||||
|
await _dali.model.user_list(),
|
||||||
|
{
|
||||||
|
"read_only": false,
|
||||||
|
"action_cancel": () => {
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
},
|
||||||
|
"action_add": (calendar_object) => {
|
||||||
|
_dali.model.calendar_add(
|
||||||
|
calendar_object
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
() => {
|
||||||
|
update_sources_and_entries();
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch(
|
||||||
|
(reason) => {
|
||||||
|
lib_plankton.log.warning(
|
||||||
|
"dali.overview.calendar_add_error",
|
||||||
|
{"reason": String(reason)}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
"initial_value": null,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
_dali.overlay.clear();
|
||||||
|
_dali.overlay.toggle({"mode": true});
|
||||||
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
|
}) ();
|
||||||
|
},
|
||||||
|
"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) => {
|
||||||
|
widget_weekview.toggle_visibility(entry.id);
|
||||||
|
widget_listview.toggle_visibility(entry.id);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await widget_sources.load(target_element.querySelector("#overview-pane-left"));
|
||||||
|
}
|
||||||
|
// events
|
||||||
|
{
|
||||||
|
const get_entries = async (from_pit, to_pit, calendar_ids) => {
|
||||||
|
/**
|
||||||
|
* @todo do NOT wait?
|
||||||
|
*/
|
||||||
|
await _dali.model.sync_events(
|
||||||
|
{
|
||||||
|
"from": from_pit,
|
||||||
|
"to": to_pit,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"calendar_ids": calendar_ids,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
/**
|
||||||
|
* @todo filter
|
||||||
|
*/
|
||||||
|
return _dali.model.event_list();
|
||||||
|
};
|
||||||
|
const action_select_event = async (event_key) => {
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
case _dali.enum_access_level.none:
|
||||||
|
{
|
||||||
|
throw (new Error("this event should not be visible"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case _dali.enum_access_level.view:
|
||||||
|
{
|
||||||
|
read_only = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case _dali.enum_access_level.edit:
|
||||||
|
case _dali.enum_access_level.admin:
|
||||||
|
{
|
||||||
|
read_only = 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,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"read_only": read_only,
|
||||||
|
"action_cancel": () => {
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
},
|
||||||
|
"action_change": (data) => {
|
||||||
|
_dali.model.event_change(
|
||||||
|
event_key,
|
||||||
|
{
|
||||||
|
"name": data.event_name,
|
||||||
|
"begin": data.event_begin,
|
||||||
|
"end": data.event_end,
|
||||||
|
"location": data.event_location,
|
||||||
|
"link": data.event_link,
|
||||||
|
"description": data.event_description,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
() => {
|
||||||
|
update_entries();
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch(
|
||||||
|
(reason) => {
|
||||||
|
lib_plankton.log.warning(
|
||||||
|
"dali.overview.event_change.error",
|
||||||
|
{"reason": String(reason)}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
"action_remove": () => {
|
||||||
|
_dali.model.event_remove(
|
||||||
|
event_key
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
() => {
|
||||||
|
update_entries();
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch(
|
||||||
|
(reason) => {
|
||||||
|
lib_plankton.log.warning(
|
||||||
|
"dali.overview.event_remove_error",
|
||||||
|
{"reason": String(reason)}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
_dali.overlay.clear();
|
||||||
|
_dali.overlay.toggle({"mode": true});
|
||||||
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
|
}) ();
|
||||||
|
};
|
||||||
|
// listview
|
||||||
|
{
|
||||||
|
widget_listview = (
|
||||||
|
new _dali.widgets.listview.class_widget_listview(
|
||||||
|
get_entries,
|
||||||
|
{
|
||||||
|
"action_select_event": action_select_event,
|
||||||
|
"action_add": () => {
|
||||||
|
lib_plankton.zoo_page.set(
|
||||||
|
{
|
||||||
|
"name": "event_add",
|
||||||
|
"parameters": {
|
||||||
|
"calendar_id": null,
|
||||||
|
"year": null,
|
||||||
|
"month": null,
|
||||||
|
"day": null,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
await widget_listview.load(target_element.querySelector("#overview-pane-right-listview"));
|
||||||
|
}
|
||||||
|
// weekview
|
||||||
|
{
|
||||||
|
widget_weekview = (
|
||||||
|
new _dali.widgets.weekview.class_widget_weekview(
|
||||||
|
get_entries,
|
||||||
|
{
|
||||||
|
"action_select_event": action_select_event,
|
||||||
|
"action_select_day": (date) => {
|
||||||
|
/*
|
||||||
|
if (! _dali.is_logged_in())
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
(async () => {
|
||||||
|
const widget = new _dali.widgets.event_edit.class_widget_event_edit(
|
||||||
|
(await get_available_calendars()),
|
||||||
|
{
|
||||||
|
"calendar_id": null,
|
||||||
|
"event_name": "",
|
||||||
|
"event_begin": lib_plankton.call.convey(
|
||||||
|
date,
|
||||||
|
[
|
||||||
|
x => ({
|
||||||
|
"timezone_shift": 0,
|
||||||
|
"date": date,
|
||||||
|
"time": {"hour": 12, "minute": 0, "second": 0}
|
||||||
|
}),
|
||||||
|
lib_plankton.pit.from_datetime,
|
||||||
|
x => lib_plankton.pit.shift_hour(x, 0),
|
||||||
|
lib_plankton.pit.to_datetime,
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"event_end": lib_plankton.call.convey(
|
||||||
|
date,
|
||||||
|
[
|
||||||
|
x => ({
|
||||||
|
"timezone_shift": 0,
|
||||||
|
"date": date,
|
||||||
|
"time": {"hour": 12, "minute": 0, "second": 0}
|
||||||
|
}),
|
||||||
|
lib_plankton.pit.from_datetime,
|
||||||
|
x => lib_plankton.pit.shift_hour(x, +1),
|
||||||
|
lib_plankton.pit.to_datetime,
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"event_location": null,
|
||||||
|
"event_link": null,
|
||||||
|
"event_description": null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"read_only": false,
|
||||||
|
"action_cancel": () => {
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
},
|
||||||
|
"action_add": (data) => {
|
||||||
|
_dali.model.event_add(
|
||||||
|
data.calendar_id,
|
||||||
|
{
|
||||||
|
"name": data.event_name,
|
||||||
|
"begin": data.event_begin,
|
||||||
|
"end": data.event_end,
|
||||||
|
"location": data.event_location,
|
||||||
|
"link": data.event_link,
|
||||||
|
"description": data.event_description,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(
|
||||||
|
() => {
|
||||||
|
update_entries();
|
||||||
|
_dali.overlay.toggle({"mode": false});
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch(
|
||||||
|
(reason) => {
|
||||||
|
// todo
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
}
|
||||||
|
);
|
||||||
|
_dali.overlay.clear();
|
||||||
|
_dali.overlay.toggle({"mode": true});
|
||||||
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
|
}) ();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
|
await widget_weekview.load(target_element.querySelector("#overview-pane-right-weekview"));
|
||||||
|
}
|
||||||
|
_dali.model.listen_reset(
|
||||||
|
async (priviliged) => {
|
||||||
|
update_sources_and_entries(priviliged);
|
||||||
|
target_element.querySelector("#overview-hint").classList.toggle("overview-hint-hidden", priviliged);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return Promise.resolve<void>(undefined);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
18
source/pages/overview/templates/default.html.tpl
Normal file
18
source/pages/overview/templates/default.html.tpl
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div id="overview">
|
||||||
|
<div id="overview-head">
|
||||||
|
<div id="overview-hint">
|
||||||
|
</div>
|
||||||
|
<div id="overview-mode">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="overview-body">
|
||||||
|
<div id="overview-pane-left">
|
||||||
|
</div>
|
||||||
|
<div id="overview-pane-right">
|
||||||
|
<div id="overview-pane-right-weekview">
|
||||||
|
</div>
|
||||||
|
<div id="overview-pane-right-listview">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -1,23 +1,3 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
namespace _dali.backend
|
namespace _dali.backend
|
||||||
|
|
@ -127,7 +107,16 @@ namespace _dali.backend
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
var _queue : lib_plankton.call.type_queue<type_request, any>;
|
var _queue : {
|
||||||
|
items : Array<
|
||||||
|
{
|
||||||
|
request : type_request;
|
||||||
|
resolve : ((result : any) => void);
|
||||||
|
reject : ((reason : any) => void);
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
busy : boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -151,9 +140,10 @@ namespace _dali.backend
|
||||||
)
|
)
|
||||||
*/
|
*/
|
||||||
);
|
);
|
||||||
_queue = lib_plankton.call.queue_make<type_request, any>(
|
_queue = {
|
||||||
call_real
|
"items": [],
|
||||||
);
|
"busy": false,
|
||||||
|
};
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -253,17 +243,59 @@ namespace _dali.backend
|
||||||
&&
|
&&
|
||||||
(http_response.status_code < 300)
|
(http_response.status_code < 300)
|
||||||
)
|
)
|
||||||
)
|
) {
|
||||||
{
|
|
||||||
return Promise.reject<any>(http_response.body.toString());
|
return Promise.reject<any>(http_response.body.toString());
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
const output : any = lib_plankton.json.decode(http_response.body.toString());
|
const output : any = lib_plankton.json.decode(http_response.body.toString());
|
||||||
return Promise.resolve<any>(output);
|
return Promise.resolve<any>(output);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
async function process(
|
||||||
|
)
|
||||||
|
: Promise<void>
|
||||||
|
{
|
||||||
|
if (_queue.busy)
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_queue.busy = true;
|
||||||
|
while (_queue.items.length > 0)
|
||||||
|
{
|
||||||
|
const entry = _queue.items.shift();
|
||||||
|
let successful : boolean;
|
||||||
|
let reason : any;
|
||||||
|
let result : any;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
result = await call_real(entry.request);
|
||||||
|
successful = true;
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{
|
||||||
|
reason = error;
|
||||||
|
successful = false;
|
||||||
|
}
|
||||||
|
if (successful)
|
||||||
|
{
|
||||||
|
entry.resolve(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
entry.reject(reason);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_queue.busy = false;
|
||||||
|
// process();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
@ -279,18 +311,19 @@ namespace _dali.backend
|
||||||
"action": action,
|
"action": action,
|
||||||
"input": input,
|
"input": input,
|
||||||
};
|
};
|
||||||
return (
|
const promise : Promise<any> = new Promise<any>(
|
||||||
new Promise<any>(
|
(resolve, reject) => {
|
||||||
(resolve, reject) => {
|
_queue.items.push(
|
||||||
lib_plankton.call.queue_add<type_request, any>(
|
{
|
||||||
_queue,
|
"request": request,
|
||||||
request,
|
"resolve": resolve,
|
||||||
resolve,
|
"reject": reject,
|
||||||
reject
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
process();
|
||||||
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -378,28 +411,6 @@ namespace _dali.backend
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function group_list(
|
|
||||||
)
|
|
||||||
: Promise<
|
|
||||||
Array<
|
|
||||||
{
|
|
||||||
id : int;
|
|
||||||
name : string;
|
|
||||||
label : string;
|
|
||||||
}
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
return call(
|
|
||||||
lib_plankton.http.enum_method.get,
|
|
||||||
"/groups",
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function user_list(
|
export function user_list(
|
||||||
|
|
@ -501,18 +512,12 @@ namespace _dali.backend
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : string;
|
default_level : string;
|
||||||
attributed_group : Array<
|
attributed : Array<
|
||||||
{
|
|
||||||
group_id : int;
|
|
||||||
level : string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
attributed_user : Array<
|
|
||||||
{
|
{
|
||||||
user_id : int;
|
user_id : int;
|
||||||
level : string;
|
level : string;
|
||||||
}
|
}
|
||||||
>;
|
>
|
||||||
};
|
};
|
||||||
resource_id : int;
|
resource_id : int;
|
||||||
}
|
}
|
||||||
|
|
@ -539,13 +544,7 @@ namespace _dali.backend
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : string;
|
default_level : string;
|
||||||
attributed_group : Array<
|
attributed : Array<
|
||||||
{
|
|
||||||
group_id : int;
|
|
||||||
level : string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
attributed_user : Array<
|
|
||||||
{
|
{
|
||||||
user_id : int;
|
user_id : int;
|
||||||
level : string;
|
level : string;
|
||||||
|
|
@ -596,13 +595,7 @@ namespace _dali.backend
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : string;
|
default_level : string;
|
||||||
attributed_group : Array<
|
attributed : Array<
|
||||||
{
|
|
||||||
group_id : int;
|
|
||||||
level : string;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
attributed_user : Array<
|
|
||||||
{
|
{
|
||||||
user_id : int;
|
user_id : int;
|
||||||
level : string;
|
level : string;
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,3 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.conf
|
namespace _dali.conf
|
||||||
{
|
{
|
||||||
|
|
@ -73,15 +53,14 @@ namespace _dali.conf
|
||||||
"default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}"
|
"default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}"
|
||||||
},
|
},
|
||||||
"use_central_europe_specific_datetime_inputs": {
|
"use_central_europe_specific_datetime_inputs": {
|
||||||
"nullable": false,
|
"nullable": true,
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"weekview_cell_day_format": {
|
"update_interval": {
|
||||||
"nullable": false,
|
"nullable": false,
|
||||||
"type": "string",
|
"type": "integer",
|
||||||
"default": "d.b",
|
"default": 60
|
||||||
"description": "available placeholders: Y,m,b,d,W,w (as in UNIX command 'date')"
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"required": [
|
"required": [
|
||||||
|
|
@ -99,25 +78,7 @@ namespace _dali.conf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
type type_data = {
|
var _data : (null | any) = null;
|
||||||
version : string;
|
|
||||||
backend : {
|
|
||||||
scheme : string;
|
|
||||||
host : string;
|
|
||||||
port : int;
|
|
||||||
path : string;
|
|
||||||
};
|
|
||||||
misc : {
|
|
||||||
oidc_redirect_uri_template : string;
|
|
||||||
use_central_europe_specific_datetime_inputs : string;
|
|
||||||
weekview_cell_day_format : string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
var _data : (null | type_data) = null;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -132,7 +93,7 @@ namespace _dali.conf
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function get(
|
export function get(
|
||||||
) : type_data
|
) : any
|
||||||
{
|
{
|
||||||
if (_data === null)
|
if (_data === null)
|
||||||
{
|
{
|
||||||
|
|
@ -150,7 +111,10 @@ namespace _dali.conf
|
||||||
path : string
|
path : string
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
_data = ((await lib_plankton.conf.load(_schema, path)) as type_data);
|
_data = await lib_plankton.conf.load(
|
||||||
|
_schema,
|
||||||
|
path
|
||||||
|
);
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
4
source/style/hacks.css
Normal file
4
source/style/hacks.css
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
.plankton_input_group_field[rel="resource_kind"]
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
@ -20,6 +20,72 @@ header
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#overlay
|
||||||
|
{
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background-color: hsla(var(--hue), 0%, 0%, 0.75);
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
#overlay_content
|
||||||
|
{
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
|
||||||
|
transform: translate(-50%,-50%);
|
||||||
|
-ms-transform: translate(-50%,-50%);
|
||||||
|
|
||||||
|
padding: 32px;
|
||||||
|
|
||||||
|
background-color: hsl(0, 0%, 12.5%);
|
||||||
|
color: hsl(0, 0%, 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
#overlay:not(.overlay_active)
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul
|
||||||
|
{
|
||||||
|
list-style-type: none;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul > li
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
margin: 8px;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav > ul > li:not(.active)
|
||||||
|
{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a
|
||||||
|
{
|
||||||
|
padding: 8px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: hsl(var(--hue), 0%, 87.5%);
|
||||||
|
}
|
||||||
|
|
||||||
|
nav a:hover
|
||||||
|
{
|
||||||
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
|
border-bottom: 2px solid hsl(0, 0%, 100%);
|
||||||
|
transition: 1s ease color;
|
||||||
|
}
|
||||||
|
|
||||||
a
|
a
|
||||||
{
|
{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
|
@ -33,9 +99,14 @@ a:hover
|
||||||
transition: 1s ease color;
|
transition: 1s ease color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
input,select,textarea
|
||||||
|
{
|
||||||
|
padding: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
button
|
button
|
||||||
{
|
{
|
||||||
padding: 8px 12px;
|
padding: 8px;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
|
@ -51,10 +122,6 @@ input,select,textarea
|
||||||
background-color: hsl(0, 0%, 25%);
|
background-color: hsl(0, 0%, 25%);
|
||||||
border: 1px solid hsl(0, 0%, 25%);
|
border: 1px solid hsl(0, 0%, 25%);
|
||||||
color: hsl(0, 0%, 100%);
|
color: hsl(0, 0%, 100%);
|
||||||
padding: 4px;
|
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
/*
|
|
||||||
font-family: monospace;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
#overlay
|
|
||||||
{
|
|
||||||
position: fixed;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
background-color: hsla(var(--hue), 0%, 0%, 0.75);
|
|
||||||
z-index: 2;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay_content
|
|
||||||
{
|
|
||||||
position: absolute;
|
|
||||||
top: 50%;
|
|
||||||
left: 50%;
|
|
||||||
|
|
||||||
transform: translate(-50%,-50%);
|
|
||||||
-ms-transform: translate(-50%,-50%);
|
|
||||||
|
|
||||||
padding: 32px;
|
|
||||||
|
|
||||||
background-color: hsl(0, 0%, 12.5%);
|
|
||||||
color: hsl(0, 0%, 100%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#overlay:not(.overlay_active)
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
.widget-caldav-conf-section
|
.caldav-conf-section
|
||||||
{
|
{
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-caldav-conf-section-label
|
.caldav-conf-section-label
|
||||||
{
|
{
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
@ -11,12 +11,12 @@
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-caldav-conf-section-value
|
.caldav-conf-section-value
|
||||||
{
|
{
|
||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-caldav-conf-section-value-regular
|
.caldav-conf-section-value-regular
|
||||||
{
|
{
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
46
source/style/page-overview.css
Normal file
46
source/style/page-overview.css
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
#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 {}
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
.listview-add
|
.listview-add
|
||||||
{
|
{
|
||||||
margin-left: 12px;
|
/*
|
||||||
|
text-transform: capitalize;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.listview-add-hidden
|
.listview-add-hidden
|
||||||
|
|
@ -29,16 +29,14 @@
|
||||||
|
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
|
||||||
/*
|
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-menu-platform:not(.widget-menu-platform-collapsed)
|
.widget-menu-platform:not(.widget-menu-platform-collapsed)
|
||||||
{
|
{
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 50px;
|
top: 32px;
|
||||||
right: 20px;
|
right: 32px;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -51,22 +49,24 @@
|
||||||
|
|
||||||
.widget-menu-entry
|
.widget-menu-entry
|
||||||
{
|
{
|
||||||
margin: 12px 8px;
|
margin: 12px 16px;
|
||||||
|
padding: 8px;
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
|
}
|
||||||
|
|
||||||
|
.widget-menu-entry:not(:hover)
|
||||||
|
{
|
||||||
background-color: hsl(var(--hue), 0%, 25%);
|
background-color: hsl(var(--hue), 0%, 25%);
|
||||||
color: hsl(var(--hue), 0%, 100%);
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-menu-entry:not(:hover) > span
|
.widget-menu-entry:hover::after
|
||||||
{
|
{
|
||||||
border-bottom: 2px solid hsl(0, 0%, 25%);
|
content: " «";
|
||||||
}
|
/*
|
||||||
|
background-color: hsl(var(--hue), 0%, 50%);
|
||||||
.widget-menu-entry:hover > span
|
color: hsl(var(--hue), 0%, 100%);
|
||||||
{
|
*/
|
||||||
border-bottom: 2px solid hsl(0, 0%, 100%);
|
|
||||||
|
|
||||||
transition: 1s ease color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.widget-menu-entry.widget-menu-entry-hidden
|
.widget-menu-entry.widget-menu-entry-hidden
|
||||||
66
source/style/widget-sources.css
Normal file
66
source/style/widget-sources.css
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
.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);
|
||||||
|
}
|
||||||
|
|
@ -1,32 +1,12 @@
|
||||||
.weekview-controls
|
.weekview-controls
|
||||||
{
|
{
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
justify-content: right;
|
|
||||||
|
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekview-controls > *
|
.weekview-control
|
||||||
{
|
{
|
||||||
flex-basis: 0;
|
margin: 0 12px;
|
||||||
flex-grow: 0;
|
|
||||||
flex-shrink: 1;
|
|
||||||
|
|
||||||
margin: 0 0 0 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.weekview-control-label
|
|
||||||
{
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
font-size: 0.75em;
|
|
||||||
/*
|
|
||||||
text-transform: uppercase;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekview-table table
|
.weekview-table table
|
||||||
|
|
@ -44,21 +24,18 @@
|
||||||
|
|
||||||
.weekview-cell-day
|
.weekview-cell-day
|
||||||
{
|
{
|
||||||
/* todo */
|
|
||||||
width: 13.5%;
|
width: 13.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekview-cell-week
|
.weekview-cell-week
|
||||||
{
|
{
|
||||||
/* todo */
|
|
||||||
width: 5.5%;
|
width: 5.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekview-cell-regular
|
.weekview-cell-regular
|
||||||
{
|
{
|
||||||
/* todo */
|
|
||||||
width: 13.5%;
|
width: 13.5%;
|
||||||
height: 100px;
|
height: 120px;
|
||||||
|
|
||||||
cursor: copy;
|
cursor: copy;
|
||||||
}
|
}
|
||||||
|
|
@ -76,12 +53,12 @@
|
||||||
.weekview-day
|
.weekview-day
|
||||||
{
|
{
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
|
cursor: help;
|
||||||
}
|
}
|
||||||
|
|
||||||
.weekview-events
|
.weekview-events
|
||||||
{
|
{
|
||||||
margin: 0;
|
margin: 0; padding: 0;
|
||||||
padding: 0;
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
119
source/types.ts
119
source/types.ts
|
|
@ -1,22 +1,3 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
|
|
@ -25,8 +6,7 @@ namespace _dali
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export enum enum_access_level
|
export enum enum_access_level {
|
||||||
{
|
|
||||||
none,
|
none,
|
||||||
view,
|
view,
|
||||||
edit,
|
edit,
|
||||||
|
|
@ -34,19 +14,6 @@ namespace _dali
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export type type_group_id = int;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export type type_group_object = {
|
|
||||||
name : string;
|
|
||||||
label : string;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export type type_user_id = int;
|
export type type_user_id = int;
|
||||||
|
|
@ -56,7 +23,6 @@ namespace _dali
|
||||||
*/
|
*/
|
||||||
export type type_user_object = {
|
export type type_user_object = {
|
||||||
name : string;
|
name : string;
|
||||||
label : string;
|
|
||||||
email_address : (
|
email_address : (
|
||||||
null
|
null
|
||||||
|
|
|
|
||||||
|
|
@ -171,11 +137,7 @@ namespace _dali
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : enum_access_level;
|
default_level : enum_access_level;
|
||||||
attributed_group : lib_plankton.map.type_map<
|
attributed : lib_plankton.map.type_map<
|
||||||
type_group_id,
|
|
||||||
enum_access_level
|
|
||||||
>;
|
|
||||||
attributed_user : lib_plankton.map.type_map<
|
|
||||||
type_user_id,
|
type_user_id,
|
||||||
enum_access_level
|
enum_access_level
|
||||||
>;
|
>;
|
||||||
|
|
@ -203,12 +165,20 @@ namespace _dali
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export enum enum_view_mode
|
||||||
|
{
|
||||||
|
week,
|
||||||
|
list,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function access_level_encode(
|
export function access_level_encode(
|
||||||
access_level : _dali.enum_access_level
|
access_level : _dali.enum_access_level
|
||||||
)
|
) : ("none" | "view" | "edit" | "admin")
|
||||||
: ("none" | "view" | "edit" | "admin")
|
|
||||||
{
|
{
|
||||||
switch (access_level)
|
switch (access_level)
|
||||||
{
|
{
|
||||||
|
|
@ -224,8 +194,7 @@ namespace _dali
|
||||||
*/
|
*/
|
||||||
export function access_level_decode(
|
export function access_level_decode(
|
||||||
representation : /*("none" | "view" | "edit" | "admin")*/string
|
representation : /*("none" | "view" | "edit" | "admin")*/string
|
||||||
)
|
) : _dali.enum_access_level
|
||||||
: _dali.enum_access_level
|
|
||||||
{
|
{
|
||||||
switch (representation)
|
switch (representation)
|
||||||
{
|
{
|
||||||
|
|
@ -238,21 +207,11 @@ namespace _dali
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export enum enum_view_mode
|
|
||||||
{
|
|
||||||
week,
|
|
||||||
list,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function view_mode_encode(
|
export function view_mode_encode(
|
||||||
mode : _dali.enum_view_mode
|
mode : _dali.enum_view_mode
|
||||||
)
|
) : string
|
||||||
: string
|
|
||||||
{
|
{
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
|
|
@ -267,8 +226,7 @@ namespace _dali
|
||||||
*/
|
*/
|
||||||
export function view_mode_decode(
|
export function view_mode_decode(
|
||||||
view_mode_encoded : string
|
view_mode_encoded : string
|
||||||
)
|
) : _dali.enum_view_mode
|
||||||
: _dali.enum_view_mode
|
|
||||||
{
|
{
|
||||||
const map : Record<string, _dali.enum_view_mode> = {
|
const map : Record<string, _dali.enum_view_mode> = {
|
||||||
"week": _dali.enum_view_mode.week,
|
"week": _dali.enum_view_mode.week,
|
||||||
|
|
@ -284,51 +242,4 @@ namespace _dali
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export enum enum_view_kind
|
|
||||||
{
|
|
||||||
regular,
|
|
||||||
touch,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function view_kind_encode(
|
|
||||||
kind : _dali.enum_view_kind
|
|
||||||
)
|
|
||||||
: string
|
|
||||||
{
|
|
||||||
switch (kind)
|
|
||||||
{
|
|
||||||
case _dali.enum_view_kind.regular: {return "regular"; break;}
|
|
||||||
case _dali.enum_view_kind.touch: {return "touch"; break;}
|
|
||||||
default: {throw (new Error("invalid kind"));}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function view_kind_decode(
|
|
||||||
view_kind_encoded : string
|
|
||||||
)
|
|
||||||
: _dali.enum_view_kind
|
|
||||||
{
|
|
||||||
const map : Record<string, _dali.enum_view_kind> = {
|
|
||||||
"regular": _dali.enum_view_kind.regular,
|
|
||||||
"touch": _dali.enum_view_kind.touch,
|
|
||||||
};
|
|
||||||
if (! (view_kind_encoded in map))
|
|
||||||
{
|
|
||||||
throw (new Error("invalid kind: " + view_kind_encoded));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return map[view_kind_encoded];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,173 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class class_widget_caldav
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public constructor(
|
|
||||||
)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public async load(
|
|
||||||
target_element : HTMLElement
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
target_element.innerHTML = "";
|
|
||||||
const conf = await _dali.backend.user_dav_conf();
|
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
|
||||||
"widget-caldav",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
"title": lib_plankton.translate.get("widget.caldav.title"),
|
|
||||||
"content": (
|
|
||||||
(conf === null)
|
|
||||||
?
|
|
||||||
await _dali.helpers.template_coin(
|
|
||||||
"widget-caldav",
|
|
||||||
"unavailable",
|
|
||||||
{
|
|
||||||
"text": lib_plankton.translate.get("widget.caldav.unavailable"),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
:
|
|
||||||
await _dali.helpers.template_coin(
|
|
||||||
"widget-caldav",
|
|
||||||
"available",
|
|
||||||
{
|
|
||||||
"conf_title": lib_plankton.translate.get("widget.caldav.conf.title"),
|
|
||||||
"conf_content": (
|
|
||||||
(conf.password === null)
|
|
||||||
?
|
|
||||||
await _dali.helpers.template_coin(
|
|
||||||
"widget-caldav",
|
|
||||||
"conf-token_unset",
|
|
||||||
{
|
|
||||||
"text": lib_plankton.translate.get("widget.caldav.conf.token_unset")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
:
|
|
||||||
await _dali.helpers.template_coin(
|
|
||||||
"widget-caldav",
|
|
||||||
"conf-token_set",
|
|
||||||
{
|
|
||||||
"address_label": lib_plankton.translate.get("widget.caldav.conf.address"),
|
|
||||||
"address_value": conf.address,
|
|
||||||
"username_label": lib_plankton.translate.get("widget.caldav.conf.username"),
|
|
||||||
"username_value": conf.username,
|
|
||||||
"password_label": lib_plankton.translate.get("widget.caldav.conf.password"),
|
|
||||||
"password_value": conf.password,
|
|
||||||
"setup_hints_label": lib_plankton.translate.get("widget.caldav.conf.setup_hints"),
|
|
||||||
"setup_hint_entries": (
|
|
||||||
await lib_plankton.call.promise_condense<string, unknown>(
|
|
||||||
conf.setup_hints
|
|
||||||
.map(
|
|
||||||
entry => () => _dali.helpers.template_coin(
|
|
||||||
"widget-caldav",
|
|
||||||
"conf-setup_hint_entry",
|
|
||||||
{
|
|
||||||
"text": entry.label,
|
|
||||||
"href": entry.link,
|
|
||||||
"remark": (
|
|
||||||
(entry.remark === null)
|
|
||||||
?
|
|
||||||
""
|
|
||||||
:
|
|
||||||
lib_plankton.string.coin(
|
|
||||||
" — {{content}}",
|
|
||||||
{
|
|
||||||
"content": entry.remark,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
).join("")
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"set_token_title": lib_plankton.translate.get("widget.caldav.set_token.title"),
|
|
||||||
"set_token_action": (
|
|
||||||
(conf.password === null)
|
|
||||||
?
|
|
||||||
lib_plankton.translate.get("widget.caldav.set_token.action.set")
|
|
||||||
:
|
|
||||||
lib_plankton.translate.get("widget.caldav.set_token.action.overwrite")
|
|
||||||
),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"close": lib_plankton.translate.get("common.close"),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
// logic
|
|
||||||
{
|
|
||||||
// set token
|
|
||||||
{
|
|
||||||
if (conf === null)
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
target_element.querySelector(".widget-caldav-set_token > button").addEventListener(
|
|
||||||
"click",
|
|
||||||
async () => {
|
|
||||||
await _dali.backend.user_dav_token();
|
|
||||||
await this.load(target_element);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// close
|
|
||||||
{
|
|
||||||
target_element.querySelector(".widget-caldav-close").addEventListener(
|
|
||||||
"click",
|
|
||||||
() => {
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// init
|
|
||||||
{
|
|
||||||
(target_element.querySelector(".widget-caldav-close") as HTMLElement).focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<div class="widget-caldav-conf-section" class="widget-caldav-conf-address">
|
|
||||||
<span class="widget-caldav-conf-section-label">{{address_label}}</span>
|
|
||||||
<span class="widget-caldav-conf-section-value widget-caldav-conf-section-value-regular">{{address_value}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="widget-caldav-conf-section" class="widget-caldav-conf-username">
|
|
||||||
<span class="widget-caldav-conf-section-label">{{username_label}}</span>
|
|
||||||
<span class="widget-caldav-conf-section-value widget-caldav-conf-section-value-regular">{{username_value}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="widget-caldav-conf-section" class="widget-caldav-conf-password">
|
|
||||||
<span class="widget-caldav-conf-section-label">{{password_label}}</span>
|
|
||||||
<span class="widget-caldav-conf-section-value widget-caldav-conf-section-value-regular">{{password_value}}</span>
|
|
||||||
</div>
|
|
||||||
<div class="widget-caldav-conf-section" class="widget-caldav-conf-setup_hints">
|
|
||||||
<span class="widget-caldav-conf-section-label">{{setup_hints_label}}</span>
|
|
||||||
<ul>
|
|
||||||
{{setup_hint_entries}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<div class="widget-caldav-conf-info">
|
|
||||||
({{text}})
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<div class="widget-caldav">
|
|
||||||
<h2>{{title}}</h2>
|
|
||||||
<div class="widget-caldav-content">
|
|
||||||
{{content}}
|
|
||||||
</div>
|
|
||||||
<hr/>
|
|
||||||
<button class="widget-caldav-close">{{close}}</button>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div class="widget-caldav-info">
|
|
||||||
{{text}}
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,24 +1,4 @@
|
||||||
/*
|
namespace _dali.widgets.calendar_edit
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -27,11 +7,6 @@ namespace _dali.widgets
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
implements lib_plankton.zoo_widget.interface_widget
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private groups : Array<{id : _dali.type_group_id; object : _dali.type_group_object;}>;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private users : Array<{id : _dali.type_user_id; name : string;}>;
|
private users : Array<{id : _dali.type_user_id; name : string;}>;
|
||||||
|
|
@ -64,21 +39,20 @@ namespace _dali.widgets
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private initial_value : _dali.type_calendar_object;
|
private initial_value : (null | _dali.type_calendar_object);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public constructor(
|
public constructor(
|
||||||
groups : Array<{id : _dali.type_group_id; object : _dali.type_group_object;}>,
|
|
||||||
users : Array<{id : _dali.type_user_id; name : string;}>,
|
users : Array<{id : _dali.type_user_id; name : string;}>,
|
||||||
initial_value : _dali.type_calendar_object,
|
|
||||||
{
|
{
|
||||||
"read_only": read_only = false,
|
"read_only": read_only = false,
|
||||||
"action_cancel": action_cancel = null,
|
"action_cancel": action_cancel = null,
|
||||||
"action_add": action_add = null,
|
"action_add": action_add = null,
|
||||||
"action_change": action_change = null,
|
"action_change": action_change = null,
|
||||||
"action_remove": action_remove = null,
|
"action_remove": action_remove = null,
|
||||||
|
"initial_value": initial_value = null,
|
||||||
}
|
}
|
||||||
:
|
:
|
||||||
{
|
{
|
||||||
|
|
@ -87,20 +61,20 @@ namespace _dali.widgets
|
||||||
action_add ?: (null | ((value : _dali.type_calendar_object) => void))
|
action_add ?: (null | ((value : _dali.type_calendar_object) => void))
|
||||||
action_change ?: (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));
|
action_remove ?: (null | ((value : _dali.type_calendar_object) => void));
|
||||||
|
initial_value ?: (null | _dali.type_calendar_object);
|
||||||
}
|
}
|
||||||
=
|
=
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.groups = groups;
|
|
||||||
this.users = users;
|
this.users = users;
|
||||||
this.initial_value = initial_value;
|
|
||||||
this.read_only = read_only;
|
this.read_only = read_only;
|
||||||
this.action_cancel = action_cancel;
|
this.action_cancel = action_cancel;
|
||||||
this.action_add = action_add;
|
this.action_add = action_add;
|
||||||
this.action_change = action_change;
|
this.action_change = action_change;
|
||||||
this.action_remove = action_remove;
|
this.action_remove = action_remove;
|
||||||
|
this.initial_value = initial_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,13 +85,6 @@ namespace _dali.widgets
|
||||||
target_element : HTMLElement
|
target_element : HTMLElement
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
const dom_root = await _dali.helpers.element_from_template(
|
|
||||||
"widget-calendar_edit",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
_dali.type_calendar_object,
|
_dali.type_calendar_object,
|
||||||
_dali.type_calendar_object
|
_dali.type_calendar_object
|
||||||
|
|
@ -155,14 +122,9 @@ namespace _dali.widgets
|
||||||
"label": lib_plankton.translate.get("calendar.access.default_level"),
|
"label": lib_plankton.translate.get("calendar.access.default_level"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "attributed_group",
|
"name": "attributed",
|
||||||
"input": _dali.helpers.input_attributed_access_group(this.groups),
|
"input": _dali.helpers.input_attributed_access(this.users),
|
||||||
"label": lib_plankton.translate.get("calendar.access.attributed_group"),
|
"label": lib_plankton.translate.get("calendar.access.attributed"),
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "attributed_user",
|
|
||||||
"input": _dali.helpers.input_attributed_access_user(this.users),
|
|
||||||
"label": lib_plankton.translate.get("calendar.access.attributed_user"),
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
),
|
),
|
||||||
|
|
@ -212,21 +174,14 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
// remove
|
// remove
|
||||||
.concat(
|
.concat(
|
||||||
((! this.read_only) && (! (this.action_remove === null)))
|
((! this.read_only) && (! (this.action_change === null)))
|
||||||
?
|
?
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("widget.calendar_edit.actions.remove"),
|
"label": lib_plankton.translate.get("widget.calendar_edit.actions.remove"),
|
||||||
"procedure": async (get_value, get_representation) => {
|
"procedure": async (get_value, get_representation) => {
|
||||||
if (! window.confirm(lib_plankton.translate.get("common.confirm_deletion")))
|
const value : _dali.type_calendar_object = await get_value();
|
||||||
{
|
this.action_remove(value);
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const value : _dali.type_calendar_object = await get_value();
|
|
||||||
this.action_remove(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -250,12 +205,36 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await form.setup(dom_root);
|
await form.setup(target_element);
|
||||||
await form.input_lock(this.read_only);
|
await form.input_write(
|
||||||
await form.input_write(this.initial_value);
|
(! (this.initial_value === null))
|
||||||
|
?
|
||||||
target_element.appendChild(dom_root);
|
this.initial_value
|
||||||
form.input_focus();
|
:
|
||||||
|
{
|
||||||
|
"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,
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
.widget-calendar_edit .plankton_input_group_field[rel="resource"]
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<div class="widget-calendar_edit">
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,24 +1,4 @@
|
||||||
/*
|
namespace _dali.widgets.event_edit
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -154,13 +134,6 @@ namespace _dali.widgets
|
||||||
target_element : HTMLElement
|
target_element : HTMLElement
|
||||||
) : Promise<void>
|
) : Promise<void>
|
||||||
{
|
{
|
||||||
const dom_root = await _dali.helpers.element_from_template(
|
|
||||||
"widget-event_edit",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
type_value,
|
type_value,
|
||||||
type_representation
|
type_representation
|
||||||
|
|
@ -211,15 +184,13 @@ namespace _dali.widgets
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "event_begin",
|
"name": "event_begin",
|
||||||
"input": _dali.helpers.datetime_input(
|
"input": _dali.helpers.datetime_input(),
|
||||||
),
|
|
||||||
"label": lib_plankton.translate.get("event.begin")
|
"label": lib_plankton.translate.get("event.begin")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "event_end",
|
"name": "event_end",
|
||||||
"input": new lib_plankton.zoo_input.class_input_soft<lib_plankton.pit.type_datetime>(
|
"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")
|
"label": lib_plankton.translate.get("event.end")
|
||||||
},
|
},
|
||||||
|
|
@ -285,21 +256,14 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
// remove
|
// remove
|
||||||
.concat(
|
.concat(
|
||||||
((! this.read_only) && (! (this.action_remove === null)))
|
((! this.read_only) && (! (this.action_change === null)))
|
||||||
?
|
?
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("widget.event_edit.actions.remove"),
|
"label": lib_plankton.translate.get("widget.event_edit.actions.remove"),
|
||||||
"procedure": async (get_value, get_representation) => {
|
"procedure": async (get_value, get_representation) => {
|
||||||
if (! window.confirm(lib_plankton.translate.get("common.confirm_deletion")))
|
const value : type_value = await get_value();
|
||||||
{
|
this.action_remove(value);
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const value : type_value = await get_value();
|
|
||||||
this.action_remove(value);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -323,12 +287,8 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await form.setup(dom_root);
|
await form.setup(target_element);
|
||||||
await form.input_lock(this.read_only);
|
|
||||||
await form.input_write(this.initial_value);
|
await form.input_write(this.initial_value);
|
||||||
|
|
||||||
target_element.appendChild(dom_root);
|
|
||||||
form.input_focus();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<div class="widget-event_edit">
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,26 +1,18 @@
|
||||||
/*
|
namespace _dali.widgets.listview
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
type type_entry = {
|
||||||
|
calendar_id : _dali.type_calendar_id;
|
||||||
|
calendar_name : string;
|
||||||
|
hue : float;
|
||||||
|
access_level : _dali.enum_access_level;
|
||||||
|
event_id : (null | _dali.type_local_resource_event_id);
|
||||||
|
event_object : _dali.type_event_object;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
type type_get_entries = (
|
type type_get_entries = (
|
||||||
|
|
@ -30,7 +22,7 @@ namespace _dali.widgets
|
||||||
calendar_ids : Array<_dali.type_calendar_id>
|
calendar_ids : Array<_dali.type_calendar_id>
|
||||||
)
|
)
|
||||||
=>
|
=>
|
||||||
Promise<Array<_dali.type_event_object_extended>>
|
Promise<Array<type_entry>>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -40,17 +32,22 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [dependency]
|
|
||||||
*/
|
*/
|
||||||
private get_entries : type_get_entries;
|
private get_entries : type_get_entries;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [hook]
|
|
||||||
*/
|
*/
|
||||||
private action_select : (
|
private container : (null | Element);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private action_select_event : (
|
||||||
(
|
(
|
||||||
event_key : _dali.type_event_key
|
calendar_id : _dali.type_calendar_id,
|
||||||
|
access_level : _dali.enum_access_level,
|
||||||
|
event_id : _dali.type_local_resource_event_id
|
||||||
)
|
)
|
||||||
=>
|
=>
|
||||||
void
|
void
|
||||||
|
|
@ -58,7 +55,6 @@ namespace _dali.widgets
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [hook]
|
|
||||||
*/
|
*/
|
||||||
private action_add : (
|
private action_add : (
|
||||||
(
|
(
|
||||||
|
|
@ -68,32 +64,16 @@ namespace _dali.widgets
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private include_passed : boolean;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [state]
|
|
||||||
*/
|
|
||||||
private container : (null | Element);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public constructor(
|
public constructor(
|
||||||
get_entries : type_get_entries,
|
get_entries : type_get_entries,
|
||||||
{
|
options : {
|
||||||
"include_passed": include_passed = false,
|
action_select_event ?: (
|
||||||
"action_select": action_select = ((event_key) => {}),
|
|
||||||
"action_add": action_add = (() => {}),
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
include_passed ?: boolean;
|
|
||||||
action_select ?: (
|
|
||||||
(
|
(
|
||||||
event_key : _dali.type_event_key
|
calendar_id : _dali.type_calendar_id,
|
||||||
|
access_level : _dali.enum_access_level,
|
||||||
|
event_id : _dali.type_local_resource_event_id
|
||||||
)
|
)
|
||||||
=>
|
=>
|
||||||
void
|
void
|
||||||
|
|
@ -104,209 +84,67 @@ namespace _dali.widgets
|
||||||
=>
|
=>
|
||||||
void
|
void
|
||||||
);
|
);
|
||||||
}
|
} = {}
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// dependencies
|
options = Object.assign(
|
||||||
|
{
|
||||||
|
"action_select_event": (calendar_id, access_level, event_id) => {},
|
||||||
|
"action_select_add": () => {},
|
||||||
|
},
|
||||||
|
options
|
||||||
|
);
|
||||||
this.get_entries = get_entries;
|
this.get_entries = get_entries;
|
||||||
|
|
||||||
// hooks
|
|
||||||
this.action_select = action_select;
|
|
||||||
this.action_add = action_add;
|
|
||||||
|
|
||||||
// state
|
|
||||||
this.include_passed = include_passed;
|
|
||||||
this.container = null;
|
this.container = null;
|
||||||
|
this.action_select_event = options.action_select_event;
|
||||||
|
this.action_add = options.action_add;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public toggle_visibility(
|
public toggle_visibility(
|
||||||
calendar_id : _dali.type_calendar_id,
|
calendar_id : _dali.type_calendar_id
|
||||||
{
|
) : void
|
||||||
"mode": mode = null,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
mode ?: (null | boolean);
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
{
|
||||||
this.container.querySelectorAll(".listview-entry").forEach(
|
this.container.querySelectorAll(".listview-entry").forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
const rel : string = element.getAttribute("rel");
|
const rel : string = element.getAttribute("rel");
|
||||||
const parts : Array<string> = rel.split("/");
|
const parts : Array<string> = rel.split("/");
|
||||||
const calendar_id_ : _dali.type_calendar_id = parseInt(parts[0]);
|
const calendar_id_ : _dali.type_calendar_id = parseInt(parts[0]);
|
||||||
if (! (calendar_id === calendar_id_))
|
if (! (calendar_id === calendar_id_)) {
|
||||||
{
|
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
element.classList.toggle("listview-entry-hidden");
|
||||||
element.classList.toggle(
|
|
||||||
"listview-entry-hidden",
|
|
||||||
((mode !== null) ? (! mode) : undefined)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public async update_entries(
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
// structure
|
|
||||||
{
|
|
||||||
const now_pit : lib_plankton.pit.type_pit = lib_plankton.pit.now();
|
|
||||||
const from_pit : lib_plankton.pit.type_pit = now_pit;
|
|
||||||
const to_pit : lib_plankton.pit.type_pit = lib_plankton.pit.shift_week(now_pit, +4);
|
|
||||||
const entries : Array<_dali.type_event_object_extended> = await this.get_entries(
|
|
||||||
from_pit,
|
|
||||||
to_pit,
|
|
||||||
null
|
|
||||||
);
|
|
||||||
entries.sort(
|
|
||||||
(x, y) => (
|
|
||||||
lib_plankton.pit.from_datetime(x.event_object.begin)
|
|
||||||
-
|
|
||||||
lib_plankton.pit.from_datetime(y.event_object.begin)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
const dom_list : HTMLElement = this.container.querySelector(".listview-entries");
|
|
||||||
dom_list.innerHTML = (
|
|
||||||
(
|
|
||||||
await _dali.helpers.promise_row<string>(
|
|
||||||
entries
|
|
||||||
.filter(
|
|
||||||
(entry) => (
|
|
||||||
this.include_passed
|
|
||||||
?
|
|
||||||
true
|
|
||||||
:
|
|
||||||
lib_plankton.pit.is_after(
|
|
||||||
lib_plankton.pit.from_datetime(entry.event_object.begin),
|
|
||||||
now_pit
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.map(
|
|
||||||
(entry) => () => _dali.helpers.template_coin(
|
|
||||||
"widget-listview",
|
|
||||||
"entry",
|
|
||||||
{
|
|
||||||
"name_value": entry.event_object.name,
|
|
||||||
"calendar_value": entry.calendar_name,
|
|
||||||
"when_value": lib_plankton.pit.timespan_format(
|
|
||||||
entry.event_object.begin,
|
|
||||||
entry.event_object.end,
|
|
||||||
{
|
|
||||||
"timezone_indicator": lib_plankton.translate.get("common.timezone_indicator"),
|
|
||||||
"adjust_to_ce": true,
|
|
||||||
"show_timezone": false,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"location_label": lib_plankton.translate.get("event.location"),
|
|
||||||
"location_extra_classes": (
|
|
||||||
(entry.event_object.location === null)
|
|
||||||
?
|
|
||||||
" listview-entry-field-empty"
|
|
||||||
:
|
|
||||||
""
|
|
||||||
),
|
|
||||||
"location_value": (
|
|
||||||
(entry.event_object.location === null)
|
|
||||||
?
|
|
||||||
"?"
|
|
||||||
:
|
|
||||||
entry.event_object.location
|
|
||||||
),
|
|
||||||
"link_label": lib_plankton.translate.get("event.link"),
|
|
||||||
"link_extra_classes": (
|
|
||||||
(entry.event_object.link === null)
|
|
||||||
?
|
|
||||||
" listview-entry-field-empty"
|
|
||||||
:
|
|
||||||
""
|
|
||||||
),
|
|
||||||
"link_value": (
|
|
||||||
(entry.event_object.link === null)
|
|
||||||
?
|
|
||||||
"?"
|
|
||||||
:
|
|
||||||
entry.event_object.link
|
|
||||||
),
|
|
||||||
"link_action": lib_plankton.translate.get("common.open"),
|
|
||||||
"description_label": lib_plankton.translate.get("event.description"),
|
|
||||||
"description_extra_classes": (
|
|
||||||
(entry.event_object.description === null)
|
|
||||||
?
|
|
||||||
" listview-entry-field-empty"
|
|
||||||
:
|
|
||||||
""
|
|
||||||
),
|
|
||||||
"description_value": (
|
|
||||||
(entry.event_object.description === null)
|
|
||||||
?
|
|
||||||
"?"
|
|
||||||
:
|
|
||||||
entry.event_object.description
|
|
||||||
),
|
|
||||||
"raw": JSON.stringify(entry),
|
|
||||||
"color": _dali.helpers.event_color(entry.hue),
|
|
||||||
"rel": entry.key,
|
|
||||||
},
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.join("")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// listeners
|
|
||||||
{
|
|
||||||
this.container.querySelectorAll(".listview-entry").forEach(
|
|
||||||
(element) => {
|
|
||||||
element.addEventListener(
|
|
||||||
"click",
|
|
||||||
(event) => {
|
|
||||||
if ((event.target as Element).nodeName === "A")
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const event_key : string = element.getAttribute("rel");
|
|
||||||
this.action_select(event_key);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
public async load(
|
public async load(
|
||||||
target_element : Element
|
target_element : Element
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
this.container = target_element;
|
const now_pit : lib_plankton.pit.type_pit = lib_plankton.pit.now();
|
||||||
|
const from_pit : lib_plankton.pit.type_pit = now_pit;
|
||||||
|
const to_pit : lib_plankton.pit.type_pit = lib_plankton.pit.shift_week(now_pit, +4);
|
||||||
|
const entries : Array<type_entry> = await this.get_entries(
|
||||||
|
from_pit,
|
||||||
|
to_pit,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
entries.sort(
|
||||||
|
(x, y) => (
|
||||||
|
lib_plankton.pit.from_datetime(x.event_object.begin)
|
||||||
|
-
|
||||||
|
lib_plankton.pit.from_datetime(y.event_object.begin)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// view
|
// view
|
||||||
{
|
{
|
||||||
|
|
@ -323,7 +161,110 @@ namespace _dali.widgets
|
||||||
:
|
:
|
||||||
""
|
""
|
||||||
),
|
),
|
||||||
"entries": "",
|
"entries": (
|
||||||
|
(
|
||||||
|
await _dali.helpers.promise_row<string>(
|
||||||
|
entries
|
||||||
|
.map(
|
||||||
|
(entry) => () => _dali.helpers.template_coin(
|
||||||
|
"widget-listview",
|
||||||
|
"entry",
|
||||||
|
{
|
||||||
|
"name_value": entry.event_object.name,
|
||||||
|
"calendar_value": entry.calendar_name,
|
||||||
|
"when_value": lib_plankton.pit.timespan_format(
|
||||||
|
entry.event_object.begin,
|
||||||
|
entry.event_object.end,
|
||||||
|
{
|
||||||
|
"timezone_indicator": lib_plankton.translate.get("common.timezone_indicator"),
|
||||||
|
"adjust_to_ce": true,
|
||||||
|
"show_timezone": false,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
"location_label": lib_plankton.translate.get("event.location"),
|
||||||
|
"location_extra_classes": (
|
||||||
|
(entry.event_object.location === null)
|
||||||
|
?
|
||||||
|
" listview-entry-field-empty"
|
||||||
|
:
|
||||||
|
""
|
||||||
|
),
|
||||||
|
"location_value": (
|
||||||
|
(entry.event_object.location === null)
|
||||||
|
?
|
||||||
|
"?"
|
||||||
|
:
|
||||||
|
entry.event_object.location
|
||||||
|
),
|
||||||
|
"link_label": lib_plankton.translate.get("event.link"),
|
||||||
|
"link_extra_classes": (
|
||||||
|
(entry.event_object.link === null)
|
||||||
|
?
|
||||||
|
" listview-entry-field-empty"
|
||||||
|
:
|
||||||
|
""
|
||||||
|
),
|
||||||
|
"link_value": (
|
||||||
|
(entry.event_object.link === null)
|
||||||
|
?
|
||||||
|
"?"
|
||||||
|
:
|
||||||
|
entry.event_object.link
|
||||||
|
),
|
||||||
|
"link_action": lib_plankton.translate.get("common.open"),
|
||||||
|
"description_label": lib_plankton.translate.get("event.description"),
|
||||||
|
"description_extra_classes": (
|
||||||
|
(entry.event_object.description === null)
|
||||||
|
?
|
||||||
|
" listview-entry-field-empty"
|
||||||
|
:
|
||||||
|
""
|
||||||
|
),
|
||||||
|
"description_value": (
|
||||||
|
(entry.event_object.description === null)
|
||||||
|
?
|
||||||
|
"?"
|
||||||
|
:
|
||||||
|
entry.event_object.description
|
||||||
|
),
|
||||||
|
"raw": JSON.stringify(entry),
|
||||||
|
"color": lib_plankton.color.output_hex(
|
||||||
|
lib_plankton.color.make_hsv(
|
||||||
|
{
|
||||||
|
"hue": entry.hue,
|
||||||
|
"saturation": 0.375,
|
||||||
|
"value": 0.375,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
|
"rel": lib_plankton.string.coin(
|
||||||
|
"{{calendar_id}}/{{event_id}}/{{access_level}}",
|
||||||
|
{
|
||||||
|
"calendar_id": entry.calendar_id.toFixed(0),
|
||||||
|
"event_id": (
|
||||||
|
(! (entry.event_id === null))
|
||||||
|
?
|
||||||
|
entry.event_id.toFixed(0)
|
||||||
|
:
|
||||||
|
"-"
|
||||||
|
),
|
||||||
|
"access_level": (() => {
|
||||||
|
switch (entry.access_level) {
|
||||||
|
case _dali.enum_access_level.none: return "none";
|
||||||
|
case _dali.enum_access_level.view: return "view";
|
||||||
|
case _dali.enum_access_level.edit: return "edit";
|
||||||
|
case _dali.enum_access_level.admin: return "admin";
|
||||||
|
}
|
||||||
|
}) (),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.join("")
|
||||||
|
),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -337,9 +278,46 @@ namespace _dali.widgets
|
||||||
this.action_add();
|
this.action_add();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
target_element.querySelectorAll(".listview-entry").forEach(
|
||||||
|
(element) => {
|
||||||
|
element.addEventListener(
|
||||||
|
"click",
|
||||||
|
(event) => {
|
||||||
|
if ((event.target as Element).nodeName === "A") {
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const rel : string = element.getAttribute("rel");
|
||||||
|
const parts : Array<string> = rel.split("/");
|
||||||
|
const calendar_id : _dali.type_calendar_id = parseInt(parts[0]);
|
||||||
|
const event_id : (null | _dali.type_local_resource_event_id) = (
|
||||||
|
parts[1] === "-"
|
||||||
|
?
|
||||||
|
null
|
||||||
|
:
|
||||||
|
parseInt(parts[1])
|
||||||
|
);
|
||||||
|
const access_level : _dali.enum_access_level = (() => {
|
||||||
|
switch (parts[2]) {
|
||||||
|
case "none": return _dali.enum_access_level.none;
|
||||||
|
case "view": return _dali.enum_access_level.view;
|
||||||
|
case "edit": return _dali.enum_access_level.edit;
|
||||||
|
case "admin": return _dali.enum_access_level.admin;
|
||||||
|
}
|
||||||
|
}) ();
|
||||||
|
this.action_select_event(
|
||||||
|
calendar_id,
|
||||||
|
access_level,
|
||||||
|
event_id,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.update_entries();
|
this.container = target_element.querySelector(".listview");
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,4 @@
|
||||||
/*
|
namespace _dali.widgets.login
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -73,7 +53,7 @@ namespace _dali.widgets
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
public async load(
|
public async load(
|
||||||
target_element : HTMLElement
|
target_element : Element
|
||||||
)
|
)
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
|
|
@ -86,36 +66,125 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
case "internal":
|
case "internal":
|
||||||
{
|
{
|
||||||
const sub_widget : lib_plankton.zoo_widget.interface_widget = (
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
new class_widget_login_internal(
|
"widget-login",
|
||||||
preparation.data,
|
"default",
|
||||||
{
|
{
|
||||||
"initial_name": this.initial_name,
|
}
|
||||||
"action_cancel": this.action_cancel,
|
);
|
||||||
"action_success": this.action_success,
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
}
|
{name : string; password : string;},
|
||||||
|
{name : string; password : string;}
|
||||||
|
> = new lib_plankton.zoo_form.class_form<
|
||||||
|
{name : string; password : string;},
|
||||||
|
{name : string; password : string;}
|
||||||
|
>(
|
||||||
|
x => x,
|
||||||
|
x => x,
|
||||||
|
new lib_plankton.zoo_input.class_input_group<
|
||||||
|
{name : string; password : string;}
|
||||||
|
>(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "name",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
|
"label": lib_plankton.translate.get("widget.login.internal.name"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "password",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_password(),
|
||||||
|
"label": lib_plankton.translate.get("widget.login.internal.password"),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
),
|
||||||
|
(
|
||||||
|
[]
|
||||||
|
.concat(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"label": lib_plankton.translate.get("widget.login.internal.do"),
|
||||||
|
"procedure": async (get_value, get_representation) => {
|
||||||
|
const value : any = await get_value();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _dali.backend.session_begin(
|
||||||
|
value.name,
|
||||||
|
value.password
|
||||||
|
);
|
||||||
|
if (this.action_success !== null) this.action_success();
|
||||||
|
}
|
||||||
|
catch (error)
|
||||||
|
{
|
||||||
|
// todo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
)
|
||||||
|
.concat(
|
||||||
|
(this.action_cancel === null)
|
||||||
|
?
|
||||||
|
[]
|
||||||
|
:
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"label": lib_plankton.translate.get("common.cancel"),
|
||||||
|
"procedure": () => {
|
||||||
|
this.action_cancel();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
await sub_widget.load(target_element);
|
await form.setup(document.querySelector(".widget-login"));
|
||||||
|
await form.input_write(
|
||||||
|
{
|
||||||
|
"name": this.initial_name,
|
||||||
|
"password": "",
|
||||||
|
}
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "oidc":
|
case "oidc":
|
||||||
{
|
{
|
||||||
const sub_widget : lib_plankton.zoo_widget.interface_widget = (
|
// link
|
||||||
new class_widget_login_oidc(
|
{
|
||||||
preparation.data,
|
let element_a : HTMLElement = document.createElement("a");;
|
||||||
|
element_a.textContent = lib_plankton.string.coin(
|
||||||
|
lib_plankton.translate.get("widget.login.oidc.via"),
|
||||||
{
|
{
|
||||||
"action_cancel": this.action_cancel,
|
"title": preparation.data.label,
|
||||||
"action_success": this.action_success,
|
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
);
|
element_a.setAttribute("href", preparation.data.url);
|
||||||
await sub_widget.load(target_element);
|
target_element.appendChild(element_a);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
let dom_br : HTMLElement = document.createElement("br");
|
||||||
|
target_element.appendChild(dom_br);
|
||||||
|
}
|
||||||
|
{
|
||||||
|
let dom_br : HTMLElement = document.createElement("br");
|
||||||
|
target_element.appendChild(dom_br);
|
||||||
|
}
|
||||||
|
// cancel
|
||||||
|
{
|
||||||
|
let dom_cancel : HTMLElement = document.createElement("button");
|
||||||
|
dom_cancel.textContent = lib_plankton.translate.get("common.cancel");
|
||||||
|
dom_cancel.addEventListener(
|
||||||
|
"click",
|
||||||
|
() => {
|
||||||
|
this.action_cancel();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
target_element.appendChild(dom_cancel);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
throw (new Error("unhandled login kind: " + preparation.kind));
|
// todo
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
source/widgets/login/templates/default.html.tpl
Normal file
2
source/widgets/login/templates/default.html.tpl
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
<div class="widget-login">
|
||||||
|
</div>
|
||||||
|
|
@ -1,165 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class class_widget_login_internal
|
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private preparation_data : any;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private initial_name : (null | string);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [hook]
|
|
||||||
*/
|
|
||||||
private action_cancel : (null | (() => void));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [hook]
|
|
||||||
*/
|
|
||||||
private action_success : (null | (() => void));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public constructor(
|
|
||||||
preparation_data : any,
|
|
||||||
{
|
|
||||||
"initial_name": initial_name = null,
|
|
||||||
"action_cancel": action_cancel = null,
|
|
||||||
"action_success": action_success = null,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
initial_name ?: (null | string);
|
|
||||||
action_cancel ?: (null | (() => void));
|
|
||||||
action_success ?: (null | (() => void));
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.preparation_data = preparation_data;
|
|
||||||
this.initial_name = initial_name;
|
|
||||||
this.action_cancel = action_cancel;
|
|
||||||
this.action_success = action_success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
public async load(
|
|
||||||
target_element : HTMLElement
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
|
||||||
{name : string; password : string;},
|
|
||||||
{name : string; password : string;}
|
|
||||||
> = new lib_plankton.zoo_form.class_form<
|
|
||||||
{name : string; password : string;},
|
|
||||||
{name : string; password : string;}
|
|
||||||
>(
|
|
||||||
x => x,
|
|
||||||
x => x,
|
|
||||||
new lib_plankton.zoo_input.class_input_group<
|
|
||||||
{name : string; password : string;}
|
|
||||||
>(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"name": "name",
|
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(),
|
|
||||||
"label": lib_plankton.translate.get("widget.login.internal.name"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "password",
|
|
||||||
"input": new lib_plankton.zoo_input.class_input_password(),
|
|
||||||
"label": lib_plankton.translate.get("widget.login.internal.password"),
|
|
||||||
},
|
|
||||||
]
|
|
||||||
),
|
|
||||||
(
|
|
||||||
[]
|
|
||||||
.concat(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("widget.login.internal.do"),
|
|
||||||
"procedure": async (get_value, get_representation) => {
|
|
||||||
const value : any = await get_value();
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _dali.backend.session_begin(
|
|
||||||
value.name,
|
|
||||||
value.password
|
|
||||||
);
|
|
||||||
if (this.action_success !== null) this.action_success();
|
|
||||||
}
|
|
||||||
catch (error)
|
|
||||||
{
|
|
||||||
// todo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
.concat(
|
|
||||||
(this.action_cancel === null)
|
|
||||||
?
|
|
||||||
[]
|
|
||||||
:
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("common.cancel"),
|
|
||||||
"procedure": () => {
|
|
||||||
this.action_cancel();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
target_element.innerHTML = "";
|
|
||||||
await form.setup(target_element);
|
|
||||||
await form.input_write(
|
|
||||||
{
|
|
||||||
"name": this.initial_name,
|
|
||||||
"password": "",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
form.input_focus();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class class_widget_login_oidc
|
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private preparation_data : any;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [hook]
|
|
||||||
*/
|
|
||||||
private action_cancel : (null | (() => void));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [hook]
|
|
||||||
*/
|
|
||||||
private action_success : (null | (() => void));
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public constructor(
|
|
||||||
preparation_data : any,
|
|
||||||
{
|
|
||||||
"action_cancel": action_cancel = null,
|
|
||||||
"action_success": action_success = null,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
action_cancel ?: (null | (() => void));
|
|
||||||
action_success ?: (null | (() => void));
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.preparation_data = preparation_data;
|
|
||||||
this.action_cancel = action_cancel;
|
|
||||||
this.action_success = action_success;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
public async load(
|
|
||||||
target_element : HTMLElement
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
// structure
|
|
||||||
{
|
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
|
||||||
"widget-login_oidc",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
"label": lib_plankton.string.coin(
|
|
||||||
lib_plankton.translate.get("widget.login.oidc.via"),
|
|
||||||
{
|
|
||||||
"title": this.preparation_data.label,
|
|
||||||
}
|
|
||||||
),
|
|
||||||
"href": this.preparation_data.url,
|
|
||||||
"cancel": lib_plankton.translate.get("common.cancel"),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// controls
|
|
||||||
{
|
|
||||||
target_element.querySelector(".widget-login_oidc-cancel").addEventListener(
|
|
||||||
"click",
|
|
||||||
() => {
|
|
||||||
this.action_cancel();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
.widget-login_oidc-cancel
|
|
||||||
{
|
|
||||||
display: block;
|
|
||||||
margin-top: 32px;
|
|
||||||
}
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<div class="widget-login_oidc">
|
|
||||||
<a class="widget-login_oidc-link" href="{{href}}">{{label}}</a>
|
|
||||||
<button class="widget-login_oidc-cancel">{{cancel}}</button>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,24 +1,4 @@
|
||||||
/*
|
namespace _dali.widgets.menu
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -37,7 +17,12 @@ namespace _dali.widgets
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private entries : Array<type_entry_data>;
|
private entries : Array<
|
||||||
|
{
|
||||||
|
data : type_entry_data;
|
||||||
|
element : (null | HTMLElement);
|
||||||
|
}
|
||||||
|
>;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -58,10 +43,10 @@ namespace _dali.widgets
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public constructor(
|
public constructor(
|
||||||
entries : Array<type_entry_data>,
|
entry_data_list : Array<type_entry_data>,
|
||||||
{
|
{
|
||||||
"initial_groups": initial_groups = [],
|
"initial_groups": initial_groups = [],
|
||||||
"initial_label": initial_label = "",
|
"initial_label": initial_label = "=",
|
||||||
}
|
}
|
||||||
:
|
:
|
||||||
{
|
{
|
||||||
|
|
@ -73,7 +58,14 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.entries = entries;
|
this.entries = entry_data_list.map(
|
||||||
|
entry_data => (
|
||||||
|
{
|
||||||
|
"data": entry_data,
|
||||||
|
"element": null,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
);
|
||||||
this.initial_groups = initial_groups;
|
this.initial_groups = initial_groups;
|
||||||
this.label = initial_label;
|
this.label = initial_label;
|
||||||
this.container = null;
|
this.container = null;
|
||||||
|
|
@ -88,28 +80,25 @@ namespace _dali.widgets
|
||||||
: void
|
: void
|
||||||
{
|
{
|
||||||
this.entries.forEach(
|
this.entries.forEach(
|
||||||
(entry, index) => {
|
entry => {
|
||||||
const active : boolean = groups.some(group => entry.groups.includes(group));
|
const active : boolean = groups.some(group => entry.data.groups.includes(group));
|
||||||
const rel : string = index.toFixed(0);
|
entry.element.classList.toggle("widget-menu-entry-hidden", (! active));
|
||||||
const dom_entry = this.container.querySelector(".widget-menu-entry[rel=\"" + rel + "\"]");
|
|
||||||
dom_entry.classList.toggle("widget-menu-entry-hidden", (! active));
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public set_label(
|
public set_label(
|
||||||
label : (null | string)
|
label ?: string
|
||||||
)
|
)
|
||||||
: void
|
: void
|
||||||
{
|
{
|
||||||
this.label = label;
|
this.label = label;
|
||||||
this.container.querySelector(".widget-menu-button").innerHTML = (
|
this.container.querySelector(".widget-menu-button").textContent = (
|
||||||
(this.label === null)
|
(this.label === null)
|
||||||
?
|
?
|
||||||
("[" + "=" + "]")
|
"[=]"
|
||||||
:
|
:
|
||||||
("[" + this.label + "]")
|
("[" + this.label + "]")
|
||||||
);
|
);
|
||||||
|
|
@ -144,69 +133,56 @@ namespace _dali.widgets
|
||||||
)
|
)
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
// structure
|
// container
|
||||||
this.container = await _dali.helpers.element_from_template(
|
|
||||||
"widget-menu",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
"entries": (
|
|
||||||
(
|
|
||||||
await lib_plankton.call.promise_condense(
|
|
||||||
this.entries.map(
|
|
||||||
(entry, index) => () => _dali.helpers.template_coin(
|
|
||||||
"widget-menu",
|
|
||||||
"entry",
|
|
||||||
{
|
|
||||||
"label": entry.label,
|
|
||||||
"rel": index.toFixed(0),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
.join("")
|
|
||||||
),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// logic
|
|
||||||
{
|
{
|
||||||
// collapser
|
const dom_container : HTMLElement = document.createElement("div");
|
||||||
|
dom_container.classList.add("widget-menu");
|
||||||
|
// button
|
||||||
{
|
{
|
||||||
this.container.querySelector(".widget-menu-button").addEventListener(
|
const dom_button : HTMLElement = document.createElement("button");
|
||||||
|
dom_button.textContent = "[" + this.label + "]";
|
||||||
|
dom_button.classList.add("widget-menu-button");
|
||||||
|
dom_button.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
() => {
|
() => {
|
||||||
this.toggle_collapsed();
|
this.toggle_collapsed();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
dom_container.classList.toggle("widget-menu-collapsed", true);
|
||||||
|
dom_container.appendChild(dom_button);
|
||||||
}
|
}
|
||||||
// entries
|
// platform
|
||||||
{
|
{
|
||||||
this.container.querySelectorAll(".widget-menu-entry").forEach(
|
const dom_platform : HTMLElement = document.createElement("div");
|
||||||
dom_entry => {
|
dom_platform.classList.add("widget-menu-platform");
|
||||||
dom_entry.addEventListener(
|
{
|
||||||
"click",
|
const dom_list : HTMLElement = document.createElement("ul");
|
||||||
() => {
|
dom_list.classList.add("widget-menu-entries");
|
||||||
const index : int = parseInt(dom_entry.getAttribute("rel"));
|
this.entries.forEach(
|
||||||
const entry : type_entry_data = this.entries[index];
|
entry => {
|
||||||
this.toggle_collapsed({"mode": true});
|
const dom_entry : HTMLElement = document.createElement("li");
|
||||||
entry.action();
|
dom_entry.classList.add("widget-menu-entry");
|
||||||
}
|
dom_entry.textContent = entry.data.label;
|
||||||
);
|
dom_entry.addEventListener(
|
||||||
}
|
"click",
|
||||||
);
|
() => {
|
||||||
|
this.toggle_collapsed({"mode": true});
|
||||||
|
entry.data.action();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
dom_list.appendChild(dom_entry);
|
||||||
|
entry.element = dom_entry;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
dom_platform.appendChild(dom_list);
|
||||||
|
}
|
||||||
|
dom_container.appendChild(dom_platform);
|
||||||
}
|
}
|
||||||
|
target_element.appendChild(dom_container);
|
||||||
|
this.container = dom_container;
|
||||||
}
|
}
|
||||||
|
|
||||||
// init
|
this.set_groups(this.initial_groups);
|
||||||
{
|
|
||||||
this.toggle_collapsed({"mode": true});
|
|
||||||
this.set_groups(this.initial_groups);
|
|
||||||
this.set_label(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
// finish
|
|
||||||
target_element.appendChild(this.container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<li class="widget-menu-entry" rel="{{rel}}">
|
|
||||||
<span>{{label}}</span>
|
|
||||||
</li>
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<div class="widget-menu">
|
|
||||||
<button class="widget-menu-button"></button>
|
|
||||||
<div class="widget-menu-platform">
|
|
||||||
<ul class="widget-menu-entries">
|
|
||||||
{{entries}}
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,24 +1,4 @@
|
||||||
/*
|
namespace _dali.widgets.mode_switcher
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -78,8 +58,7 @@ namespace _dali.widgets
|
||||||
*/
|
*/
|
||||||
public async load(
|
public async load(
|
||||||
target_element : Element
|
target_element : Element
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-mode_switcher",
|
"widget-mode_switcher",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
.widget-mode_switcher-option
|
|
||||||
{
|
|
||||||
margin-left: 16px;
|
|
||||||
}
|
|
||||||
|
|
@ -1,278 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_get_entries = (
|
|
||||||
(
|
|
||||||
from_pit : lib_plankton.pit.type_pit,
|
|
||||||
to_pit : lib_plankton.pit.type_pit,
|
|
||||||
calendar_ids : Array<_dali.type_calendar_id>
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<Array<_dali.type_event_object_extended>>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_create_event = (
|
|
||||||
(
|
|
||||||
stuff ?: {
|
|
||||||
date ?: lib_plankton.pit.type_date;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<void>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_edit_event = (
|
|
||||||
(
|
|
||||||
event_key : _dali.type_event_key
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<void>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class class_widget_multiview
|
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private initial_view_mode : _dali.enum_view_mode;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private weekview_initial_vertical : boolean;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private get_entries : type_get_entries;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_create_event : type_create_event;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_edit_event : type_edit_event;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private dom_context : (null | HTMLElement);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private widget_mode_switcher : _dali.widgets.class_widget_mode_switcher;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private widget_weekview : _dali.widgets.class_widget_weekview;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private widget_listview : _dali.widgets.class_widget_listview;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public constructor(
|
|
||||||
get_entries : type_get_entries,
|
|
||||||
{
|
|
||||||
"initial_view_mode": initial_view_mode = _dali.enum_view_mode.week,
|
|
||||||
"weekview_initial_vertical": weekview_initial_vertical = false,
|
|
||||||
"action_create_event": action_create_event = ((stuff) => Promise.resolve<void>(undefined)),
|
|
||||||
"action_edit_event": action_edit_event = ((event_key) => Promise.resolve<void>(undefined)),
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
initial_view_mode ?: _dali.enum_view_mode;
|
|
||||||
weekview_initial_vertical ?: boolean;
|
|
||||||
action_create_event ?: type_create_event;
|
|
||||||
action_edit_event ?: type_edit_event;
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.get_entries = get_entries;
|
|
||||||
this.initial_view_mode = initial_view_mode;
|
|
||||||
this.weekview_initial_vertical = weekview_initial_vertical;
|
|
||||||
this.action_create_event = action_create_event;
|
|
||||||
this.action_edit_event = action_edit_event;
|
|
||||||
this.dom_context = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public toggle_calendar_visibilty(
|
|
||||||
calendar_id : _dali.type_calendar_id,
|
|
||||||
{
|
|
||||||
"mode": mode = null,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
mode ?: (null | boolean);
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
this.widget_weekview.toggle_visibility(calendar_id, {"mode": mode});
|
|
||||||
this.widget_listview.toggle_visibility(calendar_id, {"mode": mode});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private set_view_mode
|
|
||||||
(
|
|
||||||
view_mode : _dali.enum_view_mode
|
|
||||||
)
|
|
||||||
: void
|
|
||||||
{
|
|
||||||
this.dom_context.setAttribute("rel", _dali.view_mode_encode(view_mode));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public async update_entries(
|
|
||||||
)
|
|
||||||
:
|
|
||||||
Promise<void>
|
|
||||||
{
|
|
||||||
await Promise.all(
|
|
||||||
[
|
|
||||||
this.widget_weekview.update_entries(),
|
|
||||||
this.widget_listview.update_entries(),
|
|
||||||
]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
public async load(
|
|
||||||
target_element : Element
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
this.dom_context = (target_element as HTMLElement);
|
|
||||||
|
|
||||||
this.dom_context.classList.add("widget-multiview");
|
|
||||||
|
|
||||||
// mode switcher
|
|
||||||
{
|
|
||||||
this.widget_mode_switcher = (
|
|
||||||
new _dali.widgets.class_widget_mode_switcher(
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"mode": _dali.enum_view_mode.week,
|
|
||||||
/**
|
|
||||||
* @todo as dependency
|
|
||||||
*/
|
|
||||||
"label": lib_plankton.translate.get("widget.overview.mode.week"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"mode": _dali.enum_view_mode.list,
|
|
||||||
/**
|
|
||||||
* @todo as dependency
|
|
||||||
*/
|
|
||||||
"label": lib_plankton.translate.get("widget.overview.mode.list"),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
{
|
|
||||||
"initial_selection": this.initial_view_mode,
|
|
||||||
"action_change": (view_mode) => {
|
|
||||||
this.set_view_mode(view_mode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
let dom_wrapper = document.createElement("div");
|
|
||||||
dom_wrapper.classList.add("widget-multiview-mode_switcher");
|
|
||||||
await this.widget_mode_switcher.load(dom_wrapper);
|
|
||||||
this.dom_context.appendChild(dom_wrapper);
|
|
||||||
}
|
|
||||||
// weekview
|
|
||||||
{
|
|
||||||
this.widget_weekview = (
|
|
||||||
new _dali.widgets.class_widget_weekview(
|
|
||||||
this.get_entries,
|
|
||||||
{
|
|
||||||
"action_select_event": (event_key) => this.action_edit_event(event_key),
|
|
||||||
"action_select_day": (date) => this.action_create_event({"date": date}),
|
|
||||||
"vertical": this.weekview_initial_vertical,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
let dom_wrapper = document.createElement("div");
|
|
||||||
dom_wrapper.classList.add("widget-multiview-weekview");
|
|
||||||
await this.widget_weekview.load(dom_wrapper);
|
|
||||||
this.dom_context.appendChild(dom_wrapper);
|
|
||||||
}
|
|
||||||
// listview
|
|
||||||
{
|
|
||||||
this.widget_listview = (
|
|
||||||
new _dali.widgets.class_widget_listview(
|
|
||||||
this.get_entries,
|
|
||||||
{
|
|
||||||
"action_select": (event_key) => this.action_edit_event(event_key),
|
|
||||||
"action_add": () => this.action_create_event(),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
let dom_wrapper = document.createElement("div");
|
|
||||||
dom_wrapper.classList.add("widget-multiview-listview");
|
|
||||||
await this.widget_listview.load(dom_wrapper);
|
|
||||||
this.dom_context.appendChild(dom_wrapper);
|
|
||||||
}
|
|
||||||
this.set_view_mode(this.initial_view_mode);
|
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
.widget-multiview-mode_switcher
|
|
||||||
{
|
|
||||||
margin-bottom: 12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-multiview[rel="week"] > .widget-multiview-weekview {}
|
|
||||||
.widget-multiview[rel="week"] > .widget-multiview-listview {display: none;}
|
|
||||||
|
|
||||||
.widget-multiview[rel="list"] > .widget-multiview-weekview {display: none;}
|
|
||||||
.widget-multiview[rel="list"] > .widget-multiview-listview {}
|
|
||||||
|
|
@ -1,648 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_action_create_calendar = (
|
|
||||||
(
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<void>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_action_edit_calendar = (
|
|
||||||
(
|
|
||||||
type_calendar_object_reduced_with_id
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<void>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_action_create_event = (
|
|
||||||
(
|
|
||||||
stuff ?: {
|
|
||||||
date ?: lib_plankton.pit.type_date;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<void>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
type type_action_edit_event = (
|
|
||||||
(
|
|
||||||
event_key : _dali.type_event_key
|
|
||||||
)
|
|
||||||
=>
|
|
||||||
Promise<void>
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class class_widget_overview
|
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private widget_sources : _dali.widgets.class_widget_sources;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private widget_multiview : _dali.widgets.class_widget_multiview;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_create_calendar : type_action_create_calendar;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_edit_calendar : type_action_edit_calendar;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_create_event : type_action_create_event;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_edit_event : type_action_edit_event;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public constructor(
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.action_create_calendar = async (
|
|
||||||
) => {
|
|
||||||
const widget = new _dali.widgets.class_widget_calendar_edit(
|
|
||||||
await _dali.model.group_list(),
|
|
||||||
await _dali.model.user_list(),
|
|
||||||
{
|
|
||||||
"name": "",
|
|
||||||
"hue": lib_plankton.random.generate_unit(),
|
|
||||||
"access": {
|
|
||||||
"public": false,
|
|
||||||
"default_level": _dali.enum_access_level.none,
|
|
||||||
"attributed_group": lib_plankton.map.hashmap.implementation_map<
|
|
||||||
_dali.type_group_id,
|
|
||||||
_dali.enum_access_level
|
|
||||||
>(
|
|
||||||
lib_plankton.map.hashmap.make<
|
|
||||||
_dali.type_group_id,
|
|
||||||
_dali.enum_access_level
|
|
||||||
>(
|
|
||||||
group_id => group_id.toFixed(0),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
"attributed_user": 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": () => {
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
},
|
|
||||||
"action_add": (calendar_object) => {
|
|
||||||
_dali.model.calendar_add(
|
|
||||||
calendar_object
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
() => {
|
|
||||||
this.update_sources_and_entries();
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.catch(
|
|
||||||
(reason) => {
|
|
||||||
lib_plankton.log.warning(
|
|
||||||
"dali.overview.calendar_add_error",
|
|
||||||
{"reason": String(reason)}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
_dali.overlay.clear();
|
|
||||||
_dali.overlay.toggle({"mode": true});
|
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
|
||||||
};
|
|
||||||
this.action_edit_calendar = async (
|
|
||||||
calendar_object_reduced_with_id
|
|
||||||
) => {
|
|
||||||
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.class_widget_calendar_edit(
|
|
||||||
await _dali.model.group_list(),
|
|
||||||
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(
|
|
||||||
() => {
|
|
||||||
this.update_sources_and_entries();
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
"action_remove": (data) => {
|
|
||||||
_dali.model.calendar_remove(
|
|
||||||
calendar_id
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
() => {
|
|
||||||
this.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?
|
|
||||||
*/
|
|
||||||
this.action_create_event = async (
|
|
||||||
{
|
|
||||||
"date": date = lib_plankton.pit.to_datetime(lib_plankton.pit.now()).date,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
date ?: lib_plankton.pit.type_date;
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
) => {
|
|
||||||
if (! _dali.is_logged_in())
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
const widget = new _dali.widgets.class_widget_event_edit(
|
|
||||||
(await this.get_available_calendars()),
|
|
||||||
{
|
|
||||||
"calendar_id": null,
|
|
||||||
"event_name": "",
|
|
||||||
"event_begin": lib_plankton.call.convey(
|
|
||||||
date,
|
|
||||||
[
|
|
||||||
x => ({
|
|
||||||
"timezone_shift": 0,
|
|
||||||
"date": date,
|
|
||||||
"time": {"hour": 12, "minute": 0, "second": 0}
|
|
||||||
}),
|
|
||||||
lib_plankton.pit.from_datetime,
|
|
||||||
x => lib_plankton.pit.shift_hour(x, 0),
|
|
||||||
lib_plankton.pit.to_datetime,
|
|
||||||
]
|
|
||||||
),
|
|
||||||
"event_end": lib_plankton.call.convey(
|
|
||||||
date,
|
|
||||||
[
|
|
||||||
x => ({
|
|
||||||
"timezone_shift": 0,
|
|
||||||
"date": date,
|
|
||||||
"time": {"hour": 12, "minute": 0, "second": 0}
|
|
||||||
}),
|
|
||||||
lib_plankton.pit.from_datetime,
|
|
||||||
x => lib_plankton.pit.shift_hour(x, +1),
|
|
||||||
lib_plankton.pit.to_datetime,
|
|
||||||
]
|
|
||||||
),
|
|
||||||
"event_location": null,
|
|
||||||
"event_link": null,
|
|
||||||
"event_description": null,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"read_only": false,
|
|
||||||
"action_cancel": () => {
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
},
|
|
||||||
"action_add": (data) => {
|
|
||||||
_dali.model.event_add(
|
|
||||||
data.calendar_id,
|
|
||||||
{
|
|
||||||
"name": data.event_name,
|
|
||||||
"begin": data.event_begin,
|
|
||||||
"end": data.event_end,
|
|
||||||
"location": data.event_location,
|
|
||||||
"link": data.event_link,
|
|
||||||
"description": data.event_description,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
() => {
|
|
||||||
this.update_entries();
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.catch(
|
|
||||||
(reason) => {
|
|
||||||
// todo
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
_dali.overlay.clear();
|
|
||||||
_dali.overlay.toggle({"mode": true});
|
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
this.action_edit_event = async (
|
|
||||||
event_key
|
|
||||||
) => {
|
|
||||||
const event_object_extended : _dali.type_event_object_extended = await _dali.model.event_get(event_key);
|
|
||||||
const read_only : boolean = (() => {
|
|
||||||
switch (event_object_extended.access_level)
|
|
||||||
{
|
|
||||||
case _dali.enum_access_level.none:
|
|
||||||
{
|
|
||||||
throw (new Error("this event should not be visible"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case _dali.enum_access_level.view:
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case _dali.enum_access_level.edit:
|
|
||||||
case _dali.enum_access_level.admin:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}) ();
|
|
||||||
const widget = new _dali.widgets.class_widget_event_edit(
|
|
||||||
(await this.get_available_calendars()),
|
|
||||||
{
|
|
||||||
"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,
|
|
||||||
"action_cancel": () => {
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
},
|
|
||||||
"action_change": (data) => {
|
|
||||||
_dali.model.event_change(
|
|
||||||
event_key,
|
|
||||||
{
|
|
||||||
"name": data.event_name,
|
|
||||||
"begin": data.event_begin,
|
|
||||||
"end": data.event_end,
|
|
||||||
"location": data.event_location,
|
|
||||||
"link": data.event_link,
|
|
||||||
"description": data.event_description,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
() => {
|
|
||||||
this.update_entries();
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.catch(
|
|
||||||
(reason) => {
|
|
||||||
lib_plankton.log.warning(
|
|
||||||
"dali.overview.event_change.error",
|
|
||||||
{"reason": String(reason)}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
"action_remove": () => {
|
|
||||||
_dali.model.event_remove(
|
|
||||||
event_key
|
|
||||||
)
|
|
||||||
.then(
|
|
||||||
() => {
|
|
||||||
this.update_entries();
|
|
||||||
_dali.overlay.toggle({"mode": false});
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.catch(
|
|
||||||
(reason) => {
|
|
||||||
lib_plankton.log.warning(
|
|
||||||
"dali.overview.event_remove_error",
|
|
||||||
{"reason": String(reason)}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
_dali.overlay.clear();
|
|
||||||
_dali.overlay.toggle({"mode": true});
|
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private async 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)
|
|
||||||
||
|
|
||||||
(entry.access_level === _dali.enum_access_level.admin)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private async get_entries(
|
|
||||||
from_pit : lib_plankton.pit.type_pit,
|
|
||||||
to_pit : lib_plankton.pit.type_pit,
|
|
||||||
calendar_ids : Array<_dali.type_calendar_id>
|
|
||||||
)
|
|
||||||
: Promise<Array<_dali.type_event_object_extended>>
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* @todo do NOT wait?
|
|
||||||
*/
|
|
||||||
await _dali.model.sync_events(
|
|
||||||
{
|
|
||||||
"from": from_pit,
|
|
||||||
"to": to_pit,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"calendar_ids": calendar_ids,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
/**
|
|
||||||
* @todo filter
|
|
||||||
*/
|
|
||||||
return _dali.model.event_list();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private async update_sources_and_entries(
|
|
||||||
{
|
|
||||||
"priviliged": priviliged = null,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
priviliged ?: (null | boolean);
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
await this.widget_sources.update({"priviliged": priviliged});
|
|
||||||
await this.widget_multiview.update_entries();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @todo use priviliged?
|
|
||||||
*/
|
|
||||||
private async update_entries(
|
|
||||||
{
|
|
||||||
"priviliged": priviliged = null,
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
priviliged ?: (null | boolean);
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
await this.widget_multiview.update_entries();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
public async load(
|
|
||||||
target_element : HTMLElement
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
const view_mode : _dali.enum_view_mode = _dali.helpers.view_mode_determine("auto");
|
|
||||||
const view_kind : _dali.enum_view_kind = _dali.helpers.view_kind_determine("auto");
|
|
||||||
|
|
||||||
this.widget_sources = (
|
|
||||||
new _dali.widgets.class_widget_sources(
|
|
||||||
_dali.model.calendar_list,
|
|
||||||
{
|
|
||||||
"initial_priviliged": _dali.is_logged_in(),
|
|
||||||
"action_add": this.action_create_calendar,
|
|
||||||
"action_select": this.action_edit_calendar,
|
|
||||||
"action_toggle": (entry, mode) => {
|
|
||||||
this.widget_multiview.toggle_calendar_visibilty(entry.id, {"mode": mode});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
this.widget_multiview = (
|
|
||||||
new _dali.widgets.class_widget_multiview(
|
|
||||||
this.get_entries,
|
|
||||||
{
|
|
||||||
"initial_view_mode": view_mode,
|
|
||||||
"weekview_initial_vertical": (view_kind === _dali.enum_view_kind.touch),
|
|
||||||
"action_create_event": this.action_create_event,
|
|
||||||
"action_edit_event": this.action_edit_event,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
|
||||||
"widget-overview",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// head
|
|
||||||
{
|
|
||||||
// hint
|
|
||||||
{
|
|
||||||
const dom_hint = target_element.querySelector(".widget-overview-hint");
|
|
||||||
dom_hint.textContent = lib_plankton.translate.get("widget.overview.login_hint");
|
|
||||||
dom_hint.classList.toggle("widget-overview-hint-hidden", _dali.is_logged_in());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// body
|
|
||||||
{
|
|
||||||
let widget_slider : lib_plankton.zoo_widget.interface_widget;
|
|
||||||
switch (view_kind)
|
|
||||||
{
|
|
||||||
case _dali.enum_view_kind.regular:
|
|
||||||
{
|
|
||||||
widget_slider = new lib_plankton.zoo_widget.class_slider(
|
|
||||||
[
|
|
||||||
new lib_plankton.zoo_widget.class_bunch(
|
|
||||||
[
|
|
||||||
this.widget_sources,
|
|
||||||
this.widget_multiview,
|
|
||||||
]
|
|
||||||
),
|
|
||||||
],
|
|
||||||
{
|
|
||||||
"threshold": 100,
|
|
||||||
"initial_index": 1,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case _dali.enum_view_kind.touch:
|
|
||||||
{
|
|
||||||
widget_slider = new lib_plankton.zoo_widget.class_slider(
|
|
||||||
[
|
|
||||||
this.widget_sources,
|
|
||||||
this.widget_multiview,
|
|
||||||
],
|
|
||||||
{
|
|
||||||
"threshold": 100,
|
|
||||||
"initial_index": 2,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
await widget_slider.load(target_element.querySelector(".widget-overview-body"));
|
|
||||||
}
|
|
||||||
|
|
||||||
_dali.model.listen_reset(
|
|
||||||
async (priviliged) => {
|
|
||||||
this.update_sources_and_entries({"priviliged": priviliged});
|
|
||||||
target_element.querySelector(".widget-overview-hint").classList.toggle("widget-overview-hint-hidden", priviliged);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
.widget-overview-head
|
|
||||||
{
|
|
||||||
padding-bottom: 12px;
|
|
||||||
margin-bottom: 12px;
|
|
||||||
border-bottom: 1px solid;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-hint
|
|
||||||
{
|
|
||||||
text-align: center;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-hint.widget-overview-hint-hidden
|
|
||||||
{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-body
|
|
||||||
{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-pane-left
|
|
||||||
{
|
|
||||||
flex-basis: 12.5%;
|
|
||||||
flex-grow: 0;
|
|
||||||
flex-shrink: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-pane-right
|
|
||||||
{
|
|
||||||
flex-basis: 87.5%;
|
|
||||||
flex-grow: 1;
|
|
||||||
flex-shrink: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-body .widget-slider-slide .widget-bunch
|
|
||||||
{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-body .widget-slider-slide .widget-bunch-element:nth-child(1)
|
|
||||||
{
|
|
||||||
flex-grow: 0;
|
|
||||||
flex-shrink: 1;
|
|
||||||
flex-basis: 12.5%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-overview-body .widget-slider-slide .widget-bunch-element:nth-child(2)
|
|
||||||
{
|
|
||||||
flex-grow: 1;
|
|
||||||
flex-shrink: 1;
|
|
||||||
flex-basis: 87.5%;
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<div class="widget-overview">
|
|
||||||
<div class="widget-overview-head">
|
|
||||||
<div class="widget-overview-hint">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="widget-overview-body">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,24 +1,4 @@
|
||||||
/*
|
namespace _dali.widgets.sources
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -45,23 +25,22 @@ namespace _dali.widgets
|
||||||
/**
|
/**
|
||||||
* [hook]
|
* [hook]
|
||||||
*/
|
*/
|
||||||
private action_toggle : ((entry : type_entry, mode : boolean) => void);
|
private action_open : ((entry : type_entry) => void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [hook]
|
* [hook]
|
||||||
*/
|
*/
|
||||||
private action_select : ((entry : type_entry) => void);
|
private action_toggle_visibility : ((entry : type_entry) => void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [hook]
|
* [hook]
|
||||||
*/
|
*/
|
||||||
private action_add : (() => void);
|
private action_create : (() => void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [state]
|
|
||||||
*/
|
*/
|
||||||
private priviliged : boolean;
|
private priviliged : boolean;
|
||||||
|
|
||||||
|
|
@ -77,16 +56,16 @@ namespace _dali.widgets
|
||||||
public constructor(
|
public constructor(
|
||||||
get_entries : (() => Promise<Array<type_entry>>),
|
get_entries : (() => Promise<Array<type_entry>>),
|
||||||
{
|
{
|
||||||
"action_select": action_select = ((calendar_id) => {}),
|
"action_open": action_open = ((calendar_id) => {}),
|
||||||
"action_toggle": action_toggle = ((calendar_id, mode) => {}),
|
"action_toggle_visibility": action_toggle_visibility = ((calendar_id) => {}),
|
||||||
"action_add": action_add = (() => {}),
|
"action_create": action_create = (() => {}),
|
||||||
"initial_priviliged": initial_priviliged = false,
|
"initial_priviliged": initial_priviliged = false,
|
||||||
}
|
}
|
||||||
:
|
:
|
||||||
{
|
{
|
||||||
action_select ?: ((entry : type_entry) => void);
|
action_open ?: ((entry : type_entry) => void);
|
||||||
action_toggle ?: ((entry : type_entry, mode : boolean) => void);
|
action_toggle_visibility ?: ((entry : type_entry) => void);
|
||||||
action_add ?: (() => void);
|
action_create ?: (() => void);
|
||||||
initial_priviliged ?: boolean;
|
initial_priviliged ?: boolean;
|
||||||
}
|
}
|
||||||
=
|
=
|
||||||
|
|
@ -98,9 +77,9 @@ namespace _dali.widgets
|
||||||
this.get_entries = get_entries;
|
this.get_entries = get_entries;
|
||||||
|
|
||||||
// hooks
|
// hooks
|
||||||
this.action_select = action_select;
|
this.action_open = action_open;
|
||||||
this.action_toggle = action_toggle;
|
this.action_toggle_visibility = action_toggle_visibility;
|
||||||
this.action_add = action_add;
|
this.action_create = action_create;
|
||||||
|
|
||||||
// state
|
// state
|
||||||
this.priviliged = initial_priviliged;
|
this.priviliged = initial_priviliged;
|
||||||
|
|
@ -190,8 +169,46 @@ namespace _dali.widgets
|
||||||
"entry",
|
"entry",
|
||||||
{
|
{
|
||||||
"name": pair.value.name,
|
"name": pair.value.name,
|
||||||
|
"label_toggle": lib_plankton.string.coin(
|
||||||
|
"{{show}}/{{hide}}",
|
||||||
|
{
|
||||||
|
"show": lib_plankton.translate.get("common.show"),
|
||||||
|
"hide": lib_plankton.translate.get("common.hide"),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
"label_edit": lib_plankton.translate.get("common.edit"),
|
||||||
// "access_level": entry.access_level, // TODO
|
// "access_level": entry.access_level, // TODO
|
||||||
"color": _dali.helpers.event_color(pair.value.hue),
|
// TODO centralize
|
||||||
|
"color_head": lib_plankton.color.output_hex(
|
||||||
|
lib_plankton.color.make_hsv(
|
||||||
|
{
|
||||||
|
"hue": pair.value.hue,
|
||||||
|
/**
|
||||||
|
* @todo const and outsource
|
||||||
|
*/
|
||||||
|
"saturation": 0.375,
|
||||||
|
/**
|
||||||
|
* @todo const and outsource
|
||||||
|
*/
|
||||||
|
"value": 0.375,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
|
"color_body": lib_plankton.color.output_hex(
|
||||||
|
lib_plankton.color.make_hsv(
|
||||||
|
{
|
||||||
|
"hue": pair.value.hue,
|
||||||
|
/**
|
||||||
|
* @todo const and outsource
|
||||||
|
*/
|
||||||
|
"saturation": 0.375,
|
||||||
|
/**
|
||||||
|
* @todo const and outsource
|
||||||
|
*/
|
||||||
|
"value": 0.25,
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
"rel": class_widget_sources.id_encode(pair.key),
|
"rel": class_widget_sources.id_encode(pair.key),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -211,40 +228,43 @@ namespace _dali.widgets
|
||||||
"click",
|
"click",
|
||||||
(event) => {
|
(event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.action_add();
|
this.action_create();
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.container.querySelectorAll(".sources-entry-visibility").forEach(
|
this.container.querySelectorAll(".sources-entry-head").forEach(
|
||||||
(element) => {
|
|
||||||
element.addEventListener(
|
|
||||||
"change",
|
|
||||||
() => {
|
|
||||||
const mode : boolean = (element as HTMLInputElement).checked;
|
|
||||||
const key_encoded : string = element.parentElement.getAttribute("rel");
|
|
||||||
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(entry, mode);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.container.querySelectorAll(".sources-entry").forEach(
|
|
||||||
(element) => {
|
(element) => {
|
||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
(event) => {
|
(event) => {
|
||||||
if ((event.target as Element).classList.contains("sources-entry-visibility"))
|
element.parentElement.classList.toggle("sources-entry-open");
|
||||||
{
|
}
|
||||||
// do nothing
|
);
|
||||||
}
|
}
|
||||||
else
|
);
|
||||||
{
|
this.container.querySelectorAll(".sources-entry-toggle").forEach(
|
||||||
const key_encoded : string = element.getAttribute("rel");
|
(element) => {
|
||||||
const calendar_id : _dali.type_calendar_id = class_widget_sources.id_decode(key_encoded);
|
element.addEventListener(
|
||||||
const entry : type_entry = data.get(calendar_id);
|
"click",
|
||||||
this.action_select(entry);
|
() => {
|
||||||
}
|
const key_encoded : string = element.parentElement.parentElement.parentElement.getAttribute("rel");
|
||||||
|
const calendar_id : _dali.type_calendar_id = class_widget_sources.id_decode(key_encoded);
|
||||||
|
const entry : type_entry = data.get(calendar_id);
|
||||||
|
element.parentElement.parentElement.parentElement.classList.toggle("sources-entry-hidden");
|
||||||
|
element.parentElement.parentElement.parentElement.classList.toggle("sources-entry-open", false);
|
||||||
|
this.action_toggle_visibility(entry);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.container.querySelectorAll(".sources-entry-edit").forEach(
|
||||||
|
(element) => {
|
||||||
|
element.addEventListener(
|
||||||
|
"click",
|
||||||
|
(event) => {
|
||||||
|
const key_encoded : string = element.parentElement.parentElement.parentElement.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);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,36 +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;
|
|
||||||
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
.sources-entry-hidden
|
|
||||||
{
|
|
||||||
filter: saturate(0);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
@ -1,4 +1,11 @@
|
||||||
<li class="sources-entry" style="background-color: {{color}}" rel="{{rel}}">
|
<li class="sources-entry" style="background-color: {{color_head}}" rel="{{rel}}">
|
||||||
<input class="sources-entry-visibility" type="checkbox" checked="checked"/>
|
<div class="sources-entry-head">
|
||||||
<span class="sources-entry-name">{{name}}</span>
|
<span>{{name}}</span>
|
||||||
|
</div>
|
||||||
|
<div class="sources-entry-body" style="background-color: {{color_body}}">
|
||||||
|
<ul>
|
||||||
|
<li class="sources-entry-action sources-entry-toggle">{{label_toggle}}</li>
|
||||||
|
<li class="sources-entry-action sources-entry-edit">{{label_edit}}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -1,167 +0,0 @@
|
||||||
/*
|
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export class class_widget_special_number_input
|
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private action_change : ((int) => Promise<void>);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private label : (null | string);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private minimum : (null | int);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private maximum : (null | int);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
private value : int;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public constructor(
|
|
||||||
{
|
|
||||||
"label": label = null,
|
|
||||||
"minimum": minimum = null,
|
|
||||||
"maximum": maximum = null,
|
|
||||||
"initial_value": initial_value = 0,
|
|
||||||
"action_change": action_change = ((value) => Promise.resolve<void>(undefined)),
|
|
||||||
}
|
|
||||||
:
|
|
||||||
{
|
|
||||||
label ?: (null | string);
|
|
||||||
minimum ?: (null | int);
|
|
||||||
maximum ?: (null | int);
|
|
||||||
initial_value ?: int;
|
|
||||||
action_change ?: ((int) => Promise<void>);
|
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.label = label;
|
|
||||||
this.minimum = minimum;
|
|
||||||
this.maximum = maximum;
|
|
||||||
this.value = initial_value;
|
|
||||||
this.action_change = action_change;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [implementation]
|
|
||||||
*/
|
|
||||||
public async load(
|
|
||||||
target_element : HTMLElement
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
const dom_root = await _dali.helpers.element_from_template(
|
|
||||||
"widget-special_number_input",
|
|
||||||
"main",
|
|
||||||
{
|
|
||||||
"label": this.label,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const dom_input : HTMLInputElement = (dom_root.querySelector(".widget-special_number_input-input") as HTMLInputElement);
|
|
||||||
|
|
||||||
// listeners
|
|
||||||
{
|
|
||||||
dom_input.addEventListener(
|
|
||||||
"change",
|
|
||||||
() => {
|
|
||||||
const value : int = parseInt(dom_input.value);
|
|
||||||
if (
|
|
||||||
((this.minimum === null) || (value >= this.minimum))
|
|
||||||
&&
|
|
||||||
((this.maximum === null) || (value <= this.maximum))
|
|
||||||
)
|
|
||||||
{
|
|
||||||
this.value = value;
|
|
||||||
this.action_change(this.value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
dom_root.querySelector(".widget-special_number_input-prev").addEventListener(
|
|
||||||
"click",
|
|
||||||
() => {
|
|
||||||
if ((this.minimum === null) || (this.value > this.minimum))
|
|
||||||
{
|
|
||||||
this.value -= 1;
|
|
||||||
dom_input.value = this.value.toFixed(0);
|
|
||||||
this.action_change(this.value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
dom_root.querySelector(".widget-special_number_input-next").addEventListener(
|
|
||||||
"click",
|
|
||||||
() => {
|
|
||||||
if ((this.maximum === null) || (this.value < this.maximum))
|
|
||||||
{
|
|
||||||
this.value += 1;
|
|
||||||
dom_input.value = this.value.toFixed(0);
|
|
||||||
this.action_change(this.value);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// content
|
|
||||||
{
|
|
||||||
dom_input.value = this.value.toFixed(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
target_element.appendChild(dom_root);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
.widget-special_number_input-controls
|
|
||||||
{
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-special_number_input-controls > *
|
|
||||||
{
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-special_number_input-button
|
|
||||||
{
|
|
||||||
padding: 4px 4px;
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-special_number_input-label
|
|
||||||
{
|
|
||||||
display: block;
|
|
||||||
|
|
||||||
font-size: 0.75em;
|
|
||||||
/*
|
|
||||||
text-transform: uppercase;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
.widget-special_number_input-input
|
|
||||||
{
|
|
||||||
max-width: 40px;
|
|
||||||
margin: 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<div class="widget-special_number_input">
|
|
||||||
<label class="widget-special_number_input-label">{{label}}</label>
|
|
||||||
<div class="widget-special_number_input-controls">
|
|
||||||
<div class="widget-special_number_input-button widget-special_number_input-prev">◂</div>
|
|
||||||
<input type="text" class="widget-special_number_input-input" pattern="-?[0-9]+"/>
|
|
||||||
<div class="widget-special_number_input-button widget-special_number_input-next">▸</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,26 +1,19 @@
|
||||||
/*
|
namespace _dali.widgets.weekview
|
||||||
This file is part of »dali«.
|
|
||||||
|
|
||||||
Copyright 2025 'kcf' <fenris@folksprak.org>
|
|
||||||
|
|
||||||
»dali« is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
»dali« is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU Lesser General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
type type_entry = {
|
||||||
|
key : _dali.type_event_key;
|
||||||
|
calendar_id : _dali.type_calendar_id;
|
||||||
|
calendar_name : string;
|
||||||
|
hue : float;
|
||||||
|
access_level : _dali.enum_access_level;
|
||||||
|
event_id : (null | _dali.type_local_resource_event_id);
|
||||||
|
event_object : _dali.type_event_object;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
type type_get_entries = (
|
type type_get_entries = (
|
||||||
|
|
@ -30,14 +23,13 @@ namespace _dali.widgets
|
||||||
calendar_ids : Array<_dali.type_calendar_id>
|
calendar_ids : Array<_dali.type_calendar_id>
|
||||||
)
|
)
|
||||||
=>
|
=>
|
||||||
Promise<Array<_dali.type_event_object_extended>>
|
Promise<Array<type_entry>>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export class class_widget_weekview
|
export class class_widget_weekview implements lib_plankton.zoo_widget.interface_widget
|
||||||
implements lib_plankton.zoo_widget.interface_widget
|
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,12 +62,6 @@ namespace _dali.widgets
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* [state]
|
|
||||||
*/
|
|
||||||
private vertical : boolean;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* [state]
|
* [state]
|
||||||
*/
|
*/
|
||||||
|
|
@ -119,7 +105,6 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
"action_select_day": action_select_day = ((date) => {}),
|
"action_select_day": action_select_day = ((date) => {}),
|
||||||
"action_select_event": action_select_event = ((event_key) => {}),
|
"action_select_event": action_select_event = ((event_key) => {}),
|
||||||
"vertical": vertical = false,
|
|
||||||
"initial_year": initial_year = null,
|
"initial_year": initial_year = null,
|
||||||
"initial_week": initial_week = null,
|
"initial_week": initial_week = null,
|
||||||
"initial_count": initial_count = 5,
|
"initial_count": initial_count = 5,
|
||||||
|
|
@ -140,7 +125,6 @@ namespace _dali.widgets
|
||||||
=>
|
=>
|
||||||
void
|
void
|
||||||
);
|
);
|
||||||
vertical ?: boolean;
|
|
||||||
initial_year ?: (null | int);
|
initial_year ?: (null | int);
|
||||||
initial_week ?: (null | int);
|
initial_week ?: (null | int);
|
||||||
initial_count ?: int;
|
initial_count ?: int;
|
||||||
|
|
@ -158,7 +142,6 @@ namespace _dali.widgets
|
||||||
|
|
||||||
// state
|
// state
|
||||||
const ywd_now : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(lib_plankton.pit.now());
|
const ywd_now : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(lib_plankton.pit.now());
|
||||||
this.vertical = vertical;
|
|
||||||
this.year = (
|
this.year = (
|
||||||
initial_year
|
initial_year
|
||||||
??
|
??
|
||||||
|
|
@ -191,9 +174,8 @@ namespace _dali.widgets
|
||||||
* @todo sha256 hash?
|
* @todo sha256 hash?
|
||||||
*/
|
*/
|
||||||
private static entry_hash(
|
private static entry_hash(
|
||||||
entry : _dali.type_event_object_extended
|
entry : type_entry
|
||||||
)
|
) : string
|
||||||
: string
|
|
||||||
{
|
{
|
||||||
return lib_plankton.call.convey(
|
return lib_plankton.call.convey(
|
||||||
{
|
{
|
||||||
|
|
@ -215,8 +197,7 @@ namespace _dali.widgets
|
||||||
private static event_generate_tooltip(
|
private static event_generate_tooltip(
|
||||||
calendar_name : string,
|
calendar_name : string,
|
||||||
event_object : _dali.type_event_object
|
event_object : _dali.type_event_object
|
||||||
)
|
) : string
|
||||||
: string
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
lib_plankton.string.coin(
|
lib_plankton.string.coin(
|
||||||
|
|
@ -322,7 +303,7 @@ namespace _dali.widgets
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
: Promise<Array<_dali.type_event_object_extended>>
|
: Promise<Array<type_entry>>
|
||||||
{
|
{
|
||||||
const entries = await this.get_entries(
|
const entries = await this.get_entries(
|
||||||
lib_plankton.pit.from_ywd(
|
lib_plankton.pit.from_ywd(
|
||||||
|
|
@ -361,9 +342,8 @@ namespace _dali.widgets
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private async entry_insert(
|
private async entry_insert(
|
||||||
entry : _dali.type_event_object_extended
|
entry : type_entry
|
||||||
)
|
) : Promise<(null | HTMLElement)>
|
||||||
: Promise<(null | HTMLElement)>
|
|
||||||
{
|
{
|
||||||
const selector : string = lib_plankton.string.coin(
|
const selector : string = lib_plankton.string.coin(
|
||||||
".weekview-cell[rel=\"{{rel}}\"] > .weekview-events",
|
".weekview-cell[rel=\"{{rel}}\"] > .weekview-events",
|
||||||
|
|
@ -384,11 +364,30 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const dom_entry = await _dali.helpers.element_from_template(
|
let dom_dummy : HTMLElement = document.createElement("div");
|
||||||
|
dom_dummy.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-weekview",
|
"widget-weekview",
|
||||||
"tableview-cell-entry",
|
"tableview-cell-entry",
|
||||||
{
|
{
|
||||||
"color": _dali.helpers.event_color(entry.hue),
|
"color": lib_plankton.color.output_hex(
|
||||||
|
lib_plankton.color.make_hsv(
|
||||||
|
{
|
||||||
|
"hue": entry.hue,
|
||||||
|
/**
|
||||||
|
* @todo as constant
|
||||||
|
*/
|
||||||
|
"saturation": 0.375,
|
||||||
|
/**
|
||||||
|
* @todo as constant
|
||||||
|
*/
|
||||||
|
"value": 0.375,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
"title": class_widget_weekview.event_generate_tooltip(
|
||||||
|
entry.calendar_name,
|
||||||
|
entry.event_object
|
||||||
|
),
|
||||||
"name": entry.event_object.name,
|
"name": entry.event_object.name,
|
||||||
"rel": entry.key,
|
"rel": entry.key,
|
||||||
"additional_classes": lib_plankton.string.coin(
|
"additional_classes": lib_plankton.string.coin(
|
||||||
|
|
@ -399,6 +398,7 @@ namespace _dali.widgets
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
const dom_entry : HTMLElement = dom_dummy.querySelector(".weekview-event_entry");
|
||||||
|
|
||||||
// listener
|
// listener
|
||||||
dom_entry.addEventListener(
|
dom_entry.addEventListener(
|
||||||
|
|
@ -423,9 +423,8 @@ namespace _dali.widgets
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private async entry_add(
|
private async entry_add(
|
||||||
entry : _dali.type_event_object_extended
|
entry : type_entry
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
const dom_entry : (null | HTMLElement) = await this.entry_insert(entry);
|
const dom_entry : (null | HTMLElement) = await this.entry_insert(entry);
|
||||||
if (dom_entry === null)
|
if (dom_entry === null)
|
||||||
|
|
@ -449,9 +448,8 @@ namespace _dali.widgets
|
||||||
*/
|
*/
|
||||||
private async entry_update(
|
private async entry_update(
|
||||||
key : _dali.type_event_key,
|
key : _dali.type_event_key,
|
||||||
entry : _dali.type_event_object_extended
|
entry : type_entry
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
if (! this.event_map.has(key))
|
if (! this.event_map.has(key))
|
||||||
{
|
{
|
||||||
|
|
@ -507,8 +505,7 @@ namespace _dali.widgets
|
||||||
*/
|
*/
|
||||||
private async entry_remove(
|
private async entry_remove(
|
||||||
key : _dali.type_event_key
|
key : _dali.type_event_key
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
if (! this.event_map.has(key))
|
if (! this.event_map.has(key))
|
||||||
{
|
{
|
||||||
|
|
@ -537,15 +534,14 @@ namespace _dali.widgets
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
public async update_entries(
|
public async update_entries(
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
const entries : Array<_dali.type_event_object_extended> = await this.get_entries_wrapped(
|
const entries : Array<type_entry> = await this.get_entries_wrapped(
|
||||||
);
|
);
|
||||||
|
|
||||||
const contrast = lib_plankton.list.contrast<
|
const contrast = lib_plankton.list.contrast<
|
||||||
any,
|
any,
|
||||||
_dali.type_event_object_extended
|
type_entry
|
||||||
>(
|
>(
|
||||||
lib_plankton.map.dump(this.event_map),
|
lib_plankton.map.dump(this.event_map),
|
||||||
pair => pair.key,
|
pair => pair.key,
|
||||||
|
|
@ -576,11 +572,22 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
private async update_controls(
|
||||||
|
) : Promise<void>
|
||||||
|
{
|
||||||
|
const context : Element = this.container;
|
||||||
|
(context.querySelector(".weekview-control-year > input") as HTMLInputElement).value = this.year.toFixed(0);
|
||||||
|
(context.querySelector(".weekview-control-week > input") as HTMLInputElement).value = this.week.toFixed(0);
|
||||||
|
(context.querySelector(".weekview-control-count > input") as HTMLInputElement).value = this.count.toFixed(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private async update_table(
|
private async update_table(
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @todo avoid?
|
* @todo avoid?
|
||||||
|
|
@ -589,13 +596,6 @@ namespace _dali.widgets
|
||||||
const context : Element = this.container;
|
const context : Element = this.container;
|
||||||
// structure
|
// structure
|
||||||
{
|
{
|
||||||
type type_row_data = Array<
|
|
||||||
{
|
|
||||||
week : int;
|
|
||||||
day_pits : Array<lib_plankton.pit.type_pit>;
|
|
||||||
}
|
|
||||||
>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo als Variable?
|
* @todo als Variable?
|
||||||
*/
|
*/
|
||||||
|
|
@ -603,194 +603,127 @@ namespace _dali.widgets
|
||||||
const now_pit : lib_plankton.pit.type_pit = lib_plankton.pit.now();
|
const now_pit : lib_plankton.pit.type_pit = lib_plankton.pit.now();
|
||||||
const today_begin_pit : lib_plankton.pit.type_pit = lib_plankton.pit.trunc_day(now_pit);
|
const today_begin_pit : lib_plankton.pit.type_pit = lib_plankton.pit.trunc_day(now_pit);
|
||||||
const today_end_pit : lib_plankton.pit.type_pit = lib_plankton.pit.shift_day(today_begin_pit, 1);
|
const today_end_pit : lib_plankton.pit.type_pit = lib_plankton.pit.shift_day(today_begin_pit, 1);
|
||||||
const day_names : Array<string> = [
|
const row_data : Array<
|
||||||
lib_plankton.translate.get("common.weekday.monday"),
|
{
|
||||||
lib_plankton.translate.get("common.weekday.tuesday"),
|
week : int;
|
||||||
lib_plankton.translate.get("common.weekday.wednesday"),
|
data : Array<
|
||||||
lib_plankton.translate.get("common.weekday.thursday"),
|
{
|
||||||
lib_plankton.translate.get("common.weekday.friday"),
|
pit : lib_plankton.pit.type_pit;
|
||||||
lib_plankton.translate.get("common.weekday.saturday"),
|
today : boolean;
|
||||||
lib_plankton.translate.get("common.weekday.sunday"),
|
}
|
||||||
];
|
>;
|
||||||
const row_data_original : type_row_data = (
|
}
|
||||||
|
> = (
|
||||||
lib_plankton.list.sequence(this.count)
|
lib_plankton.list.sequence(this.count)
|
||||||
.map(
|
.map(
|
||||||
offset => {
|
offset => {
|
||||||
const week : int = (this.week + offset);
|
const week : int = (this.week + offset);
|
||||||
return {
|
return {
|
||||||
"week": week,
|
"week": week,
|
||||||
"day_pits": (
|
"data": (
|
||||||
lib_plankton.list.sequence(7)
|
lib_plankton.list.sequence(7)
|
||||||
.map(
|
.map(
|
||||||
day => lib_plankton.pit.from_ywd(
|
day => {
|
||||||
{
|
const day_pit : lib_plankton.pit.type_pit = lib_plankton.pit.from_ywd(
|
||||||
"year": this.year,
|
{
|
||||||
"week": week,
|
"year": this.year,
|
||||||
"day": (1 + day),
|
"week": week,
|
||||||
},
|
"day": (day + 1),
|
||||||
{
|
},
|
||||||
"timezone_shift": timezone_shift,
|
{
|
||||||
}
|
"timezone_shift": timezone_shift,
|
||||||
)
|
}
|
||||||
|
);
|
||||||
|
return {
|
||||||
|
"pit": day_pit,
|
||||||
|
"today": lib_plankton.pit.is_between(
|
||||||
|
day_pit,
|
||||||
|
today_begin_pit,
|
||||||
|
today_end_pit
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const row_data_alternative : type_row_data = (
|
context.querySelector(".weekview-table tbody").innerHTML = (
|
||||||
lib_plankton.list.sequence(7)
|
await _dali.helpers.promise_row<string>(
|
||||||
.map(
|
row_data
|
||||||
day_of_week => {
|
.map(
|
||||||
return {
|
(row) => async () => _dali.helpers.template_coin(
|
||||||
/*"day_of_week"*/"week": day_of_week,
|
"widget-weekview",
|
||||||
/*"week_pits"*/"day_pits": (
|
"tableview-row",
|
||||||
lib_plankton.list.sequence(this.count)
|
{
|
||||||
.map(
|
"week": row.week.toFixed(0).padStart(2, "0"),
|
||||||
offset => {
|
"cells": (
|
||||||
const week : int = (this.week + offset);
|
await _dali.helpers.promise_row<string>(
|
||||||
return lib_plankton.pit.from_ywd(
|
row.data
|
||||||
{
|
.map(
|
||||||
"year": this.year,
|
(cell) => async () => _dali.helpers.template_coin(
|
||||||
"week": week,
|
"widget-weekview",
|
||||||
"day": (1 + day_of_week),
|
"tableview-cell",
|
||||||
},
|
{
|
||||||
{
|
"extra_classes": (
|
||||||
"timezone_shift": timezone_shift,
|
[""]
|
||||||
}
|
.concat(cell.today ? ["weekview-cell-today"] : [])
|
||||||
);
|
.join(" ")
|
||||||
}
|
),
|
||||||
)
|
"title": lib_plankton.call.convey(
|
||||||
)
|
cell.pit,
|
||||||
};
|
[
|
||||||
}
|
lib_plankton.pit.to_datetime_ce,
|
||||||
)
|
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
||||||
);
|
|
||||||
const row_data : type_row_data = (
|
|
||||||
(! this.vertical)
|
|
||||||
?
|
|
||||||
row_data_original
|
|
||||||
:
|
|
||||||
row_data_alternative
|
|
||||||
);
|
|
||||||
// head
|
|
||||||
{
|
|
||||||
const dom_tr = document.createElement("tr");
|
|
||||||
{
|
|
||||||
if (! this.vertical)
|
|
||||||
{
|
|
||||||
// anchor
|
|
||||||
{
|
|
||||||
const dom_th = document.createElement("th");
|
|
||||||
dom_th.classList.add("weekview-cell");
|
|
||||||
dom_tr.appendChild(dom_th);
|
|
||||||
}
|
|
||||||
// days
|
|
||||||
{
|
|
||||||
day_names.forEach(
|
|
||||||
(day_name) => {
|
|
||||||
const dom_th = document.createElement("th");
|
|
||||||
dom_th.classList.add("weekview-cell");
|
|
||||||
dom_th.classList.add("weekview-cell-week");
|
|
||||||
dom_th.textContent = day_name;
|
|
||||||
dom_tr.appendChild(dom_th);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// anchor
|
|
||||||
{
|
|
||||||
const dom_th = document.createElement("th");
|
|
||||||
dom_th.classList.add("weekview-cell");
|
|
||||||
dom_tr.appendChild(dom_th);
|
|
||||||
}
|
|
||||||
// days
|
|
||||||
{
|
|
||||||
lib_plankton.list.sequence(this.count).forEach(
|
|
||||||
(offset) => {
|
|
||||||
const dom_th = document.createElement("th");
|
|
||||||
dom_th.classList.add("weekview-cell");
|
|
||||||
dom_th.classList.add("weekview-cell-day");
|
|
||||||
dom_th.textContent = (this.week + offset).toFixed(0).padStart(2, "0");
|
|
||||||
dom_tr.appendChild(dom_th);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
context.querySelector(".weekview-table thead").innerHTML = "";
|
|
||||||
context.querySelector(".weekview-table thead").appendChild(dom_tr);
|
|
||||||
}
|
|
||||||
// body
|
|
||||||
{
|
|
||||||
context.querySelector(".weekview-table tbody").innerHTML = (
|
|
||||||
await _dali.helpers.promise_row<string>(
|
|
||||||
row_data
|
|
||||||
.map(
|
|
||||||
(row, index) => async () => _dali.helpers.template_coin(
|
|
||||||
"widget-weekview",
|
|
||||||
"tableview-row",
|
|
||||||
{
|
|
||||||
"week": (
|
|
||||||
(! this.vertical)
|
|
||||||
?
|
|
||||||
row.week.toFixed(0).padStart(2, "0")
|
|
||||||
:
|
|
||||||
day_names[index]
|
|
||||||
),
|
|
||||||
"cells": (
|
|
||||||
await _dali.helpers.promise_row<string>(
|
|
||||||
row.day_pits
|
|
||||||
.map(
|
|
||||||
(day_pit) => async () => {
|
|
||||||
const is_today : boolean = lib_plankton.pit.is_between(
|
|
||||||
day_pit,
|
|
||||||
today_begin_pit,
|
|
||||||
today_end_pit
|
|
||||||
);
|
|
||||||
const day_as_date : lib_plankton.pit.type_date = lib_plankton.pit.to_datetime_ce(day_pit).date;
|
|
||||||
const day_as_ywd : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(day_pit);
|
|
||||||
return _dali.helpers.template_coin(
|
|
||||||
"widget-weekview",
|
|
||||||
"tableview-cell",
|
|
||||||
{
|
|
||||||
"extra_classes": (
|
|
||||||
[""]
|
|
||||||
.concat(is_today ? ["weekview-cell-today"] : [])
|
|
||||||
.join(" ")
|
|
||||||
),
|
|
||||||
"day": (
|
|
||||||
_dali.conf.get().misc.weekview_cell_day_format
|
|
||||||
.replace(new RegExp("Y", "g"), day_as_date.year.toFixed(0).padStart(4, "0"))
|
|
||||||
.replace(new RegExp("m", "g"), day_as_date.month.toFixed(0).padStart(2, "0"))
|
|
||||||
.replace(new RegExp("b", "g"), _dali.helpers.month_name(day_as_date.month))
|
|
||||||
.replace(new RegExp("d", "g"), day_as_date.day.toFixed(0).padStart(2, "0"))
|
|
||||||
.replace(new RegExp("W", "g"), day_as_ywd.week.toFixed(0).padStart(2, "0"))
|
|
||||||
.replace(new RegExp("w", "g"), day_as_ywd.day.toFixed(0).padStart(1, "0"))
|
|
||||||
),
|
|
||||||
"rel": lib_plankton.string.coin(
|
|
||||||
"{{year}}-{{month}}-{{day}}",
|
"{{year}}-{{month}}-{{day}}",
|
||||||
{
|
{
|
||||||
"year": day_as_date.year.toFixed(0).padStart(4, "0"),
|
"year": x.date.year.toFixed(0).padStart(4, "0"),
|
||||||
"month": day_as_date.month.toFixed(0).padStart(2, "0"),
|
"month": x.date.month.toFixed(0).padStart(2, "0"),
|
||||||
"day": day_as_date.day.toFixed(0).padStart(2, "0"),
|
"day": x.date.day.toFixed(0).padStart(2, "0"),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
"entries": ""
|
]
|
||||||
}
|
),
|
||||||
);
|
"day": lib_plankton.call.convey(
|
||||||
|
cell.pit,
|
||||||
|
[
|
||||||
|
lib_plankton.pit.to_datetime_ce,
|
||||||
|
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
||||||
|
"{{day}}",
|
||||||
|
{
|
||||||
|
"year": x.date.year.toFixed(0).padStart(4, "0"),
|
||||||
|
"month": x.date.month.toFixed(0).padStart(2, "0"),
|
||||||
|
"day": x.date.day.toFixed(0).padStart(2, "0"),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"rel": lib_plankton.call.convey(
|
||||||
|
cell.pit,
|
||||||
|
[
|
||||||
|
lib_plankton.pit.to_datetime_ce,
|
||||||
|
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
|
||||||
|
"{{year}}-{{month}}-{{day}}",
|
||||||
|
{
|
||||||
|
"year": x.date.year.toFixed(0).padStart(4, "0"),
|
||||||
|
"month": x.date.month.toFixed(0).padStart(2, "0"),
|
||||||
|
"day": x.date.day.toFixed(0).padStart(2, "0"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
]
|
||||||
|
),
|
||||||
|
"entries": ""
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).join(""),
|
)
|
||||||
}
|
).join(""),
|
||||||
)
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
).join("");
|
)
|
||||||
}
|
).join("");
|
||||||
}
|
}
|
||||||
// listeners
|
// listeners
|
||||||
{
|
{
|
||||||
|
|
@ -799,11 +732,7 @@ namespace _dali.widgets
|
||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
"click",
|
"click",
|
||||||
(event) => {
|
(event) => {
|
||||||
if (
|
if (! (element === event.target))
|
||||||
(! (element === event.target))
|
|
||||||
&&
|
|
||||||
(! (event.target as HTMLElement).classList.contains("weekview-day"))
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
@ -840,8 +769,7 @@ namespace _dali.widgets
|
||||||
=
|
=
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
)
|
) : void
|
||||||
: void
|
|
||||||
{
|
{
|
||||||
this.container.querySelectorAll(".weekview-event_entry").forEach(
|
this.container.querySelectorAll(".weekview-event_entry").forEach(
|
||||||
(element) => {
|
(element) => {
|
||||||
|
|
@ -854,10 +782,7 @@ namespace _dali.widgets
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
element.classList.toggle(
|
element.classList.toggle("weekview-cell-hidden", mode ?? undefined);
|
||||||
"weekview-cell-hidden",
|
|
||||||
((mode !== null) ? (! mode) : undefined)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -869,97 +794,62 @@ namespace _dali.widgets
|
||||||
*/
|
*/
|
||||||
public async load(
|
public async load(
|
||||||
target_element : Element
|
target_element : Element
|
||||||
)
|
) : Promise<void>
|
||||||
: Promise<void>
|
|
||||||
{
|
{
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
"widget-weekview",
|
"widget-weekview",
|
||||||
"main",
|
"main",
|
||||||
{
|
{
|
||||||
|
"label_control_year": lib_plankton.translate.get("widget.weekview.controls.year"),
|
||||||
|
"label_control_week": lib_plankton.translate.get("widget.weekview.controls.week"),
|
||||||
|
"label_control_count": lib_plankton.translate.get("widget.weekview.controls.count"),
|
||||||
|
"label_control_apply": lib_plankton.translate.get("widget.weekview.controls.apply"),
|
||||||
|
"label_weekday_monday": lib_plankton.translate.get("common.weekday.monday"),
|
||||||
|
"label_weekday_tuesday": lib_plankton.translate.get("common.weekday.tuesday"),
|
||||||
|
"label_weekday_wednesday": lib_plankton.translate.get("common.weekday.wednesday"),
|
||||||
|
"label_weekday_thursday": lib_plankton.translate.get("common.weekday.thursday"),
|
||||||
|
"label_weekday_friday": lib_plankton.translate.get("common.weekday.friday"),
|
||||||
|
"label_weekday_saturday": lib_plankton.translate.get("common.weekday.saturday"),
|
||||||
|
"label_weekday_sunday": lib_plankton.translate.get("common.weekday.sunday"),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// control:year
|
|
||||||
{
|
|
||||||
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_special_number_input(
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.year"),
|
|
||||||
"minimum": 1900,
|
|
||||||
"maximum": 2500,
|
|
||||||
"initial_value": this.year,
|
|
||||||
"action_change": async (value) => {
|
|
||||||
this.year = value;
|
|
||||||
await this.update_table();
|
|
||||||
await this.update_entries();
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await widget.load(target_element.querySelector(".weekview-controls"));
|
|
||||||
}
|
|
||||||
// control:week
|
|
||||||
{
|
|
||||||
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_special_number_input(
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.week"),
|
|
||||||
"minimum": 1,
|
|
||||||
/**
|
|
||||||
* @todo correct
|
|
||||||
*/
|
|
||||||
"maximum": 53,
|
|
||||||
"initial_value": this.week,
|
|
||||||
"action_change": async (value) => {
|
|
||||||
this.week = value;
|
|
||||||
await this.update_table();
|
|
||||||
await this.update_entries();
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await widget.load(target_element.querySelector(".weekview-controls"));
|
|
||||||
}
|
|
||||||
// control:count
|
|
||||||
/*
|
|
||||||
{
|
|
||||||
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_special_number_input(
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.count"),
|
|
||||||
"minimum": 2,
|
|
||||||
"maximum": 6,
|
|
||||||
"initial_value": this.count,
|
|
||||||
"action_change": async (value) => {
|
|
||||||
this.count = value;
|
|
||||||
await this.update_table();
|
|
||||||
await this.update_entries();
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await widget.load(target_element.querySelector(".weekview-controls"));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
// control:vertical
|
|
||||||
{
|
|
||||||
const dom_control = await _dali.helpers.element_from_template(
|
|
||||||
"widget-weekview",
|
|
||||||
"control-vertical",
|
|
||||||
{
|
|
||||||
"label": lib_plankton.translate.get("widget.weekview.controls.vertical"),
|
|
||||||
}
|
|
||||||
);
|
|
||||||
const dom_input : HTMLInputElement = (dom_control.querySelector("input") as HTMLInputElement);
|
|
||||||
dom_input.addEventListener(
|
|
||||||
"change",
|
|
||||||
async () => {
|
|
||||||
event.preventDefault();
|
|
||||||
const value : boolean = dom_input.checked;
|
|
||||||
this.vertical = value;
|
|
||||||
await this.update_table();
|
|
||||||
await this.update_entries();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
dom_input.checked = this.vertical;
|
|
||||||
target_element.querySelector(".weekview-controls").appendChild(dom_control);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.container = target_element.querySelector(".weekview");
|
this.container = target_element.querySelector(".weekview");
|
||||||
|
// controls
|
||||||
|
{
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "year",
|
||||||
|
"transform": parseInt,
|
||||||
|
"write": x => {this.year = x;}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "week",
|
||||||
|
"transform": parseInt,
|
||||||
|
"write": x => {this.week = x;}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "count",
|
||||||
|
"transform": parseInt,
|
||||||
|
"write": x => {this.count = x;}
|
||||||
|
},
|
||||||
|
].forEach(
|
||||||
|
(entry) => {
|
||||||
|
const selector : string = (".weekview-control-" + entry.name + " > input");
|
||||||
|
const element : HTMLInputElement = (target_element.querySelector(selector) as HTMLInputElement);
|
||||||
|
element.addEventListener(
|
||||||
|
"change",
|
||||||
|
async (event) => {
|
||||||
|
event.preventDefault();
|
||||||
|
const value : int = entry.transform(element.value);
|
||||||
|
entry.write(value);
|
||||||
|
await this.update_table();
|
||||||
|
await this.update_entries();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
await this.update_controls();
|
||||||
await this.update_table();
|
await this.update_table();
|
||||||
await this.update_entries();
|
await this.update_entries();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<div class="weekview-control weekview-control-vertical">
|
|
||||||
<label class="weekview-control-label">{{label}}</label>
|
|
||||||
<div class="weekview-control-input">
|
|
||||||
<input type="checkbox"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,9 +1,31 @@
|
||||||
<div class="weekview">
|
<div class="weekview">
|
||||||
<div class="weekview-controls">
|
<div class="weekview-controls">
|
||||||
|
<label class="weekview-control weekview-control-year">
|
||||||
|
<span>{{label_control_year}}</span>
|
||||||
|
<input type="number"/>
|
||||||
|
</label>
|
||||||
|
<label class="weekview-control weekview-control-week">
|
||||||
|
<span>{{label_control_week}}</span>
|
||||||
|
<input type="number"/>
|
||||||
|
</label>
|
||||||
|
<label class="weekview-control weekview-control-count">
|
||||||
|
<span>{{label_control_count}}</span>
|
||||||
|
<input type="number"/>
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="weekview-table">
|
<div class="weekview-table">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="calendar-cell"></th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_monday}}</th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_tuesday}}</th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_wednesday}}</th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_thursday}}</th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_friday}}</th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_saturday}}</th>
|
||||||
|
<th class="calendar-cell calendar-cell-day">{{label_weekday_sunday}}</th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
<li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" rel="{{rel}}">
|
<li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" title="{{title}}" rel="{{rel}}">
|
||||||
{{name}}
|
{{name}}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<td class="weekview-cell weekview-cell-regular{{extra_classes}}" rel="{{rel}}">
|
<td class="weekview-cell weekview-cell-regular{{extra_classes}}" rel="{{rel}}">
|
||||||
<span class="weekview-day">
|
<span class="weekview-day" title="{{title}}">
|
||||||
{{day}}
|
{{day}}
|
||||||
</span>
|
</span>
|
||||||
<ul class="weekview-events">
|
<ul class="weekview-events">
|
||||||
|
|
|
||||||
10
tools/build
10
tools/build
|
|
@ -24,24 +24,16 @@ def main():
|
||||||
metavar = "<conf-path>",
|
metavar = "<conf-path>",
|
||||||
help = "conf path",
|
help = "conf path",
|
||||||
)
|
)
|
||||||
argument_parser.add_argument(
|
|
||||||
"-f",
|
|
||||||
"--force",
|
|
||||||
action = 'store_true',
|
|
||||||
default = False,
|
|
||||||
help = "force",
|
|
||||||
)
|
|
||||||
args = argument_parser.parse_args()
|
args = argument_parser.parse_args()
|
||||||
|
|
||||||
## exec
|
## exec
|
||||||
targets = []
|
targets = []
|
||||||
targets.append("default")
|
targets.append("default")
|
||||||
_os.system(
|
_os.system(
|
||||||
"make dir_build=%s --file=tools/makefile %s%s"
|
"make dir_build=%s --file=tools/makefile %s"
|
||||||
% (
|
% (
|
||||||
args.output_directory,
|
args.output_directory,
|
||||||
" ".join(targets),
|
" ".join(targets),
|
||||||
(" --always-make" if args.force else ""),
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if True:
|
if True:
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,14 @@ def main(
|
||||||
dest = "index_template_path",
|
dest = "index_template_path",
|
||||||
type = str,
|
type = str,
|
||||||
)
|
)
|
||||||
|
argument_parser.add_argument(
|
||||||
|
"-t",
|
||||||
|
"--template",
|
||||||
|
dest = "template_paths",
|
||||||
|
type = str,
|
||||||
|
action = "append",
|
||||||
|
default = []
|
||||||
|
)
|
||||||
args = argument_parser.parse_args()
|
args = argument_parser.parse_args()
|
||||||
|
|
||||||
## exec
|
## exec
|
||||||
|
|
@ -38,6 +46,12 @@ def main(
|
||||||
string_coin(
|
string_coin(
|
||||||
file_read(args.index_template_path),
|
file_read(args.index_template_path),
|
||||||
{
|
{
|
||||||
|
"templates": "".join(
|
||||||
|
map(
|
||||||
|
file_read,
|
||||||
|
args.template_paths
|
||||||
|
)
|
||||||
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
131
tools/makefile
131
tools/makefile
|
|
@ -26,108 +26,91 @@ ${dir_build}/index.html: \
|
||||||
${dir_source}/index.html.tpl
|
${dir_source}/index.html.tpl
|
||||||
@ ${cmd_log} "index …"
|
@ ${cmd_log} "index …"
|
||||||
@ ${cmd_mkdir} $(dir $@)
|
@ ${cmd_mkdir} $(dir $@)
|
||||||
@ tools/make-index ${dir_source}/index.html.tpl > $@
|
@ tools/make-index \
|
||||||
|
${dir_source}/index.html.tpl \
|
||||||
|
> $@
|
||||||
|
|
||||||
.PHONY: templates
|
.PHONY: templates
|
||||||
templates: \
|
templates: \
|
||||||
templates-widgets-special_number_input \
|
templates-widgets-login \
|
||||||
templates-widgets-login_oidc \
|
|
||||||
templates-widgets-menu \
|
|
||||||
templates-widgets-sources \
|
templates-widgets-sources \
|
||||||
templates-widgets-calendar_edit \
|
|
||||||
templates-widgets-event_edit \
|
|
||||||
templates-widgets-caldav \
|
|
||||||
templates-widgets-listview \
|
templates-widgets-listview \
|
||||||
templates-widgets-weekview \
|
templates-widgets-weekview \
|
||||||
templates-widgets-overview \
|
templates-widgets-mode_switcher \
|
||||||
templates-widgets-mode_switcher
|
templates-widgets-calendar_edit \
|
||||||
|
templates-widgets-event_edit \
|
||||||
|
templates-pages-caldav \
|
||||||
|
templates-pages-overview
|
||||||
|
|
||||||
.PHONY: templates-widgets-special_number_input
|
.PHONY: templates-widgets-login
|
||||||
templates-widgets-special_number_input: \
|
templates-widgets-login: \
|
||||||
$(wildcard ${dir_source}/widgets/special_number_input/templates/*)
|
$(wildcard ${dir_source}/widgets/login/templates/*)
|
||||||
@ ${cmd_log} "templates:widget:special_number_input …"
|
@ ${cmd_log} "templates:widgets:login …"
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-special_number_input
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-login
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/special_number_input/templates/* ${dir_build}/templates/widget-special_number_input/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/login/templates/* ${dir_build}/templates/widget-login/
|
||||||
|
|
||||||
.PHONY: templates-widgets-login_oidc
|
|
||||||
templates-widgets-login_oidc: \
|
|
||||||
$(wildcard ${dir_source}/widgets/login_oidc/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:login_oidc …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-login_oidc
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/login_oidc/templates/* ${dir_build}/templates/widget-login_oidc/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-menu
|
|
||||||
templates-widgets-menu: \
|
|
||||||
$(wildcard ${dir_source}/widgets/menu/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:menu …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-menu
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/menu/templates/* ${dir_build}/templates/widget-menu/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-sources
|
.PHONY: templates-widgets-sources
|
||||||
templates-widgets-sources: \
|
templates-widgets-sources: \
|
||||||
$(wildcard ${dir_source}/widgets/sources/templates/*)
|
$(wildcard ${dir_source}/widgets/sources/templates/*)
|
||||||
@ ${cmd_log} "templates:widget:sources …"
|
@ ${cmd_log} "templates:widgets:sources …"
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-sources
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-sources
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/sources/templates/* ${dir_build}/templates/widget-sources/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/sources/templates/* ${dir_build}/templates/widget-sources/
|
||||||
|
|
||||||
.PHONY: templates-widgets-calendar_edit
|
|
||||||
templates-widgets-calendar_edit: \
|
|
||||||
$(wildcard ${dir_source}/widgets/calendar_edit/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:calendar_edit …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-calendar_edit
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/calendar_edit/templates/* ${dir_build}/templates/widget-calendar_edit/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-event_edit
|
|
||||||
templates-widgets-event_edit: \
|
|
||||||
$(wildcard ${dir_source}/widgets/event_edit/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:event_edit …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-event_edit
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/event_edit/templates/* ${dir_build}/templates/widget-event_edit/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-caldav
|
|
||||||
templates-widgets-caldav: \
|
|
||||||
$(wildcard ${dir_source}/widgets/caldav/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:caldav …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-caldav
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/caldav/templates/* ${dir_build}/templates/widget-caldav/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-listview
|
.PHONY: templates-widgets-listview
|
||||||
templates-widgets-listview: \
|
templates-widgets-listview: \
|
||||||
$(wildcard ${dir_source}/widgets/listview/templates/*)
|
$(wildcard ${dir_source}/widgets/listview/templates/*)
|
||||||
@ ${cmd_log} "templates:widget:listview …"
|
@ ${cmd_log} "templates:widgets:listview …"
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-listview
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-listview
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/listview/templates/* ${dir_build}/templates/widget-listview/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/listview/templates/* ${dir_build}/templates/widget-listview/
|
||||||
|
|
||||||
.PHONY: templates-widgets-weekview
|
.PHONY: templates-widgets-weekview
|
||||||
templates-widgets-weekview: \
|
templates-widgets-weekview: \
|
||||||
$(wildcard ${dir_source}/widgets/weekview/templates/*)
|
$(wildcard ${dir_source}/widgets/weekview/templates/*)
|
||||||
@ ${cmd_log} "templates:widget:weekview …"
|
@ ${cmd_log} "templates:widgets:weekview …"
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-weekview
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-weekview
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/weekview/templates/* ${dir_build}/templates/widget-weekview/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/weekview/templates/* ${dir_build}/templates/widget-weekview/
|
||||||
|
|
||||||
.PHONY: templates-widgets-overview
|
|
||||||
templates-widgets-overview: \
|
|
||||||
$(wildcard ${dir_source}/widgets/overview/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:overview …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-overview
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/overview/templates/* ${dir_build}/templates/widget-overview/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-mode_switcher
|
.PHONY: templates-widgets-mode_switcher
|
||||||
templates-widgets-mode_switcher: \
|
templates-widgets-mode_switcher: \
|
||||||
$(wildcard ${dir_source}/widgets/mode_switcher/templates/*)
|
$(wildcard ${dir_source}/widgets/mode_switcher/templates/*)
|
||||||
@ ${cmd_log} "templates:widget:mode_switcher …"
|
@ ${cmd_log} "templates:widgets:mode_switcher …"
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-mode_switcher
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-mode_switcher
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/mode_switcher/templates/* ${dir_build}/templates/widget-mode_switcher/
|
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/mode_switcher/templates/* ${dir_build}/templates/widget-mode_switcher/
|
||||||
|
|
||||||
.PHONY: style
|
.PHONY: templates-widgets-calendar_edit
|
||||||
style: ${dir_build}/style.css
|
templates-widgets-calendar_edit: \
|
||||||
|
$(wildcard ${dir_source}/widgets/calendar_edit/templates/*)
|
||||||
|
@ ${cmd_log} "templates:widgets:calendar_edit …"
|
||||||
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-calendar_edit
|
||||||
|
# @ ${cmd_cp} -r -u -v ${dir_source}/widgets/calendar_edit/templates/* ${dir_build}/templates/widget-calendar_edit/
|
||||||
|
|
||||||
${dir_build}/style.css: \
|
.PHONY: templates-widgets-event_edit
|
||||||
$(wildcard ${dir_source}/style/*.css) \
|
templates-widgets-event_edit: \
|
||||||
$(wildcard ${dir_source}/widgets/*/style.css)
|
$(wildcard ${dir_source}/pages/event_edit/templates/*)
|
||||||
|
@ ${cmd_log} "templates:widgets:event_edit …"
|
||||||
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-event_edit
|
||||||
|
# @ ${cmd_cp} -r -u -v ${dir_source}/pages/event_edit/templates/* ${dir_build}/templates/widget-uevent_edit/
|
||||||
|
|
||||||
|
.PHONY: templates-pages-caldav
|
||||||
|
templates-pages-caldav: \
|
||||||
|
$(wildcard ${dir_source}/pages/caldav/templates/*)
|
||||||
|
@ ${cmd_log} "templates:caldav …"
|
||||||
|
@ ${cmd_mkdir} ${dir_build}/templates/caldav
|
||||||
|
@ ${cmd_cp} -r -u -v ${dir_source}/pages/caldav/templates/* ${dir_build}/templates/caldav/
|
||||||
|
|
||||||
|
.PHONY: templates-pages-overview
|
||||||
|
templates-pages-overview: \
|
||||||
|
$(wildcard ${dir_source}/pages/overview/templates/*)
|
||||||
|
@ ${cmd_log} "templates:overview …"
|
||||||
|
@ ${cmd_mkdir} ${dir_build}/templates/overview
|
||||||
|
@ ${cmd_cp} -r -u -v ${dir_source}/pages/overview/templates/* ${dir_build}/templates/overview/
|
||||||
|
|
||||||
|
.PHONY: style
|
||||||
|
style: \
|
||||||
|
$(wildcard ${dir_source}/style/*)
|
||||||
@ ${cmd_log} "style …"
|
@ ${cmd_log} "style …"
|
||||||
@ ${cmd_mkdir} ${dir_build}
|
@ ${cmd_mkdir} ${dir_build}
|
||||||
@ ${cmd_cat} $^ > $@
|
@ ${cmd_cat} ${dir_source}/style/* > ${dir_build}/style.css
|
||||||
|
|
||||||
.PHONY: logic
|
.PHONY: logic
|
||||||
logic: ${dir_build}/logic.js
|
logic: ${dir_build}/logic.js
|
||||||
|
|
@ -139,9 +122,19 @@ ${dir_temp}/logic-unlinked.js: \
|
||||||
${dir_source}/base.ts \
|
${dir_source}/base.ts \
|
||||||
${dir_source}/types.ts \
|
${dir_source}/types.ts \
|
||||||
${dir_source}/model.ts \
|
${dir_source}/model.ts \
|
||||||
${dir_source}/overlay.ts \
|
|
||||||
${dir_source}/helpers.ts \
|
${dir_source}/helpers.ts \
|
||||||
$(wildcard ${dir_source}/widgets/*/logic.ts) \
|
${dir_source}/widgets/login/logic.ts \
|
||||||
|
${dir_source}/widgets/menu/logic.ts \
|
||||||
|
${dir_source}/widgets/sources/logic.ts \
|
||||||
|
${dir_source}/widgets/listview/logic.ts \
|
||||||
|
${dir_source}/widgets/weekview/logic.ts \
|
||||||
|
${dir_source}/widgets/mode_switcher/logic.ts \
|
||||||
|
${dir_source}/widgets/calendar_edit/logic.ts \
|
||||||
|
${dir_source}/widgets/event_edit/logic.ts \
|
||||||
|
${dir_source}/overlay.ts \
|
||||||
|
${dir_source}/pages/caldav/logic.ts \
|
||||||
|
${dir_source}/pages/oidc_finish/logic.ts \
|
||||||
|
${dir_source}/pages/overview/logic.ts \
|
||||||
${dir_source}/main.ts
|
${dir_source}/main.ts
|
||||||
@ ${cmd_log} "logic | compile …"
|
@ ${cmd_log} "logic | compile …"
|
||||||
@ ${cmd_mkdir} $(dir $@)
|
@ ${cmd_mkdir} $(dir $@)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue