diff --git a/source/data/localization/deu.loc.json b/source/data/localization/deu.loc.json index f5ec083..abaf730 100644 --- a/source/data/localization/deu.loc.json +++ b/source/data/localization/deu.loc.json @@ -14,6 +14,18 @@ "common.weekday.friday": "Fr", "common.weekday.saturday": "Sa", "common.weekday.sunday": "So", + "common.monthname.january": "Jan", + "common.monthname.february": "Feb", + "common.monthname.march": "Mär", + "common.monthname.april": "Apr", + "common.monthname.may": "Mai", + "common.monthname.june": "Jun", + "common.monthname.july": "Jul", + "common.monthname.august": "Aug", + "common.monthname.september": "Sep", + "common.monthname.october": "Okt", + "common.monthname.november": "Nov", + "common.monthname.december": "Dez", "common.open": "öffnen", "common.edit": "bearbeiten", "common.show": "zeigen", diff --git a/source/data/localization/eng.loc.json b/source/data/localization/eng.loc.json index 47785ec..1436b7d 100644 --- a/source/data/localization/eng.loc.json +++ b/source/data/localization/eng.loc.json @@ -14,6 +14,18 @@ "common.weekday.friday": "Fri", "common.weekday.saturday": "Sat", "common.weekday.sunday": "Sun", + "common.monthname.january": "jan", + "common.monthname.february": "feb", + "common.monthname.march": "mar", + "common.monthname.april": "apr", + "common.monthname.may": "may", + "common.monthname.june": "jun", + "common.monthname.july": "jul", + "common.monthname.august": "aug", + "common.monthname.september": "sep", + "common.monthname.october": "oct", + "common.monthname.november": "nov", + "common.monthname.december": "dec", "common.open": "open", "common.edit": "edit", "common.show": "show", diff --git a/source/helpers.ts b/source/helpers.ts index df17da7..48b1a3f 100644 --- a/source/helpers.ts +++ b/source/helpers.ts @@ -283,4 +283,29 @@ namespace _dali.helpers ); } + + /** + */ + export function month_name( + month : int + ) + : string + { + const keys : Array = [ + "common.monthname.january", + "common.monthname.february", + "common.monthname.march", + "common.monthname.april", + "common.monthname.may", + "common.monthname.june", + "common.monthname.july", + "common.monthname.august", + "common.monthname.september", + "common.monthname.october", + "common.monthname.november", + "common.monthname.december", + ]; + return lib_plankton.translate.get(keys[month-1]); + } + } diff --git a/source/main.ts b/source/main.ts index 83ef871..97cb9d8 100644 --- a/source/main.ts +++ b/source/main.ts @@ -40,21 +40,6 @@ namespace _dali } - /** - * @todo reload page when switching to "logged_out" - */ - async function update( - ) - : Promise - { - lib_plankton.log.debug( - "dali.update" - ); - const logged_in : boolean = _dali.is_logged_in(); - lib_plankton.zoo_page.nav_set_groups(nav_groups(logged_in)); - // lib_plankton.zoo_page.reload(); - } - /** */ @@ -196,16 +181,7 @@ namespace _dali } ); } - await update(); await _dali.overlay.initialize(); - /* - lib_plankton.call.loop( - () => { - update(); - }, - _dali.conf.get().misc.update_interval - ); - */ // check if logged_in { diff --git a/source/resources/conf.ts b/source/resources/conf.ts index 68968ca..915504b 100644 --- a/source/resources/conf.ts +++ b/source/resources/conf.ts @@ -73,14 +73,15 @@ namespace _dali.conf "default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}" }, "use_central_europe_specific_datetime_inputs": { - "nullable": true, + "nullable": false, "type": "boolean", "default": false }, - "update_interval": { + "weekview_cell_day_format": { "nullable": false, - "type": "integer", - "default": 60 + "type": "string", + "default": "d.b", + "description": "available placeholders: Y,m,b,d,W,w (as in UNIX command 'date')" }, }, "required": [ @@ -98,7 +99,25 @@ namespace _dali.conf /** */ - var _data : (null | any) = null; + type type_data = { + version : string; + backend : { + scheme : string; + host : string; + port : int; + path : string; + }; + misc : { + oidc_redirect_uri_template : string; + use_central_europe_specific_datetime_inputs : string; + weekview_cell_day_format : string; + }; + }; + + + /** + */ + var _data : (null | type_data) = null; /** @@ -113,7 +132,7 @@ namespace _dali.conf /** */ export function get( - ) : any + ) : type_data { if (_data === null) { @@ -131,10 +150,7 @@ namespace _dali.conf path : string ) : Promise { - _data = await lib_plankton.conf.load( - _schema, - path - ); + _data = ((await lib_plankton.conf.load(_schema, path)) as type_data); return Promise.resolve(undefined); } diff --git a/source/widgets/menu/logic.ts b/source/widgets/menu/logic.ts index 195be71..fd9d540 100644 --- a/source/widgets/menu/logic.ts +++ b/source/widgets/menu/logic.ts @@ -66,7 +66,7 @@ namespace _dali.widgets.menu entry_data_list : Array, { "initial_groups": initial_groups = [], - "initial_label": initial_label = "=", + "initial_label": initial_label = "", } : { @@ -115,10 +115,10 @@ namespace _dali.widgets.menu : void { this.label = label; - this.container.querySelector(".widget-menu-button").textContent = ( + this.container.querySelector(".widget-menu-button").innerHTML = ( (this.label === null) ? - "[=]" + ("[" + "=" + "]") : ("[" + this.label + "]") ); diff --git a/source/widgets/menu/style.css b/source/widgets/menu/style.css index ab45279..8451302 100644 --- a/source/widgets/menu/style.css +++ b/source/widgets/menu/style.css @@ -47,6 +47,24 @@ list-style-type: none; } +.widget-menu-entry +{ + margin: 12px 8px; + text-transform: capitalize; + background-color: hsl(var(--hue), 0%, 25%); + color: hsl(var(--hue), 0%, 100%); + border-bottom: 2px solid hsl(0, 0%, 25%); +} + +.widget-menu-entry:hover +{ + color: hsl(var(--hue), 0%, 100%); + border-bottom: 2px solid hsl(0, 0%, 100%); + + transition: 1s ease color; +} + +/* .widget-menu-entry { margin: 8px; @@ -58,15 +76,7 @@ background-color: hsl(var(--hue), 0%, 25%); color: hsl(var(--hue), 0%, 100%); } - -.widget-menu-entry:hover::before -{ - content: "» "; - /* - background-color: hsl(var(--hue), 0%, 50%); - color: hsl(var(--hue), 0%, 100%); - */ -} + */ .widget-menu-entry.widget-menu-entry-hidden { diff --git a/source/widgets/weekview/logic.ts b/source/widgets/weekview/logic.ts index 8ed405f..fec5824 100644 --- a/source/widgets/weekview/logic.ts +++ b/source/widgets/weekview/logic.ts @@ -121,7 +121,7 @@ namespace _dali.widgets.weekview "vertical": vertical = false, "initial_year": initial_year = null, "initial_week": initial_week = null, - "initial_count": initial_count = 4, + "initial_count": initial_count = 5, } : { @@ -386,13 +386,6 @@ namespace _dali.widgets.weekview "tableview-cell-entry", { "color": _dali.helpers.event_color(entry.hue), - /* - "title": class_widget_weekview.event_generate_tooltip( - entry.calendar_name, - entry.event_object - ), - */ - "title": "", "name": entry.event_object.name, "rel": entry.key, "additional_classes": lib_plankton.string.coin( @@ -763,6 +756,8 @@ namespace _dali.widgets.weekview today_begin_pit, today_end_pit ); + const day_as_date : lib_plankton.pit.type_date = lib_plankton.pit.to_datetime_ce(day_pit).date; + const day_as_ywd : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(day_pit); return _dali.helpers.template_coin( "widget-weekview", "tableview-cell", @@ -772,47 +767,22 @@ namespace _dali.widgets.weekview .concat(is_today ? ["weekview-cell-today"] : []) .join(" ") ), - "title": lib_plankton.call.convey( - day_pit, - [ - lib_plankton.pit.to_datetime_ce, - (x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin( - "{{year}}-{{month}}-{{day}}", - { - "year": x.date.year.toFixed(0).padStart(4, "0"), - "month": x.date.month.toFixed(0).padStart(2, "0"), - "day": x.date.day.toFixed(0).padStart(2, "0"), - } - ), - ] + "day": ( + _dali.conf.get().misc.weekview_cell_day_format + .replace(new RegExp("Y", "g"), day_as_date.year.toFixed(0).padStart(4, "0")) + .replace(new RegExp("m", "g"), day_as_date.month.toFixed(0).padStart(2, "0")) + .replace(new RegExp("b", "g"), _dali.helpers.month_name(day_as_date.month)) + .replace(new RegExp("d", "g"), day_as_date.day.toFixed(0).padStart(2, "0")) + .replace(new RegExp("W", "g"), day_as_ywd.week.toFixed(0).padStart(2, "0")) + .replace(new RegExp("w", "g"), day_as_ywd.day.toFixed(0).padStart(1, "0")) ), - "day": lib_plankton.call.convey( - day_pit, - [ - lib_plankton.pit.to_datetime_ce, - (x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin( - "{{year}}-{{month}}-{{day}}", - { - "year": x.date.year.toFixed(0).padStart(4, "0"), - "month": x.date.month.toFixed(0).padStart(2, "0"), - "day": x.date.day.toFixed(0).padStart(2, "0"), - } - ), - ] - ), - "rel": lib_plankton.call.convey( - day_pit, - [ - lib_plankton.pit.to_datetime_ce, - (x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin( - "{{year}}-{{month}}-{{day}}", - { - "year": x.date.year.toFixed(0).padStart(4, "0"), - "month": x.date.month.toFixed(0).padStart(2, "0"), - "day": x.date.day.toFixed(0).padStart(2, "0"), - } - ) - ] + "rel": lib_plankton.string.coin( + "{{year}}-{{month}}-{{day}}", + { + "year": day_as_date.year.toFixed(0).padStart(4, "0"), + "month": day_as_date.month.toFixed(0).padStart(2, "0"), + "day": day_as_date.day.toFixed(0).padStart(2, "0"), + } ), "entries": "" } @@ -835,7 +805,11 @@ namespace _dali.widgets.weekview element.addEventListener( "click", (event) => { - if (! (element === event.target)) + if ( + (! (element === event.target)) + && + (! (event.target as HTMLElement).classList.contains("weekview-day")) + ) { // do nothing } diff --git a/source/widgets/weekview/style.css b/source/widgets/weekview/style.css index f9c98fd..93b07bc 100644 --- a/source/widgets/weekview/style.css +++ b/source/widgets/weekview/style.css @@ -87,7 +87,6 @@ .weekview-day { font-size: 0.75em; - cursor: help; } .weekview-events diff --git a/source/widgets/weekview/templates/tableview-cell-entry.html.tpl b/source/widgets/weekview/templates/tableview-cell-entry.html.tpl index 3b578f9..e4240e7 100644 --- a/source/widgets/weekview/templates/tableview-cell-entry.html.tpl +++ b/source/widgets/weekview/templates/tableview-cell-entry.html.tpl @@ -1,3 +1,3 @@ -
  • +
  • {{name}}
  • diff --git a/source/widgets/weekview/templates/tableview-cell.html.tpl b/source/widgets/weekview/templates/tableview-cell.html.tpl index 7c2d76a..5fb9651 100644 --- a/source/widgets/weekview/templates/tableview-cell.html.tpl +++ b/source/widgets/weekview/templates/tableview-cell.html.tpl @@ -1,5 +1,5 @@ - + {{day}}