Skip to content

Commit 846c24c

Browse files
authored
Merge pull request #37633 from Digital-Peak/j4/tinymce/6
[5.0] Upgrade TinyMCE to version 6
2 parents 407a4a8 + 1ef6e7c commit 846c24c

File tree

8 files changed

+24
-18
lines changed

8 files changed

+24
-18
lines changed

build/build-modules-js/init/exemptions/tinymce.es6.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,14 @@ module.exports.tinyMCE = async (packageName, version) => {
5050
await mkdir(join(itemvendorPath, 'skins'), { mode: 0o755 });
5151
await mkdir(join(itemvendorPath, 'themes'), { mode: 0o755 });
5252
await mkdir(join(itemvendorPath, 'templates'), { mode: 0o755 });
53+
await mkdir(join(itemvendorPath, 'models'), { mode: 0o755 });
5354
}
5455

5556
await copyAllFiles('icons', 'tinymce', 'icons');
5657
await copyAllFiles('plugins', 'tinymce', 'plugins');
5758
await copyAllFiles('skins', 'tinymce', 'skins');
5859
await copyAllFiles('themes', 'tinymce', 'themes');
60+
await copyAllFiles('models', 'tinymce', 'models');
5961

6062
await copyArrayFiles('', ['tinymce.js', 'tinymce.min.js', 'changelog.txt', 'license.txt'], 'tinymce', '');
6163

build/media_source/plg_editors_tinymce/js/tinymce.es6.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120

121121
if (buttonValues.length) {
122122
options.setup = (editor) => {
123-
editor.settings.readonly = readOnlyMode;
123+
editor.mode.set(readOnlyMode ? 'readonly' : 'design');
124124

125125
Object.keys(icons).forEach((icon) => {
126126
editor.ui.registry.addIcon(icon, icons[icon]);
@@ -134,7 +134,7 @@
134134
};
135135
} else {
136136
options.setup = (editor) => {
137-
editor.settings.readonly = readOnlyMode;
137+
editor.mode.set(readOnlyMode ? 'readonly' : 'design');
138138
};
139139
}
140140

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"roboto-fontface": "^0.10.0",
6363
"short-and-sweet": "^1.0.4",
6464
"skipto": "^4.1.6",
65-
"tinymce": "^5.10.2",
65+
"tinymce": "^6.1.2",
6666
"vue": "3.2.26",
6767
"vuex": "^4.0.2",
6868
"vuex-persistedstate": "^4.1.0"

plugins/editors/tinymce/src/PluginTraits/DisplayTrait.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ public function onDisplay(
380380
}
381381

382382
// Convert pt to px in dropdown
383-
$scriptOptions['fontsize_formats'] = '8px 10px 12px 14px 18px 24px 36px';
383+
$scriptOptions['font_size_formats'] = '8px 10px 12px 14px 18px 24px 36px';
384384

385385
// select the languages for the "language of parts" menu
386386
if (isset($extraOptions->content_languages) && $extraOptions->content_languages) {
@@ -401,6 +401,11 @@ public function onDisplay(
401401
$plugins = array_merge($plugins, explode(strpos($custom_plugin, ',') !== false ? ',' : ' ', $custom_plugin));
402402
}
403403

404+
// Version 6 unload removed plugins
405+
$plugins = array_filter($plugins, function ($plugin) {
406+
return !in_array($plugin, ['hr', 'paste', 'print']);
407+
});
408+
404409
if ($custom_button) {
405410
$toolbar1 = array_merge($toolbar1, explode(strpos($custom_button, ',') !== false ? ',' : ' ', $custom_button));
406411
}
@@ -412,7 +417,6 @@ public function onDisplay(
412417
$scriptOptions = array_merge(
413418
$scriptOptions,
414419
[
415-
'deprecation_warnings' => JDEBUG ? true : false,
416420
'suffix' => JDEBUG ? '' : '.min',
417421
'baseURL' => Uri::root(true) . '/media/vendor/tinymce',
418422
'directionality' => $language->isRtl() ? 'rtl' : 'ltr',

plugins/editors/tinymce/src/PluginTraits/KnownButtons.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ public static function getKnownButtons()
4545
'italic' => ['label' => 'Italic'],
4646
'underline' => ['label' => 'Underline'],
4747
'strikethrough' => ['label' => 'Strikethrough'],
48-
'styleselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_STYLESELECT'), 'text' => 'Formats'],
49-
'formatselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FORMATSELECT'), 'text' => 'Paragraph'],
50-
'fontselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSELECT'), 'text' => 'Font Family'],
51-
'fontsizeselect' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSIZESELECT'), 'text' => 'Font Sizes'],
48+
'styles' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_STYLESELECT'), 'text' => 'Formats'],
49+
'blocks' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FORMATSELECT'), 'text' => 'Paragraph'],
50+
'fontfamily' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSELECT'), 'text' => 'Font Family'],
51+
'fontsize' => ['label' => Text::_('PLG_TINY_TOOLBAR_BUTTON_FONTSIZESELECT'), 'text' => 'Font Sizes'],
5252

5353
'alignleft' => ['label' => 'Align left'],
5454
'aligncenter' => ['label' => 'Align center'],

plugins/editors/tinymce/src/PluginTraits/ToolbarPresets.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static function getToolbarPreset()
6464
'alignleft', 'aligncenter', 'alignright', 'alignjustify', '|',
6565
'lineheight', '|',
6666
'styleselect', '|',
67-
'formatselect', 'fontselect', 'fontsizeselect', '|',
67+
'formatselect', 'fontfamily', 'fontsizeselect', '|',
6868
'searchreplace', '|',
6969
'bullist', 'numlist', '|',
7070
'outdent', 'indent', '|',

plugins/editors/tinymce/tinymce.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<extension type="plugin" group="editors" method="upgrade">
33
<name>plg_editors_tinymce</name>
4-
<version>5.10.5</version>
4+
<version>6.1.2</version>
55
<creationDate>2005-08</creationDate>
66
<author>Tiny Technologies, Inc</author>
77
<authorEmail>N/A</authorEmail>

0 commit comments

Comments
 (0)