Skip to content

Commit 7f7b6c7

Browse files
committed
chore: prepping for release
1 parent b53d684 commit 7f7b6c7

File tree

13 files changed

+56
-3005
lines changed

13 files changed

+56
-3005
lines changed

README.md

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,25 @@
11
# TinyMCE Rich Text Editor
22

3-
TinyMCE 5 for MODX Revolution
3+
TinyMCE 6 for MODX Revolution
44

55
## Features
66

77
TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor. It
88
allows non-technical users to format content without knowing how to code. This
9-
package is based on the TinyMCE 5.
9+
package is based on the TinyMCE 6.
1010

1111
To build and install the package from source you have to use [Git Package
12-
Management](https://github.com/TheBoxer/Git-Package-Management). The GitHub
12+
Management (GPM)](https://github.com/TheBoxer/Git-Package-Management). The GitHub
1313
repository of TinyMCE Rich Text Editor contains a
14-
[config.json](https://github.com/modxcms/tinymce-rte/blob/tinymce5/_build/config.json)
14+
[config.json](https://github.com/modxcms/tinymce-rte/blob/main/_build/config.json)
1515
to build that package locally. Use this option, if you want to debug TinyMCE
1616
Rich Text Editor and/or contribute bugfixes and enhancements.
1717

18-
To update the TinyMCE core, you have to change the `tinymce_version` property in
19-
the `gulpfile.js` and run the `gulp update` task afterwards. This task will
20-
prepare all needed files in `assets/components/tinymcerte`. Please check, wether
21-
the TinyMCE image and link plugins are changed in the new version of TinyMCE and
22-
adopt the changes in the `src/modx/plugins` files and run the `gulp prepare`
23-
task afterwards.
24-
25-
To modify the MODX skin, you have to open the [TinyMCE 5 Skin
26-
Tool](http://skin.tiny.cloud/t5/) and upload the current
27-
[skintool.json](https://github.com/modxcms/tinymce-rte/blob/tinymce5/src/modx/skintool.json).
28-
After modifying the skin, you must click on `Get Skin` and replace the skin
29-
folder in the src/modx folder with the extracted downloaded skin folder. Then
30-
you should run the `gulp update` task. This task will prepare all needed files
31-
in `assets/components/tinymcerte`.
32-
33-
There is a `gulp prepare-debug` task, that copies not uglyfied script files to
34-
`assets/components/tinymcerte`.
18+
To update the plugin run `npm install` to install the dependencies. Run
19+
`npm run build` to build the plugin. The source files are located in the `/src/`
20+
directory. The package is compiled using Node 20.
21+
22+
To update the TinyMCE core, you have to change the `tinymcerte.tiny_url` system setting.
3523

3624
## Change Log
3725
https://github.com/modxcms/tinymce-rte/blob/master/core/components/tinymcerte/docs/changelog.md

_build/config.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "TinyMCE Rich Text Editor",
33
"lowCaseName": "tinymcerte",
4-
"description": "TinyMCE 5",
4+
"description": "TinyMCE 6",
55
"author": "John Peca/Thomas Jakobi",
6-
"version": "3.0.0-beta2",
6+
"version": "3.0.0",
77
"package": {
88
"elements": {
99
"plugins": [
@@ -124,19 +124,24 @@
124124
"value": "500",
125125
"area": "tinymcerte.default"
126126
},
127+
{
128+
"key": "min_height",
129+
"value": "100",
130+
"area": "tinymcerte.default"
131+
},
127132
{
128133
"key": "insert_toolbar",
129134
"value": "image media quicktable modxlink modai_generate",
130135
"area": "tinymcerte.toolbar"
131136
},
132137
{
133138
"key": "selection_toolbar",
134-
"value": "bold italic underline | modxlink | h2 h3 h4 blockquote | modai_generate modai_enhance",
139+
"value": "bold italic underline | modxlink | modai_enhance",
135140
"area": "tinymcerte.toolbar"
136141
},
137142
{
138143
"key": "toolbar1",
139-
"value": "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | modxlink | image",
144+
"value": "undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | modxlink | image",
140145
"area": "tinymcerte.toolbar"
141146
},
142147
{
@@ -196,6 +201,11 @@
196201
"area": "modai",
197202
"type": "textarea",
198203
"value": "- This is not a conversation, do not include justifcation, suggestions, or explanation\n- The output should be usable as is, without requiring editing or modification\n- Format it with HTML markup so it will work in the TinyMCE rich text editor"
204+
},
205+
{
206+
"key": "tiny_url",
207+
"area": "tinymcerte.default",
208+
"value": "https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.5/tinymce.min.js"
199209
}
200210
]
201211
},

_build/resolvers/resolve.update.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,17 @@ function cleanupPlugin($modx, $name)
238238
addToSetting($modx, 'tinymcerte.toolbar1', '| modai_generate modai_generate_image modai_enhance');
239239
}
240240

241-
if ($oldPackage && $oldPackage->compareVersion('2.1.1-pl', '>')) {
242-
removeFromSetting($modx, 'tinymcerte.toolbar1', 'modai_generate_image');
243-
}
241+
if ($oldPackage && $oldPackage->compareVersion('2.1.1-pl', '>')) {
242+
removeFromSetting($modx, 'tinymcerte.toolbar1', 'modai_generate_image');
243+
}
244+
245+
if ($oldPackage && $oldPackage->compareVersion('2.1.1-pl', '>')) {
246+
addToSetting($modx, 'tinymcerte.plugins', 'quickbars');
247+
changeSetting($modx, 'skin', 'modx', 'oxide');
248+
changeSetting($modx, 'tinymcerte.toolbar1', 'link', 'modxlink');
249+
changeSetting($modx, 'tinymcerte.toolbar2', 'link', 'modxlink');
250+
changeSetting($modx, 'tinymcerte.toolbar3', 'link', 'modxlink');
251+
}
244252

245253
break;
246254
}

core/components/tinymcerte/docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.0.0] - 2025-05-29
9+
10+
### Changed
11+
12+
- Refactored the project to use TinyMCE 6
13+
814
## [2.1.1] - 2025-03-21
915

1016
### Changed

core/components/tinymcerte/docs/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# TinyMCE Rich Text Editor
22

3-
TinyMCE 5 for MODX Revolution.
3+
TinyMCE 6 for MODX Revolution.
44

55
- Author: John Peca <john@modx.com>
66
- Upgrade to TinyMCE 5: Thomas Jakobi <office@treehillstudio.com>
7+
- Upgrade to TinyMCE 6: Mat Dave Jones <mat@modx.com>
78
- License: GNU GPLv2
89

910
## Features

core/components/tinymcerte/lexicon/en/setting.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
$_lang['setting_tinymcerte.links_across_contexts'] = 'Links across contexts';
3535
$_lang['setting_tinymcerte.links_across_contexts_desc'] = 'Lists resources from other contexts when creating internal links in the editor. Otherwise only Resources from the same context appear.';
3636
$_lang['setting_tinymcerte.max_height'] = 'Max height';
37-
$_lang['setting_tinymcerte.max_height_desc'] = 'The max_height option has two kinds of behaviors depending on the state of the autoresize plugin. Without the autoresize plugin, this option allows you to set the maximum height that a user can stretch the entire TinyMCE interface (by grabbing the dragable area in the bottom right of the editor interface). With the autoresize plugin, this option sets the maximum height the editor can automatically expand to.';
37+
$_lang['setting_tinymcerte.max_height_desc'] = 'The max_height option has two kinds of behaviors depending on the state of the autoresize plugin. Without the autoresize plugin, this option allows you to set the maximum height that a user can stretch the entire TinyMCE interface (by grabbing the draggable area in the bottom right of the editor interface). With the autoresize plugin, this option sets the maximum height the editor can automatically expand to.';
38+
$_lang['setting_tinymcerte.min_height'] = 'Min height';
39+
$_lang['setting_tinymcerte.min_height_desc'] = 'The min_height option has two kinds of behaviors depending on the state of the autoresize plugin. Without the autoresize plugin, this option allows you to set the minimum height that a user can shrink the entire TinyMCE interface (by grabbing the draggable area in the bottom right of the editor interface). With the autoresize plugin, this option sets the minimum height the editor can automatically shrink to.';
3840
$_lang['setting_tinymcerte.menubar'] = 'Menubar';
3941
$_lang['setting_tinymcerte.menubar_desc'] = 'This option allows you to configure the menus you want to appear in the menu bar. <a href="https://www.tiny.cloud/docs/configure/editor-appearance/#menubar">https://www.tiny.cloud/docs/configure/editor-appearance/#menubar</a>';
4042
$_lang['setting_tinymcerte.modai.global.text.base_prompt'] = 'Base Prompt';
@@ -69,3 +71,9 @@
6971
$_lang['setting_tinymcerte.toolbar3_desc'] = 'This controls what buttons you want show up in the toolbar. <a href="https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar">https://www.tiny.cloud/docs/configure/editor-appearance/#toolbar</a>';
7072
$_lang['setting_tinymcerte.valid_elements'] = 'Valid elements';
7173
$_lang['setting_tinymcerte.valid_elements_desc'] = 'This option defines which elements will remain in the edited text when the editor saves. You can use this to limit the returned HTML to a subset. <a href="https://www.tiny.cloud/docs/configure/content-filtering/#valid_elements">https://www.tiny.cloud/docs/configure/content-filtering/#valid_elements</a>.';
74+
$_lang['setting_tinymcerte.selection_toolbar'] = 'Selection Toolbar';
75+
$_lang['setting_tinymcerte.selection_toolbar_desc'] = 'This option defines what is shown in the toolbar when selecting text. <a href="https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_selection_toolbar">https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_selection_toolbar</a>.';
76+
$_lang['setting_tinymcerte.insert_toolbar'] = 'Insert Toolbar';
77+
$_lang['setting_tinymcerte.insert_toolbar_desc'] = 'This option defines what is shown in the toolbar when the cursor is at the start of an empty line. <a href="https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_insert_toolbar">https://www.tiny.cloud/docs/tinymce/latest/quickbars/#quickbars_insert_toolbar</a>.';
78+
$_lang['setting_tinymcerte.tiny_url'] = 'TinyMCE URL';
79+
$_lang['setting_tinymcerte.tiny_url_desc'] = 'The URL or path to the TinyMCE JavaScript file.';

core/components/tinymcerte/src/Plugins/Events/OnRichTextEditorInit.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function process()
5050
*/
5151
private function initTinyMCE()
5252
{
53-
$this->modx->controller->addJavascript('https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.5/tinymce.min.js');
53+
$this->modx->controller->addJavascript($this->tinymcerte->getOption('tiny_url'));
5454
$this->modx->controller->addJavascript($this->tinymcerte->getOption('assetsUrl') . 'mgr/tinymcerte.min.js?v=' . $this->tinymcerte->version);
5555
$this->modx->controller->addCss($this->tinymcerte->getOption('assetsUrl') . 'mgr/tinymcerte.css?v=' . $this->tinymcerte->version);
5656

@@ -109,10 +109,10 @@ private function getTinyConfig()
109109
}
110110

111111
$config = array_merge([
112-
'plugins' => $this->tinymcerte->getOption('plugins', [], 'advlist autoresize autolink lists charmap preview anchor visualblocks searchreplace code fullscreen insertdatetime media table image quickbars link modxlink modai'),
112+
'plugins' => $this->tinymcerte->getOption('plugins', [], 'advlist autoresize autolink lists charmap preview anchor visualblocks searchreplace code fullscreen insertdatetime media table image quickbars modxlink modai'),
113113
'quickbars_insert_toolbar' => $this->tinymcerte->getOption('insert_toolbar', [], 'image media quicktable modxlink modai_generate'),
114-
'quickbars_selection_toolbar' => $this->tinymcerte->getOption('selection_toolbar', [], 'bold italic underline | modxlink h2 h3 h4 blockquote | modai_generate modai_enhance'),
115-
'toolbar1' => $this->tinymcerte->getOption('toolbar1', [], 'undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image | modai_generate modai_generate_image modai_enhance'),
114+
'quickbars_selection_toolbar' => $this->tinymcerte->getOption('selection_toolbar', [], 'bold italic underline | modxlink | modai_enhance'),
115+
'toolbar1' => $this->tinymcerte->getOption('toolbar1', [], 'undo redo | styleselect | bold italic underline | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | modxlink | image'),
116116
'toolbar2' => $this->tinymcerte->getOption('toolbar2', [], ''),
117117
'toolbar3' => $this->tinymcerte->getOption('toolbar3', [], ''),
118118
'connector_url' => $this->tinymcerte->getOption('connectorUrl'),
@@ -135,6 +135,7 @@ private function getTinyConfig()
135135
'entity_encoding' => $this->tinymcerte->getOption('entity_encoding', [], 'named'),
136136
'enable_link_list' => $this->tinymcerte->getOption('enable_link_list', [], true) == 1,
137137
'max_height' => (int)$this->tinymcerte->getOption('max_height', [], 500),
138+
'min_height' => (int)$this->tinymcerte->getOption('min_height', [], 100),
138139
'branding' => $this->tinymcerte->getOption('branding', [], false) == 1,
139140
'cache_suffix' => '?v=' . $this->tinymcerte->version,
140141
'promotion' => false

src/modx/mgr/browser.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)