From 39ee80c53088d3d74e7ab67c13d27c3f992cd364 Mon Sep 17 00:00:00 2001 From: "ivan.hrytsai" Date: Mon, 21 Oct 2024 17:13:35 +0300 Subject: [PATCH 1/3] 12062-TinyMCE-support-upgrade --- Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php b/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php index 43361a8..ef2974b 100644 --- a/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php +++ b/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php @@ -94,8 +94,8 @@ public function afterGetConfig( // Get current wysiwyg adapter's path $editor = $this->activeEditor->getWysiwygAdapterPath(); - // Is the current wysiwyg tinymce v4 or v5? - if (strpos($editor, 'tinymce4Adapter') || strpos($editor, 'tinymce5Adapter')) { + // Is the current wysiwyg tinymce v4 or v5 or v7? + if (strpos($editor, 'tinymce4Adapter') || strpos($editor, 'tinymce5Adapter') || strpos($editor, 'tinymceAdapter')) { if (($result->getDataByPath('settings/menubar')) || ($result->getDataByPath('settings/toolbar')) || ($result->getDataByPath('settings/plugins'))) { // do not override ui_element config (unsure if this is needed) @@ -112,11 +112,15 @@ public function afterGetConfig( $settings['menubar'] = true; $settings['image_advtab'] = true; - $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table textcolor toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; + if (strpos($editor, 'tinymceAdapter')) { + $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; + } else { + $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table textcolor toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; + $settings['force_p_newlines'] = false; + } $settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'; $settings['toolbar2'] = ' undo redo | link anchor table charmap | image media insertdatetime | widget | searchreplace visualblocks help | hr pagebreak | emoticons'; - $settings['force_p_newlines'] = false; $settings['valid_children'] = '+body[style]'; From 29be320e554f696d411b50ad83ea6d9cff4f6475 Mon Sep 17 00:00:00 2001 From: "ivan.hrytsai" Date: Tue, 22 Oct 2024 10:54:21 +0300 Subject: [PATCH 2/3] add text style formay size --- Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php b/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php index ef2974b..117211f 100644 --- a/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php +++ b/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php @@ -112,16 +112,17 @@ public function afterGetConfig( $settings['menubar'] = true; $settings['image_advtab'] = true; + $settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'; + $settings['toolbar2'] = ' undo redo | link anchor table charmap | image media insertdatetime | widget | searchreplace visualblocks help | hr pagebreak | emoticons'; + if (strpos($editor, 'tinymceAdapter')) { + $settings['toolbar1'] = str_replace('formatselect | styleselect | fontselect | fontsizeselect','blocks | styles | fontfamily | fontsize', $settings['toolbar1']); $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; } else { $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table textcolor toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; $settings['force_p_newlines'] = false; } - $settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'; - $settings['toolbar2'] = ' undo redo | link anchor table charmap | image media insertdatetime | widget | searchreplace visualblocks help | hr pagebreak | emoticons'; - $settings['valid_children'] = '+body[style]'; $result->setData('settings', $settings); From 8661436077b39800416128354bb5df0cd14daf33 Mon Sep 17 00:00:00 2001 From: "ivan.hrytsai" Date: Thu, 24 Oct 2024 13:56:46 +0300 Subject: [PATCH 3/3] 12062-TinyMCE-support-upgrade --- Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php b/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php index 117211f..448fd05 100644 --- a/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php +++ b/Plugin/Magento/Ui/Component/Wysiwyg/ConfigPlugin.php @@ -112,17 +112,17 @@ public function afterGetConfig( $settings['menubar'] = true; $settings['image_advtab'] = true; - $settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'; - $settings['toolbar2'] = ' undo redo | link anchor table charmap | image media insertdatetime | widget | searchreplace visualblocks help | hr pagebreak | emoticons'; - if (strpos($editor, 'tinymceAdapter')) { - $settings['toolbar1'] = str_replace('formatselect | styleselect | fontselect | fontsizeselect','blocks | styles | fontfamily | fontsize', $settings['toolbar1']); $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; + $settings['toolbar1'] = 'magentovariable magentowidget | blocks | styles | fontfamily | fontsize | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'; } else { $settings['plugins'] = 'advlist autolink code colorpicker directionality hr imagetools link media noneditable paste print table textcolor toc visualchars anchor charmap codesample contextmenu help image insertdatetime lists nonbreaking pagebreak preview searchreplace template textpattern visualblocks wordcount magentovariable magentowidget emoticons'; + $settings['toolbar1'] = 'magentovariable magentowidget | formatselect | styleselect | fontselect | fontsizeselect | lineheight | forecolor backcolor | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent'; $settings['force_p_newlines'] = false; } + $settings['toolbar2'] = ' undo redo | link anchor table charmap | image media insertdatetime | widget | searchreplace visualblocks help | hr pagebreak | emoticons'; + $settings['valid_children'] = '+body[style]'; $result->setData('settings', $settings);