Skip to content

Commit

Permalink
Merge pull request #38 from modxcms/tiny6
Browse files Browse the repository at this point in the history
Language customization
  • Loading branch information
matdave committed Apr 11, 2024
2 parents bb93831 + 84f8db7 commit c15997b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions _build/assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default (fred, pluginTools) => {
return (el, config, onInit, onChange, onFocus, onBlur) => {
const promise = new Promise((resolve, reject) => {
setTimeout(() => {
const lang = fred.rteLanguage || 'en';
const finalConfig = {
menubar: false,
inline: true,
Expand All @@ -20,6 +21,8 @@ export default (fred, pluginTools) => {
branding: false,
relative_urls: false,
image_dimensions: false,
language: lang,
language_url: 'https://cdn.tiny.cloud/1/no-api-key/tinymce/6.8.3/langs/'+lang+'.js',
powerpaste_word_import: 'clean',
powerpaste_html_import: 'clean',
a11y_advanced_options: true,
Expand Down
2 changes: 1 addition & 1 deletion _build/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"lowCaseName": "fredrtetinymce",
"description": "",
"author": "John Peca",
"version": "1.2.0-pl",
"version": "1.2.1-pl",
"package": {
"menus": [],
"elements": {
Expand Down
4 changes: 4 additions & 0 deletions core/components/fredrtetinymce/docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog for FredRTETinyMCE.

1.2.1-pl
==============
- base the TinyMCE language off of the MODX manager language

1.2.0-pl
==============
- Migrate to TinyMCE 6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
);

$includes = '
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.2/tinymce.min.js" integrity="sha512-6JR4bbn8rCKvrkdoTJd/VFyXAN4CE9XMtgykPWgKiHjou56YDJxWsi90hAeMTYxNwUnKSQu9JPc3SQUg+aGCHw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.3/tinymce.min.js" integrity="sha512-VCEWnpOl7PIhbYMcb64pqGZYez41C2uws/M/mDdGPy+vtEJHd9BqbShE4/VNnnZdr7YCPOjd+CBmYca/7WWWCw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script type="text/javascript" src="' . $fredRTETinyMCE->getOption('webAssetsUrl') . 'fredrtetinymce.min.js"></script>
<link href="' . $fredRTETinyMCE->getOption('webAssetsUrl') . 'fredrtetinymce.css" rel="stylesheet" />
';
$language = $modx->getOption('manager_language', null, 'en');
$beforeRender = '
this.rteLanguage = "'.$language.'";
this.registerRTE("TinyMCE", FredRTETinyMCE);
';

Expand Down

0 comments on commit c15997b

Please sign in to comment.