Fix TinyMCE ext-buttons. Respect ext-buttons configuration per an editor instance#14520
Fix TinyMCE ext-buttons. Respect ext-buttons configuration per an editor instance#14520zero-24 merged 7 commits intojoomla:stagingfrom
Conversation
|
I have tested this item 🔴 unsuccessfully on 7efc54b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
|
I have tested this item ✅ successfully on 7efc54b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
|
@Fedik Can you fix the conflicts in your PR please? |
|
I have tested this item ✅ successfully on 7efc54b This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
Conflicts: media/editors/tinymce/js/tinymce.min.js
|
@Bakual conflict fixed |
|
Looks like it works now also for the custom fields. Either your conflict solving or me changing some settings in my testing site fixed it. |
|
I have tested this item ✅ successfully on 09b6ad3 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
|
I will test that pr tomorrow morning as well. |
|
please remove RTC, |
|
Remove RTC as wanted by @Fedik This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
This comment was marked as abuse.
This comment was marked as abuse.
That's not true:
|
This comment was marked as abuse.
This comment was marked as abuse.
it is a last problem here 😄 |
|
I have tested this item ✅ successfully on 96603d2
|
This comment was marked as abuse.
This comment was marked as abuse.
|
I have tested this item ✅ successfully on 96603d2 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
|
Thank you @Fedik RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520. |
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
|
@PhilETaylor i think we can fix the other bug in a new PR. I'm merging this for now and we can fix the other bug with a new PR. Thanks! 👍 |
|
@PhilETaylor the code is not related to tinyMCE: https://github.com/joomla/joomla-cms/blob/staging/media/com_content/js/admin-article-readmore.js |
This comment was marked as abuse.
This comment was marked as abuse.
content = (new Function('return ' + options.editor))();replace it with: if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
content = window.parent.Joomla.editors.instances[editor].getContent()
} else {
content = (new Function('return ' + options.editor))();
}Simple fix |
|
Good work! |
|
Would that mean we can have now different editors on the same page? Then we can think about a setting in the editor custom field to define which editor should be loaded. |
As I understood @DGT41, different editors on the same page work if all editor-xtd plugins are rewritten to the new format. It doesn't work for those using the old format (which will be a lot 3rd party ones). So for now I wouldn't add the option to specify the editor type. With 4.0 we can add it. |
Not so soon :( The only thing we could do is prepare all the plugins to use the new API if the editor supports it e.g. if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
content = window.parent.Joomla.editors.instances[editor].getContent()
} else {
content = (new Function('return ' + options.editor))();
}Also there is another instance that needs to follow the API in /administarator/components/com_fields/view/fields/tmpl/modal.php fieldIns = function(id) {
window.parent.jInsertEditorText("{field " + id + "}", "' . $editor . '");
window.parent.jModalClose();
};
fieldgroupIns = function(id) {
window.parent.jInsertEditorText("{fieldgroup " + id + "}", "' . $editor . '");
window.parent.jModalClose();
};we should use fieldIns = function(id) {
if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
window.parent.Joomla.editors.instances[editor].replaceSelection("{field " + id + "}")
} else {
window.parent.jInsertEditorText("{field " + id + "}", "' . $editor . '");
}
window.parent.jModalClose();
};
fieldgroupIns = function(id) {
if (window.parent.Joomla && window.parent.Joomla.editors && window.parent.Joomla.editors.instances && window.parent.Joomla.editors.instances.hasOwnProperty(editor)) {
window.parent.Joomla.editors.instances[editor].replaceSelection("{fieldgroup " + id + "}")
} else {
window.parent.jInsertEditorText("{fieldgroup " + id + "}", "' . $editor . '");
}
window.parent.jModalClose();
}; |
This comment was marked as abuse.
This comment was marked as abuse.
|
@PhilETaylor if we apply these changes to read more and fields modal view then all core components are supporting multiple (different types) editors per page. |
This comment was marked as abuse.
This comment was marked as abuse.
|
ok then, someone needs to copy paste those code snippets and create the PRs |
Pull Request for Issue #14417.
Summary of Changes
This pull restore possibility to hide the ext-buttons per TinyMCE instance.
Testing Instructions
In the article form XML
administrator/components/com_content/models/forms/article.xmladd one more editor element (somewhere after line<fieldset name="basic" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">)Expected result
Now open the Article editing, you should got:
Actual result
Always displayed all buttons.
Documentation Changes Required
nope