From e8432a3c48f672e8e8cccfdcfdcfc6c0e92af560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Fra=C3=9F?= Date: Wed, 24 Apr 2024 08:33:22 +0200 Subject: [PATCH] [mod] view --- lib/plankton/plankton.d.ts | 21 +++++++++++++-------- lib/plankton/plankton.js | 14 +++++++++++++- source/logic/conf.ts | 3 +++ source/logic/main.ts | 2 ++ source/logic/pages/view.ts | 10 +++++----- source/structure/index.html.tpl | 2 +- source/style/style.css | 31 ++++++++++++++++++++++++++++--- 7 files changed, 65 insertions(+), 18 deletions(-) diff --git a/lib/plankton/plankton.d.ts b/lib/plankton/plankton.d.ts index 48a85aa..154ed8e 100644 --- a/lib/plankton/plankton.d.ts +++ b/lib/plankton/plankton.d.ts @@ -1,15 +1,15 @@ /** * @author fenris */ -declare type int = number; +type int = number; /** * @author fenris */ -declare type float = number; +type float = number; /** * @author fenris */ -declare type type_date = { +type type_date = { year: int; month: int; day: int; @@ -17,7 +17,7 @@ declare type type_date = { /** * @author fenris */ -declare type type_time = { +type type_time = { hour: int; minute: int; second: int; @@ -25,7 +25,7 @@ declare type type_time = { /** * @author fenris */ -declare type type_datetimeobject = { +type type_datetimeobject = { date: type_date; time: type_time; }; @@ -42,7 +42,7 @@ declare namespace lib_plankton.base { /** * @author fenris */ -declare type type_pseudopointer = { +type type_pseudopointer = { value: type_value; }; /** @@ -1513,7 +1513,7 @@ declare namespace lib_plankton.storage.memory { clear(): Promise; write(key: any, value: any): Promise; delete(key: any): Promise; - read(key: any): Promise; + read(key: any): Promise>; search(term: any): Promise<{ key: string; preview: string; @@ -1815,12 +1815,17 @@ declare namespace lib_plankton.zoo_input { * @author fenris */ class class_input_checkbox implements interface_input { + /** + */ + private read_only; /** */ private dom_input; /** */ - constructor(); + constructor(options?: { + read_only?: boolean; + }); /** * [implementation] */ diff --git a/lib/plankton/plankton.js b/lib/plankton/plankton.js index 060ea8c..c54c988 100644 --- a/lib/plankton/plankton.js +++ b/lib/plankton/plankton.js @@ -4613,7 +4613,11 @@ var lib_plankton; class class_input_checkbox { /** */ - constructor() { + constructor(options = {}) { + options = Object.assign({ + "read_only": false, + }, options); + this.read_only = options.read_only; this.dom_input = null; } /** @@ -4622,6 +4626,14 @@ var lib_plankton; setup(parent) { this.dom_input = document.createElement("input"); this.dom_input.setAttribute("type", "checkbox"); + { + if (this.read_only) { + this.dom_input.setAttribute("disabled", "disabled"); + } + else { + // do nothing + } + } // this.dom_input.style.display = "initial"; // n3o!!! parent.appendChild(this.dom_input); return Promise.resolve(undefined); diff --git a/source/logic/conf.ts b/source/logic/conf.ts index ff7b58b..0e89ad2 100644 --- a/source/logic/conf.ts +++ b/source/logic/conf.ts @@ -10,6 +10,9 @@ namespace _espe.conf port : int; path_base : string; }; + settings : { + title : string; + }; }; diff --git a/source/logic/main.ts b/source/logic/main.ts index fe664fb..7103d64 100644 --- a/source/logic/main.ts +++ b/source/logic/main.ts @@ -100,6 +100,8 @@ async function main( "fallback": {"name": "index", "parameters": {}}, } ); + // set title + document.querySelector("header > h1").textContent = _espe.conf.get().settings.title; setup_nav(); lib_plankton.zoo_page.start(); } diff --git a/source/logic/pages/view.ts b/source/logic/pages/view.ts index fd58803..2ac9f16 100644 --- a/source/logic/pages/view.ts +++ b/source/logic/pages/view.ts @@ -15,27 +15,27 @@ lib_plankton.zoo_page.register( }, { "name": "name_real_value", - "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), + "input": new lib_plankton.zoo_input.class_input_text(), "label": "Echter Name", }, { "name": "email_address_private_value", - "input": new lib_plankton.zoo_input.class_input_text({"read_only": true}), + "input": new lib_plankton.zoo_input.class_input_text(), "label": "Private E-Mail-Adresse", }, { "name": "email_address_numberbased_use", - "input": new lib_plankton.zoo_input.class_input_checkbox(/*{"read_only": true}*/), + "input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}), "label": "Nummernbasierte E-Mail-Adresse verwenden", }, { "name": "email_address_namebased_use", - "input": new lib_plankton.zoo_input.class_input_checkbox(/*{"read_only": true}*/), + "input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}), "label": "Namensbasierte E-Mail-Adresse verwenden", }, { "name": "email_redirect", - "input": new lib_plankton.zoo_input.class_input_checkbox(/*{"read_only": true}*/), + "input": new lib_plankton.zoo_input.class_input_checkbox({"read_only": true}), "label": "eingehende E-Mails zu privater Adresse umleiten", }, { diff --git a/source/structure/index.html.tpl b/source/structure/index.html.tpl index 1bb8629..1c91c08 100644 --- a/source/structure/index.html.tpl +++ b/source/structure/index.html.tpl @@ -40,7 +40,7 @@
-

DIE LINKE. Landesverband Sachsen

+

Espe