Project

General

Profile

Actions

Bug #7271

closed

Implement WYSIWYG JS workarounds for other editors

Added by krileon about 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
11 September 2018
Due date:
% Done:

100%

Estimated time:

Description

TinyMCE workaround was implemented to rebind the JS, but a workaround is needed for JCE and likely other editors to rebind their JS.

https://www.joomlapolis.com/forum/153-professional-member-support/239764-jce-does-not-work-with-cb-core-fields-ajax#307260

Actions #1

Updated by krileon over 5 years ago

  • Target version changed from 914 to 4.2.0
Actions #2

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.

Actions #3

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).

Actions #4

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.

Actions #5

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.

Actions #6

Updated by krileon over 5 years ago

  • % Done changed from 10 to 40

JCE and CodeMirror both officially fully functional now.

Actions #7

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.

Actions #8

Updated by krileon over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF