diff --git a/administrator/language/en-GB/plg_editors_tinymce.ini b/administrator/language/en-GB/plg_editors_tinymce.ini index 3a8fd89c6deb7..f0633f03e916d 100644 --- a/administrator/language/en-GB/plg_editors_tinymce.ini +++ b/administrator/language/en-GB/plg_editors_tinymce.ini @@ -59,6 +59,7 @@ PLG_TINY_FIELD_LINK_CLASS_NONE="None" PLG_TINY_FIELD_NEWLINES_LABEL="New Lines" PLG_TINY_FIELD_NUMBER_OF_SETS_LABEL="Number of Sets" PLG_TINY_FIELD_PASTE_AS_TEXT_LABEL="Paste As Text" +PLG_TINY_FIELD_PASTE_FROM_WORD_LABEL="Paste from Word" PLG_TINY_FIELD_PATH_LABEL="Element Path" PLG_TINY_FIELD_PROHIBITED_LABEL="Prohibited Elements" PLG_TINY_FIELD_RESIZE_HORIZONTAL_LABEL="Horizontal Resizing" diff --git a/build/media_source/plg_editors_tinymce/joomla.asset.json b/build/media_source/plg_editors_tinymce/joomla.asset.json index 08c1999f25612..6249f904a7652 100644 --- a/build/media_source/plg_editors_tinymce/joomla.asset.json +++ b/build/media_source/plg_editors_tinymce/joomla.asset.json @@ -70,6 +70,17 @@ "dependencies": [ "tinymce" ] + }, + { + "name": "plg_editors_tinymce.pastefromword", + "type": "script", + "uri": "plg_editors_tinymce/plugins/paste-from-word/plugin.min.js", + "attributes": { + "type": "module" + }, + "dependencies": [ + "tinymce" + ] } ] } diff --git a/build/media_source/plg_editors_tinymce/js/plugins/paste-from-word/plugin.es6.js b/build/media_source/plg_editors_tinymce/js/plugins/paste-from-word/plugin.es6.js new file mode 100644 index 0000000000000..0c9a50e2b2f92 --- /dev/null +++ b/build/media_source/plg_editors_tinymce/js/plugins/paste-from-word/plugin.es6.js @@ -0,0 +1 @@ +import '@pangaeatech/tinymce-paste-from-word-plugin'; diff --git a/package-lock.json b/package-lock.json index 52981ccc7aedb..7185b78e5efd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,7 @@ "packages": { "": { "name": "joomla", - "version": "6.0.0", + "version": "6.1.0", "hasInstallScript": true, "license": "GPL-2.0-or-later", "dependencies": { @@ -27,6 +27,7 @@ "@codemirror/theme-one-dark": "^6.1.3", "@codemirror/view": "^6.38.3", "@fortawesome/fontawesome-free": "^6.7.2", + "@pangaeatech/tinymce-paste-from-word-plugin": "^1.3.2", "@popperjs/core": "^2.11.8", "accessibility": "^3.0.17", "awesomplete": "^1.1.7", @@ -3796,6 +3797,19 @@ "node": ">= 8" } }, + "node_modules/@pangaeatech/tinymce-paste-from-word-plugin": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@pangaeatech/tinymce-paste-from-word-plugin/-/tinymce-paste-from-word-plugin-1.3.2.tgz", + "integrity": "sha512-8tl7XkGv59pj2EaiK5Jhwn5+FNCpc4amGADxGKornADLByeWUdHQ/s4VuznKtkK/nQ9JilL8A9J4XhF4lMB4rg==", + "license": "LGPL-2.1", + "engines": { + "node": ">=16.0.0", + "npm": ">=8.0.0" + }, + "peerDependencies": { + "tinymce": "6.8.5" + } + }, "node_modules/@parcel/watcher": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", diff --git a/package.json b/package.json index 9a19f06a8795e..c45842534d824 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,7 @@ "@codemirror/theme-one-dark": "^6.1.3", "@codemirror/view": "^6.38.3", "@fortawesome/fontawesome-free": "^6.7.2", + "@pangaeatech/tinymce-paste-from-word-plugin": "^1.3.2", "@popperjs/core": "^2.11.8", "accessibility": "^3.0.17", "awesomplete": "^1.1.7", diff --git a/plugins/editors/tinymce/forms/setoptions.xml b/plugins/editors/tinymce/forms/setoptions.xml index 7535b9d1d415b..87e84ffc6d318 100644 --- a/plugins/editors/tinymce/forms/setoptions.xml +++ b/plugins/editors/tinymce/forms/setoptions.xml @@ -360,6 +360,17 @@ + + + + + get('content_template_path') . '&' . $csrf . '=1'; } + // Paste from word plugin + if ($levelParams->get('paste_from_word', 0)) { + $wa->useScript('plg_editors_tinymce.pastefromword'); + $plugins[] = 'pastefromword'; + } + // User custom plugins and buttons $custom_plugin = trim($levelParams->get('custom_plugin', '')); $custom_button = trim($levelParams->get('custom_button', ''));