From 8ebea068b4bb76257953c18bcca7347ca7b11134 Mon Sep 17 00:00:00 2001 From: Sereza7 Date: Mon, 6 Nov 2023 18:24:20 +0100 Subject: [PATCH 1/3] XWIKI-21523: Fields in form of WYSIWYG configuration are not accessible * Added labels for the three elements in the form that failed because no accessible name. --- .../src/main/resources/CKEditor/ConfigSheet.xml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml index c2e7a580f73f..40f1c041a217 100644 --- a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml +++ b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml @@ -218,15 +218,19 @@ require(['jquery', 'xwiki-ckeditor', 'bootstrap-select'], function($, ckeditorPr var commaSeparator = /\s*,\s*/; var enhanceConfig = function(editor) { var availablePlugins = editor.config.plugins.split(commaSeparator); - enhanceList($('#CKEditor\\.ConfigClass_0_removePlugins'), availablePlugins); + enhanceList($('#CKEditor\\.ConfigClass_0_removePlugins'), availablePlugins, 'availablepluginsselect'); var availableButtons = Object.keys(editor.ui.items); - enhanceList($('#CKEditor\\.ConfigClass_0_removeButtons'), availableButtons); + enhanceList($('#CKEditor\\.ConfigClass_0_removeButtons'), availableButtons, 'availablebuttonsselect'); + + enhanceTextArea($('#CKEditor\\.ConfigClass_0_advanced'), 'advancedtextarea'); }; - var enhanceList = function(input, allowedValues) { + var enhanceList = function(input, allowedValues, selectId) { var values = input.hide().val().split(commaSeparator); var select = $('<select class="form-control" multiple></select>').insertAfter(input); + input.parent().prev().find('label').attr('for', selectId); + select.attr('id', selectId); allowedValues.sort().forEach(function(value) { select.append($('<option></option>').text(value)); }); @@ -242,6 +246,11 @@ require(['jquery', 'xwiki-ckeditor', 'bootstrap-select'], function($, ckeditorPr input.val(values.join(',')); }); }; + + var enhanceTextArea = function(textarea, textareaId) { + textarea.parent().prev().find('label').attr('for', textareaId); + textarea.attr('id', textareaId); + }; ckeditorPromise.done(function(ckeditor) { ckeditor.once('instanceLoaded', function(event) { From fb28aaeee874138f364789c3b3a93bc45d221df5 Mon Sep 17 00:00:00 2001 From: Sereza7 Date: Mon, 4 Dec 2023 14:22:59 +0100 Subject: [PATCH 2/3] XWIKI-21523: Fields in form of WYSIWYG configuration are not accessible * Switched the IDs to camelCase --- .../src/main/resources/CKEditor/ConfigSheet.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml index 40f1c041a217..c96c6424ec50 100644 --- a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml +++ b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml @@ -218,12 +218,12 @@ require(['jquery', 'xwiki-ckeditor', 'bootstrap-select'], function($, ckeditorPr var commaSeparator = /\s*,\s*/; var enhanceConfig = function(editor) { var availablePlugins = editor.config.plugins.split(commaSeparator); - enhanceList($('#CKEditor\\.ConfigClass_0_removePlugins'), availablePlugins, 'availablepluginsselect'); + enhanceList($('#CKEditor\\.ConfigClass_0_removePlugins'), availablePlugins, 'availablePluginsSelect'); var availableButtons = Object.keys(editor.ui.items); - enhanceList($('#CKEditor\\.ConfigClass_0_removeButtons'), availableButtons, 'availablebuttonsselect'); + enhanceList($('#CKEditor\\.ConfigClass_0_removeButtons'), availableButtons, 'availableButtonsSelect'); - enhanceTextArea($('#CKEditor\\.ConfigClass_0_advanced'), 'advancedtextarea'); + enhanceTextArea($('#CKEditor\\.ConfigClass_0_advanced'), 'advancedTextArea'); }; var enhanceList = function(input, allowedValues, selectId) { From 8599be3eb3639c067095378f06bbdd7431bf0844 Mon Sep 17 00:00:00 2001 From: LucasC Date: Wed, 28 Feb 2024 14:00:47 +0100 Subject: [PATCH 3/3] XWIKI-21523: Fields in form of WYSIWYG configuration are not accessible * Fixed case on ids to match new codestyle --- .../src/main/resources/CKEditor/ConfigSheet.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml index c96c6424ec50..7b64c93608ba 100644 --- a/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml +++ b/xwiki-platform-core/xwiki-platform-ckeditor/xwiki-platform-ckeditor-ui/src/main/resources/CKEditor/ConfigSheet.xml @@ -218,12 +218,12 @@ require(['jquery', 'xwiki-ckeditor', 'bootstrap-select'], function($, ckeditorPr var commaSeparator = /\s*,\s*/; var enhanceConfig = function(editor) { var availablePlugins = editor.config.plugins.split(commaSeparator); - enhanceList($('#CKEditor\\.ConfigClass_0_removePlugins'), availablePlugins, 'availablePluginsSelect'); + enhanceList($('#CKEditor\\.ConfigClass_0_removePlugins'), availablePlugins, 'available-plugins-select'); var availableButtons = Object.keys(editor.ui.items); - enhanceList($('#CKEditor\\.ConfigClass_0_removeButtons'), availableButtons, 'availableButtonsSelect'); + enhanceList($('#CKEditor\\.ConfigClass_0_removeButtons'), availableButtons, 'available-buttons-select'); - enhanceTextArea($('#CKEditor\\.ConfigClass_0_advanced'), 'advancedTextArea'); + enhanceTextArea($('#CKEditor\\.ConfigClass_0_advanced'), 'advanced-text-area'); }; var enhanceList = function(input, allowedValues, selectId) {