User tests: Successful: Unsuccessful:
Pull Request for Issue #14417.
This pull restore possibility to hide the ext-buttons per TinyMCE instance.
In the article form XML administrator/components/com_content/models/forms/article.xml
add one more editor element (somewhere after line <fieldset name="basic" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">
)
<field name="text2" type="editor" hide="menu,module,contact"
label="Text2" description="" filter="JComponentHelper::filterText" buttons="true" />
Now open the Article editing, you should got:
Always displayed all buttons.
nope
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content JavaScript External Library Front End Plugins |
Labels |
Added:
?
|
I have tested this item
On Tab Options
Editor Text2
is shown (first changes in xml-File got not saved).
I have tested this item
This fixes the editor buttons for when they are set to hidden in the form xml. It also fixes the issue #14935 for that case.
However both issues remain for the case where the editor is added using a custom editor field.
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.
All good now as far as I see.
Status | Pending | ⇒ | Ready to Commit |
I have tested this item
Tested after conflict solving again.
I will test that pr tomorrow morning as well.
Status | Ready to Commit | ⇒ | Pending |
Remove RTC as wanted by @Fedik
There are also merge conflicts now
There are also merge conflicts now
That's not true:
This branch has no conflicts with the base branch
Well the patch file doesnt apply, it rejects... https://patch-diff.githubusercontent.com/raw/joomla/joomla-cms/pull/14520.patch
There are also merge conflicts now
it is a last problem here
I have tested this item
Tested both with my extension and a custom editor field.
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
Thank you @Fedik
RTC
@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!
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-03-30 20:16:33 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
|
@PhilETaylor the code is not related to tinyMCE: https://github.com/joomla/joomla-cms/blob/staging/media/com_content/js/admin-article-readmore.js
``js
content = (new Function('return ' + options.editor))();
replace it with:
```js
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.
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.
Would that mean we can have now different editors on the same page?
Not so soon :(
The problem is that all the existing editors (apart the core ones) are still using the old jInsertEditorText()
which by design is not supporting multiple editors (different type).
On top of that as @Bakual wrote above all the XTDs are using as well the old method jInsertEditorText()
.
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
instead of
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();
};
@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.
But all 3rd PD editors and XTDs will not if they don't update their code to use the API
ok then, someone needs to copy paste those code snippets and create the PRs
I have tested this item? unsuccessfully on 7efc54b
In none Tab a
text2
-Editor is shown.This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14520.