From 29e7fea95ae17bf96677658a418d29055e98584c Mon Sep 17 00:00:00 2001 From: Tobias Jordans Date: Thu, 30 Sep 2021 20:09:09 +0200 Subject: [PATCH 1/6] Replace inline style with TW classes --- .../mapcomplete_charging_stations.json | 38 +++++----- .../charging_station/charging_station.json | 74 +++++++++---------- assets/layers/charging_station/csvToJson.ts | 10 +-- css/index-tailwind-output.css | 5 ++ langs/layers/en.json | 38 +++++----- langs/layers/nl.json | 38 +++++----- 6 files changed, 104 insertions(+), 99 deletions(-) diff --git a/Docs/TagInfo/mapcomplete_charging_stations.json b/Docs/TagInfo/mapcomplete_charging_stations.json index 0306d72849..22ca1d0a4b 100644 --- a/Docs/TagInfo/mapcomplete_charging_stations.json +++ b/Docs/TagInfo/mapcomplete_charging_stations.json @@ -106,84 +106,84 @@ }, { "key": "socket:schuko", - "description": "Layer 'Charging stations' shows socket:schuko=1 with a fixed text, namely ' Schuko wall plug without ground pin (CEE7/4 type F)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:schuko=1 with a fixed text, namely ' Schuko wall plug without ground pin (CEE7/4 type F)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:schuko", - "description": "Layer 'Charging stations' shows socket:schuko~^..*$&socket:schuko!~^1$ with a fixed text, namely ' Schuko wall plug without ground pin (CEE7/4 type F)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:schuko~^..*$&socket:schuko!~^1$ with a fixed text, namely ' Schuko wall plug without ground pin (CEE7/4 type F)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:typee", - "description": "Layer 'Charging stations' shows socket:typee=1 with a fixed text, namely ' European wall plug with ground pin (CEE7/4 type E)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:typee=1 with a fixed text, namely ' European wall plug with ground pin (CEE7/4 type E)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:typee", - "description": "Layer 'Charging stations' shows socket:typee~^..*$&socket:typee!~^1$ with a fixed text, namely ' European wall plug with ground pin (CEE7/4 type E)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:typee~^..*$&socket:typee!~^1$ with a fixed text, namely ' European wall plug with ground pin (CEE7/4 type E)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:chademo", - "description": "Layer 'Charging stations' shows socket:chademo=1 with a fixed text, namely ' Chademo' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:chademo=1 with a fixed text, namely ' Chademo' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:chademo", - "description": "Layer 'Charging stations' shows socket:chademo~^..*$&socket:chademo!~^1$ with a fixed text, namely ' Chademo' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:chademo~^..*$&socket:chademo!~^1$ with a fixed text, namely ' Chademo' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:type1_cable", - "description": "Layer 'Charging stations' shows socket:type1_cable=1 with a fixed text, namely ' Type 1 with cable (J1772)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:type1_cable=1 with a fixed text, namely ' Type 1 with cable (J1772)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:type1_cable", - "description": "Layer 'Charging stations' shows socket:type1_cable~^..*$&socket:type1_cable!~^1$ with a fixed text, namely ' Type 1 with cable (J1772)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:type1_cable~^..*$&socket:type1_cable!~^1$ with a fixed text, namely ' Type 1 with cable (J1772)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:type1", - "description": "Layer 'Charging stations' shows socket:type1=1 with a fixed text, namely ' Type 1 without cable (J1772)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:type1=1 with a fixed text, namely ' Type 1 without cable (J1772)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:type1", - "description": "Layer 'Charging stations' shows socket:type1~^..*$&socket:type1!~^1$ with a fixed text, namely ' Type 1 without cable (J1772)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:type1~^..*$&socket:type1!~^1$ with a fixed text, namely ' Type 1 without cable (J1772)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:type1_combo", - "description": "Layer 'Charging stations' shows socket:type1_combo=1 with a fixed text, namely ' Type 1 CCS (aka Type 1 Combo)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:type1_combo=1 with a fixed text, namely ' Type 1 CCS (aka Type 1 Combo)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:type1_combo", - "description": "Layer 'Charging stations' shows socket:type1_combo~^..*$&socket:type1_combo!~^1$ with a fixed text, namely ' Type 1 CCS (aka Type 1 Combo)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:type1_combo~^..*$&socket:type1_combo!~^1$ with a fixed text, namely ' Type 1 CCS (aka Type 1 Combo)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:tesla_supercharger", - "description": "Layer 'Charging stations' shows socket:tesla_supercharger=1 with a fixed text, namely ' Tesla Supercharger' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:tesla_supercharger=1 with a fixed text, namely ' Tesla Supercharger' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:tesla_supercharger", - "description": "Layer 'Charging stations' shows socket:tesla_supercharger~^..*$&socket:tesla_supercharger!~^1$ with a fixed text, namely ' Tesla Supercharger' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:tesla_supercharger~^..*$&socket:tesla_supercharger!~^1$ with a fixed text, namely ' Tesla Supercharger' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:type2", - "description": "Layer 'Charging stations' shows socket:type2=1 with a fixed text, namely ' Type 2 (mennekes)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:type2=1 with a fixed text, namely ' Type 2 (mennekes)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:type2", - "description": "Layer 'Charging stations' shows socket:type2~^..*$&socket:type2!~^1$ with a fixed text, namely ' Type 2 (mennekes)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:type2~^..*$&socket:type2!~^1$ with a fixed text, namely ' Type 2 (mennekes)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:type2_combo", - "description": "Layer 'Charging stations' shows socket:type2_combo=1 with a fixed text, namely ' Type 2 CCS (mennekes)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", + "description": "Layer 'Charging stations' shows socket:type2_combo=1 with a fixed text, namely ' Type 2 CCS (mennekes)' and allows to pick this as a default answer (in the MapComplete.osm.be theme 'Charging stations')", "value": "1" }, { "key": "socket:type2_combo", - "description": "Layer 'Charging stations' shows socket:type2_combo~^..*$&socket:type2_combo!~^1$ with a fixed text, namely ' Type 2 CCS (mennekes)' (in the MapComplete.osm.be theme 'Charging stations')" + "description": "Layer 'Charging stations' shows socket:type2_combo~^..*$&socket:type2_combo!~^1$ with a fixed text, namely ' Type 2 CCS (mennekes)' (in the MapComplete.osm.be theme 'Charging stations')" }, { "key": "socket:schuko", @@ -793,4 +793,4 @@ "value": "yes" } ] -} \ No newline at end of file +} diff --git a/assets/layers/charging_station/charging_station.json b/assets/layers/charging_station/charging_station.json index 3935c515f9..e20cde9583 100644 --- a/assets/layers/charging_station/charging_station.json +++ b/assets/layers/charging_station/charging_station.json @@ -151,8 +151,8 @@ "if": "socket:schuko=1", "ifnot": "socket:schuko=", "then": { - "en": " Schuko wall plug without ground pin (CEE7/4 type F)", - "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "en": " Schuko wall plug without ground pin (CEE7/4 type F)", + "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" } }, { @@ -163,8 +163,8 @@ ] }, "then": { - "en": " Schuko wall plug without ground pin (CEE7/4 type F)", - "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "en": " Schuko wall plug without ground pin (CEE7/4 type F)", + "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" }, "hideInAnswer": true }, @@ -172,8 +172,8 @@ "if": "socket:typee=1", "ifnot": "socket:typee=", "then": { - "en": " European wall plug with ground pin (CEE7/4 type E)", - "nl": " Europese stekker met aardingspin (CEE7/4 type E)" + "en": " European wall plug with ground pin (CEE7/4 type E)", + "nl": " Europese stekker met aardingspin (CEE7/4 type E)" } }, { @@ -184,8 +184,8 @@ ] }, "then": { - "en": " European wall plug with ground pin (CEE7/4 type E)", - "nl": " Europese stekker met aardingspin (CEE7/4 type E)" + "en": " European wall plug with ground pin (CEE7/4 type E)", + "nl": " Europese stekker met aardingspin (CEE7/4 type E)" }, "hideInAnswer": true }, @@ -193,8 +193,8 @@ "if": "socket:chademo=1", "ifnot": "socket:chademo=", "then": { - "en": " Chademo", - "nl": " " + "en": " Chademo", + "nl": " " } }, { @@ -205,8 +205,8 @@ ] }, "then": { - "en": " Chademo", - "nl": " " + "en": " Chademo", + "nl": " " }, "hideInAnswer": true }, @@ -214,8 +214,8 @@ "if": "socket:type1_cable=1", "ifnot": "socket:type1_cable=", "then": { - "en": " Type 1 with cable (J1772)", - "nl": " Type 1 met kabel (J1772)" + "en": " Type 1 with cable (J1772)", + "nl": " Type 1 met kabel (J1772)" } }, { @@ -226,8 +226,8 @@ ] }, "then": { - "en": " Type 1 with cable (J1772)", - "nl": " Type 1 met kabel (J1772)" + "en": " Type 1 with cable (J1772)", + "nl": " Type 1 met kabel (J1772)" }, "hideInAnswer": true }, @@ -235,8 +235,8 @@ "if": "socket:type1=1", "ifnot": "socket:type1=", "then": { - "en": " Type 1 without cable (J1772)", - "nl": " Type 1 zonder kabel (J1772)" + "en": " Type 1 without cable (J1772)", + "nl": " Type 1 zonder kabel (J1772)" } }, { @@ -247,8 +247,8 @@ ] }, "then": { - "en": " Type 1 without cable (J1772)", - "nl": " Type 1 zonder kabel (J1772)" + "en": " Type 1 without cable (J1772)", + "nl": " Type 1 zonder kabel (J1772)" }, "hideInAnswer": true }, @@ -256,8 +256,8 @@ "if": "socket:type1_combo=1", "ifnot": "socket:type1_combo=", "then": { - "en": " Type 1 CCS (aka Type 1 Combo)", - "nl": " " + "en": " Type 1 CCS (aka Type 1 Combo)", + "nl": " " } }, { @@ -268,8 +268,8 @@ ] }, "then": { - "en": " Type 1 CCS (aka Type 1 Combo)", - "nl": " " + "en": " Type 1 CCS (aka Type 1 Combo)", + "nl": " " }, "hideInAnswer": true }, @@ -277,8 +277,8 @@ "if": "socket:tesla_supercharger=1", "ifnot": "socket:tesla_supercharger=", "then": { - "en": " Tesla Supercharger", - "nl": " " + "en": " Tesla Supercharger", + "nl": " " } }, { @@ -289,8 +289,8 @@ ] }, "then": { - "en": " Tesla Supercharger", - "nl": " " + "en": " Tesla Supercharger", + "nl": " " }, "hideInAnswer": true }, @@ -298,8 +298,8 @@ "if": "socket:type2=1", "ifnot": "socket:type2=", "then": { - "en": " Type 2 (mennekes)", - "nl": " " + "en": " Type 2 (mennekes)", + "nl": " " } }, { @@ -310,8 +310,8 @@ ] }, "then": { - "en": " Type 2 (mennekes)", - "nl": " " + "en": " Type 2 (mennekes)", + "nl": " " }, "hideInAnswer": true }, @@ -319,8 +319,8 @@ "if": "socket:type2_combo=1", "ifnot": "socket:type2_combo=", "then": { - "en": " Type 2 CCS (mennekes)", - "nl": " " + "en": " Type 2 CCS (mennekes)", + "nl": " " } }, { @@ -331,8 +331,8 @@ ] }, "then": { - "en": " Type 2 CCS (mennekes)", - "nl": " " + "en": " Type 2 CCS (mennekes)", + "nl": " " }, "hideInAnswer": true } @@ -2180,4 +2180,4 @@ "eraseInvalidValues": true } ] -} \ No newline at end of file +} diff --git a/assets/layers/charging_station/csvToJson.ts b/assets/layers/charging_station/csvToJson.ts index 7ea31a10fa..80c3e557eb 100644 --- a/assets/layers/charging_station/csvToJson.ts +++ b/assets/layers/charging_station/csvToJson.ts @@ -64,8 +64,8 @@ function run(file, protojson) { const entries = loadCsv(file) for (const e of entries) { const txt = { - en: ` ${e.description.get("en")}`, - nl: ` ${e.description.get("nl")}` + en: ` ${e.description.get("en")}`, + nl: ` ${e.description.get("nl")}` } const json = { if: `${e.key}=1`, @@ -220,8 +220,8 @@ function run(file, protojson) { options: filterOptions }) - - + + const extraUnits = [ { appliesToKey: entries.map(e => e.key + ":voltage"), @@ -273,7 +273,7 @@ function run(file, protojson) { proto["units"] = [] } proto["units"].push(...extraUnits) - + writeFileSync("charging_station.json", JSON.stringify(proto, undefined, " ")) } diff --git a/css/index-tailwind-output.css b/css/index-tailwind-output.css index e3d669e7cd..1f7b87e18f 100644 --- a/css/index-tailwind-output.css +++ b/css/index-tailwind-output.css @@ -839,6 +839,11 @@ video { margin-bottom: 0.75rem; } +.mx-4 { + margin-left: 1rem; + margin-right: 1rem; +} + .-ml-1 { margin-left: -0.25rem; } diff --git a/langs/layers/en.json b/langs/layers/en.json index 9149f19660..a6472bf0f0 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -960,58 +960,58 @@ "4": { "mappings": { "0": { - "then": " Schuko wall plug without ground pin (CEE7/4 type F)" + "then": " Schuko wall plug without ground pin (CEE7/4 type F)" }, "1": { - "then": " Schuko wall plug without ground pin (CEE7/4 type F)" + "then": " Schuko wall plug without ground pin (CEE7/4 type F)" }, "2": { - "then": " European wall plug with ground pin (CEE7/4 type E)" + "then": " European wall plug with ground pin (CEE7/4 type E)" }, "3": { - "then": " European wall plug with ground pin (CEE7/4 type E)" + "then": " European wall plug with ground pin (CEE7/4 type E)" }, "4": { - "then": " Chademo" + "then": " Chademo" }, "5": { - "then": " Chademo" + "then": " Chademo" }, "6": { - "then": " Type 1 with cable (J1772)" + "then": " Type 1 with cable (J1772)" }, "7": { - "then": " Type 1 with cable (J1772)" + "then": " Type 1 with cable (J1772)" }, "8": { - "then": " Type 1 without cable (J1772)" + "then": " Type 1 without cable (J1772)" }, "9": { - "then": " Type 1 without cable (J1772)" + "then": " Type 1 without cable (J1772)" }, "10": { - "then": " Type 1 CCS (aka Type 1 Combo)" + "then": " Type 1 CCS (aka Type 1 Combo)" }, "11": { - "then": " Type 1 CCS (aka Type 1 Combo)" + "then": " Type 1 CCS (aka Type 1 Combo)" }, "12": { - "then": " Tesla Supercharger" + "then": " Tesla Supercharger" }, "13": { - "then": " Tesla Supercharger" + "then": " Tesla Supercharger" }, "14": { - "then": " Type 2 (mennekes)" + "then": " Type 2 (mennekes)" }, "15": { - "then": " Type 2 (mennekes)" + "then": " Type 2 (mennekes)" }, "16": { - "then": " Type 2 CCS (mennekes)" + "then": " Type 2 CCS (mennekes)" }, "17": { - "then": " Type 2 CCS (mennekes)" + "then": " Type 2 CCS (mennekes)" } }, "question": "Which charging stations are available here?" @@ -3383,4 +3383,4 @@ "watermill": { "name": "Watermill" } -} \ No newline at end of file +} diff --git a/langs/layers/nl.json b/langs/layers/nl.json index bddc9c2557..a4be84c4f4 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -1036,58 +1036,58 @@ "4": { "mappings": { "0": { - "then": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "then": " Schuko stekker zonder aardingspin (CEE7/4 type F)" }, "1": { - "then": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "then": " Schuko stekker zonder aardingspin (CEE7/4 type F)" }, "2": { - "then": " Europese stekker met aardingspin (CEE7/4 type E)" + "then": " Europese stekker met aardingspin (CEE7/4 type E)" }, "3": { - "then": " Europese stekker met aardingspin (CEE7/4 type E)" + "then": " Europese stekker met aardingspin (CEE7/4 type E)" }, "4": { - "then": " " + "then": " " }, "5": { - "then": " " + "then": " " }, "6": { - "then": " Type 1 met kabel (J1772)" + "then": " Type 1 met kabel (J1772)" }, "7": { - "then": " Type 1 met kabel (J1772)" + "then": " Type 1 met kabel (J1772)" }, "8": { - "then": " Type 1 zonder kabel (J1772)" + "then": " Type 1 zonder kabel (J1772)" }, "9": { - "then": " Type 1 zonder kabel (J1772)" + "then": " Type 1 zonder kabel (J1772)" }, "10": { - "then": " " + "then": " " }, "11": { - "then": " " + "then": " " }, "12": { - "then": " " + "then": " " }, "13": { - "then": " " + "then": " " }, "14": { - "then": " " + "then": " " }, "15": { - "then": " " + "then": " " }, "16": { - "then": " " + "then": " " }, "17": { - "then": " " + "then": " " } } }, @@ -3781,4 +3781,4 @@ "render": "Watermolens" } } -} \ No newline at end of file +} From 43618fe3f1210696ac6dcca552234ba9d4f5bbab Mon Sep 17 00:00:00 2001 From: Tobias Jordans Date: Thu, 30 Sep 2021 21:41:21 +0200 Subject: [PATCH 2/6] Refactoring: Small html/variables changes --- UI/Input/Checkboxes.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/UI/Input/Checkboxes.ts b/UI/Input/Checkboxes.ts index 15aa758322..32386eea3a 100644 --- a/UI/Input/Checkboxes.ts +++ b/UI/Input/Checkboxes.ts @@ -31,7 +31,7 @@ export default class CheckBoxes extends InputElement { } protected InnerConstructElement(): HTMLElement { - const el = document.createElement("form"); + const formTag = document.createElement("form"); const value = this.value; const elements = this._elements; @@ -57,7 +57,7 @@ export default class CheckBoxes extends InputElement { "bg-red" ); - const wrapper = document.createElement("span"); + const wrapper = document.createElement("div"); wrapper.classList.add( "wrapper", "flex", @@ -68,7 +68,7 @@ export default class CheckBoxes extends InputElement { ); wrapper.appendChild(input); wrapper.appendChild(label); - el.appendChild(wrapper); + formTag.appendChild(wrapper); value.addCallbackAndRunD((selectedValues) => { if (selectedValues.indexOf(i) >= 0) { @@ -97,6 +97,6 @@ export default class CheckBoxes extends InputElement { }; } - return el; + return formTag; } } From b8dc1063d0aa8c30b346fdd8d7006c6a9e432098 Mon Sep 17 00:00:00 2001 From: Tobias Jordans Date: Thu, 30 Sep 2021 21:41:51 +0200 Subject: [PATCH 3/6] Refactoring: Random spaces / newline changes --- UI/BaseUIElement.ts | 5 ++--- UI/Input/FixedInputElement.ts | 4 +--- UI/Input/InputElement.ts | 1 - 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/UI/BaseUIElement.ts b/UI/BaseUIElement.ts index 99462acbdb..ff2d75b835 100644 --- a/UI/BaseUIElement.ts +++ b/UI/BaseUIElement.ts @@ -99,9 +99,8 @@ export default abstract class BaseUIElement { if (this.InnerConstructElement === undefined) { throw "ERROR! This is not a correct baseUIElement: " + this.constructor.name } + try { - - const el = this.InnerConstructElement(); if (el === undefined) { @@ -163,4 +162,4 @@ export default abstract class BaseUIElement { } protected abstract InnerConstructElement(): HTMLElement; -} \ No newline at end of file +} diff --git a/UI/Input/FixedInputElement.ts b/UI/Input/FixedInputElement.ts index d82f795d43..ee2e8d9506 100644 --- a/UI/Input/FixedInputElement.ts +++ b/UI/Input/FixedInputElement.ts @@ -41,6 +41,4 @@ export class FixedInputElement extends InputElement { protected InnerConstructElement(): HTMLElement { return this._el; } - - -} \ No newline at end of file +} diff --git a/UI/Input/InputElement.ts b/UI/Input/InputElement.ts index aadc6d9ee1..f9920b1d6a 100644 --- a/UI/Input/InputElement.ts +++ b/UI/Input/InputElement.ts @@ -10,4 +10,3 @@ export abstract class InputElement extends BaseUIElement { abstract IsValid(t: T): boolean; } - From 9889b0d464dcb0e9a785f7041cc2d36dcfcb9fbe Mon Sep 17 00:00:00 2001 From: Tobias Jordans Date: Thu, 30 Sep 2021 21:42:31 +0200 Subject: [PATCH 4/6] Checkboxes: Margin only bottom We only need it to the bottom and left/right mess with w-full in this css-setup. --- UI/Input/Checkboxes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/Input/Checkboxes.ts b/UI/Input/Checkboxes.ts index 32386eea3a..affad21920 100644 --- a/UI/Input/Checkboxes.ts +++ b/UI/Input/Checkboxes.ts @@ -64,7 +64,7 @@ export default class CheckBoxes extends InputElement { "w-full", "border", "border-gray-400", - "m-1" + "mb-1" ); wrapper.appendChild(input); wrapper.appendChild(label); From 821c97662bc4d98c89f022268beee01340be0a16 Mon Sep 17 00:00:00 2001 From: Tobias Jordans Date: Thu, 30 Sep 2021 21:44:55 +0200 Subject: [PATCH 5/6] TW Classes instead of inline; no pointer event "all" The way I read https://developer.mozilla.org/de/docs/Web/CSS/pointer-events, `pointer-events: all` is a special SVG thing and what we want here, is what TW provides with `pointer-events-none` https://tailwindcss.com/docs/pointer-events so that event pass through. --- UI/BaseUIElement.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/UI/BaseUIElement.ts b/UI/BaseUIElement.ts index ff2d75b835..d0152bbd54 100644 --- a/UI/BaseUIElement.ts +++ b/UI/BaseUIElement.ts @@ -131,8 +131,7 @@ export default abstract class BaseUIElement { // @ts-ignore e.consumed = true; } - el.style.pointerEvents = "all"; - el.style.cursor = "pointer"; + el.classList.add("pointer-events-none", "cursor-pointer"); } if (this._onHover !== undefined) { From 8e040a8c4dc8ea580a434516743ee1f5e676bd54 Mon Sep 17 00:00:00 2001 From: Tobias Jordans Date: Thu, 30 Sep 2021 21:46:20 +0200 Subject: [PATCH 6/6] Fix #491 with custom HTML/Classes inside translations This is not the fixed I hoped for, but the JS generates so many empty `` tags that I cannot get rid of, that it is not possible to style this "from the outside", which is unfortunate. --- .../charging_station/charging_station.json | 128 +++++++++--------- css/index-tailwind-output.css | 12 +- langs/layers/en.json | 92 ++++++------- langs/layers/nl.json | 38 +++--- 4 files changed, 137 insertions(+), 133 deletions(-) diff --git a/assets/layers/charging_station/charging_station.json b/assets/layers/charging_station/charging_station.json index e20cde9583..9c9aa44714 100644 --- a/assets/layers/charging_station/charging_station.json +++ b/assets/layers/charging_station/charging_station.json @@ -151,8 +151,8 @@ "if": "socket:schuko=1", "ifnot": "socket:schuko=", "then": { - "en": " Schuko wall plug without ground pin (CEE7/4 type F)", - "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "en": "

Schuko wall plug without ground pin (CEE7/4 type F)

", + "nl": "

Schuko stekker zonder aardingspin (CEE7/4 type F)

" } }, { @@ -163,8 +163,8 @@ ] }, "then": { - "en": " Schuko wall plug without ground pin (CEE7/4 type F)", - "nl": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "en": "

Schuko wall plug without ground pin (CEE7/4 type F)

", + "nl": "

Schuko stekker zonder aardingspin (CEE7/4 type F)

" }, "hideInAnswer": true }, @@ -172,8 +172,8 @@ "if": "socket:typee=1", "ifnot": "socket:typee=", "then": { - "en": " European wall plug with ground pin (CEE7/4 type E)", - "nl": " Europese stekker met aardingspin (CEE7/4 type E)" + "en": "

European wall plug with ground pin (CEE7/4 type E)

", + "nl": "

Europese stekker met aardingspin (CEE7/4 type E)

" } }, { @@ -184,8 +184,8 @@ ] }, "then": { - "en": " European wall plug with ground pin (CEE7/4 type E)", - "nl": " Europese stekker met aardingspin (CEE7/4 type E)" + "en": "

European wall plug with ground pin (CEE7/4 type E)

", + "nl": "

Europese stekker met aardingspin (CEE7/4 type E)

" }, "hideInAnswer": true }, @@ -193,8 +193,8 @@ "if": "socket:chademo=1", "ifnot": "socket:chademo=", "then": { - "en": " Chademo", - "nl": " " + "en": "

Chademo

", + "nl": "

" } }, { @@ -205,8 +205,8 @@ ] }, "then": { - "en": " Chademo", - "nl": " " + "en": "

Chademo

", + "nl": "

" }, "hideInAnswer": true }, @@ -214,8 +214,8 @@ "if": "socket:type1_cable=1", "ifnot": "socket:type1_cable=", "then": { - "en": " Type 1 with cable (J1772)", - "nl": " Type 1 met kabel (J1772)" + "en": "

Type 1 with cable (J1772)

", + "nl": "

Type 1 met kabel (J1772)

" } }, { @@ -226,8 +226,8 @@ ] }, "then": { - "en": " Type 1 with cable (J1772)", - "nl": " Type 1 met kabel (J1772)" + "en": "

Type 1 with cable (J1772)

", + "nl": "

Type 1 met kabel (J1772)

" }, "hideInAnswer": true }, @@ -235,8 +235,8 @@ "if": "socket:type1=1", "ifnot": "socket:type1=", "then": { - "en": " Type 1 without cable (J1772)", - "nl": " Type 1 zonder kabel (J1772)" + "en": "

Type 1 without cable (J1772)

", + "nl": "

Type 1 zonder kabel (J1772)

" } }, { @@ -247,8 +247,8 @@ ] }, "then": { - "en": " Type 1 without cable (J1772)", - "nl": " Type 1 zonder kabel (J1772)" + "en": "

Type 1 without cable (J1772)

", + "nl": "

Type 1 zonder kabel (J1772)

" }, "hideInAnswer": true }, @@ -256,8 +256,8 @@ "if": "socket:type1_combo=1", "ifnot": "socket:type1_combo=", "then": { - "en": " Type 1 CCS (aka Type 1 Combo)", - "nl": " " + "en": "

Type 1 CCS (aka Type 1 Combo)

", + "nl": "

" } }, { @@ -268,8 +268,8 @@ ] }, "then": { - "en": " Type 1 CCS (aka Type 1 Combo)", - "nl": " " + "en": "

Type 1 CCS (aka Type 1 Combo)

", + "nl": "

" }, "hideInAnswer": true }, @@ -277,8 +277,8 @@ "if": "socket:tesla_supercharger=1", "ifnot": "socket:tesla_supercharger=", "then": { - "en": " Tesla Supercharger", - "nl": " " + "en": "

Tesla Supercharger

", + "nl": "

" } }, { @@ -289,8 +289,8 @@ ] }, "then": { - "en": " Tesla Supercharger", - "nl": " " + "en": "

Tesla Supercharger

", + "nl": "

" }, "hideInAnswer": true }, @@ -298,8 +298,8 @@ "if": "socket:type2=1", "ifnot": "socket:type2=", "then": { - "en": " Type 2 (mennekes)", - "nl": " " + "en": "

Type 2 (mennekes)

", + "nl": "

" } }, { @@ -310,8 +310,8 @@ ] }, "then": { - "en": " Type 2 (mennekes)", - "nl": " " + "en": "

Type 2 (mennekes)

", + "nl": "

" }, "hideInAnswer": true }, @@ -319,8 +319,8 @@ "if": "socket:type2_combo=1", "ifnot": "socket:type2_combo=", "then": { - "en": " Type 2 CCS (mennekes)", - "nl": " " + "en": "

Type 2 CCS (mennekes)

", + "nl": "

" } }, { @@ -331,8 +331,8 @@ ] }, "then": { - "en": " Type 2 CCS (mennekes)", - "nl": " " + "en": "

Type 2 CCS (mennekes)

", + "nl": "

" }, "hideInAnswer": true } @@ -561,11 +561,11 @@ }, { "question": { - "en": "How much plugs of type Chademo are available here?", + "en": "How much plugs of type Chademo are available here?", "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" }, "render": { - "en": "There are Chademo plugs of type Chademo available here", + "en": "There are Chademo plugs of type Chademo available here", "nl": "Hier zijn stekkers van het type " }, "freeform": { @@ -581,11 +581,11 @@ }, { "question": { - "en": "What voltage do the plugs with Chademo offer?", + "en": "What voltage do the plugs with Chademo offer?", "nl": "Welke spanning levert de stekker van type " }, "render": { - "en": "Chademo outputs {socket:chademo:voltage} volt", + "en": "Chademo outputs {socket:chademo:voltage} volt", "nl": " heeft een spanning van {socket:chademo:voltage} volt" }, "freeform": { @@ -596,7 +596,7 @@ { "if": "socket:socket:chademo:voltage=500 V", "then": { - "en": "Chademo outputs 500 volt", + "en": "Chademo outputs 500 volt", "nl": " heeft een spanning van 500 volt" } } @@ -610,11 +610,11 @@ }, { "question": { - "en": "What current do the plugs with Chademo offer?", + "en": "What current do the plugs with Chademo offer?", "nl": "Welke stroom levert de stekker van type ?" }, "render": { - "en": "Chademo outputs at most {socket:chademo:current}A", + "en": "Chademo outputs at most {socket:chademo:current}A", "nl": " levert een stroom van maximaal {socket:chademo:current}A" }, "freeform": { @@ -625,7 +625,7 @@ { "if": "socket:socket:chademo:current=120 A", "then": { - "en": "Chademo outputs at most 120 A", + "en": "Chademo outputs at most 120 A", "nl": " levert een stroom van maximaal 120 A" } } @@ -639,11 +639,11 @@ }, { "question": { - "en": "What power output does a single plug of type Chademo offer?", + "en": "What power output does a single plug of type Chademo offer?", "nl": "Welk vermogen levert een enkele stekker van type ?" }, "render": { - "en": "Chademo outputs at most {socket:chademo:output}", + "en": "Chademo outputs at most {socket:chademo:output}", "nl": " levert een vermogen van maximaal {socket:chademo:output}" }, "freeform": { @@ -654,7 +654,7 @@ { "if": "socket:socket:chademo:output=50 kw", "then": { - "en": "Chademo outputs at most 50 kw", + "en": "Chademo outputs at most 50 kw", "nl": " levert een vermogen van maximaal 50 kw" } } @@ -1066,11 +1066,11 @@ }, { "question": { - "en": "How much plugs of type Tesla Supercharger are available here?", + "en": "How much plugs of type Tesla Supercharger are available here?", "nl": "Hoeveel stekkers van type heeft dit oplaadpunt?" }, "render": { - "en": "There are Tesla Supercharger plugs of type Tesla Supercharger available here", + "en": "There are Tesla Supercharger plugs of type Tesla Supercharger available here", "nl": "Hier zijn stekkers van het type " }, "freeform": { @@ -1086,11 +1086,11 @@ }, { "question": { - "en": "What voltage do the plugs with Tesla Supercharger offer?", + "en": "What voltage do the plugs with Tesla Supercharger offer?", "nl": "Welke spanning levert de stekker van type " }, "render": { - "en": "Tesla Supercharger outputs {socket:tesla_supercharger:voltage} volt", + "en": "Tesla Supercharger outputs {socket:tesla_supercharger:voltage} volt", "nl": " heeft een spanning van {socket:tesla_supercharger:voltage} volt" }, "freeform": { @@ -1101,7 +1101,7 @@ { "if": "socket:socket:tesla_supercharger:voltage=480 V", "then": { - "en": "Tesla Supercharger outputs 480 volt", + "en": "Tesla Supercharger outputs 480 volt", "nl": " heeft een spanning van 480 volt" } } @@ -1115,11 +1115,11 @@ }, { "question": { - "en": "What current do the plugs with Tesla Supercharger offer?", + "en": "What current do the plugs with Tesla Supercharger offer?", "nl": "Welke stroom levert de stekker van type ?" }, "render": { - "en": "Tesla Supercharger outputs at most {socket:tesla_supercharger:current}A", + "en": "Tesla Supercharger outputs at most {socket:tesla_supercharger:current}A", "nl": " levert een stroom van maximaal {socket:tesla_supercharger:current}A" }, "freeform": { @@ -1130,14 +1130,14 @@ { "if": "socket:socket:tesla_supercharger:current=125 A", "then": { - "en": "Tesla Supercharger outputs at most 125 A", + "en": "Tesla Supercharger outputs at most 125 A", "nl": " levert een stroom van maximaal 125 A" } }, { "if": "socket:socket:tesla_supercharger:current=350 A", "then": { - "en": "Tesla Supercharger outputs at most 350 A", + "en": "Tesla Supercharger outputs at most 350 A", "nl": " levert een stroom van maximaal 350 A" } } @@ -1151,11 +1151,11 @@ }, { "question": { - "en": "What power output does a single plug of type Tesla Supercharger offer?", + "en": "What power output does a single plug of type Tesla Supercharger offer?", "nl": "Welk vermogen levert een enkele stekker van type ?" }, "render": { - "en": "Tesla Supercharger outputs at most {socket:tesla_supercharger:output}", + "en": "Tesla Supercharger outputs at most {socket:tesla_supercharger:output}", "nl": " levert een vermogen van maximaal {socket:tesla_supercharger:output}" }, "freeform": { @@ -1166,21 +1166,21 @@ { "if": "socket:socket:tesla_supercharger:output=120 kw", "then": { - "en": "Tesla Supercharger outputs at most 120 kw", + "en": "Tesla Supercharger outputs at most 120 kw", "nl": " levert een vermogen van maximaal 120 kw" } }, { "if": "socket:socket:tesla_supercharger:output=150 kw", "then": { - "en": "Tesla Supercharger outputs at most 150 kw", + "en": "Tesla Supercharger outputs at most 150 kw", "nl": " levert een vermogen van maximaal 150 kw" } }, { "if": "socket:socket:tesla_supercharger:output=250 kw", "then": { - "en": "Tesla Supercharger outputs at most 250 kw", + "en": "Tesla Supercharger outputs at most 250 kw", "nl": " levert een vermogen van maximaal 250 kw" } } @@ -1970,7 +1970,7 @@ }, { "question": { - "en": "Has a Chademo connector", + "en": "Has a Chademo connector", "nl": "Heeft een " }, "osmTags": "socket:chademo~*" @@ -1998,7 +1998,7 @@ }, { "question": { - "en": "Has a Tesla Supercharger connector", + "en": "Has a Tesla Supercharger connector", "nl": "Heeft een " }, "osmTags": "socket:tesla_supercharger~*" @@ -2180,4 +2180,4 @@ "eraseInvalidValues": true } ] -} +} \ No newline at end of file diff --git a/css/index-tailwind-output.css b/css/index-tailwind-output.css index 1f7b87e18f..a4f2972838 100644 --- a/css/index-tailwind-output.css +++ b/css/index-tailwind-output.css @@ -912,6 +912,10 @@ video { margin-right: 0px; } +.mb-1 { + margin-bottom: 0.25rem; +} + .mb-4 { margin-bottom: 1rem; } @@ -1152,14 +1156,14 @@ video { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; } -.cursor-wait { - cursor: wait; -} - .cursor-pointer { cursor: pointer; } +.cursor-wait { + cursor: wait; +} + .resize { resize: both; } diff --git a/langs/layers/en.json b/langs/layers/en.json index a6472bf0f0..3a55d9b00c 100644 --- a/langs/layers/en.json +++ b/langs/layers/en.json @@ -903,7 +903,7 @@ "question": "Has a European wall plug with ground pin (CEE7/4 type E) connector" }, "3": { - "question": "Has a Chademo connector" + "question": "Has a Chademo connector" }, "4": { "question": "Has a Type 1 with cable (J1772) connector" @@ -915,7 +915,7 @@ "question": "Has a Type 1 CCS (aka Type 1 Combo) connector" }, "7": { - "question": "Has a Tesla Supercharger connector" + "question": "Has a Tesla Supercharger connector" }, "8": { "question": "Has a Type 2 (mennekes) connector" @@ -960,58 +960,58 @@ "4": { "mappings": { "0": { - "then": " Schuko wall plug without ground pin (CEE7/4 type F)" + "then": "

Schuko wall plug without ground pin (CEE7/4 type F)

" }, "1": { - "then": " Schuko wall plug without ground pin (CEE7/4 type F)" + "then": "

Schuko wall plug without ground pin (CEE7/4 type F)

" }, "2": { - "then": " European wall plug with ground pin (CEE7/4 type E)" + "then": "

European wall plug with ground pin (CEE7/4 type E)

" }, "3": { - "then": " European wall plug with ground pin (CEE7/4 type E)" + "then": "

European wall plug with ground pin (CEE7/4 type E)

" }, "4": { - "then": " Chademo" + "then": "

Chademo

" }, "5": { - "then": " Chademo" + "then": "

Chademo

" }, "6": { - "then": " Type 1 with cable (J1772)" + "then": "

Type 1 with cable (J1772)

" }, "7": { - "then": " Type 1 with cable (J1772)" + "then": "

Type 1 with cable (J1772)

" }, "8": { - "then": " Type 1 without cable (J1772)" + "then": "

Type 1 without cable (J1772)

" }, "9": { - "then": " Type 1 without cable (J1772)" + "then": "

Type 1 without cable (J1772)

" }, "10": { - "then": " Type 1 CCS (aka Type 1 Combo)" + "then": "

Type 1 CCS (aka Type 1 Combo)

" }, "11": { - "then": " Type 1 CCS (aka Type 1 Combo)" + "then": "

Type 1 CCS (aka Type 1 Combo)

" }, "12": { - "then": " Tesla Supercharger" + "then": "

Tesla Supercharger

" }, "13": { - "then": " Tesla Supercharger" + "then": "

Tesla Supercharger

" }, "14": { - "then": " Type 2 (mennekes)" + "then": "

Type 2 (mennekes)

" }, "15": { - "then": " Type 2 (mennekes)" + "then": "

Type 2 (mennekes)

" }, "16": { - "then": " Type 2 CCS (mennekes)" + "then": "

Type 2 CCS (mennekes)

" }, "17": { - "then": " Type 2 CCS (mennekes)" + "then": "

Type 2 CCS (mennekes)

" } }, "question": "Which charging stations are available here?" @@ -1082,35 +1082,35 @@ "render": "European wall plug with ground pin (CEE7/4 type E) outputs at most {socket:typee:output}" }, "13": { - "question": "How much plugs of type Chademo are available here?", - "render": "There are Chademo plugs of type Chademo available here" + "question": "How much plugs of type Chademo are available here?", + "render": "There are Chademo plugs of type Chademo available here" }, "14": { "mappings": { "0": { - "then": "Chademo outputs 500 volt" + "then": "Chademo outputs 500 volt" } }, - "question": "What voltage do the plugs with Chademo offer?", - "render": "Chademo outputs {socket:chademo:voltage} volt" + "question": "What voltage do the plugs with Chademo offer?", + "render": "Chademo outputs {socket:chademo:voltage} volt" }, "15": { "mappings": { "0": { - "then": "Chademo outputs at most 120 A" + "then": "Chademo outputs at most 120 A" } }, - "question": "What current do the plugs with Chademo offer?", - "render": "Chademo outputs at most {socket:chademo:current}A" + "question": "What current do the plugs with Chademo offer?", + "render": "Chademo outputs at most {socket:chademo:current}A" }, "16": { "mappings": { "0": { - "then": "Chademo outputs at most 50 kw" + "then": "Chademo outputs at most 50 kw" } }, - "question": "What power output does a single plug of type Chademo offer?", - "render": "Chademo outputs at most {socket:chademo:output}" + "question": "What power output does a single plug of type Chademo offer?", + "render": "Chademo outputs at most {socket:chademo:output}" }, "17": { "question": "How much plugs of type Type 1 with cable (J1772) are available here?", @@ -1239,44 +1239,44 @@ "render": "Type 1 CCS (aka Type 1 Combo) outputs at most {socket:type1_combo:output}" }, "29": { - "question": "How much plugs of type Tesla Supercharger are available here?", - "render": "There are Tesla Supercharger plugs of type Tesla Supercharger available here" + "question": "How much plugs of type Tesla Supercharger are available here?", + "render": "There are Tesla Supercharger plugs of type Tesla Supercharger available here" }, "30": { "mappings": { "0": { - "then": "Tesla Supercharger outputs 480 volt" + "then": "Tesla Supercharger outputs 480 volt" } }, - "question": "What voltage do the plugs with Tesla Supercharger offer?", - "render": "Tesla Supercharger outputs {socket:tesla_supercharger:voltage} volt" + "question": "What voltage do the plugs with Tesla Supercharger offer?", + "render": "Tesla Supercharger outputs {socket:tesla_supercharger:voltage} volt" }, "31": { "mappings": { "0": { - "then": "Tesla Supercharger outputs at most 125 A" + "then": "Tesla Supercharger outputs at most 125 A" }, "1": { - "then": "Tesla Supercharger outputs at most 350 A" + "then": "Tesla Supercharger outputs at most 350 A" } }, - "question": "What current do the plugs with Tesla Supercharger offer?", - "render": "Tesla Supercharger outputs at most {socket:tesla_supercharger:current}A" + "question": "What current do the plugs with Tesla Supercharger offer?", + "render": "Tesla Supercharger outputs at most {socket:tesla_supercharger:current}A" }, "32": { "mappings": { "0": { - "then": "Tesla Supercharger outputs at most 120 kw" + "then": "Tesla Supercharger outputs at most 120 kw" }, "1": { - "then": "Tesla Supercharger outputs at most 150 kw" + "then": "Tesla Supercharger outputs at most 150 kw" }, "2": { - "then": "Tesla Supercharger outputs at most 250 kw" + "then": "Tesla Supercharger outputs at most 250 kw" } }, - "question": "What power output does a single plug of type Tesla Supercharger offer?", - "render": "Tesla Supercharger outputs at most {socket:tesla_supercharger:output}" + "question": "What power output does a single plug of type Tesla Supercharger offer?", + "render": "Tesla Supercharger outputs at most {socket:tesla_supercharger:output}" }, "33": { "question": "How much plugs of type Type 2 (mennekes) are available here?", @@ -3383,4 +3383,4 @@ "watermill": { "name": "Watermill" } -} +} \ No newline at end of file diff --git a/langs/layers/nl.json b/langs/layers/nl.json index a4be84c4f4..97668f8abd 100644 --- a/langs/layers/nl.json +++ b/langs/layers/nl.json @@ -1036,58 +1036,58 @@ "4": { "mappings": { "0": { - "then": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "then": "

Schuko stekker zonder aardingspin (CEE7/4 type F)

" }, "1": { - "then": " Schuko stekker zonder aardingspin (CEE7/4 type F)" + "then": "

Schuko stekker zonder aardingspin (CEE7/4 type F)

" }, "2": { - "then": " Europese stekker met aardingspin (CEE7/4 type E)" + "then": "

Europese stekker met aardingspin (CEE7/4 type E)

" }, "3": { - "then": " Europese stekker met aardingspin (CEE7/4 type E)" + "then": "

Europese stekker met aardingspin (CEE7/4 type E)

" }, "4": { - "then": " " + "then": "

" }, "5": { - "then": " " + "then": "

" }, "6": { - "then": " Type 1 met kabel (J1772)" + "then": "

Type 1 met kabel (J1772)

" }, "7": { - "then": " Type 1 met kabel (J1772)" + "then": "

Type 1 met kabel (J1772)

" }, "8": { - "then": " Type 1 zonder kabel (J1772)" + "then": "

Type 1 zonder kabel (J1772)

" }, "9": { - "then": " Type 1 zonder kabel (J1772)" + "then": "

Type 1 zonder kabel (J1772)

" }, "10": { - "then": " " + "then": "

" }, "11": { - "then": " " + "then": "

" }, "12": { - "then": " " + "then": "

" }, "13": { - "then": " " + "then": "

" }, "14": { - "then": " " + "then": "

" }, "15": { - "then": " " + "then": "

" }, "16": { - "then": " " + "then": "

" }, "17": { - "then": " " + "then": "

" } } }, @@ -3781,4 +3781,4 @@ "render": "Watermolens" } } -} +} \ No newline at end of file