Bug #7271
closedImplement WYSIWYG JS workarounds for other editors
Description
TinyMCE workaround was implemented to rebind the JS, but a workaround is needed for JCE and likely other editors to rebind their JS.
Updated by krileon over 5 years ago
- % Done changed from 0 to 10
JCE seams to be only somewhat fixable. The initial ajax edit functions, but if you Edit > Cancel > Edit the JS refuses to rebind.
Updated by krileon over 5 years ago
Looks like JCE can be fixed by calling tinymce.get( 'TEXTAREA_ID' ).render() since JCE is an extension of TinyMCE. This is after JCEs specific WFEditor.load() function has been called, but is also unreliable (sometimes works.. sometimes doesn't.. doesn't make a lot of sense).
Updated by krileon over 5 years ago
JCE refuses to clear editor instances. These instances are bound by element id. Seams the only solution is to randomize the textareas id on subsequent edits so it will rebind unless a means of clearing editors can be found.
Updated by krileon over 5 years ago
JCE solution found. Using tinymce.editors = [];
the cached editor instances can be completely purged. Follow this with WFEditor.load();
. This appears to reliably work to rebind the editors. Calling editors directly is marked deprecated in tinymce documentation, but there's no other means of overriding it besides that since tinymce.remove();
only marks them destroyed and does not remove their cached instance. Normally a combination of remove and add functions would be used, but this appears to still not clear cached instances to allow for rebinding. Accepting this as the solution for JCE.
Updated by krileon over 5 years ago
- % Done changed from 10 to 40
JCE and CodeMirror both officially fully functional now.
Updated by krileon over 5 years ago
- Status changed from Assigned to Resolved
- % Done changed from 40 to 100
For now only TinyMCE, CodeMirror, and JCE will be supported. ARKEditor caused multiple server errors so was not able to test and implement support for it.