[task-419] [int]
This commit is contained in:
parent
0c7dbbaa57
commit
57ce184761
|
|
@ -7,7 +7,7 @@
|
||||||
"path": ""
|
"path": ""
|
||||||
},
|
},
|
||||||
"misc": {
|
"misc": {
|
||||||
"oidc_redirect_uri_template": "http://localhost:8888/#oidc_finish,session_key={{session_key}}",
|
"oidc_redirect_uri_template": "http://localhost:8888/?action=oidc_finish&session_key={{session_key}}",
|
||||||
"use_central_europe_specific_datetime_inputs": true
|
"use_central_europe_specific_datetime_inputs": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,19 @@ 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();
|
||||||
await _dali.notify_login(status.name);
|
if (! status.logged_in)
|
||||||
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
"common.monthname.november": "Nov",
|
"common.monthname.november": "Nov",
|
||||||
"common.monthname.december": "Dez",
|
"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",
|
||||||
|
|
@ -78,27 +79,20 @@
|
||||||
"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}}",
|
||||||
"page.caldav.title": "CalDAV",
|
"widget.caldav.title": "CalDAV",
|
||||||
"page.caldav.unavailable": "CalDAV nicht verfügbar",
|
"widget.caldav.unavailable": "CalDAV nicht verfügbar",
|
||||||
"page.caldav.conf.title": "Zugangsdaten",
|
"widget.caldav.conf.title": "Zugangsdaten",
|
||||||
"page.caldav.conf.address": "Adresse (URL)",
|
"widget.caldav.conf.address": "Adresse (URL)",
|
||||||
"page.caldav.conf.username": "Nutzername",
|
"widget.caldav.conf.username": "Nutzername",
|
||||||
"page.caldav.conf.password": "Kennwort",
|
"widget.caldav.conf.password": "Kennwort",
|
||||||
"page.caldav.conf.setup_hints": "Einrichtungs-Hinweise",
|
"widget.caldav.conf.setup_hints": "Einrichtungs-Hinweise",
|
||||||
"page.caldav.conf.token_unset": "es muss zunächst ein Token gesetzt werden",
|
"widget.caldav.conf.token_unset": "es muss zunächst ein Token gesetzt werden",
|
||||||
"page.caldav.set_token.title": "Token setzen",
|
"widget.caldav.set_token.title": "Token setzen",
|
||||||
"page.caldav.set_token.action.set": "setzen",
|
"widget.caldav.set_token.action.set": "setzen",
|
||||||
"page.caldav.set_token.action.overwrite": "überschreiben",
|
"widget.caldav.set_token.action.overwrite": "überschreiben",
|
||||||
"page.calendar_add.title": "Kalendar anlegen",
|
"widget.overview.title": "Übersicht",
|
||||||
"page.calendar_add.actions.do": "anlegen",
|
"widget.overview.login_hint": "anmelden um nicht-öffentliche Termine zu sehen",
|
||||||
"page.calendar_edit.title.regular": "Kalendar bearbeiten",
|
"widget.overview.mode.week": "Wochen-Ansicht",
|
||||||
"page.calendar_edit.title.read_only": "Kalendar-Details",
|
"widget.overview.mode.list": "Listen-Ansicht"
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@
|
||||||
"common.monthname.november": "nov",
|
"common.monthname.november": "nov",
|
||||||
"common.monthname.december": "dec",
|
"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",
|
||||||
|
|
@ -78,27 +79,20 @@
|
||||||
"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}}",
|
||||||
"page.caldav.title": "CalDAV",
|
"widget.caldav.title": "CalDAV",
|
||||||
"page.caldav.unavailable": "CalDAV not available",
|
"widget.caldav.unavailable": "CalDAV not available",
|
||||||
"page.caldav.conf.title": "credentials",
|
"widget.caldav.conf.title": "credentials",
|
||||||
"page.caldav.conf.address": "address (URL)",
|
"widget.caldav.conf.address": "address (URL)",
|
||||||
"page.caldav.conf.username": "username",
|
"widget.caldav.conf.username": "username",
|
||||||
"page.caldav.conf.password": "password",
|
"widget.caldav.conf.password": "password",
|
||||||
"page.caldav.conf.setup_hints": "setup hints",
|
"widget.caldav.conf.setup_hints": "setup hints",
|
||||||
"page.caldav.conf.token_unset": "a token has to be set",
|
"widget.caldav.conf.token_unset": "a token has to be set",
|
||||||
"page.caldav.set_token.title": "set token",
|
"widget.caldav.set_token.title": "set token",
|
||||||
"page.caldav.set_token.action.set": "set",
|
"widget.caldav.set_token.action.set": "set",
|
||||||
"page.caldav.set_token.action.overwrite": "overwrite",
|
"widget.caldav.set_token.action.overwrite": "overwrite",
|
||||||
"page.calendar_add.title": "Add calendar",
|
"widget.overview.title": "Overview",
|
||||||
"page.calendar_add.actions.do": "anlegen",
|
"widget.overview.login_hint": "log in to view non-public events",
|
||||||
"page.event_add.title": "Add event",
|
"widget.overview.mode.week": "week view",
|
||||||
"page.calendar_edit.title.regular": "Edit calendar",
|
"widget.overview.mode.list": "list view"
|
||||||
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -350,4 +350,23 @@ namespace _dali.helpers
|
||||||
return lib_plankton.translate.get(keys[month-1]);
|
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});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
134
source/main.ts
134
source/main.ts
|
|
@ -23,24 +23,6 @@ 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"]
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export async function main(
|
export async function main(
|
||||||
|
|
@ -52,7 +34,7 @@ namespace _dali
|
||||||
"conf.json"
|
"conf.json"
|
||||||
);
|
);
|
||||||
|
|
||||||
// init
|
// init:logger
|
||||||
lib_plankton.log.set_main_logger(
|
lib_plankton.log.set_main_logger(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
|
@ -68,6 +50,11 @@ namespace _dali
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
// init:overlay
|
||||||
|
{
|
||||||
|
await _dali.overlay.initialize();
|
||||||
|
_dali.helpers.loading(true);
|
||||||
|
}
|
||||||
// init:localization
|
// init:localization
|
||||||
{
|
{
|
||||||
const order : Array<string> = ["deu", "eng"];
|
const order : Array<string> = ["deu", "eng"];
|
||||||
|
|
@ -76,10 +63,11 @@ namespace _dali
|
||||||
"verbosity": 1,
|
"verbosity": 1,
|
||||||
"packages": await Promise.all(
|
"packages": await Promise.all(
|
||||||
order.map(
|
order.map(
|
||||||
async (code) => JSON.parse(
|
code => (
|
||||||
await lib_plankton.file.read(
|
Promise.resolve(code)
|
||||||
"data/localization/" + code + ".loc.json"
|
.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)))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
@ -88,11 +76,14 @@ namespace _dali
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
// 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"),
|
||||||
{
|
{
|
||||||
|
|
@ -100,69 +91,55 @@ namespace _dali
|
||||||
"name": "overview",
|
"name": "overview",
|
||||||
"parameters": {}
|
"parameters": {}
|
||||||
},
|
},
|
||||||
/*
|
|
||||||
"nav_entries": [
|
|
||||||
],
|
|
||||||
*/
|
|
||||||
"nav_initial_groups": [],
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
// menu widget
|
// init:menu
|
||||||
{
|
{
|
||||||
const widget_menu : _dali.widgets.menu.class_widget_menu = new _dali.widgets.menu.class_widget_menu(
|
const widget_menu : _dali.widgets.class_widget_menu = new _dali.widgets.class_widget_menu(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("common.login"),
|
"label": lib_plankton.translate.get("common.login"),
|
||||||
"groups": ["logged_out"],
|
"groups": ["logged_out"],
|
||||||
"action": () => {
|
"action": async () => {
|
||||||
const widget_login = new _dali.widgets.login.class_widget_login(
|
_dali.helpers.loading(true);
|
||||||
|
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.overlay.toggle({"mode": false});
|
_dali.helpers.loading(false);
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
_dali.overlay.clear();
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
|
// _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("page.overview.title"),
|
"label": lib_plankton.translate.get("widget.caldav.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": () => {
|
"action": async () => {
|
||||||
lib_plankton.zoo_page.set(
|
_dali.helpers.loading(true);
|
||||||
{
|
const widget : lib_plankton.zoo_widget.interface_widget = new _dali.widgets.class_widget_caldav();
|
||||||
"name": "caldav",
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
"parameters": {}
|
// _dali.helpers.loading(false);
|
||||||
}
|
_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": () => {
|
"action": async () => {
|
||||||
_dali.logout();
|
_dali.helpers.loading(true);
|
||||||
|
await _dali.logout();
|
||||||
|
_dali.helpers.loading(false);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
@ -181,9 +158,36 @@ namespace _dali
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
await _dali.overlay.initialize();
|
|
||||||
|
|
||||||
// check if logged_in
|
// process actions
|
||||||
|
{
|
||||||
|
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(
|
||||||
|
|
@ -200,7 +204,15 @@ namespace _dali
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lib_plankton.zoo_page.start();
|
// load overview
|
||||||
|
{
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ namespace _dali.overlay
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
function get_container_element(
|
function get_container_element(
|
||||||
) : HTMLElement
|
)
|
||||||
|
: HTMLElement
|
||||||
{
|
{
|
||||||
return document.querySelector("#overlay");
|
return document.querySelector("#overlay");
|
||||||
}
|
}
|
||||||
|
|
@ -33,7 +34,8 @@ 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");
|
||||||
}
|
}
|
||||||
|
|
@ -42,7 +44,8 @@ namespace _dali.overlay
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function clear(
|
export function clear(
|
||||||
) : void
|
)
|
||||||
|
: void
|
||||||
{
|
{
|
||||||
get_content_element().innerHTML = "";
|
get_content_element().innerHTML = "";
|
||||||
}
|
}
|
||||||
|
|
@ -61,7 +64,8 @@ namespace _dali.overlay
|
||||||
=
|
=
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
) : void
|
)
|
||||||
|
: void
|
||||||
{
|
{
|
||||||
get_container_element().classList.toggle("overlay_active", mode ?? undefined);
|
get_container_element().classList.toggle("overlay_active", mode ?? undefined);
|
||||||
}
|
}
|
||||||
|
|
@ -70,7 +74,8 @@ 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();
|
||||||
|
|
|
||||||
|
|
@ -1,18 +0,0 @@
|
||||||
<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>
|
|
||||||
|
|
@ -1,4 +0,0 @@
|
||||||
<div id="caldav-conf-info">
|
|
||||||
({{text}})
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
<div id="caldav">
|
|
||||||
<h2>{{label}}</h2>
|
|
||||||
<div id="caldav-content">
|
|
||||||
{{content}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<div id="caldav-info">
|
|
||||||
{{text}}
|
|
||||||
</div>
|
|
||||||
|
|
@ -1,41 +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.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);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +0,0 @@
|
||||||
<div id="overview">
|
|
||||||
<div id="overview-head">
|
|
||||||
<div id="overview-hint">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="overview-body">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
@ -18,65 +18,80 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.pages
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
lib_plankton.zoo_page.register(
|
export class class_widget_caldav
|
||||||
"caldav",
|
{
|
||||||
async (parameters, target_element) => {
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public constructor(
|
||||||
|
)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
public async load(
|
||||||
|
target_element : HTMLElement
|
||||||
|
)
|
||||||
|
: Promise<void>
|
||||||
|
{
|
||||||
target_element.innerHTML = "";
|
target_element.innerHTML = "";
|
||||||
const conf = await _dali.backend.user_dav_conf();
|
const conf = await _dali.backend.user_dav_conf();
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
"caldav",
|
"widget-caldav",
|
||||||
"main",
|
"main",
|
||||||
{
|
{
|
||||||
"label": lib_plankton.translate.get("page.caldav.title"),
|
"title": lib_plankton.translate.get("widget.caldav.title"),
|
||||||
"content": (
|
"content": (
|
||||||
(conf === null)
|
(conf === null)
|
||||||
?
|
?
|
||||||
await _dali.helpers.template_coin(
|
await _dali.helpers.template_coin(
|
||||||
"caldav",
|
"widget-caldav",
|
||||||
"unavailable",
|
"unavailable",
|
||||||
{
|
{
|
||||||
"text": lib_plankton.translate.get("page.caldav.unavailable"),
|
"text": lib_plankton.translate.get("widget.caldav.unavailable"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
await _dali.helpers.template_coin(
|
await _dali.helpers.template_coin(
|
||||||
"caldav",
|
"widget-caldav",
|
||||||
"available",
|
"available",
|
||||||
{
|
{
|
||||||
"conf_title": lib_plankton.translate.get("page.caldav.conf.title"),
|
"conf_title": lib_plankton.translate.get("widget.caldav.conf.title"),
|
||||||
"conf_content": (
|
"conf_content": (
|
||||||
(conf.password === null)
|
(conf.password === null)
|
||||||
?
|
?
|
||||||
await _dali.helpers.template_coin(
|
await _dali.helpers.template_coin(
|
||||||
"caldav",
|
"widget-caldav",
|
||||||
"conf-token_unset",
|
"conf-token_unset",
|
||||||
{
|
{
|
||||||
"text": lib_plankton.translate.get("page.caldav.conf.token_unset")
|
"text": lib_plankton.translate.get("widget.caldav.conf.token_unset")
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
await _dali.helpers.template_coin(
|
await _dali.helpers.template_coin(
|
||||||
"caldav",
|
"widget-caldav",
|
||||||
"conf-token_set",
|
"conf-token_set",
|
||||||
{
|
{
|
||||||
"address_label": lib_plankton.translate.get("page.caldav.conf.address"),
|
"address_label": lib_plankton.translate.get("widget.caldav.conf.address"),
|
||||||
"address_value": conf.address,
|
"address_value": conf.address,
|
||||||
"username_label": lib_plankton.translate.get("page.caldav.conf.username"),
|
"username_label": lib_plankton.translate.get("widget.caldav.conf.username"),
|
||||||
"username_value": conf.username,
|
"username_value": conf.username,
|
||||||
"password_label": lib_plankton.translate.get("page.caldav.conf.password"),
|
"password_label": lib_plankton.translate.get("widget.caldav.conf.password"),
|
||||||
"password_value": conf.password,
|
"password_value": conf.password,
|
||||||
"setup_hints_label": lib_plankton.translate.get("page.caldav.conf.setup_hints"),
|
"setup_hints_label": lib_plankton.translate.get("widget.caldav.conf.setup_hints"),
|
||||||
"setup_hint_entries": (
|
"setup_hint_entries": (
|
||||||
await lib_plankton.call.promise_condense<string, unknown>(
|
await lib_plankton.call.promise_condense<string, unknown>(
|
||||||
conf.setup_hints
|
conf.setup_hints
|
||||||
.map(
|
.map(
|
||||||
entry => () => _dali.helpers.template_coin(
|
entry => () => _dali.helpers.template_coin(
|
||||||
"caldav",
|
"widget-caldav",
|
||||||
"conf-setup_hint_entry",
|
"conf-setup_hint_entry",
|
||||||
{
|
{
|
||||||
"text": entry.label,
|
"text": entry.label,
|
||||||
|
|
@ -101,31 +116,45 @@ namespace _dali.pages
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
"set_token_title": lib_plankton.translate.get("page.caldav.set_token.title"),
|
"set_token_title": lib_plankton.translate.get("widget.caldav.set_token.title"),
|
||||||
"set_token_action": (
|
"set_token_action": (
|
||||||
(conf.password === null)
|
(conf.password === null)
|
||||||
?
|
?
|
||||||
lib_plankton.translate.get("page.caldav.set_token.action.set")
|
lib_plankton.translate.get("widget.caldav.set_token.action.set")
|
||||||
:
|
:
|
||||||
lib_plankton.translate.get("page.caldav.set_token.action.overwrite")
|
lib_plankton.translate.get("widget.caldav.set_token.action.overwrite")
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
),
|
||||||
|
"close": lib_plankton.translate.get("common.close"),
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
// logic
|
||||||
/**
|
|
||||||
* logic: set token
|
|
||||||
*/
|
|
||||||
{
|
{
|
||||||
if (conf !== null)
|
// set token
|
||||||
{
|
{
|
||||||
document.querySelector("#caldav-set_token > button").addEventListener(
|
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",
|
"click",
|
||||||
async () => {
|
() => {
|
||||||
await _dali.backend.user_dav_token();
|
_dali.overlay.toggle({"mode": false});
|
||||||
lib_plankton.zoo_page.reload();
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -133,7 +162,8 @@ namespace _dali.pages
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
.caldav-conf-section
|
.widget-caldav-conf-section
|
||||||
{
|
{
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.caldav-conf-section-label
|
.widget-caldav-conf-section-label
|
||||||
{
|
{
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
@ -11,12 +11,12 @@
|
||||||
text-transform: capitalize;
|
text-transform: capitalize;
|
||||||
}
|
}
|
||||||
|
|
||||||
.caldav-conf-section-value
|
.widget-caldav-conf-section-value
|
||||||
{
|
{
|
||||||
margin-left: 32px;
|
margin-left: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.caldav-conf-section-value-regular
|
.widget-caldav-conf-section-value-regular
|
||||||
{
|
{
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
}
|
}
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<div id="caldav-conf">
|
<div class="widget-caldav-conf">
|
||||||
<h3>{{conf_title}}</h3>
|
<h3>{{conf_title}}</h3>
|
||||||
{{conf_content}}
|
{{conf_content}}
|
||||||
</div>
|
</div>
|
||||||
<div id="caldav-set_token">
|
<div class="widget-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="caldav-conf-setup_hints-entry">
|
<li class="widget-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/widgets/caldav/templates/conf-token_set.html.tpl
Normal file
18
source/widgets/caldav/templates/conf-token_set.html.tpl
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<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>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<div class="widget-caldav-conf-info">
|
||||||
|
({{text}})
|
||||||
|
</div>
|
||||||
|
|
||||||
8
source/widgets/caldav/templates/main.html.tpl
Normal file
8
source/widgets/caldav/templates/main.html.tpl
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<div class="widget-caldav">
|
||||||
|
<h2>{{title}}</h2>
|
||||||
|
<div class="widget-caldav-content">
|
||||||
|
{{content}}
|
||||||
|
</div>
|
||||||
|
<hr/>
|
||||||
|
<button class="widget-caldav-close">{{close}}</button>
|
||||||
|
</div>
|
||||||
3
source/widgets/caldav/templates/unavailable.html.tpl
Normal file
3
source/widgets/caldav/templates/unavailable.html.tpl
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<div class="widget-caldav-info">
|
||||||
|
{{text}}
|
||||||
|
</div>
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.calendar_edit
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.event_edit
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.listview
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.login
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -73,7 +73,7 @@ namespace _dali.widgets.login
|
||||||
* [implementation]
|
* [implementation]
|
||||||
*/
|
*/
|
||||||
public async load(
|
public async load(
|
||||||
target_element : Element
|
target_element : HTMLElement
|
||||||
)
|
)
|
||||||
: Promise<void>
|
: Promise<void>
|
||||||
{
|
{
|
||||||
|
|
@ -86,125 +86,36 @@ namespace _dali.widgets.login
|
||||||
{
|
{
|
||||||
case "internal":
|
case "internal":
|
||||||
{
|
{
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
const sub_widget : lib_plankton.zoo_widget.interface_widget = (
|
||||||
"widget-login",
|
new class_widget_login_internal(
|
||||||
"default",
|
preparation.data,
|
||||||
{
|
{
|
||||||
}
|
"initial_name": this.initial_name,
|
||||||
);
|
"action_cancel": this.action_cancel,
|
||||||
const form : lib_plankton.zoo_form.class_form<
|
"action_success": this.action_success,
|
||||||
{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 form.setup(document.querySelector(".widget-login"));
|
await sub_widget.load(target_element);
|
||||||
await form.input_write(
|
|
||||||
{
|
|
||||||
"name": this.initial_name,
|
|
||||||
"password": "",
|
|
||||||
}
|
|
||||||
);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "oidc":
|
case "oidc":
|
||||||
{
|
{
|
||||||
// link
|
const sub_widget : lib_plankton.zoo_widget.interface_widget = (
|
||||||
{
|
new class_widget_login_oidc(
|
||||||
let element_a : HTMLElement = document.createElement("a");;
|
preparation.data,
|
||||||
element_a.textContent = lib_plankton.string.coin(
|
|
||||||
lib_plankton.translate.get("widget.login.oidc.via"),
|
|
||||||
{
|
{
|
||||||
"title": preparation.data.label,
|
"action_cancel": this.action_cancel,
|
||||||
|
"action_success": this.action_success,
|
||||||
}
|
}
|
||||||
);
|
)
|
||||||
element_a.setAttribute("href", preparation.data.url);
|
);
|
||||||
target_element.appendChild(element_a);
|
await sub_widget.load(target_element);
|
||||||
}
|
|
||||||
{
|
|
||||||
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:
|
||||||
{
|
{
|
||||||
// todo
|
throw (new Error("unhandled login kind: " + preparation.kind));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
<div class="widget-login">
|
|
||||||
</div>
|
|
||||||
164
source/widgets/login_internal/logic.ts
Normal file
164
source/widgets/login_internal/logic.ts
Normal file
|
|
@ -0,0 +1,164 @@
|
||||||
|
/*
|
||||||
|
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": "",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
110
source/widgets/login_oidc/logic.ts
Normal file
110
source/widgets/login_oidc/logic.ts
Normal file
|
|
@ -0,0 +1,110 @@
|
||||||
|
/*
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
5
source/widgets/login_oidc/style.css
Normal file
5
source/widgets/login_oidc/style.css
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
.widget-login_oidc-cancel
|
||||||
|
{
|
||||||
|
display: block;
|
||||||
|
margin-top: 32px;
|
||||||
|
}
|
||||||
4
source/widgets/login_oidc/templates/main.html.tpl
Normal file
4
source/widgets/login_oidc/templates/main.html.tpl
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<div class="widget-login_oidc">
|
||||||
|
<a class="widget-login_oidc-link" href="{{href}}">{{label}}</a>
|
||||||
|
<button class="widget-login_oidc-cancel">{{cancel}}</button>
|
||||||
|
</div>
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.menu
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.mode_switcher
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.multiview
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -96,17 +96,17 @@ namespace _dali.widgets.multiview
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private widget_mode_switcher : _dali.widgets.mode_switcher.class_widget_mode_switcher;
|
private widget_mode_switcher : _dali.widgets.class_widget_mode_switcher;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private widget_weekview : _dali.widgets.weekview.class_widget_weekview;
|
private widget_weekview : _dali.widgets.class_widget_weekview;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
private widget_listview : _dali.widgets.listview.class_widget_listview;
|
private widget_listview : _dali.widgets.class_widget_listview;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -205,15 +205,21 @@ namespace _dali.widgets.multiview
|
||||||
// mode switcher
|
// mode switcher
|
||||||
{
|
{
|
||||||
this.widget_mode_switcher = (
|
this.widget_mode_switcher = (
|
||||||
new _dali.widgets.mode_switcher.class_widget_mode_switcher(
|
new _dali.widgets.class_widget_mode_switcher(
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"mode": _dali.enum_view_mode.week,
|
"mode": _dali.enum_view_mode.week,
|
||||||
"label": lib_plankton.translate.get("page.overview.mode.week"),
|
/**
|
||||||
|
* @todo as dependency
|
||||||
|
*/
|
||||||
|
"label": lib_plankton.translate.get("widget.overview.mode.week"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mode": _dali.enum_view_mode.list,
|
"mode": _dali.enum_view_mode.list,
|
||||||
"label": lib_plankton.translate.get("page.overview.mode.list"),
|
/**
|
||||||
|
* @todo as dependency
|
||||||
|
*/
|
||||||
|
"label": lib_plankton.translate.get("widget.overview.mode.list"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
|
|
@ -232,7 +238,7 @@ namespace _dali.widgets.multiview
|
||||||
// weekview
|
// weekview
|
||||||
{
|
{
|
||||||
this.widget_weekview = (
|
this.widget_weekview = (
|
||||||
new _dali.widgets.weekview.class_widget_weekview(
|
new _dali.widgets.class_widget_weekview(
|
||||||
this.get_entries,
|
this.get_entries,
|
||||||
{
|
{
|
||||||
"action_select_event": (event_key) => this.action_edit_event(event_key),
|
"action_select_event": (event_key) => this.action_edit_event(event_key),
|
||||||
|
|
@ -249,7 +255,7 @@ namespace _dali.widgets.multiview
|
||||||
// listview
|
// listview
|
||||||
{
|
{
|
||||||
this.widget_listview = (
|
this.widget_listview = (
|
||||||
new _dali.widgets.listview.class_widget_listview(
|
new _dali.widgets.class_widget_listview(
|
||||||
this.get_entries,
|
this.get_entries,
|
||||||
{
|
{
|
||||||
"action_select": (event_key) => this.action_edit_event(event_key),
|
"action_select": (event_key) => this.action_edit_event(event_key),
|
||||||
|
|
|
||||||
|
|
@ -18,120 +18,98 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.pages.overview
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
lib_plankton.zoo_page.register(
|
type type_action_create_calendar = (
|
||||||
"overview",
|
(
|
||||||
async (parameters, target_element) => {
|
)
|
||||||
// params
|
=>
|
||||||
const view_mode : _dali.enum_view_mode = _dali.helpers.view_mode_determine(parameters["mode"] ?? "auto");
|
Promise<void>
|
||||||
const view_kind : _dali.enum_view_kind = _dali.helpers.view_kind_determine(parameters["kind"] ?? "auto");
|
);
|
||||||
|
|
||||||
// exec
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
async function get_available_calendars(
|
type type_action_edit_calendar = (
|
||||||
)
|
(
|
||||||
: Promise<
|
type_calendar_object_reduced_with_id
|
||||||
Array<
|
)
|
||||||
_dali.type_calendar_object_reduced_with_id
|
=>
|
||||||
>
|
Promise<void>
|
||||||
>
|
);
|
||||||
{
|
|
||||||
return (
|
|
||||||
(await _dali.model.calendar_list())
|
/**
|
||||||
/*
|
*/
|
||||||
.filter(
|
type type_action_create_event = (
|
||||||
(entry) => (
|
(
|
||||||
(entry.access_level === _dali.enum_access_level.edit)
|
stuff ?: {
|
||||||
||
|
date ?: lib_plankton.pit.type_date;
|
||||||
(entry.access_level === _dali.enum_access_level.admin)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
)
|
||||||
/**
|
=>
|
||||||
* @todo add return type
|
Promise<void>
|
||||||
*/
|
);
|
||||||
async function get_entries(
|
|
||||||
from_pit : lib_plankton.pit.type_pit,
|
|
||||||
to_pit : lib_plankton.pit.type_pit,
|
/**
|
||||||
calendar_ids : Array<_dali.type_calendar_id>
|
*/
|
||||||
)
|
type type_action_edit_event = (
|
||||||
: Promise<Array<_dali.type_event_object_extended>>
|
(
|
||||||
{
|
event_key : _dali.type_event_key
|
||||||
/**
|
)
|
||||||
* @todo do NOT wait?
|
=>
|
||||||
*/
|
Promise<void>
|
||||||
await _dali.model.sync_events(
|
);
|
||||||
{
|
|
||||||
"from": from_pit,
|
|
||||||
"to": to_pit,
|
/**
|
||||||
},
|
*/
|
||||||
{
|
export class class_widget_overview
|
||||||
"calendar_ids": calendar_ids,
|
implements lib_plankton.zoo_widget.interface_widget
|
||||||
}
|
{
|
||||||
);
|
|
||||||
/**
|
/**
|
||||||
* @todo filter
|
*/
|
||||||
*/
|
private widget_sources : _dali.widgets.class_widget_sources;
|
||||||
return _dali.model.event_list();
|
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
*/
|
||||||
* @todo update listview
|
private widget_multiview : _dali.widgets.class_widget_multiview;
|
||||||
*/
|
|
||||||
async function update_sources_and_entries(
|
|
||||||
{
|
/**
|
||||||
"priviliged": priviliged = null,
|
*/
|
||||||
}
|
private action_create_calendar : type_action_create_calendar;
|
||||||
:
|
|
||||||
{
|
|
||||||
priviliged ?: (null | boolean);
|
/**
|
||||||
}
|
*/
|
||||||
=
|
private action_edit_calendar : type_action_edit_calendar;
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
/**
|
||||||
: Promise<void>
|
*/
|
||||||
{
|
private action_create_event : type_action_create_event;
|
||||||
await widget_sources.update({"priviliged": priviliged});
|
|
||||||
await widget_multiview.update_entries();
|
|
||||||
}
|
/**
|
||||||
|
*/
|
||||||
/**
|
private action_edit_event : type_action_edit_event;
|
||||||
* @todo use priviliged?
|
|
||||||
* @todo update listview
|
|
||||||
*/
|
/**
|
||||||
async function update_entries(
|
*/
|
||||||
{
|
public constructor(
|
||||||
"priviliged": priviliged = null,
|
)
|
||||||
}
|
{
|
||||||
:
|
this.action_create_calendar = async (
|
||||||
{
|
) => {
|
||||||
priviliged ?: (null | boolean);
|
const widget = new _dali.widgets.class_widget_calendar_edit(
|
||||||
}
|
|
||||||
=
|
|
||||||
{
|
|
||||||
}
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
await widget_multiview.update_entries();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
async function action_create_calendar(
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
|
|
||||||
await _dali.model.group_list(),
|
await _dali.model.group_list(),
|
||||||
await _dali.model.user_list(),
|
await _dali.model.user_list(),
|
||||||
{
|
{
|
||||||
|
|
@ -179,7 +157,7 @@ namespace _dali.pages.overview
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
update_sources_and_entries();
|
this.update_sources_and_entries();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -197,15 +175,10 @@ namespace _dali.pages.overview
|
||||||
_dali.overlay.clear();
|
_dali.overlay.clear();
|
||||||
_dali.overlay.toggle({"mode": true});
|
_dali.overlay.toggle({"mode": true});
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
}
|
};
|
||||||
|
this.action_edit_calendar = async (
|
||||||
/**
|
calendar_object_reduced_with_id
|
||||||
*/
|
) => {
|
||||||
async function action_edit_calendar(
|
|
||||||
calendar_object_reduced_with_id : type_calendar_object_reduced_with_id
|
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
const read_only : boolean = (() => {
|
const read_only : boolean = (() => {
|
||||||
switch (calendar_object_reduced_with_id.access_level)
|
switch (calendar_object_reduced_with_id.access_level)
|
||||||
{
|
{
|
||||||
|
|
@ -242,7 +215,7 @@ namespace _dali.pages.overview
|
||||||
const calendar_object : _dali.type_calendar_object = await _dali.model.calendar_get(
|
const calendar_object : _dali.type_calendar_object = await _dali.model.calendar_get(
|
||||||
calendar_id
|
calendar_id
|
||||||
);
|
);
|
||||||
const widget = new _dali.widgets.calendar_edit.class_widget_calendar_edit(
|
const widget = new _dali.widgets.class_widget_calendar_edit(
|
||||||
await _dali.model.group_list(),
|
await _dali.model.group_list(),
|
||||||
await _dali.model.user_list(),
|
await _dali.model.user_list(),
|
||||||
calendar_object,
|
calendar_object,
|
||||||
|
|
@ -258,7 +231,7 @@ namespace _dali.pages.overview
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
update_sources_and_entries();
|
this.update_sources_and_entries();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -269,7 +242,7 @@ namespace _dali.pages.overview
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
update_sources_and_entries();
|
this.update_sources_and_entries();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
@ -281,11 +254,10 @@ namespace _dali.pages.overview
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo unterschiedliches Verhalten bei Anmeldung?
|
* @todo unterschiedliches Verhalten bei Anmeldung?
|
||||||
*/
|
*/
|
||||||
async function action_create_event(
|
this.action_create_event = async (
|
||||||
{
|
{
|
||||||
"date": date = lib_plankton.pit.to_datetime(lib_plankton.pit.now()).date,
|
"date": date = lib_plankton.pit.to_datetime(lib_plankton.pit.now()).date,
|
||||||
}
|
}
|
||||||
|
|
@ -296,17 +268,15 @@ namespace _dali.pages.overview
|
||||||
=
|
=
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
)
|
) => {
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
if (! _dali.is_logged_in())
|
if (! _dali.is_logged_in())
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const widget = new _dali.widgets.event_edit.class_widget_event_edit(
|
const widget = new _dali.widgets.class_widget_event_edit(
|
||||||
(await get_available_calendars()),
|
(await this.get_available_calendars()),
|
||||||
{
|
{
|
||||||
"calendar_id": null,
|
"calendar_id": null,
|
||||||
"event_name": "",
|
"event_name": "",
|
||||||
|
|
@ -359,7 +329,7 @@ namespace _dali.pages.overview
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
update_entries();
|
this.update_entries();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -376,15 +346,11 @@ namespace _dali.pages.overview
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
await widget.load(_dali.overlay.get_content_element());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
async function action_edit_event
|
this.action_edit_event = async (
|
||||||
(
|
event_key
|
||||||
event_key : _dali.type_event_key
|
) => {
|
||||||
)
|
|
||||||
: Promise<void>
|
|
||||||
{
|
|
||||||
const event_object_extended : _dali.type_event_object_extended = await _dali.model.event_get(event_key);
|
const event_object_extended : _dali.type_event_object_extended = await _dali.model.event_get(event_key);
|
||||||
const read_only : boolean = (() => {
|
const read_only : boolean = (() => {
|
||||||
switch (event_object_extended.access_level)
|
switch (event_object_extended.access_level)
|
||||||
|
|
@ -407,8 +373,8 @@ namespace _dali.pages.overview
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}) ();
|
}) ();
|
||||||
const widget = new _dali.widgets.event_edit.class_widget_event_edit(
|
const widget = new _dali.widgets.class_widget_event_edit(
|
||||||
(await get_available_calendars()),
|
(await this.get_available_calendars()),
|
||||||
{
|
{
|
||||||
"calendar_id": event_object_extended.calendar_id,
|
"calendar_id": event_object_extended.calendar_id,
|
||||||
"event_name": event_object_extended.event_object.name,
|
"event_name": event_object_extended.event_object.name,
|
||||||
|
|
@ -437,7 +403,7 @@ namespace _dali.pages.overview
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
update_entries();
|
this.update_entries();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -456,7 +422,7 @@ namespace _dali.pages.overview
|
||||||
)
|
)
|
||||||
.then(
|
.then(
|
||||||
() => {
|
() => {
|
||||||
update_entries();
|
this.update_entries();
|
||||||
_dali.overlay.toggle({"mode": false});
|
_dali.overlay.toggle({"mode": false});
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -471,98 +437,212 @@ namespace _dali.pages.overview
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
_dali.overlay.clear();
|
_dali.overlay.clear();
|
||||||
_dali.overlay.toggle({"mode": true});
|
_dali.overlay.toggle({"mode": true});
|
||||||
await widget.load(_dali.overlay.get_content_element());
|
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");
|
||||||
|
|
||||||
const widget_sources : _dali.widgets.sources.class_widget_sources = (
|
this.widget_sources = (
|
||||||
new _dali.widgets.sources.class_widget_sources(
|
new _dali.widgets.class_widget_sources(
|
||||||
_dali.model.calendar_list,
|
_dali.model.calendar_list,
|
||||||
{
|
{
|
||||||
"initial_priviliged": _dali.is_logged_in(),
|
"initial_priviliged": _dali.is_logged_in(),
|
||||||
"action_add": action_create_calendar,
|
"action_add": this.action_create_calendar,
|
||||||
"action_select": (entry) => action_edit_calendar(entry),
|
"action_select": this.action_edit_calendar,
|
||||||
"action_toggle": (entry, mode) => {
|
"action_toggle": (entry, mode) => {
|
||||||
widget_multiview.toggle_calendar_visibilty(entry.id, {"mode": mode});
|
this.widget_multiview.toggle_calendar_visibilty(entry.id, {"mode": mode});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
const widget_multiview : _dali.widgets.multiview.class_widget_multiview = (
|
this.widget_multiview = (
|
||||||
new _dali.widgets.multiview.class_widget_multiview(
|
new _dali.widgets.class_widget_multiview(
|
||||||
get_entries,
|
this.get_entries,
|
||||||
{
|
{
|
||||||
"initial_view_mode": view_mode,
|
"initial_view_mode": view_mode,
|
||||||
"weekview_initial_vertical": (view_kind === _dali.enum_view_kind.touch),
|
"weekview_initial_vertical": (view_kind === _dali.enum_view_kind.touch),
|
||||||
"action_create_event": action_create_event,
|
"action_create_event": this.action_create_event,
|
||||||
"action_edit_event": action_edit_event,
|
"action_edit_event": this.action_edit_event,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
target_element.innerHTML = await _dali.helpers.template_coin(
|
target_element.innerHTML = await _dali.helpers.template_coin(
|
||||||
"overview",
|
"widget-overview",
|
||||||
"main",
|
"main",
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
switch (view_kind)
|
// head
|
||||||
{
|
{
|
||||||
case _dali.enum_view_kind.regular:
|
// hint
|
||||||
{
|
{
|
||||||
const widget_slider = new lib_plankton.zoo_widget.class_slider(
|
const dom_hint = target_element.querySelector(".widget-overview-hint");
|
||||||
[
|
dom_hint.textContent = lib_plankton.translate.get("widget.overview.login_hint");
|
||||||
new lib_plankton.zoo_widget.class_bunch(
|
dom_hint.classList.toggle("widget-overview-hint-hidden", _dali.is_logged_in());
|
||||||
[
|
|
||||||
widget_sources,
|
|
||||||
widget_multiview,
|
|
||||||
]
|
|
||||||
),
|
|
||||||
],
|
|
||||||
{
|
|
||||||
"threshold": 100,
|
|
||||||
"initial_index": 1,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await widget_slider.load(target_element.querySelector("#overview-body"));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case _dali.enum_view_kind.touch:
|
|
||||||
{
|
|
||||||
const widget_slider = new lib_plankton.zoo_widget.class_slider(
|
|
||||||
[
|
|
||||||
widget_sources,
|
|
||||||
widget_multiview,
|
|
||||||
],
|
|
||||||
{
|
|
||||||
"threshold": 100,
|
|
||||||
"initial_index": 2,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
await widget_slider.load(target_element.querySelector("#overview-body"));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// body
|
||||||
// hint
|
|
||||||
{
|
{
|
||||||
const dom_hint = target_element.querySelector("#overview-hint");
|
let widget_slider : lib_plankton.zoo_widget.interface_widget;
|
||||||
dom_hint.textContent = lib_plankton.translate.get("page.overview.login_hint");
|
switch (view_kind)
|
||||||
dom_hint.classList.toggle("overview-hint-hidden", _dali.is_logged_in());
|
{
|
||||||
|
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(
|
_dali.model.listen_reset(
|
||||||
async (priviliged) => {
|
async (priviliged) => {
|
||||||
update_sources_and_entries({"priviliged": priviliged});
|
this.update_sources_and_entries({"priviliged": priviliged});
|
||||||
target_element.querySelector("#overview-hint").classList.toggle("overview-hint-hidden", priviliged);
|
target_element.querySelector(".widget-overview-hint").classList.toggle("widget-overview-hint-hidden", priviliged);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return Promise.resolve<void>(undefined);
|
return Promise.resolve<void>(undefined);
|
||||||
},
|
}
|
||||||
);
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,57 +1,57 @@
|
||||||
#overview-head
|
.widget-overview-head
|
||||||
{
|
{
|
||||||
padding-bottom: 12px;
|
padding-bottom: 12px;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
border-bottom: 1px solid;
|
border-bottom: 1px solid;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-hint
|
.widget-overview-hint
|
||||||
{
|
{
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-hint.overview-hint-hidden
|
.widget-overview-hint.widget-overview-hint-hidden
|
||||||
{
|
{
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-body
|
.widget-overview-body
|
||||||
{
|
{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-pane-left
|
.widget-overview-pane-left
|
||||||
{
|
{
|
||||||
flex-basis: 12.5%;
|
flex-basis: 12.5%;
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-pane-right
|
.widget-overview-pane-right
|
||||||
{
|
{
|
||||||
flex-basis: 87.5%;
|
flex-basis: 87.5%;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-body .widget-slider-slide .widget-bunch
|
.widget-overview-body .widget-slider-slide .widget-bunch
|
||||||
{
|
{
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-body .widget-slider-slide .widget-bunch-element:nth-child(1)
|
.widget-overview-body .widget-slider-slide .widget-bunch-element:nth-child(1)
|
||||||
{
|
{
|
||||||
flex-grow: 0;
|
flex-grow: 0;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
flex-basis: 12.5%;
|
flex-basis: 12.5%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#overview-body .widget-slider-slide .widget-bunch-element:nth-child(2)
|
.widget-overview-body .widget-slider-slide .widget-bunch-element:nth-child(2)
|
||||||
{
|
{
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
8
source/widgets/overview/templates/main.html.tpl
Normal file
8
source/widgets/overview/templates/main.html.tpl
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
<div class="widget-overview">
|
||||||
|
<div class="widget-overview-head">
|
||||||
|
<div class="widget-overview-hint">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="widget-overview-body">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.sources
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ along with »dali«. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
namespace _dali.widgets.weekview
|
namespace _dali.widgets
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -30,21 +30,14 @@ ${dir_build}/index.html: \
|
||||||
|
|
||||||
.PHONY: templates
|
.PHONY: templates
|
||||||
templates: \
|
templates: \
|
||||||
templates-widgets-login \
|
|
||||||
templates-widgets-special_number_input \
|
templates-widgets-special_number_input \
|
||||||
|
templates-widgets-login_oidc \
|
||||||
templates-widgets-sources \
|
templates-widgets-sources \
|
||||||
|
templates-widgets-caldav \
|
||||||
templates-widgets-listview \
|
templates-widgets-listview \
|
||||||
templates-widgets-weekview \
|
templates-widgets-weekview \
|
||||||
templates-widgets-mode_switcher \
|
templates-widgets-overview \
|
||||||
templates-pages-caldav \
|
templates-widgets-mode_switcher
|
||||||
templates-pages-overview
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-login
|
|
||||||
templates-widgets-login: \
|
|
||||||
$(wildcard ${dir_source}/widgets/login/templates/*)
|
|
||||||
@ ${cmd_log} "templates:widget:login …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-login
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/widgets/login/templates/* ${dir_build}/templates/widget-login/
|
|
||||||
|
|
||||||
.PHONY: templates-widgets-special_number_input
|
.PHONY: templates-widgets-special_number_input
|
||||||
templates-widgets-special_number_input: \
|
templates-widgets-special_number_input: \
|
||||||
|
|
@ -53,6 +46,13 @@ templates-widgets-special_number_input: \
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/widget-special_number_input
|
@ ${cmd_mkdir} ${dir_build}/templates/widget-special_number_input
|
||||||
@ ${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/special_number_input/templates/* ${dir_build}/templates/widget-special_number_input/
|
||||||
|
|
||||||
|
.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-sources
|
.PHONY: templates-widgets-sources
|
||||||
templates-widgets-sources: \
|
templates-widgets-sources: \
|
||||||
$(wildcard ${dir_source}/widgets/sources/templates/*)
|
$(wildcard ${dir_source}/widgets/sources/templates/*)
|
||||||
|
|
@ -60,6 +60,13 @@ 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-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/*)
|
||||||
|
|
@ -74,6 +81,13 @@ 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/*)
|
||||||
|
|
@ -81,27 +95,12 @@ 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: templates-pages-caldav
|
|
||||||
templates-pages-caldav: \
|
|
||||||
$(wildcard ${dir_source}/pages/caldav/templates/*)
|
|
||||||
@ ${cmd_log} "templates:page: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:page:overview …"
|
|
||||||
@ ${cmd_mkdir} ${dir_build}/templates/overview
|
|
||||||
@ ${cmd_cp} -r -u -v ${dir_source}/pages/overview/templates/* ${dir_build}/templates/overview/
|
|
||||||
|
|
||||||
.PHONY: style
|
.PHONY: style
|
||||||
style: ${dir_build}/style.css
|
style: ${dir_build}/style.css
|
||||||
|
|
||||||
${dir_build}/style.css: \
|
${dir_build}/style.css: \
|
||||||
$(wildcard ${dir_source}/style/*.css) \
|
$(wildcard ${dir_source}/style/*.css) \
|
||||||
$(wildcard ${dir_source}/widgets/*/style.css) \
|
$(wildcard ${dir_source}/widgets/*/style.css)
|
||||||
$(wildcard ${dir_source}/pages/*/style.css)
|
|
||||||
@ ${cmd_log} "style …"
|
@ ${cmd_log} "style …"
|
||||||
@ ${cmd_mkdir} ${dir_build}
|
@ ${cmd_mkdir} ${dir_build}
|
||||||
@ ${cmd_cat} $^ > $@
|
@ ${cmd_cat} $^ > $@
|
||||||
|
|
@ -116,10 +115,9 @@ ${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}/helpers.ts \
|
|
||||||
${dir_source}/overlay.ts \
|
${dir_source}/overlay.ts \
|
||||||
|
${dir_source}/helpers.ts \
|
||||||
$(wildcard ${dir_source}/widgets/*/logic.ts) \
|
$(wildcard ${dir_source}/widgets/*/logic.ts) \
|
||||||
$(wildcard ${dir_source}/pages/*/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