Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Wim Leers’s picture

Status: Active » Needs review
Issue tags: +Spark
FileSize
17.07 KB

To make this work at all, we need to add the sharedSpaces plugin for CKEditor, which @FredCK kindly ported from CKE 3 to CKE4: http://dev.ckeditor.com/ticket/9387. I've included the sharedSpaces plugin in full for now.

Wim Leers’s picture

As of #1833716-80: WYSIWYG: Introduce "Text editors" as part of filter format configuration, integrating with the Edit module now no longer requires an Edit-module specific plug-in. Instead, the Edit module leverages the Editor module to allow for WYSIWYG editors. (Please apply that core patch, otherwise the one attached here will not work.)

Because you already committed #1874332: Convert to use the plugin system, adding Edit support now becomes trivial: just implement the following methods in the JS:

  • onChange()
  • attachTrueWysiwyg() (better name suggestions are of course welcome)

And annotate the Editor plug-in with supports_true_wysiwyg = "TRUE" and you're good to go :)

Note that the Edit module will no longer rely on Editor module once #1874936: Pluggable in-place editors (allow modules to define new Create.js PropertyEditor widgets) is done, then the Editor module can implement a Create.js PropertyEditor widget (the same one that I'm currently hackishly including inside of Edit), so that all Editor-related functionality is entirely decoupled from the Edit module, and that the Editor module not only provides an abstraction for plugging in WYSIWYG editors on the back-end, but also on the front-end.

Finally, CKEditor's toolbar gets rendered N times where N is the number of times the toolbar setting got added… this is in fact a core bug (about incorrect JS settings merging); fixed by #1875632: JS settings merging behavior: preserve integer keys (allow for array literals in drupalSettings). (The settings get added twice if the settings are added both for in-place editing "true WYSIWYG" and back-end editing "regular WYSIWYG".)

UPDATE: 6 hours after posting this, I've updated the first issue comment link from a placeholder to an actual link.

Wim Leers’s picture

Wim Leers’s picture

Wim Leers’s picture

Now that #1833716: WYSIWYG: Introduce "Text editors" as part of filter format configuration has been committed and #1886566: Make WYSIWYG editors available for in-place editing, #1878344: Add CKEditor JS library to core and #1890502: WYSIWYG: Add CKEditor module to core are happening, this patch is now against Drupal core with those patches applied instead of against this module. You must have #1886566-8: Make WYSIWYG editors available for in-place editing applied, there we changed some names, so the method names in #2 are now outdated. Hence also no interdiff.

This patch must not be committed, because it adds the sharedspaces plugin, which will be part of CKEditor 4.1. This patch is only necessary to demonstrate today how CKEditor can be used in the Edit module for in-place editing.

Wim Leers’s picture

Forgot to include one tiny change in #15.

Wim Leers’s picture

Reroll now that #1890502: WYSIWYG: Add CKEditor module to core has been pluginified.

sharedspace plugin excluded from this patch; it's now in the d8 branch of CKEditor and will be in "mainline" 4.1.

Apply #1905424-4: Update CKEditor library (or later) to get the (needed!) sharedspace plugin.

quicksketch’s picture

Issue tags: +CKEditor in core

Wim, I'm not sure if you're planning on porting this to D7 soon, and if it makes sense for this issue to move to the core queue or not. AFAIK, this patch doesn't apply to the ckeditor_wysiwyg project, but to the core patch in #1890502: WYSIWYG: Add CKEditor module to core. Seems like it would make sense to move it for find-ability.

Wim Leers’s picture

Project: CKEditor for WYSIWYG Module » Drupal core
Version: 8.x-1.x-dev » 8.x-dev
Component: Code » editor.module
Category: feature » task
Status: Needs review » Postponed

It's already ported to D7, in the sense that Edit.module in D7 + ckeditor.module in D7 together already offer this.

Indeed it makes sense to move this to the Drupal core queue.

Blocked on #1886566: Make WYSIWYG editors available for in-place editing.

Wim Leers’s picture

Component: editor.module » ckeditor.module
sun’s picture

Note: I've unpublished comments #4 to #13 due to various reasons. It might/would have been better to create a new issue for the Drupal core queue instead of moving this one.

On the patch: I'm not sure I understand what it's doing. Can we clarify the issue summary, please? :)

effulgentsia’s picture

Status: Postponed » Closed (duplicate)

#1886566-26: Make WYSIWYG editors available for in-place editing asks whether it makes sense to merge this into that issue. I think it does, so closing this as a duplicate. Re-open if you disagree.