[task-396]
This commit is contained in:
parent
4766fd7f59
commit
58e8688bf7
|
|
@ -100,6 +100,7 @@ namespace _dali.type
|
||||||
*/
|
*/
|
||||||
export type calendar_object = {
|
export type calendar_object = {
|
||||||
name : string;
|
name : string;
|
||||||
|
hue : float;
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : enum_access_level;
|
default_level : enum_access_level;
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
"resource.kinds.caldav.read_only": "nur lesen",
|
"resource.kinds.caldav.read_only": "nur lesen",
|
||||||
"calendar.calendar": "Kalender",
|
"calendar.calendar": "Kalender",
|
||||||
"calendar.name": "Name",
|
"calendar.name": "Name",
|
||||||
|
"calendar.hue": "Farbton",
|
||||||
"calendar.resource": "Resource",
|
"calendar.resource": "Resource",
|
||||||
"calendar.access.access": "Zugriff",
|
"calendar.access.access": "Zugriff",
|
||||||
"calendar.access.public": "öffentlich",
|
"calendar.access.public": "öffentlich",
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@
|
||||||
"resource.kinds.caldav.read_only": "read-only",
|
"resource.kinds.caldav.read_only": "read-only",
|
||||||
"calendar.calendar": "Kalendar",
|
"calendar.calendar": "Kalendar",
|
||||||
"calendar.name": "name",
|
"calendar.name": "name",
|
||||||
|
"calendar.hue": "hue",
|
||||||
"calendar.resource": "resource",
|
"calendar.resource": "resource",
|
||||||
"calendar.access.access": "access",
|
"calendar.access.access": "access",
|
||||||
"calendar.access.public": "public",
|
"calendar.access.public": "public",
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ namespace _dali.pages
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
_dali.type.calendar_object,
|
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
access : {
|
access : {
|
||||||
|
|
@ -27,9 +26,22 @@ namespace _dali.pages
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
resource_kind : string;
|
resource_kind : string;
|
||||||
|
hue : (null | float);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
access : {
|
||||||
|
public : boolean;
|
||||||
|
default_level : _dali.type.enum_access_level;
|
||||||
|
attributed : lib_plankton.map.type_map<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
resource_kind : string;
|
||||||
|
hue : (null | float);
|
||||||
}
|
}
|
||||||
> = new lib_plankton.zoo_form.class_form<
|
> = new lib_plankton.zoo_form.class_form<
|
||||||
_dali.type.calendar_object,
|
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
access : {
|
access : {
|
||||||
|
|
@ -41,44 +53,24 @@ namespace _dali.pages
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
resource_kind : string;
|
resource_kind : string;
|
||||||
|
hue : (null | float);
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
access : {
|
||||||
|
public : boolean;
|
||||||
|
default_level : _dali.type.enum_access_level;
|
||||||
|
attributed : lib_plankton.map.type_map<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
resource_kind : string;
|
||||||
|
hue : (null | float);
|
||||||
}
|
}
|
||||||
>(
|
>(
|
||||||
(calendar_object) => ({
|
(value) => value,
|
||||||
"name": calendar_object.name,
|
(raw) => raw,
|
||||||
"access": calendar_object.access,
|
|
||||||
"resource_kind": calendar_object.resource.kind,
|
|
||||||
}),
|
|
||||||
(raw) => ({
|
|
||||||
"name": raw.name,
|
|
||||||
"access": raw.access,
|
|
||||||
"resource": (() => {
|
|
||||||
switch (raw.resource_kind) {
|
|
||||||
case "local": {
|
|
||||||
return {
|
|
||||||
"kind": "local",
|
|
||||||
"data": {
|
|
||||||
"events": [],
|
|
||||||
}
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case "caldav": {
|
|
||||||
return {
|
|
||||||
"kind": "caldav",
|
|
||||||
"data": {
|
|
||||||
"url": "", // TODO
|
|
||||||
"read_only": true, // TODO
|
|
||||||
}
|
|
||||||
};
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
throw (new Error("invalid resource kind: " + raw.resource_kind));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}) (),
|
|
||||||
}),
|
|
||||||
new lib_plankton.zoo_input.class_input_group<any>(
|
new lib_plankton.zoo_input.class_input_group<any>(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
@ -86,6 +78,12 @@ namespace _dali.pages
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(),
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
"label": lib_plankton.translate.get("calendar.name")
|
"label": lib_plankton.translate.get("calendar.name")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "hue",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_hue(
|
||||||
|
),
|
||||||
|
"label": lib_plankton.translate.get("calendar.hue"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "access",
|
"name": "access",
|
||||||
"input": new lib_plankton.zoo_input.class_input_group(
|
"input": new lib_plankton.zoo_input.class_input_group(
|
||||||
|
|
@ -130,12 +128,51 @@ namespace _dali.pages
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("page.calendar_add.actions.do"),
|
"label": lib_plankton.translate.get("page.calendar_add.actions.do"),
|
||||||
"target": "submit",
|
|
||||||
"procedure": async (get_value, get_representation) => {
|
"procedure": async (get_value, get_representation) => {
|
||||||
const value : any = await get_value();
|
const value : any = await get_value();
|
||||||
try {
|
const calendar_object : _dali.type.calendar_object = {
|
||||||
|
"name": value.name,
|
||||||
|
"access": {
|
||||||
|
"public": value.access.public,
|
||||||
|
"default_level": value.access.default_level,
|
||||||
|
"attributed": value.access.attributed,
|
||||||
|
},
|
||||||
|
"resource": (() => {
|
||||||
|
switch (value.resource_kind) {
|
||||||
|
case "local":
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"kind": "local",
|
||||||
|
"data": {
|
||||||
|
"events": [],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case "caldav":
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"kind": "caldav",
|
||||||
|
"data": {
|
||||||
|
"url": "", // TODO
|
||||||
|
"read_only": true, // TODO
|
||||||
|
}
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
throw (new Error("invalid resource kind: " + value.resource_kind));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}) (),
|
||||||
|
"hue": value.hue,
|
||||||
|
};
|
||||||
|
try
|
||||||
|
{
|
||||||
await _dali.backend.calendar_add(
|
await _dali.backend.calendar_add(
|
||||||
value
|
calendar_object
|
||||||
);
|
);
|
||||||
lib_plankton.zoo_page.set(
|
lib_plankton.zoo_page.set(
|
||||||
{
|
{
|
||||||
|
|
@ -144,7 +181,8 @@ namespace _dali.pages
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error)
|
||||||
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
/*
|
/*
|
||||||
lib_plankton.zoo_page.set(
|
lib_plankton.zoo_page.set(
|
||||||
|
|
@ -161,6 +199,28 @@ namespace _dali.pages
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
await form.setup(document.querySelector("#calendar_add_form"));
|
await form.setup(document.querySelector("#calendar_add_form"));
|
||||||
|
await form.input_write(
|
||||||
|
{
|
||||||
|
"name": "",
|
||||||
|
"access": {
|
||||||
|
"public": false,
|
||||||
|
"default_level": _dali.type.enum_access_level.view,
|
||||||
|
"attributed": lib_plankton.map.hashmap.implementation_map<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>(
|
||||||
|
lib_plankton.map.hashmap.make<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>(
|
||||||
|
user_id => user_id.toFixed(0),
|
||||||
|
)
|
||||||
|
),
|
||||||
|
},
|
||||||
|
"resource_kind": "local",
|
||||||
|
"hue": lib_plankton.random.generate_unit(),
|
||||||
|
}
|
||||||
|
);
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,21 @@ namespace _dali.pages
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
const form : lib_plankton.zoo_form.class_form<
|
||||||
_dali.type.calendar_object,
|
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
hue : float;
|
||||||
|
access : {
|
||||||
|
public : boolean;
|
||||||
|
default_level : _dali.type.enum_access_level;
|
||||||
|
attributed : lib_plankton.map.type_map<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
hue : float;
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : _dali.type.enum_access_level;
|
default_level : _dali.type.enum_access_level;
|
||||||
|
|
@ -30,9 +42,21 @@ namespace _dali.pages
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
> = new lib_plankton.zoo_form.class_form<
|
> = new lib_plankton.zoo_form.class_form<
|
||||||
_dali.type.calendar_object,
|
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
|
hue : float;
|
||||||
|
access : {
|
||||||
|
public : boolean;
|
||||||
|
default_level : _dali.type.enum_access_level;
|
||||||
|
attributed : lib_plankton.map.type_map<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : string;
|
||||||
|
hue : float;
|
||||||
access : {
|
access : {
|
||||||
public : boolean;
|
public : boolean;
|
||||||
default_level : _dali.type.enum_access_level;
|
default_level : _dali.type.enum_access_level;
|
||||||
|
|
@ -43,20 +67,8 @@ namespace _dali.pages
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
>(
|
>(
|
||||||
(calendar_object) => ({
|
(value) => value,
|
||||||
"name": calendar_object.name,
|
(raw) => raw,
|
||||||
"access": calendar_object.access,
|
|
||||||
}),
|
|
||||||
(raw) => ({
|
|
||||||
"name": raw.name,
|
|
||||||
"access": raw.access,
|
|
||||||
"resource": {
|
|
||||||
"kind": "local",
|
|
||||||
"data": {
|
|
||||||
"events": [],
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
new lib_plankton.zoo_input.class_input_group<any>(
|
new lib_plankton.zoo_input.class_input_group<any>(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
@ -64,6 +76,12 @@ namespace _dali.pages
|
||||||
"input": new lib_plankton.zoo_input.class_input_text(),
|
"input": new lib_plankton.zoo_input.class_input_text(),
|
||||||
"label": lib_plankton.translate.get("calendar.name")
|
"label": lib_plankton.translate.get("calendar.name")
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "hue",
|
||||||
|
"input": new lib_plankton.zoo_input.class_input_hue(
|
||||||
|
),
|
||||||
|
"label": lib_plankton.translate.get("calendar.hue"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "access",
|
"name": "access",
|
||||||
"input": new lib_plankton.zoo_input.class_input_group(
|
"input": new lib_plankton.zoo_input.class_input_group(
|
||||||
|
|
@ -98,13 +116,12 @@ namespace _dali.pages
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("page.calendar_edit.actions.change"),
|
"label": lib_plankton.translate.get("page.calendar_edit.actions.change"),
|
||||||
"target": "submit",
|
|
||||||
"procedure": async (get_value, get_representation) => {
|
"procedure": async (get_value, get_representation) => {
|
||||||
const value : any = await get_value();
|
const data : any = await get_value();
|
||||||
try {
|
try {
|
||||||
await _dali.backend.calendar_change(
|
await _dali.backend.calendar_change(
|
||||||
calendar_id,
|
calendar_id,
|
||||||
value
|
data
|
||||||
);
|
);
|
||||||
lib_plankton.zoo_page.set(
|
lib_plankton.zoo_page.set(
|
||||||
{
|
{
|
||||||
|
|
@ -129,7 +146,6 @@ namespace _dali.pages
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("page.calendar_edit.actions.remove"),
|
"label": lib_plankton.translate.get("page.calendar_edit.actions.remove"),
|
||||||
"target": "submit",
|
|
||||||
"procedure": async (get_value, get_representation) => {
|
"procedure": async (get_value, get_representation) => {
|
||||||
try {
|
try {
|
||||||
await _dali.backend.calendar_remove(
|
await _dali.backend.calendar_remove(
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ namespace _dali.pages.overview
|
||||||
{
|
{
|
||||||
id : _dali.type.calendar_id;
|
id : _dali.type.calendar_id;
|
||||||
name : string;
|
name : string;
|
||||||
|
hue : float;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
}
|
}
|
||||||
> = await _dali.backend.calendar_list(
|
> = await _dali.backend.calendar_list(
|
||||||
|
|
|
||||||
|
|
@ -310,6 +310,7 @@ namespace _dali.backend
|
||||||
{
|
{
|
||||||
id : int;
|
id : int;
|
||||||
name : string;
|
name : string;
|
||||||
|
hue : float;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
|
@ -328,6 +329,7 @@ namespace _dali.backend
|
||||||
(entry) => ({
|
(entry) => ({
|
||||||
"id": entry.id,
|
"id": entry.id,
|
||||||
"name": entry.name,
|
"name": entry.name,
|
||||||
|
"hue": entry.hue,
|
||||||
"access_level": access_level_decode(entry.access_level),
|
"access_level": access_level_decode(entry.access_level),
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
@ -360,6 +362,7 @@ namespace _dali.backend
|
||||||
(raw) => Promise.resolve(
|
(raw) => Promise.resolve(
|
||||||
{
|
{
|
||||||
"name": raw.name,
|
"name": raw.name,
|
||||||
|
"hue": raw.hue,
|
||||||
"access": {
|
"access": {
|
||||||
"public": raw.access.public,
|
"public": raw.access.public,
|
||||||
"default_level": access_level_decode(raw.access.default_level),
|
"default_level": access_level_decode(raw.access.default_level),
|
||||||
|
|
@ -387,7 +390,7 @@ namespace _dali.backend
|
||||||
"data": {
|
"data": {
|
||||||
"events": []
|
"events": []
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -412,6 +415,7 @@ namespace _dali.backend
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
"name": calendar_object.name,
|
"name": calendar_object.name,
|
||||||
|
"hue": calendar_object.hue,
|
||||||
"access": {
|
"access": {
|
||||||
"public": calendar_object.access.public,
|
"public": calendar_object.access.public,
|
||||||
"default_level": access_level_encode(calendar_object.access.default_level),
|
"default_level": access_level_encode(calendar_object.access.default_level),
|
||||||
|
|
@ -435,7 +439,18 @@ namespace _dali.backend
|
||||||
*/
|
*/
|
||||||
export async function calendar_change(
|
export async function calendar_change(
|
||||||
calendar_id : _dali.type.calendar_id,
|
calendar_id : _dali.type.calendar_id,
|
||||||
calendar_object : _dali.type.calendar_object
|
data : {
|
||||||
|
name : string;
|
||||||
|
hue : float;
|
||||||
|
access : {
|
||||||
|
public : boolean;
|
||||||
|
default_level : _dali.type.enum_access_level;
|
||||||
|
attributed : lib_plankton.map.type_map<
|
||||||
|
_dali.type.user_id,
|
||||||
|
_dali.type.enum_access_level
|
||||||
|
>;
|
||||||
|
};
|
||||||
|
}
|
||||||
) : Promise<
|
) : Promise<
|
||||||
void
|
void
|
||||||
>
|
>
|
||||||
|
|
@ -449,12 +464,13 @@ namespace _dali.backend
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
{
|
{
|
||||||
"name": calendar_object.name,
|
"name": data.name,
|
||||||
|
"hue": data.hue,
|
||||||
"access": {
|
"access": {
|
||||||
"public": calendar_object.access.public,
|
"public": data.access.public,
|
||||||
"default_level": access_level_encode(calendar_object.access.default_level),
|
"default_level": access_level_encode(data.access.default_level),
|
||||||
"attributed": (
|
"attributed": (
|
||||||
lib_plankton.map.dump(calendar_object.access.attributed)
|
lib_plankton.map.dump(data.access.attributed)
|
||||||
.map(
|
.map(
|
||||||
(pair) => ({
|
(pair) => ({
|
||||||
"user_id": pair.key,
|
"user_id": pair.key,
|
||||||
|
|
@ -463,7 +479,6 @@ namespace _dali.backend
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
"resource": calendar_object.resource,
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -588,6 +603,7 @@ namespace _dali.backend
|
||||||
{
|
{
|
||||||
calendar_id : _dali.type.calendar_id;
|
calendar_id : _dali.type.calendar_id;
|
||||||
calendar_name : string;
|
calendar_name : string;
|
||||||
|
hue : float;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
event_id : (null | _dali.type.local_resource_event_id);
|
event_id : (null | _dali.type.local_resource_event_id);
|
||||||
event_object : _dali.type.event_object;
|
event_object : _dali.type.event_object;
|
||||||
|
|
@ -627,6 +643,7 @@ namespace _dali.backend
|
||||||
(entry) => ({
|
(entry) => ({
|
||||||
"calendar_id": entry.calendar_id,
|
"calendar_id": entry.calendar_id,
|
||||||
"calendar_name": entry.calendar_name,
|
"calendar_name": entry.calendar_name,
|
||||||
|
"hue": entry.hue,
|
||||||
"access_level": access_level_decode(entry.access_level),
|
"access_level": access_level_decode(entry.access_level),
|
||||||
"event_id": entry.event_id,
|
"event_id": entry.event_id,
|
||||||
"event_object": entry.event_object,
|
"event_object": entry.event_object,
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ namespace _dali.widgets.listview
|
||||||
type type_entry = {
|
type type_entry = {
|
||||||
calendar_id : _dali.type.calendar_id;
|
calendar_id : _dali.type.calendar_id;
|
||||||
calendar_name : string;
|
calendar_name : string;
|
||||||
|
hue : float;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
event_id : (null | _dali.type.local_resource_event_id);
|
event_id : (null | _dali.type.local_resource_event_id);
|
||||||
event_object : _dali.type.event_object;
|
event_object : _dali.type.event_object;
|
||||||
|
|
@ -229,9 +230,9 @@ namespace _dali.widgets.listview
|
||||||
),
|
),
|
||||||
"raw": JSON.stringify(entry),
|
"raw": JSON.stringify(entry),
|
||||||
"color": lib_plankton.color.output_hex(
|
"color": lib_plankton.color.output_hex(
|
||||||
lib_plankton.color.give_generic(
|
lib_plankton.color.make_hsv(
|
||||||
(entry.calendar_id - 1),
|
|
||||||
{
|
{
|
||||||
|
"hue": entry.hue,
|
||||||
"saturation": 0.375,
|
"saturation": 0.375,
|
||||||
"value": 0.375,
|
"value": 0.375,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ namespace _dali.widgets.sources
|
||||||
type type_entry = {
|
type type_entry = {
|
||||||
id : _dali.type.calendar_id;
|
id : _dali.type.calendar_id;
|
||||||
name : string;
|
name : string;
|
||||||
|
hue : float;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -101,18 +102,18 @@ namespace _dali.widgets.sources
|
||||||
// "access_level": entry.access_level, // TODO
|
// "access_level": entry.access_level, // TODO
|
||||||
// TODO centralize
|
// TODO centralize
|
||||||
"color_head": lib_plankton.color.output_hex(
|
"color_head": lib_plankton.color.output_hex(
|
||||||
lib_plankton.color.give_generic(
|
lib_plankton.color.make_hsv(
|
||||||
(entry.id - 1),
|
|
||||||
{
|
{
|
||||||
|
"hue": entry.hue,
|
||||||
"saturation": 0.375,
|
"saturation": 0.375,
|
||||||
"value": 0.375,
|
"value": 0.375,
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
"color_body": lib_plankton.color.output_hex(
|
"color_body": lib_plankton.color.output_hex(
|
||||||
lib_plankton.color.give_generic(
|
lib_plankton.color.make_hsv(
|
||||||
(entry.id - 1),
|
|
||||||
{
|
{
|
||||||
|
"hue": entry.hue,
|
||||||
"saturation": 0.375,
|
"saturation": 0.375,
|
||||||
"value": 0.25,
|
"value": 0.25,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ namespace _dali.widgets.weekview
|
||||||
type type_entry = {
|
type type_entry = {
|
||||||
calendar_id : _dali.type.calendar_id;
|
calendar_id : _dali.type.calendar_id;
|
||||||
calendar_name : string;
|
calendar_name : string;
|
||||||
|
hue : float;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
event_id : (null | _dali.type.local_resource_event_id);
|
event_id : (null | _dali.type.local_resource_event_id);
|
||||||
event_object : _dali.type.event_object;
|
event_object : _dali.type.event_object;
|
||||||
|
|
@ -223,6 +224,7 @@ namespace _dali.widgets.weekview
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
|
hue : float;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
rows : Array<
|
rows : Array<
|
||||||
|
|
@ -280,6 +282,7 @@ namespace _dali.widgets.weekview
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
|
hue : float;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
rows : Array<
|
rows : Array<
|
||||||
|
|
@ -314,6 +317,7 @@ namespace _dali.widgets.weekview
|
||||||
"value": {
|
"value": {
|
||||||
"name": entry.calendar_name,
|
"name": entry.calendar_name,
|
||||||
"access_level": entry.access_level,
|
"access_level": entry.access_level,
|
||||||
|
"hue": entry.hue,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -508,6 +512,7 @@ namespace _dali.widgets.weekview
|
||||||
{
|
{
|
||||||
name : string;
|
name : string;
|
||||||
access_level : _dali.type.enum_access_level;
|
access_level : _dali.type.enum_access_level;
|
||||||
|
hue : float;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
rows : Array<
|
rows : Array<
|
||||||
|
|
@ -555,9 +560,9 @@ namespace _dali.widgets.weekview
|
||||||
"value": {
|
"value": {
|
||||||
"name": pair.value.name,
|
"name": pair.value.name,
|
||||||
"access_level": pair.value.access_level,
|
"access_level": pair.value.access_level,
|
||||||
"color": lib_plankton.color.give_generic(
|
"color": lib_plankton.color.make_hsv(
|
||||||
(pair.key - 1),
|
|
||||||
{
|
{
|
||||||
|
"hue": pair.value.hue,
|
||||||
"saturation": 0.375,
|
"saturation": 0.375,
|
||||||
"value": 0.375,
|
"value": 0.375,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ modules="${modules} storage"
|
||||||
modules="${modules} file"
|
modules="${modules} file"
|
||||||
modules="${modules} json"
|
modules="${modules} json"
|
||||||
modules="${modules} string"
|
modules="${modules} string"
|
||||||
|
modules="${modules} random"
|
||||||
modules="${modules} map"
|
modules="${modules} map"
|
||||||
modules="${modules} color"
|
modules="${modules} color"
|
||||||
# modules="${modules} xml"
|
# modules="${modules} xml"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue