From 94850677497e8cb4fdfccdd1b64c2c209777c29b Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 13 Nov 2024 23:34:43 +0200 Subject: [PATCH 1/3] client: Replace the editor type combo box with radio buttons --- .../type_widgets/options/text_notes/editor.js | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/text_notes/editor.js b/src/public/app/widgets/type_widgets/options/text_notes/editor.js index 9db62b40b7..ce5bc9edc8 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/editor.js +++ b/src/public/app/widgets/type_widgets/options/text_notes/editor.js @@ -6,25 +6,37 @@ const TPL = `

${t("editing.editor_type.label")}

- +
+ +
+ +
+ +
+
`; export default class EditorOptions extends OptionsWidget { doRender() { this.$widget = $(TPL); this.$body = $("body"); - this.$editorType = this.$widget.find(".editor-type-select"); - this.$editorType.on('change', async () => { - const newEditorType = this.$editorType.val(); + this.$widget.find(`input[name="editor-type"]`).on('change', async () => { + const newEditorType = this.$widget.find(`input[name="editor-type"]:checked`).val(); await this.updateOption('textNoteEditorType', newEditorType); utils.reloadFrontendApp("editor type change"); }); } async optionsLoaded(options) { - this.$editorType.val(options.textNoteEditorType); + this.$widget.find(`input[name="editor-type"][value="${options.textNoteEditorType}"]`) + .prop("checked", "true"); } } From de4f06d9be52f6af46b9b1ae59d03ce3ead29421 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 13 Nov 2024 23:35:10 +0200 Subject: [PATCH 2/3] Update translations --- src/public/translations/en/translation.json | 10 ++++++++-- src/public/translations/es/translation.json | 10 ++++++++-- src/public/translations/ro/translation.json | 12 +++++++++--- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 66a1359358..bc97fa3c6f 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1518,8 +1518,14 @@ "editing": { "editor_type": { "label": "Formatting toolbar", - "floating": "Floating (editing tools appear near the cursor)", - "fixed": "Fixed (editing tools appear in the \"Formatting\" ribbon tab)" + "floating": { + "title": "Floating", + "description": "editing tools appear near the cursor;" + }, + "fixed": { + "title": "Fixed", + "description": "editing tools appear in the \"Formatting\" ribbon tab." + } } } } diff --git a/src/public/translations/es/translation.json b/src/public/translations/es/translation.json index 56726417e5..18c1d6de08 100644 --- a/src/public/translations/es/translation.json +++ b/src/public/translations/es/translation.json @@ -1518,8 +1518,14 @@ "editing": { "editor_type": { "label": "Barra de herramientas de formato", - "floating": "Flotante (las herramientas de edición aparecen cerca del cursor)", - "fixed": "Fijo (las herramientas de edición aparecen en la pestaña de la cinta \"Formato\")" + "floating": { + "title": "Flotante", + "description": "las herramientas de edición aparecen cerca del cursor;" + }, + "fixed": { + "title": "Fijo", + "description": "las herramientas de edición aparecen en la pestaña de la cinta \"Formato\")." + } } } } diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 999572f434..5914273190 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -1514,9 +1514,15 @@ }, "editing": { "editor_type": { - "fixed": "Editor cu bară fixă (uneltele de editare vor apărea în tab-ul „Formatare” din panglică)", - "floating": "Editor cu bară flotantă (uneltele de editare vor apărea lângă cursor)", - "label": "Bară de formatare" + "label": "Bară de formatare", + "floating": { + "title": "Editor cu bară fixă", + "description": "uneltele de editare vor apărea în tab-ul „Formatare” din panglică;" + }, + "fixed": { + "title": "Editor cu bară flotantă", + "description": "uneltele de editare vor apărea lângă cursor." + } } }, "editor": { From 8731b8a65bfd4cbeb60bf42a93963df542589b74 Mon Sep 17 00:00:00 2001 From: Adorian Doran Date: Wed, 13 Nov 2024 23:55:30 +0200 Subject: [PATCH 3/3] Fix translation --- src/public/translations/ro/translation.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json index 5914273190..b308a9a5f4 100644 --- a/src/public/translations/ro/translation.json +++ b/src/public/translations/ro/translation.json @@ -1516,12 +1516,12 @@ "editor_type": { "label": "Bară de formatare", "floating": { - "title": "Editor cu bară fixă", - "description": "uneltele de editare vor apărea în tab-ul „Formatare” din panglică;" - }, - "fixed": { "title": "Editor cu bară flotantă", "description": "uneltele de editare vor apărea lângă cursor." + }, + "fixed": { + "title": "Editor cu bară fixă", + "description": "uneltele de editare vor apărea în tab-ul „Formatare” din panglică;" } } },